简体   繁体   English

ChainLink:当我调用 GetRoundData 时,数据来自哪里?

[英]ChainLink: where does the data from when I call GetRoundData?

I am currently learning how to start developing on ChainLink, and I saw that there is a GetRoundData() method that is used to return data from a specific timestamp.我目前正在学习如何开始在 ChainLink 上进行开发,我看到有一个 GetRoundData() 方法用于从特定时间戳返回数据。

When I dig into the code and I found that there the method came from the interface AggregatorV3Interface.当我深入研究代码时,我发现该方法来自接口 AggregatorV3Interface。 Also, I didn't find the implementation of the function inside any of.sol files, but I find it in a.go file.此外,我没有在任何 .sol 文件中找到 function 的实现,但我在 .go 文件中找到了它。

My question is, how is the aggregator store data on the blockchain?我的问题是,聚合器如何在区块链上存储数据? as I see the data come from nowhere when I call getRoundData.当我调用 getRoundData 时,我看到数据无处不在。 If data comes from the module written by Go lang, does that means the data source is off-chain?如果数据来自Go lang写的模块,是否说明数据源是链下的? Thank you.谢谢你。

Code snippet captures: aggregator_v2v3_interface.go AggregatorV3Interface.sol代码片段捕获: aggregator_v2v3_interface.go AggregatorV3Interface.sol

A contract implementing this interface is deployed on an address specified in the _AggregatorV2V3Interface Golang variable.实现此接口的合约部署在_AggregatorV2V3Interface Golang 变量中指定的地址上。

So your offchain script is connected to a node of some EVM.network (Ethereum, BSC, Polygon, ...) and queries the node to perform a read-only, gas-free, call on that specific contract address.因此,您的链下脚本连接到某个 EVM.network(以太坊、BSC、Polygon 等)的节点,并查询该节点以对该特定合约地址执行只读、无 gas调用 The actual data is stored onchain.实际数据存储在链上。

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

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