1. 程式人生 > >hyperledger cli 驗證方法

hyperledger cli 驗證方法

Cli驗證

register

賬號儲存在cat membersrvc/membersrvc.yaml

peer network login jim 6avZQLwcUe9b

deploy

peer chaincode deploy -u jim -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c ‘{“Function”:”init”, “Args”: [“a”,”100”, “b”, “200”]}’

[email protected]:/opt/gopath/src/github.com/hyperledger/fabric# ^C

invoke

peer chaincode invoke -u jim -n 980d4bb7f69578592e5775a6da86d81a221887817d7164d3e9d4d4df1c981440abf9a61417eaf8ad6f7fc79893da36de2cf4709131e9af39bca6ebc2e5a1cd9d -c ‘{“Function”: “invoke”, “Args”: [“a”, “b”, “10”]}’

query

peer chaincode query -u jim -n 980d4bb7f69578592e5775a6da86d81a221887817d7164d3e9d4d4df1c981440abf9a61417eaf8ad6f7fc79893da36de2cf4709131e9af39bca6ebc2e5a1cd9d -c ‘{“Function”: “query”, “Args”: [“a”]}’

01:37:59.163 [chaincodeCmd] getChaincodeSpecification -> INFO 001 Local user ‘jim’ is already logged in. Retrieving login token.
01:37:59.263 [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 002 Successfully queried transaction: chaincodeSpec: