Oracle Adapters
This section introduces how to use chainlink to implement external oracle adapters
Last updated
This section introduces how to use chainlink to implement external oracle adapters
Last updated
External adapters are how Chainlink enables easy integration of custom computations and specialized APIs. External adapters are services which the core of the Chainlink node communicates via its API with a simple JSON specification.
will need to know how to specify an external adapter in their request for external data.
will need to know how to implement an external adapter for an API.
will need to know how to add an external adapter to their node so that they can provide specialized services to smart contracts.
The following is a simple tutorial of creating a Chainlink Oracle Adapter.
Firstly, we need to run a Chainlink node locally, and we recommend using . The Chainlink node will be configured to connect to the Ethereum Sepolia.
Run PostgreSQL in a Docker container. You can replace mysecretpassword
with your own password.
1. Create a local directory to hold the Chainlink data:
2. Run the following as a command to create a config.toml
file and populate with variables specific to the network you're running on. For a full list of available configuration variables, see the page. Be sure to update the value for CHANGEME
to the value given by your .
4. Start the Chainlink Node by running the Docker image.
Developers of external adapters will need to know how the Chainlink node requests data from it, and how the data should be formatted for a response.
Here is a complete example of a simple external adapter written as a serverless function. This external adapter takes two input fields, inserts the API key as a header, and returns the resulting payload to the node.
Currently, we have successfully launched the Chainlink Node UI and implemented contract declaration and data requests in a JavaScript environment.
Users can add external adapters to a Chainlink node according to their needs by creating a bridge in the Node Operators Interface. They can also access other existing third-party APIs through Any API. Note that during this process, it's necessary to declare Jobs to the Chainlink Node. Below are detailed reference links:
3. Create a secrets.toml
file with a keystore password and the URL to your database. Update the value for mysecretpassword
to the chosen password in . Specify a complex keystore password. This will be your wallet password that you can use to unlock the keystore file generated for you.
5. You can now connect to your Chainlink node's UI interface by navigating to . Use the API credentials you set up earlier to log in.
Bridge:
Any API:
Jobs: