Running a Chainlink Node locally | Chainlink Documentation (2024)

This guide will teach you how to run a Chainlink node locally using Docker. The Chainlink node will be configured to connect to the Ethereum Sepolia.

Requirements

  • As explained in the requirements page, make sure there are enough resources to run a Chainlink node and a PostgreSQL database.
  • Install Docker Desktop. You will run the Chainlink node and PostgreSQL in Docker containers.
  • Chainlink nodes must be able to connect to an Ethereum client with an active websocket connection. See Running an Ethereum Client for details. In this tutorial, you can use an external service as your client.

Using Docker

Run PostgreSQL

  1. Run PostgreSQL in a Docker container. You can replace mysecretpassword with your own password.

    docker run --name cl-postgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres
  2. Confirm that the container is running. Note the 5432 port is published 0.0.0.0:5432->5432/tcp and therefore accessible outside of Docker.

    docker ps -a -f name=cl-postgres

    If the container is running successfully, the output shows a healthy status:

    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESdc08cfad2a16 postgres "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 0.0.0.0:5432->5432/tcp cl-postgres

Run Chainlink node

Configure your node

  1. Create a local directory to hold the Chainlink data:

    mkdir ~/.chainlink-sepolia
  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 Node Config page.Be sure to update the value for CHANGEME to the value given by your external Ethereum provider.

    echo "[Log]Level = 'warn'[WebServer]AllowOrigins = '\*'SecureCookies = false[WebServer.TLS]HTTPSPort = 0[[EVM]]ChainID = '11155111'[[EVM.Nodes]]Name = 'Sepolia'WSURL = 'wss://CHANGE_ME'HTTPURL = 'https://CHANGE_ME'" > ~/.chainlink-sepolia/config.toml
  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 Run PostgreSQL. Specify a complex keystore password. This will be your wallet password that you can use to unlock the keystore file generated for you.

    echo "[Password]Keystore = 'mysecretkeystorepassword'[Database]URL = 'postgresql://postgres:[emailprotected]:5432/postgres?sslmode=disable'" > ~/.chainlink-sepolia/secrets.toml
  4. Optionally, you can create an .api file with the credentials for the node's API and Operator Interface. The node stores the credentials from the .api file in the database only the first time you run the container using the database. The .api file cannot override credentials for an existing user in the database.

    Create the file in the same directory as your TOML config files and list your API credentials. Change the values for API email and password. The user must be an email address with an @ character and the password must be 16-50 characters in length.

    echo "CHANGE_THIS_EXAMPLE_EMAILCHANGE_THIS_EXAMPLE_PASSWORD" > ~/.chainlink-sepolia/.api
  5. Start the Chainlink Node by running the Docker image.

    Change the version number in smartcontract/chainlink:2.10.0 with the version of the Docker image that you need to run. For most new nodes, use version 2.0.0 or later. Tag versions are available in the Chainlink Docker hub. The latest version does not work.

    Chainlink Nodes running 2.0.0 and later require the -config and -secrets flags after the node part of the command.

    If you created an .api file with your API and Operator UI login credentials, add -a /chainlink/.api to the end of the docker run command. Otherwise, the node will ask you for these credentials when you start it for the first time. These credentials are stored in the database only when you run a container for the first time against that database. If you need to remove the .api file, delete the container, and start it again without -a /chainlink/.api.

    cd ~/.chainlink-sepolia && docker run --platform linux/x86_64/v8 --name chainlink -v ~/.chainlink-sepolia:/chainlink -it -p 6688:6688 --add-host=host.docker.internal:host-gateway smartcontract/chainlink:2.10.0 node -config /chainlink/config.toml -secrets /chainlink/secrets.toml start
  6. Detach from the container by pressing the Ctrl+P command and then the Ctrl-Q command. On MacOS, use ⌘-P and ⌘-Q.

  7. Confirm that the container is running. Note that the 6688 port is published 0.0.0.0:6688->6688/tcp and is accessible outside of Docker.

    docker ps -a -f name=chainlink

    If the container is running, the output shows a healthy status:

    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES867e792d6f78 smartcontract/chainlink:2.10.0 "chainlink node -con…" 2 minutes ago Up 2 minutes (healthy) 0.0.0.0:6688->6688/tcp, :::6688->6688/tcp chainlink
  8. You can now connect to your Chainlink node's UI interface by navigating to http://localhost:6688. Use the APIcredentials you set up earlier to log in.

    If you are using a VPS, you can create an SSH tunnel to your node for 6688:localhost:6688 to enable connectivity to the GUI. Typically this is done with ssh -i $KEY $USER@$REMOTE-IP -L 6688:localhost:6688 -N. An SSH tunnel is recommended over opening public-facing ports specific to the Chainlink node. See the Security and Operation Best Practices page for more details about securing your node.

Configure users and roles

You can create several users with different role-based access tiers. This allows you to grant access to several users without granting admin privileges to every user. Role-based access can be configured only by using the CLI.

  1. Open an interactive bash shell on the container that is running your node:

    docker exec -it chainlink /bin/bash
  2. Log into the Chainlink CLI. The CLI prompts you for the admin credentials that you configured for your node.

    chainlink admin login
  3. Add a user with view-only permissions on the node. The CLI prompts you for the new user's credentials.

    chainlink admin users create --email=[emailprotected] --role=view

    This user can now log into the UI and query the API, but cannot change any settings or jobs.

  4. Confirm the current list of users:

    chainlink admin users list
  5. Log out of the CLI. This prevents users with access to the shell from executing admin commands.

    chainlink admin logout
  6. Exit from the container.

    exit

To learn how to modify user roles and see the full list of available roles, read the Role-Based Access Control page.

Running a Chainlink Node locally | Chainlink Documentation (2024)

FAQs

What do you need to run a Chainlink node? ›

Hardware
  1. Minimum: At least 2 CPU cores and 4 GB of RAM will allow you to get a node running for testing and basic development.
  2. Recommended: For nodes in a production environment with over 100 jobs, you will need at least 4 CPU cores and 8GB of RAM.

How much do Chainlink node operators make? ›

Chainlink Node Operators' have earned $289mm in revenue and $149mm in gross profit from price feeds since June 2020. A~35% net income margin would imply $1.74mm in net income per node operator or ~$628K per node operator per year.

What are the benefits of running a Chainlink node? ›

The node operators are rewarded with the LINK tokens for doing high-quality, honest work. Chainlink nodes have job specifications registered with each node to execute jobs coordinated by the on-chain Oracle contracts. Running a Chainlink node allows you to provide external data directly to smart contracts.

What are the hardware requirements for Chainlink node? ›

Each Chainlink node needs a dedicated object relational database to keep state and store a history of its operations. This includes blockchain synchronization, transaction history, all historical job runs and much more. Its minimum hardware requirements are 2 cores, 4GB RAM and a 100GB SSD disk.

What are node requirements? ›

Node Requirements
  • CPU: X86/X64 compatible (Intel Xeon or AMD EPYC); 24 cores/48 threads meeting or exceeding the following benchmarks: ...
  • Network Connectivity: Sustained 1Gb/s internet bandwidth via a single 1-Gigabit / 10-Gigabit Ethernet interface.
Feb 21, 2024

How much ETH is needed to run a node? ›

Users need to stake 32 ETH to the smart contract to set up and run a node. Furthermore, node operators need vast technical expertise to run their nodes optimally. As a result, many investors choose to delegate ETH through liquid staking services, which offer far more freedom and flexibility.

Is running nodes profitable? ›

Yes, some node runners are earning a decent amount of sats every month with their lightning nodes, but they are also the ones putting in the most effort and the most capital to do so.

Do you get paid for running a node? ›

While no one will pay you for running a Lightning Node, you can charge routing fees for payments that go through your channels.

What is the most profitable crypto node to run? ›

Top crypto nodes to run in 2024: Overview
NBlockchain nodeCrypto node reward token
1BitcoinBTC
2EthereumETH
3SolanaSOL
4PolkadotDOT
1 more row
Apr 17, 2024

How much money can you make running an Ethereum node? ›

Your Estimated Rewards:
DurationETH StakeETH Reward
Day32.0035 ETH ($94 511.03)0.0035 ETH ($10.23)
Week32.0242 ETH ($94 572.39)0.0242 ETH ($71.59)
Month32.1074 ETH ($94 817.86)0.1074 ETH ($317.06)
Year33.2641 ETH ($98 233.94)1.2641 ETH ($3 733.14)

What does a Chainlink node operator do? ›

Chainlink node operators are the entities running the oracle infrastructure (hardware and software) that powers and secures every oracle network running on the Chainlink Network.

Why is it important to run a node? ›

A full node client verifies all transactions in each new block, helps ensure that the network is secure, and that the transaction data is valid.

What programming language does Chainlink use? ›

Chainlink (blockchain)
Denominations
Written inSolidity, Go
Operating systemBlockchain-agnostic
Source modelOpen source
LicenseMIT License
11 more rows

How many Chainlink nodes are there? ›

Since launch, the Chainlink ecosystem has grown substantially from just three nodes to over 27 security reviewed nodes that are live today feeding off-chain data to the 29 various Chainlink Price Reference Data contracts currently being consumed by several Ethereum mainnet DeFi protocols such as Synthetix, Loopring, ...

How much Chainlink do you need to stake? ›

2 community pool is filled, additional LINK can only be staked once an existing staker completes a withdrawal of their staked LINK and pool space becomes available. Node Operator Stakers can stake a minimum of 1,000 LINK and a maximum of up to 75,000 LINK.

Can anyone run a node? ›

Nodes are not just for proof-of-stake validators. Anyone can run a node—you don't even need ETH. You don't need to stake ETH to run a node. In fact, it's every other node on Ethereum that holds validators accountable.

What are the requirements for TRX node? ›

Minimum specifications for full node deployment CPU:16-core RAM:16G Bandwidth:100M DISK:10T Recommended specifications for full node deployment CPU:64-core or more RAM:64G or more Bandwidth:500M and more DISK:20T or more Minimum specifications for solidity node deployment CPU:16-core RAM:16G Bandwidth:100M DISK:10T ...

How do I run my own crypto node? ›

To run a node, you can download the Bitcoin Core software and let it copy the entire blockchain from other nodes, and then your node will be ready to verify each block itself. To set up a new node, you need to go through the IBD (Initial block download) that enables node synchronization to the network on the first run.

What are the requirements for staking Chainlink? ›

In order to stake LINK, you'll need to have LINK tokens on Ethereum in a self-custodial wallet, where you can connect to Chainlink Staking v0. 2's frontend interface using a Web3 wallet such as MetaMask. Your wallet will also need to contain ETH to pay for Ethereum network transaction fees.

Top Articles
Latest Posts
Article information

Author: Maia Crooks Jr

Last Updated:

Views: 5724

Rating: 4.2 / 5 (63 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Maia Crooks Jr

Birthday: 1997-09-21

Address: 93119 Joseph Street, Peggyfurt, NC 11582

Phone: +2983088926881

Job: Principal Design Liaison

Hobby: Web surfing, Skiing, role-playing games, Sketching, Polo, Sewing, Genealogy

Introduction: My name is Maia Crooks Jr, I am a homely, joyous, shiny, successful, hilarious, thoughtful, joyous person who loves writing and wants to share my knowledge and understanding with you.