Oracle Labs
DiscordGitHubTelegram
  • Welcome!
  • Why Oracle Labs?
  • Services
    • Chainlink node service provider
    • Consulting & development
  • Infrastructure Whitepaper
    • Supported Networks
    • Cloud setup
    • How do we monitor?
      • Monitoring Endpoints
  • Technical
    • Chainlink Guide
    • Chainlink Public Jobs
    • Solving common problems
    • Chainlink Node Logs
      • Log
      • Keystore
      • HeadTracker
      • GasEstimator
      • DirectRequest
      • Postgres
      • Client
      • BulletproofTxManager
      • BalanceMonitor
      • FluxMonitor
      • PeriodicBackups
      • OCR
  • Blog
    • Articles
      • External Initiators
      • Configuring logging in a kubernetes cluster
      • Integrate Chainlink Operator Contract with Chainlink Node
      • Setting up custom price feeds on chainlink node
      • Two-factor authentication to the server via ssh
      • Creating an L2TP vpn tunnel over IPSec
Powered by GitBook
On this page
  • Overview
  • External Initiator
  • Sources
  1. Blog
  2. Articles

External Initiators

#chainlinknode #externalinitiators #nodeoperator

PreviousArticlesNextConfiguring logging in a kubernetes cluster

Last updated 2 years ago

Overview

To better understand why we need External Initiators and what role they play, it's worth getting a better understanding of the Job Spec. The Job Spec conceptually consists of two parts:

  • Initiator - When the Job is to be executed

  • Task - How and in which order the Job is to be executed

Under the hood, Chainlink Node has a built-in set of Initiators and Tasks. If the built-in tools are not suitable for your task, the External Initiators and External Adapters come to the rescue.

External Initiator

The External Initiator has a bi-directional action. This means that we can both send data to the client and receive data from the data sources.

For connected External Initiators, the Chainlink Node will notify them about the events of creating a new Job or deleting an existing Job whose whitelist contains a specific External Initiator.

Creating External Initiator

The External Initiator is a service (e.g. written in go, nodejs, etc.) that must have a connection to the Postgres database (different from the database used by the Chainlink Node).

In order to communicate with the Job deployed on the Chainlink Node, the External Initiator must have cryptographic pairs:

  • External Initiator Outgoing Access Key / External Initiator Outgoing Secret - To interact External Initiator → Chainlink Node

  • External Initiator Incoming Access Key/External Initiator Incoming Secret - For interaction Chainlink Node → External Initiator

These pairs are automatically generated on the Chainlink Node side when you add the External Initiator. You will also need to add certain env variables to the External Initiator service after that.

Adding External Initiator to the Chainlink Node

What you should pay attention to:

The .env file with variables like EI_* must be plugged into the service that acts as the External Initiator.

Important! The database specified in the variable EI_DATABASEURL must be different from the Chainlink Node database.

Sources

The basic process is described in the documentation:

https://docs.chain.link/chainlink-nodes/external-initiators/external-initiators-in-nodes
https://docs.chain.link/chainlink-nodes/external-initiators/external-initiators-in-nodes
https://github.com/smartcontractkit/chainlink/wiki/External-Initiators
https://github.com/Conflux-Network-Global/demo-cfx-chainlink
Example of External Initiator 1.1. Querying an external database and starting a Job according to specific criteria
Example of External Initiator 1.2.0. Blockchain polling. Sending SMS messages to a client based on Blockchain events. Sending SMS messages to a client to create transactions on Blockchain
Example of External Initiator 1.2.1 operation