NEW

Connect the world's APIs to Web3 with Chainlink Functions. Get started

Miscellaneous

Execute Commands Running Docker

In order to interact with the node’s CLI commands, you need to be authenticated. This means that you need to access a shell within the Chainlink node’s running container first. You can obtain the running container’s NAME by running:

docker ps

The output will look similar to:

CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS                              NAMES
436882efd51d        smartcontract/chainlink   "./chainlink-launche…"   33 minutes ago      Up 21 minutes       6688/tcp, 0.0.0.0:6688->6688/tcp   chainlink

The last item, chainlink, is the name of the running container (using --name chainlink in your docker run command will give you a common name). Accessing a shell for this container is accomplished by running:

docker exec -it chainlink /bin/bash

This changes the prompt to something similar to:

root@436882efd51d:~#

You can now log in by running:

chainlink admin login

You will be prompted to enter your API Email and Password, and if successful, the prompt will simply appear again. You can check that you are authenticated by running:

chainlink jobs list

If no jobs have been added, you will receive the following output, otherwise, the list of added jobs will be returned:

╔ Jobs
╬════╬════════════╬════════════╬═══════╬
║ ID ║ CREATED AT ║ INITIATORS ║ TASKS ║
╬════╬════════════╬════════════╬═══════╬

Transfer funds from node wallet.

If using Docker, you will first need to follow the Execute Commands Running Docker guide to enter the running container.

To transfer funds from the node wallet to another address, use the following CLI command:

chainlink txs create <amount> <your-cl-node-address> <send-to-address>

This method is the preferred way to interact with your node wallet. Using other methods to manually interact with the node wallet can cause nonce issues.

Change your API password

If using Docker, you will first need to follow the Execute Commands Running Docker guide to enter the running container.

In order to change your password, you first need to log into the CLI by running:

chainlink admin login

Use your API email and old password in order to authenticate.

Then run the following in order to update the password:

chainlink admin chpass

It will ask for your old password first, then ask for the new password and a confirmation.

Once complete, you should see a message “Password updated.”

Multi-user and Role Based Access Control (RBAC)

Chainlink Nodes allow the root admin CLI user and any additional admin users to create and assign tiers of role-based access to new users. These new API users can able to log in to the Operator UI independently.

Each user has a specific role assigned to their account. There are four roles: admin, edit, run, and view.

If there are multiple users who need specific access to manage the Chainlink Node instance, permissions and level of access can be set here.

User management is configured through the use of the admin chainlink admin users command. Run chainlink admin login before you set user roles for other accounts. For example, a read-only user can be created with the following command:

chainlink admin users create --email=operator-ui-read-only@test.com --role=view

Specific actions are enabled to check role-based access before they execute. The following table lists the actions that have role-based access and the role that is required to run that action:

ActionReadRunEditAdmin
Update passwordXXXX
Create self API tokenXXXX
Delete self API tokenXXXX
List external initiatorsXXXX
Create external initiatorXX
Delete external initiatorXX
List bridgesXXXX
View bridgeXXXX
Create bridgeXX
Edit bridgeXX
Delete bridgeXX
View configXXXX
Update configX
Dump env/configX
View transaction attemptsXXXX
View transaction attempts EVMXXXX
View transactionsXXXX
Replay a specific block numberXXX
List keys (CSA,ETH,OCR(2),P2P,Solana,Terra)XXXX
Create keys (CSA,ETH,OCR(2),P2P,Solana,Terra)XX
Delete keys (CSA,ETH,OCR(2),P2P,Solana,Terra)X
Import keys (CSA,ETH,OCR(2),P2P,Solana,Terra)X
Export keys (CSA,ETH,OCR(2),P2P,Solana,Terra)X
List jobsXXXX
View jobXXXX
Create jobXX
Delete jobXX
List pipeline runsXXXX
View job runsXXXX
Delete job spec errorsXX
View featuresXXXX
View logXXXX
Update logX
List chainsXXXX
View chainXXXX
Create chainXX
Update chainXX
Delete chainXX
View nodesXXXX
Create nodeXX
Update nodeXX
Delete nodeXX
View forwardersXXXX
Create forwarderXX
Delete forwarderXX
Create job runXXX
Create Transfer EVMX
Create Transfer TerraX
Create Transfer SolanaX
Create userX
Delete userX
Edit userX
List usersX

The run command allows for minimal interaction and only enables the ability to replay a specific block number and kick off a job run.

Instead of allowing Docker to generate a name for your running container for you, you can provide a name with the --name option in your run command. For example, without the --name option, docker ps could reveal a name like:

... NAMES
... cocky_austin

However, if we add --name chainlink to our run command, docker ps gives us:

... NAMES
... chainlink

This can be easily accomplished by using the following example run command:

Sepolia Goerli Mainnet ```shell Sepolia cd ~/.chainlink-sepolia && docker run --name chainlink -p 6688:6688 -v ~/.chainlink-sepolia:/chainlink -it --env-file=.env smartcontract/chainlink local n ``` ```shell Goerli cd ~/.chainlink-goerli && docker run --name chainlink -p 6688:6688 -v ~/.chainlink-goerli:/chainlink -it --env-file=.env smartcontract/chainlink local n ``` ```shell Mainnet cd ~/.chainlink && docker run --name chainlink -p 6688:6688 -v ~/.chainlink:/chainlink -it --env-file=.env smartcontract/chainlink local n ```

Running this the once will save the options provided so that you may easily start the named container in the future by running:

docker start -i chainlink

If you need to make changes to the run parameters or the environment file, first remove the named container by running:

docker rm chainlink

Then make your changes and use the longer docker run command again.

Use Password and API Files On Startup

The Chainlink node can be supplied with files for the wallet password and API email and password (on separate lines) on startup so that you don’t need to enter credentials when starting the node. Following the pattern established in Running a Chainlink Node, you can create an API file by running the following:

Change the values within the quotes to something unique for your node.

Sepolia Goerli Mainnet ```shell Sepolia echo "user@example.com" > ~/.chainlink-sepolia/.api ``` ```shell Goerli echo "user@example.com" > ~/.chainlink-goerli/.api ``` ```shell Mainnet echo "user@example.com" > ~/.chainlink/.api ```

Then add the password line by running:

Sepolia Goerli Mainnet ```shell Sepolia echo "password" >> ~/.chainlink-sepolia/.api ``` ```shell Goerli echo "password" >> ~/.chainlink-goerli/.api ``` ```shell Mainnet echo "password" >> ~/.chainlink/.api ```

Create the password file by running the following:

Sepolia Goerli Mainnet ```shell Sepolia echo "my_wallet_password" > ~/.chainlink-sepolia/.password ``` ```shell Goerli echo "my_wallet_password" > ~/.chainlink-goerli/.password ``` ```shell Mainnet echo "my_wallet_password" > ~/.chainlink/.password ```

Finally, in order to use the password and API files upon running the node, add -p /chainlink/.password -a /chainlink/.api to your run command, like so:

Sepolia Goerli Mainnet ```shell Sepolia cd ~/.chainlink-sepolia && docker run -p 6688:6688 -v ~/.chainlink-sepolia:/chainlink -it --env-file=.env smartcontract/chainlink local n -p /chainlink/.password -a /chainlink/.api ``` ```shell Goerli cd ~/.chainlink-goerli && docker run -p 6688:6688 -v ~/.chainlink-goerli:/chainlink -it --env-file=.env smartcontract/chainlink local n -p /chainlink/.password -a /chainlink/.api ``` ```shell Mainnet cd ~/.chainlink && docker run -p 6688:6688 -v ~/.chainlink:/chainlink -it --env-file=.env smartcontract/chainlink local n -p /chainlink/.password -a /chainlink/.api ```

Importing a Keystore

If you haven’t ran the node before and want to import a key you can use the following command, where ./keystore.json is the path to the keystore file of your account.

chainlink local import ./keystore.json

If there is already a key in your database and you want to import another key, you will need to make sure that the same password unlocks all accounts.

Full example in detached mode

cd ~/.chainlink-sepolia && docker run --restart=always  -p 6688:6688 -d --name sepolia-primary -v ~/.chainlink-sepolia:/chainlink -it --env-file=.env smartcontract/chainlink:1.0.0 local n -p /chainlink/.password

What's next

Stay updated on the latest Chainlink news