Lawson Cheng
Lawson Cheng

Reputation: 13

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.

When I dig into the code and I found that there the method came from the interface AggregatorV3Interface. Also, I didn't find the implementation of the function inside any of .sol files, but I find it in a .go file.

My question is, how is the aggregator store data on the blockchain? as I see the data come from nowhere when I call getRoundData. If data comes from the module written by Go lang, does that means the data source is off-chain? Thank you.

Code snippet captures: aggregator_v2v3_interface.go AggregatorV3Interface.sol

Upvotes: 0

Views: 215

Answers (1)

Petr Hejda
Petr Hejda

Reputation: 43481

A contract implementing this interface is deployed on an address specified in the _AggregatorV2V3Interface Golang variable.

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. The actual data is stored onchain.

Upvotes: 0

Related Questions