Actions

Interacting With Chainlink Contracts: Difference between revisions

From Chainlink Community Wiki

No edit summary
No edit summary
Line 23: Line 23:


[[Formatting RPC Call Data]]
[[Formatting RPC Call Data]]
----
----In the Below tables, you can navigate to each contract's separate Read and Write RPC calls.
=== '''EACAggregatorProxy''' ===
'''LINK / USD EACAggregatorProxy contract address: [https://etherscan.io/address/0x2c1d072e956affc0d435cb7ac38ef18d24d9127c#readContract 0x2c1d072e956affc0d435cb7ac38ef18d24d9127c]'''


The Access Controlled Aggregator Proxy is a proxy contract that enables the owner to point it to other contracts as needed/desired.
Each page will container example curl requests and example responses.
 
This prevents the users from having to update anything if they wanted to move to a new contract version/release
 
==== '''[[EACAggregatorProxy Reads|Read Calls]]''' ====
The Read calls are queries you can make to each <code>EACAggregatorProxy</code> to get a wide range of data from the proxy's associated <code>AccessControlledOffchainAggregator</code> contract.  One such example is to get the latest round data from a price feed.
 
==== [[EACAggregatorProxy Writes|'''Write Calls''']] ====
The Write calls that are available to each <code>EACAggregatorProxy</code> are used to make changes to the contract.  An example of a write call would be to change the associated <code>AccessControlledOffchainAggregator</code>


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.
{| class="wikitable"
|+
! colspan="2" |'''EACAggregatorProxy'''
|-
| colspan="2" |'''LINK / USD EACAggregatorProxy contract address: [https://etherscan.io/address/0x2c1d072e956affc0d435cb7ac38ef18d24d9127c#readContract 0x2c1d072e956affc0d435cb7ac38ef18d24d9127c]'''
|-
|'''[[EACAggregatorProxy Reads|Read Calls]]'''
|The Read calls are queries you can make to each <code>EACAggregatorProxy</code> to get a wide range of data from the proxy's associated <code>AccessControlledOffchainAggregator</code> contract.  One such example is to get the latest round data from a price feed.
|-
|[[EACAggregatorProxy Writes|'''Write Calls''']]
|The Write calls that are available to each <code>EACAggregatorProxy</code> are used to make changes to the contract.  An example of a write call would be to change the associated <code>AccessControlledOffchainAggregator</code>
|}
----
{| class="wikitable"
|+
! colspan="2" |'''AccessControlledOffchainAggregator'''
|-
| colspan="2" |'''LINK / USD AccessControlledOffchainAggregator contract address: [https://etherscan.io/address/0xdfd03bfc3465107ce570a0397b247f546a42d0fa#code 0xDfd03BfC3465107Ce570a0397b247F546a42D0fA]'''
|-
|'''Read Calls'''
|The Read calls are queries you can make to each '''<code>AccessControlledOffchainAggregator</code>''' to get a wide range of on-chain data.  One such example is to get the latest round data from a price feed.
|-
|'''Write Calls'''
|The Write calls that are available to each '''<code>AccessControlledOffchainAggregator</code>''' are used to make changes to the contract.  An example of a write call would be to change the <code>adminAddress</code> of a Chainlink Node
|}
----
----
=== '''AccessControlledOffchainAggregator''' ===
'''LINK / USD AccessControlledOffchainAggregator contract address: [https://etherscan.io/address/0xdfd03bfc3465107ce570a0397b247f546a42d0fa#code 0xDfd03BfC3465107Ce570a0397b247F546a42D0fA]'''
The Access Controlled Offchain Aggregator is the aggregator contract that the Chainlink Nodes report to.
This is the contract that contains the on-chain information that is read by the <code>EACAggregatorProxy</code>
==== '''Read Calls''' ====
blah
==== '''Write Calls''' ====
blah
----
----

Revision as of 17:54, 25 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
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

AccessControlledOffchainAggregator
LINK / USD AccessControlledOffchainAggregator contract address: 0xDfd03BfC3465107Ce570a0397b247F546a42D0fA
Read Calls The Read calls are queries you can make to each AccessControlledOffchainAggregator to get a wide range of on-chain data. One such example is to get the latest round data from a price feed.
Write Calls The Write calls that are available to each 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