Search code examples
blockchainsoliditychainlinkaggregator

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


Solution

  • 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.