blockchain

Node.js or Go for Hyperledger Fabric's chaincode development?

无人久伴 提交于 2020-01-03 19:01:21
问题 Which language among Node.js and Go is better suited for 'chaincode' development when it comes to maintainibility, scalability and better support? 回答1: It's a matter of personal preference, but I'd say Golang, because: Node.js chaincode uses npm install at the time of container building, which is slow and might fail due to network problems, while Golang just compiles the source code without fetching anything. Chaincode features are introduced to Golang chaincode first and then later on to

Node.js or Go for Hyperledger Fabric's chaincode development?

浪尽此生 提交于 2020-01-03 18:59:09
问题 Which language among Node.js and Go is better suited for 'chaincode' development when it comes to maintainibility, scalability and better support? 回答1: It's a matter of personal preference, but I'd say Golang, because: Node.js chaincode uses npm install at the time of container building, which is slow and might fail due to network problems, while Golang just compiles the source code without fetching anything. Chaincode features are introduced to Golang chaincode first and then later on to

In Corda, what data is sent to a non-validating notary service?

帅比萌擦擦* 提交于 2020-01-03 13:30:44
问题 This question frequently comes up in conversations: When a Corda transaction is sent to a non-validating notary service for finalisation, what can the notary service see and deduce about the world? 回答1: Before sending a transaction to a non-validating notary, it is filtered as follows: stx.buildFilteredTransaction(Predicate { it is StateRef || it is TimeWindow || it == notaryParty }) (see NotaryFlow.kt in the main Corda repo). This means that the non-validating notary will only see: Any

Chaincode (smart contract) interactions within and across channels in Hyperledger Fabric

China☆狼群 提交于 2020-01-02 05:29:07
问题 Consider the Organization-Peer setup in a Hyperledger Fabric network as shown in the image. Org 1 has two peers, Org 2 has one peer - all of which exist inside the same channel - X. Org 3 has one peer which exist outside in a different channel. The peers have distinct chaincodes(c1, c2, c3 & c4) installed in each of them with the functions as explained. write() - put a key-value pair into the ledger update() - update a value for an existing key read() - query an existing key-value pair Now on

Hyperledger transaction verification

会有一股神秘感。 提交于 2020-01-01 22:03:09
问题 In case of Bitcoin transaction the verification/validation involves looking at the input UTXO balance etc... But in Hyperledger the transaction (if I may) "just" carries the data (function name and data-string) for the target smart contract. Does it mean that there is no necessity of validation (apart from the syntax) of the transaction? If yes what has to checked and against what? Can anyone pls give me an example use-case? If there is no validation, then is my understanding correct that the

Get chaincode caller ID from the function InvokeChaincode() in Hyperledger Fabric Node SDK

痞子三分冷 提交于 2020-01-01 11:35:36
问题 Let's suppose the following network architecture: A -> Chaincode1 -> fabcar A is the application, Chaincode1 is a chaincode in Go and fabcar is a chaincode in Nodejs. They are on the same channel: "mychannel". When is performed the operation APIstub.InvokeChaincode from the Chaincode1 such as APIstub.InvokeChaincode("fabcar", chainCodeArgs, "mychannel") , is there a possibility for the chaincode fabcar (the chaincode called) to get the id of the the caller chaincode? The getCreator() method

Limit of number of nodes in Hyperledger

风格不统一 提交于 2020-01-01 03:30:10
问题 In Hyperledger-fabric blockchain, is there a limit to the number of nodes participating in a network? If yes, how many nodes can be in a network? 回答1: To get the complete functionality of blockchain(consensus mechanism, hyperledger fabric uses PBFT consensus which means it will accept any transaction to be valid if more than 66% of the nodes are up and running. In short more than 66% of nodes must be up and must validate the order to requests in Hyperledger farbic. Both the Starter Developer

通过命令行操作区块链的区块添加与查询

試著忘記壹切 提交于 2019-12-25 19:15:01
目录 flag基本使用 os.Args基本使用 flag与os.Args组合使用 通过命令行添加/查询区块 测试代码与测试结果 一. flag基本使用 通常我们在写命令行程序(工具、server)时,对命令参数进行解析是常见的需求。各种语言一般都会提供解析命令行参数的方法或库,以方便程序员使用。在 go 标准库中提供了一个包:flag,方便进行命令行解析。 1.导入flag包 import ( "flag" ) 2.使用示例 //定义一个字符串flag,flag名为printchain,默认值为:hello BTC world,参数说明: 输出所有的区块信息 flagString := flag.String("printchain", "hello BTC world", "输出所有的区块信息") //定义一个整型flag,flag名为:number ,默认值为:6 ,参数说明:输入一个整数 flagInt := flag.Int("number", 6, "输出一个整数...") //定义一个布尔类型的flag,flag名为:open,默认值:false,参数说明:判断真假 flagBool := flag.Bool("open", false, "判断真假...") //解析flag flag.Parse() //输入参数后的值 fmt.Printf("%s\n",

Error when i running the application hyperledger fabric

假如想象 提交于 2019-12-25 18:53:19
问题 I'm following this tutorial: https://github.com/ITPeople-Blockchain/auction and at the step: "Build peer and Orderer binaries and Start Orderer", at the command: make native I recived following error: Makefile:71: *** "No go in PATH: Check dependencies". Arresto. I'm using Ubuntu on VirtualBox and I set the gopath correctly 回答1: go path is not set. find installed directory of go lang. (e.g linux ) whereis go then export below var. export GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin these

HyperLedger-Fabric ChainCode Deployment Giving Parse Error

假如想象 提交于 2019-12-25 09:14:14
问题 I have setup a peer in a vm and its running fine. Also i have registered the chaincode with the peer through this CORE_CHAINCODE_ID_NAME=chaincode_example02 CORE_PEER_ADDRESS=localhost:51011 ./chaincode_example02 and it showed no error Now after this when i try to hit the init method from rest using this json { "jsonrpc": "2.0", "method": "deploy", "params": { "type": 1, "chaincodeID":{ "name": "chaincode_example02", "path": "github.com/hyperledger/fabric/examples/chaincode/go/chaincode