我想在当前现有的VSCC和ESCC中分别添加一些额外的验证和认可逻辑。有没有关于如何编辑和将我的自定义VSCC和ESCC部署到Hyperledger Fabric的文档?如何在Hyperledger Fabric中实施和部署可插拔ESCC或VSCC策略?
3
A
回答
5
所有系统chaincodes,特别是外阴鳞癌和食管癌,应实现Chaincode
接口:
// Chaincode interface must be implemented by all chaincodes. The fabric runs
// the transactions by calling these functions as specified.
type Chaincode interface {
// Init is called during Instantiate transaction after the chaincode container
// has been established for the first time, allowing the chaincode to
// initialize its internal data
Init(stub ChaincodeStubInterface) pb.Response
// Invoke is called to update or query the ledger in a proposal transaction.
// Updated state variables are not committed to the ledger until the
// transaction is committed.
Invoke(stub ChaincodeStubInterface) pb.Response
}
目前所有的系统chaincodes静态编译进同行代码,并在文件中列出。此外,他们必须在chaincode段内core.yaml
文件启用,例如:
chaincode:
# system chaincodes whitelist. To add system chaincode "myscc" to the
# whitelist, add "myscc: enable" to the list below, and register in
# chaincode/importsysccs.go
system:
cscc: enable
lscc: enable
escc: enable
vscc: enable
qscc: enable
下一步,然后你实例化你chaincode并愿提供定制VSCC和ESCC您需要提供他们的名字喉癌。例如,如果你将使用同级cli,你可以这样做:
peer chaincode instantiate -o localhost:7050 -n myCC -v 1.0 -C mychannel -c '{"Args": ["init"]}' --vscc myVSCC --escc myESCC
2
VSCC和ESCC是系统链代码,并且界面与链式代码完全相同,因此请查看链式代码文档或转至VSCC source code。您可以添加您自己的验证系统链接代码并将其与您的链接代码关联。
系统链代码是用对等体可执行文件构建的,并且不通过事务性安装/实例化过程。它在对等体启动时加载,因此它需要在core/scc/importsysccs.go中进行一些注册。看看systemChaincodes变量,你可以看到别人是如何注册的。
相关问题
- 1. 如何部署Hyperledger Fabric应用程序
- 2. HyperLedger-Fabric ChainCode部署 - Base64错误
- 3. HyperLedger-Fabric ChainCode部署给解析错误
- 4. Angularjs部署策略
- 5. Hyperledger Fabric/Hyperledger Composer
- 6. Tomcat部署策略
- 7. WPF LinkLabel实施策略
- 8. SSIS部署策略
- 9. Hyperledger Fabric内部表实现Chaincode
- 10. DLL部署策略
- 11. 的部署策略
- 12. 如何实施策略设计模式?
- 13. Asp.net部署策略
- 14. ColdFusion实施策略模式
- 15. Restful WebService部署策略 - 最佳实践
- 16. 构建部署策略
- 17. Drupal DATABASE部署策略?
- 18. 部署策略,PHP + SVN
- 19. 回归测试和部署策略
- 20. 如何在Web MVC框架中正确实施策略模式?
- 21. MSP,Consensus,Ordering服务如何在Hyperledger Fabric中插入?
- 22. 实际系统中的hyperledger-fabric设置
- 23. 如何使用TeamCity和Octopus实现这种分支和部署策略
- 24. WCF数据服务实施策略
- 25. 如何根据现有策略选择实施新数据结构的策略?
- 26. 对发票实施销售税策略
- 27. jBPM如何实施决策
- 28. 实施广告网络策略
- 29. 实施ServiceBusTransientErrorDetectionStrategy的指数重试策略
- 30. Amazon Cognito:实施密码过期策略