简体   繁体   English

如何让智能合约程序调用外部数据?

[英]How to let the smart contract programs call the external data?

How to let the smart contract programs call the external data? 如何让智能合约程序调用外部数据? The data are stored in the desktop's hard desk,but need to be updated constantly,and the new content will be delivered by another slave computer regularly. 数据存储在桌面硬盘中,但需要不断更新,新内容将由另一台从属计算机定期发送。

And what if the contract was depolyed on the private chain? 如果合同在私人链上被解除了怎么办?

How to let the smart contract programs call the external data? 如何让智能合约程序调用外部数据?

Smart contracts can't call or at least Ethereum contracts can't call. 智能合约不能打电话或至少以太坊合约不能打电话。 They can be called and they can be triggered, but they can't call by themselves. 它们可以被调用,它们可以被触发,但它们不能自己调用​​。

The approach you will need to take is to use something like web3js to make a transaction every time you want data to be stored in your smart contract. 您需要采取的方法是在每次希望将数据存储在智能合约中时使用类似web3js的事务来进行交易。

And what if the contract was depolyed on the private chain? 如果合同在私人链上被解除了怎么办?

The approach would be the same, although you must ensure all the machines involved have access to the private chain. 虽然您必须确保所涉及的所有计算机都可以访问私有链,但方法是相同的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM