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
  • Requirements
  • Compile and deploy and Operator.sol contract through Remix IDE
  • Setup MyOperator contract for integration with Chainlink Node
  • Funding
  • Troubleshooting
  1. Blog
  2. Articles

Integrate Chainlink Operator Contract with Chainlink Node

#chainlinknode #operator.sol

PreviousConfiguring logging in a kubernetes clusterNextSetting up custom price feeds on chainlink node

Last updated 2 years ago

Requirements

  • MetaMask browser extension.

  • Address with sufficient LINK & ETH tokens in the network where you want to deploy a smart contract

Compile and deploy and Operator.sol contract through Remix IDE

  1. Go to

  2. Create new file, let’s call it MyOperator.sol

// MyOperator.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;

import "@chainlink/contracts/src/v0.7/Operator.sol";
  1. Go to tab “Solidity Compiler” in sidebar. Click “Compile MyOperator.sol”

  2. Go to tab "Deploy & run transactions.

  3. Click “ENVIRONMENT” -> “Injected Provider - MetaMask”. After that, the metamask extension should open. Select the network on which you want to process transactions. We will use Goerli testnet. Important: Chainlink Node and MyOperator contract must use the same network!

  4. If everything is correct, your address should appear in the “ACCOUNT” field. In “CONTRACT” field find “Operator - @chainlink/contracts/src/v0.7/Operator.sol” and use it.

  5. Expand the DEPLOY section. There you must fill in the LINK and OWNER parameters. LINK - the address of the LINK token in the selected network. Check (Chainlink Token addresses)[] OWNER - is your address from the metamask.

  6. Click “Transact” button, pay gas and wait when transaction is over.

  7. If everything is correct, your contract should appear in the interaction menu, in the “Deployed Contracts” section

Setup MyOperator contract for integration with Chainlink Node

  1. In “Deployed Contracts” section find Operator contract, which you deployed in the previous step. There is a set of contract fields that you can interact with.

  2. Find “setAuthorizedSenders” method, expand it, fill senders parameter with value [“YOUR_CHAINLINK_NODE_ACCOUNT_ADDRESS”], click “Transact” button, pay gas and await when transaction over. Important! Chainlink Node Address shows on you Chainlink Node UI, this is NOT your address from MetaMask.

  3. Find “getAuthorizedSenders” method and click on it. That should return array with your Chainlink Node Address.

Funding

  • Fund MyOperator contract with LINK. You can do this for example by Metamask transfer tokens. Be careful, it is required to sponsor at least the MINIMUM_CONTRACT_PAYMENT_LINK_JUELS configuration value in LINK on your Chainlink Node. To get started, 1-2 LINKs are usually enough.

  • Fund Chainlink Node Address with ETH. You can do this for example by Metamask transfer tokens

That’s all! Now your Chainlink node is connected to the blockchain.

Troubleshooting

Transaction reverted

Often this error occurs when you forgot to sponsor an Operator contract or Chainlink Node Address. Make sure you have sufficient funds in your accounts.

Remix Online IDE
https://docs.chain.link/resources/link-token-contracts/