如何在链码部署期间在区块链中添加自定义数据?
我知道我们可以在链表部署期间调用智能合约功能以获取初始数据。但是,还有其他方法可以做同样的事情吗?喜欢调用一些外部功能或外部服务做同样的事情?
I know that we can invoke smart contract function during chaincode deployment for initial data. But is there any other way around by which we can do the same thing ? Like calling some external function or external service to do the same thing ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您仅通过向订单器提交认可的交易来更新分类帐,然后您通过调用智能合约交易功能获得了认可的交易。因此,我认为您真的没有替代方案来调用智能合约事务功能以在链码部署后用一些初始状态填充分类帐,但是您可以提供包装交易提交的功能或服务,以便您的客户端(或部署过程) )无需直接处理织物。
You only update the ledger by submitted endorsed transactions to the orderer, and you got those endorsed transactions by invoking smart contract transaction functions. So I don't think you really have an alternative to invoking a smart contract transaction function to populate the ledger with some initial state after chaincode deployment, but you could provide a function or service that wraps that transactions submission so your client (or deployment process) doesn't need to deal with Fabric directly.