如何在链码部署期间在区块链中添加自定义数据?

发布于 2025-01-25 11:37:53 字数 78 浏览 5 评论 0原文

我知道我们可以在链表部署期间调用智能合约功能以获取初始数据。但是,还有其他方法可以做同样的事情吗?喜欢调用一些外部功能或外部服务做同样的事情?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

窝囊感情。 2025-02-01 11:37:53

您仅通过向订单器提交认可的交易来更新分类帐,然后您通过调用智能合约交易功能获得了认可的交易。因此,我认为您真的没有替代方案来调用智能合约事务功能以在链码部署后用一些初始状态填充分类帐,但是您可以提供包装交易提交的功能或服务,以便您的客户端(或部署过程) )无需直接处理织物。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文