fabric生产环境搭建六:调用chaincode

调用智能合约有多种方法,一种是直接使用peer工具,一般用于管理调试时。另一个是通过SDK接口。

我们这里先讨论peer工具

peer工具有两个接口可调用智能合约,一个是peer chaincode invoke, 另一个是peer chaincode query。二者区别在于:

  • invoke会创建新的交易,需要与orderer通讯,该交易被提交到链上,并被保存起来。常常用于”写”动作
  • query不会创建交易,只需要与peer通讯。常常用于”读”动作

本项目测试代码:

  1. peer chaincode invoke
peer chaincode invoke -o orderer1.orgA:7050  --tls --cafile /etc/hyperledger/fabric/tls/root-orgA.crt -C channel1 -n hello --peerAddresses peer1.orgA:8050 --tlsRootCertFiles /etc/hyperledger/fabric/tls/root-orgA.crt  -c '{"function":"InitLedger","Args":[]}'
  1. peer chaincode query
peer chaincode query -C channel1 -n hello -c '{"Args":["GetAllAssets"]}'

Next

OK, 现在智能合约成功被唤醒,你已经在链上刻下了属于你的印记,但如果有时候你需要对智能合约升级怎么办呢?

异次元传送门:[升级chaincode]()



《 “fabric生产环境搭建六:调用chaincode” 》 有 4 条评论

  1. The goal is to have a normal BMI, which ranges from 18 where to get generic cytotec without rx A, cumulative histopathology score of male mice and B, female mice

  2. where to get cytotec without prescription Sclerosing therapy for chronic Achilles tendinosis is based on the premise that the process of neovascularization in the damaged tendon is the source of the patient s pain

  3. priligy price During exercise, fat melting hormones known as catecholamines are released by your adrenal glands

  4. Despite intensived treatment with dialysis for twelve days, the puppy continued to vomit and decline, ultimately dying of cardiopulmonary arrest priligy online pharmacy

回复 agodelo 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注

About Me

一位程序员,会弹吉他,喜欢读诗。
有一颗感恩的心,一位美丽的妻子,两个可爱的女儿
mail: geraldlee0825@gmail.com
github: https://github.com/lisuxiaoqi
medium: https://medium.com/@geraldlee0825