Interacting With Chainlink Contracts: Difference between revisions
From Chainlink Community Wiki
No edit summary |
No edit summary |
||
Line 35: | Line 35: | ||
! colspan="2" |'''<big>EACAggregatorProxy</big>''' | ! colspan="2" |'''<big>EACAggregatorProxy</big>''' | ||
|- | |- | ||
| colspan="2" |'''LINK / USD EACAggregatorProxy contract address: [https://etherscan.io/address/0x2c1d072e956affc0d435cb7ac38ef18d24d9127c#readContract 0x2c1d072e956affc0d435cb7ac38ef18d24d9127c]''' | | colspan="2" |'''<big>LINK / USD EACAggregatorProxy contract address: [https://etherscan.io/address/0x2c1d072e956affc0d435cb7ac38ef18d24d9127c#readContract 0x2c1d072e956affc0d435cb7ac38ef18d24d9127c]</big>''' | ||
|- | |||
|'''Deploying an Aggregator Proxy''' | |||
|Directions on deploying an <code>EACAggregatorProxy.sol</code> contract to help manage your own price feed | |||
|- | |||
|'''Verifying an Aggregator Proxy''' | |||
|Directions on how to verify a deployed <code>EACAggregatorProxy</code> contract in etherescan | |||
|- | |- | ||
|'''Managing an Aggregator Proxy''' | |'''Managing an Aggregator Proxy''' | ||
|Directions on | |Directions on managing and updating a deployed <code>EACAggregatorProxy</code> contract | ||
|- | |- | ||
|'''[[EACAggregatorProxy Reads|Read Calls]]''' | |'''[[EACAggregatorProxy Reads|Read Calls]]''' | ||
Line 52: | Line 58: | ||
! colspan="2" |'''<big>SimpleWriteAccessController</big>''' | ! colspan="2" |'''<big>SimpleWriteAccessController</big>''' | ||
|- | |- | ||
| colspan="2" |'''LINK / USD (Billing) SimpleWriteAccessController contract address: [https://etherscan.io/address/0xdfd03bfc3465107ce570a0397b247f546a42d0fa#readContract 0x9db83cef9f68b63989e4e82d65d549e7ff2acda9]''' | | colspan="2" |'''<big>LINK / USD (Billing) SimpleWriteAccessController contract address: [https://etherscan.io/address/0xdfd03bfc3465107ce570a0397b247f546a42d0fa#readContract 0x9db83cef9f68b63989e4e82d65d549e7ff2acda9]</big>''' | ||
|- | |||
| colspan="2" |'''<big>LINK / USD (Requester) SimpleWriteAccessController contract address: [https://etherscan.io/address/0x641b698ad1c6e503470520b0eecb472c0589dfe6 0x641b698ad1c6e503470520b0eecb472c0589dfe6]</big>''' | |||
|- | |||
|'''[[AccessControlledOffchainAggregator Deployment|Deploying an Access Controller]]''' | |||
|Directions on deploying a <code>SimpleWriteAccessController.sol</code> contract to build your own price feed. | |||
|- | |- | ||
| | |'''Verifying an Access Controller''' | ||
|Directions on how to verify a deployed <code>SimpleWriteAccessController</code> contract in etherscan | |||
|- | |- | ||
|''' | |'''Managing an Access Controller''' | ||
|Directions on | |Directions on how to manage and update the <code>SimpleWriteAccessController</code> depending on its application | ||
|- | |- | ||
|'''Read Calls''' | |'''Read Calls''' | ||
Line 68: | Line 80: | ||
! colspan="2" |'''<big>AccessControlledOffchainAggregator</big>''' | ! colspan="2" |'''<big>AccessControlledOffchainAggregator</big>''' | ||
|- | |- | ||
| colspan="2" |'''LINK / USD AccessControlledOffchainAggregator contract address: [https://etherscan.io/address/0xdfd03bfc3465107ce570a0397b247f546a42d0fa#code 0xDfd03BfC3465107Ce570a0397b247F546a42D0fA]''' | | colspan="2" |'''<big>LINK / USD AccessControlledOffchainAggregator contract address: [https://etherscan.io/address/0xdfd03bfc3465107ce570a0397b247f546a42d0fa#code 0xDfd03BfC3465107Ce570a0397b247F546a42D0fA]</big>''' | ||
|- | |||
| '''[[Deploy OCR Contract|Deploying an OCR Aggregator]]''' | |||
|Directions on deploying an <code>AccessControlledOffchainAggregator.sol</code> contract to build your own price feed. | |||
|- | |||
|'''Verifying an OCR Aggregator''' | |||
|Directions on verifying a deployed <code>AccessControlledOffchainAggregator</code> contract in etherscan | |||
|- | |- | ||
| ''' | |'''Managing an OCR Aggregator''' | ||
|Directions on | |Directions on how to manage and update a deployed OCR Aggregator contract | ||
|- | |- | ||
|'''[[AccessControlledOffchainAggregator Reads|Read Calls]]''' | |'''[[AccessControlledOffchainAggregator Reads|Read Calls]]''' |
Revision as of 16:54, 30 May 2022
How to Query Chainlink Contracts
This page will provide you with information regarding how to query a Chainlink Aggregator
Included are some examples using bash.
All examples are based on the LINK / USD price feed on Ethereum Mainnet
Overview
Each Chainlink Aggregator has a wide range of data that you can query.
From historic price data to the timestamp of the most recent completed round, a lot of information is stored on-chain and available for you to query.
This page will be broken out into each major contract type, and then each individual query that can be made, with examples.
How To Format Request Data
Formatting the data we want to send in our RPC calls is a bit tricky if you've never done it before.
This page will assist you in learning how to do this as well as provide outside resources to make it a bit easier.
Formatting RPC Call Data
In the Below tables, you can navigate to each contract's separate Read and Write RPC calls.
Each page will container example curl requests and example responses.
While curl is nowhere near the most common way to interact with smartcontracts, I felt it would provide the simplest and most detailed information possible.
EACAggregatorProxy | |
---|---|
LINK / USD EACAggregatorProxy contract address: 0x2c1d072e956affc0d435cb7ac38ef18d24d9127c | |
Deploying an Aggregator Proxy | Directions on deploying an EACAggregatorProxy.sol contract to help manage your own price feed
|
Verifying an Aggregator Proxy | Directions on how to verify a deployed EACAggregatorProxy contract in etherescan
|
Managing an Aggregator Proxy | Directions on managing and updating a deployed EACAggregatorProxy contract
|
Read Calls | The Read calls are queries you can make to each EACAggregatorProxy to get a wide range of data from the proxy's associated AccessControlledOffchainAggregator contract. One such example is to get the latest round data from a price feed.
|
Write Calls | The Write calls that are available to each EACAggregatorProxy are used to make changes to the contract. An example of a write call would be to change the associated AccessControlledOffchainAggregator
|
SimpleWriteAccessController | |
---|---|
LINK / USD (Billing) SimpleWriteAccessController contract address: 0x9db83cef9f68b63989e4e82d65d549e7ff2acda9 | |
LINK / USD (Requester) SimpleWriteAccessController contract address: 0x641b698ad1c6e503470520b0eecb472c0589dfe6 | |
Deploying an Access Controller | Directions on deploying a SimpleWriteAccessController.sol contract to build your own price feed.
|
Verifying an Access Controller | Directions on how to verify a deployed SimpleWriteAccessController contract in etherscan
|
Managing an Access Controller | Directions on how to manage and update the SimpleWriteAccessController depending on its application
|
Read Calls | The Read calls are queries you can make to each SimpleWriteAccessController to get relevant information to check access and state of a contract. One such example is to get to check if a provided address has access permissions to make a specified call.
|
Write Calls | The Write calls that are available to each SimpleWriteAccessController are used to make changes to the contract. An example of a write call would be to replace one Chainlink Node for another.
|
AccessControlledOffchainAggregator.sol
contract to build your own price feed.
AccessControlledOffchainAggregator
contract in etherscan
AccessControlledOffchainAggregator
to get a wide range of on-chain data. One such example is to get the latest round data from a price feed.
AccessControlledOffchainAggregator
are used to make changes to the contract. An example of a write call would be to change the adminAddress
of a Chainlink Node