blockchain

Cannot put state in query context

无人久伴 提交于 2019-12-10 11:29:36
问题 Im trying to use a ticker in my chaincode to update the chaincode state periodically, based on some condition: func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) { ticker := time.NewTicker(time.Millisecond * 10000) go func() { for t := range ticker.C { fmt.Println("Tick at", t) a = a+5 err:= stub.PutState("a", []byte(strconv.Itoa(a))) fmt.Println(err.Error()) } }() return nil, nil } I am sending the invoke transaction using the chaincode

PROTOBUF_INLINE_NOT_IN_HEADERS

对着背影说爱祢 提交于 2019-12-10 11:16:23
问题 I'm trying to install Open Transactions, the open-source project, on a debian 8. I've installed all the dependencies and am having an issue when compiling (make). The following error is showing at my terminal, even though i made sure to install the protobuf project: In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:64:0, from /root/opentxs/src/core/OTStorage.cpp:47: /root/opentxs/build/src/core/otprotob/Generics.pb.h:501:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS"

How to change Endorsement policies

笑着哭i 提交于 2019-12-10 09:25:10
问题 I changed the endorsement policy from "OR" to "AND" with BYFN and instantiate the Chaincode. But, the data in the ledger is not changed even after the Invoke is executed. I confirmed "OR" condition is working.(data in the ledger is changed) Kindly let me know how I can solve it. peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp

以太坊源码分析-BlockChain

末鹿安然 提交于 2019-12-10 08:15:36
BlockChain 位置: package core github.com/ethereum/go-ethereum/core/BlockChain.go release 1.8 作用 BlockChain管理具有创世纪数据库的规范链,主要实现管理区块(BLock)形成/引进链,reverts(恢复)、重组链 以太坊启动节点启动后后,系统中只存在一个BlockChain对象实例、BlockChain是以太坊中的一个类 BlockChain只保存规范链的头区块 规范链 在区块的创建过程中,可能在短时间内产生一些分叉, 在我们的数据库里面记录的其实是一颗区块树。 我们会认为其中总难度最高的一条路径认为是我们的规 范的区块链 。 有很 多区块虽然也能形成区块链, 但是不是规范的区块链。 Blockchain 数据结构 Blockchain管理所有的Block, 让其组成一个单向链表。Headerchain管理所有的Header,也形成一个单向链表, Headerchain是Blockchain里面的一部分,HeaderChain在全局范围内也仅有一个对象 type BlockChain struct { chainConfig *params.ChainConfig // Chain & network configuration cacheConfig *CacheConfig //

Hyperledger Composer : No business network has been specified for this connection

巧了我就是萌 提交于 2019-12-09 20:54:06
问题 I have installed hyperledger composer locally. But on localhost it gives error : Error : Error trying to ping. Error: No business network has been specified for this connection. I am not able to add model and script file as well. This is the errors showing in terminal error: [Hyperledger-Composer] undefined:HLFConnection :ping() Error: Error trying to ping. Error: No business network has been specified for this connection at _checkRuntimeVersions.then.catch (/usr/local/lib/node_modules

ltdl.h Not found error while building chaincode

烂漫一生 提交于 2019-12-09 17:56:22
问题 I am trying to build a chaincode by using go build . when i run Go build command its reporting .\hyperledger\fabric\vendor\github.com\miekg\pkcs11\pkcs11.g‌​o:29:18: fatal error:ltdl.h: No such file or directory compilation terminated I installed libtools from this link. But I am getting the same error 回答1: It worked for me on ubuntu: sudo apt install libltdl-dev 回答2: if you are using centos/RHEL 7 you can use this code yum install libtool-ltdl-devel 回答3: For Mac, make sure you have brew

Private blockchains Vs Hashgraph, Ripple, BigChainDb

ぃ、小莉子 提交于 2019-12-09 16:48:43
问题 I have been investigating different blockchains for some use cases. In the end, I came to the conclusion that setting up a private blockchain is equivalent to having a distributed database with blockchain concepts like immutability, digital signatures on top of it. Eg: Bigchaindb. (Well, If we do need smart contract feature then distributed database might not work) Theoretically, hashgraph consensus algorithm doesn't look secure enough for a public chain. It looks like a close alternate

Different ways to invoke contract method

空扰寡人 提交于 2019-12-09 03:56:08
问题 I have one contract with method name as getValues().From Dapp I am invoking contract method as 'contractCAt.getValues.call(function(error,result){...})' this works fine and by using 'contractCAt.getValues(function(error,result){...})' this syntax also works fine.I didn't get any difference between those two ways to invoke contract method.So could anyone help me to give idea about those syntax. 回答1: See the web3j documentation: contractCAt.getValues.call() is run locally and will not alter the

Who is a validating peer?

ⅰ亾dé卋堺 提交于 2019-12-08 13:17:10
问题 I don't see a definition of the terms Validating Peer and Non-Validating Peer in the Glossary. It is important to have this definition as a good deal of literature seems to depend on these types of peers. Coming to my main question. Looking at the Blockchain as a data-store, it is clear that, this datastore will expose functions to change and read the state of its store. Therefore, is the validating peer an entity that will verify the fact that, X was before state, T was the transaction

Hyperledger Fabric v0.6, set up network (additional peer) directly without docker any possible way?

99封情书 提交于 2019-12-08 11:55:59
问题 I has a question related to network setup of additional peer in Hyperledger Fabric. I want to add 2 more peers to existing peer to form a network ,but all available document is all about connection peer together by using Docker. In my case I already have multiple servers. so I just directly install peers to 3 different Servers separately ,but how can I connect that 3 peer up and running together. I cannot find any document related to this. Hopp you can guide. To install Fabric directly to