我想在當前現有的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. 如何實施XACML策略?
- 3. HyperLedger-Fabric ChainCode部署 - Base64錯誤
- 4. HyperLedger-Fabric ChainCode部署給解析錯誤
- 5. Hyperledger Fabric/Hyperledger Composer
- 6. Angularjs部署策略
- 7. Hyperledger Fabric內部表實現Chaincode
- 8. Tomcat部署策略
- 9. WPF LinkLabel實施策略
- 10. SSIS部署策略
- 11. 如何實施策略設計模式?
- 12. DLL部署策略
- 13. 的部署策略
- 14. aws ec2 createInstance策略實施
- 15. Asp.net部署策略
- 16. ColdFusion實施策略模式
- 17. Restful WebService部署策略 - 最佳實踐
- 18. 在沒有命令行的情況下部署Hyperledger Fabric模型
- 19. 構建部署策略
- 20. RabbitMQ + PHP部署策略
- 21. 使用Nginx和Passenger的部署策略
- 22. Drupal DATABASE部署策略?
- 23. 部署策略,PHP + SVN
- 24. 芹菜部署策略
- 25. 迴歸測試和部署策略
- 26. MSP,Consensus,Ordering服務如何在Hyperledger Fabric中插入?
- 27. 實際系統中的hyperledger-fabric設置
- 28. 如何在Go中實施策略模式?
- 29. 如何在Web MVC框架中正確實施策略模式?
- 30. Spring Boot部署策略