Skip to content

Architecture Overview

Thomas edited this page May 27, 2018 · 1 revision

diagram

In the diagram above, we see 4 distinct entities:

  • External Data
  • External Adapter(s)
  • Chainlink Node
  • Blockchain Node

These entities represent the major external components of Chainlink's architecture. Below, we will dive into the details of each one and discuss their relationship, represented by the arrows, with one another.

External Data

External data may represent an API, whether open or private, another blockchain, network, or any repository of data that would need to be read or written to.

External Adapter(s)

External adapters allow for additional functionality outside of what is supported within the core Chainlink adapters. External adapters may be written in any language and can operate as a separate service that accepts and responds with JSON formatted data.

The red arrow above the External Adapter(s) entity represents connectivity between the adapter and external data. This may be necessary when the external data provider requires authentication in order to establish connectivity. Credentials for that provider can be stored in the adapter, rather than the Chainlink node itself, giving the node operator complete control over how to securely store their credentials. The Chainlink node will pass an "id" to the external adapter, which is the JobRunID that the external adapter should include in its response back.

Chainlink Node

The Chainlink node handles jobs, tasks, scheduling, and signing transactions for the blockchain. The Chainlink node runs through a specified set of sequential processes and includes a number of core adapters which give it support to read and process data, and write to the blockchain. The Chainlink node also contains the keystore used to sign transactions. This prevents needing to keep the sensitive keystore file unlocked on the blockchain node.

The green arrow represents connectivity to external data which does not require any sort of authentication. The Chainlink node can read open APIs, process their response, and write to the blockchain without any external adapters.

The blue arrow represents the Chainlink node's connectivity to its external adapter(s). The node operator must add each external adapter they are willing to support as a bridge, and the adapter may be on a separate system than that which the Chainlink node resides on.

Blockchain Node

The blockchain node monitors the blockchain and allows the Chainlink node to look for specific events to occur to initiate a job. It also allows the node to broadcast its signed transactions, which return data to consuming contracts. In the case of the blockchain node going offline, the Chainlink node will continuously attempt to reconnect, and monitor the missed blocks when connected for any requests.

The black arrow represents connectivity between the Chainlink and the blockchain node. The Chainlink node will subscribe to the blockchain node in order to read events occurring on the blockchain, and send signed transactions to it in order to publish responses.