Chainlink Guide
Getting off-chain data from on-chain requires the orchestration of many Chainlink components, performing different tasks, depending on the product and solution. The following chart (and description to follow) enumerates Chainlink's 'direct request' model, which is great starting point for new developers working with Chainlink.
Guide to interacting with off-chain data with Chainlink
Reference
I. Blockchain Space
Full Node
a.A Full Node is the bridge from the Chainlink Node to the Blockchain. A Full Node enables the Chainlink node to detect inbound on-chain requests from consumer contracts and submit transactions back to the blockchain.
Consumer Contract
b.A Consumer Contract is deployed for a given Job or set of related Jobs on a given Chainlink Node. A Consumer Contract initiates a call to a specified Job on a given Chainlink Node which may interact with data on some third-party API off-chain. Once deployed, a Consumer Contract exists as a contract address on the blockchain.
Required deployment params:
OracleAddress
LinkTokenAddress
Oracle Contract
c.An Oracle Contract is deployed for each Chainlink Node, and is always referenced by the Consumer Contract. The Oracle Contract is what receives the LINK payment associated with the Job request. Once deployed, an Oracle Contract exists as a contract address on the blockchain.
Required params:
- deployment:
AccountId
(web3 wallet) - setFulfillmentPermission:
NodeAddress
(Chainlink Node)
Node Wallet
d.A Node Wallet is required to run a Chainlink Node, and is the source of payment for all on-chain transaction fees.
II. Chainlink Node
Core
a.Consumer Contract requests are directed to a given Chainlink Node based on the Oracle Contract Node Address
supplied when setting the Oracle Contract fullment permissions to true
.
The Chainlink Node is responsible for receiving the request and initiating the Job id specified via the Consumer Contract.
Jobs
b.A Job is created within the Chainlink Operator GUI, and defines some pipeline of tasks to execute, such as retrieving data from some off-chain source, transforming the data, and returning data to the Smart Contract. One step in the Job Pipeline may be to invoke some Bridge.
Bridges
c.A Bridge is created within the Chainlink Operator GUI, and is simply a reference to a given URL for an External Adapter. A Bridge may be referenced by one or more Jobs.
III. Internet
External Adapter
a.An External Adapter is a middleware application which follows the standard for receiving requests from a given Chainlink Job, executes some custom logic for interacting with data on some third-party API, and returns the result from that API back to the Job.
b. Third-party API
A third-party API can be any API on the internet. External Adapters can call a third-party API to get, create, update, or delete data of any kind.