Skip to content

CSI-DAO/chainlink-node-setup

 
 

Repository files navigation

chainlink node setup

chainlink node setup using xdai.

external links

content of repo

public part of config files for virtual server setup.

accessing the chainlink node

assumption: only ssh access is possible

chainlink cli

  1. open new shell (green)
  2. ssh login using the command below
ssh <user>@<ip-address> 
  • <user> your ssh username
  • <ip-address> the ip address of the machine where your chainlink node runs

then, in the chainlink node shell

  1. use docker ps to check the state of running containers and their names.
  2. use docker exec to open a shell inside the chainlink container
cd /opt/chainlinknode
cat api
docker ps -a
docker exec -it chainlinknode_chainlink_1 bash

inside the chainlink docker container you can now use the chainlink cli. the chainlink cli first needs an admin login (see file api for the credentials)

chainlink admin login
chainlink help

chainlink api

  1. open new shell (green)
  2. ssh tunnel using the command below
  3. access api endpoints via localhost:/6688
ssh -L 6688:localhost:6688 <user>@<ip-address> 
  • <user> your ssh username
  • <ip-address> the ip address of the machine where your chainlink node runs

chainlink node auth can be done via session cookies. curl can be used to create a session cookie (./cookie) as shown below.

export USERNAME=<chainlink admin user name>
export PASSWORD=<chainlink admin user password>
curl -c ./cookie -H 'Content-Type: application/json' -d '{"email":"'${USERNAME}'", "PASSWORD":"'${PASSWORD}'"}' localhost:6688/sessions

examples below: use the cookie to show the node's accounting address and list the oracle node jobs

curl -b ./cookie -c ./cookie localhost:6688/v2/keys/eth
curl -b ./cookie -c ./cookie localhost:6688/v2/jobs

chainlink api endpoints extracted from the chainlink go source on github

/health
/readyz
/v2/bridge_types
/v2/chains/evm
/v2/config
/v2/external_initiators
/v2/features
/v2/feeds_managers
/v2/job_proposals
/v2/jobs
/v2/keys/csa
/v2/keys/eth
/v2/keys/ocr
/v2/keys/p2p
/v2/keys/vrf
/v2/log
/v2/ping
/v2/pipeline/runs
/v2/transactions/
/v2/tx_attempts

chainlink node ui

  1. open new shell (green)
  2. ssh tunnel using the command below
  3. open ui in your browser via url http://localhost:6688/
ssh -L 6688:localhost:6688 <user>@<ip-address> 
  • <user> your ssh username
  • <ip-address> the ip address of the machine where your chainlink node runs

chainlink database

  1. ssh tunnel
  2. open new shell (green)
  3. connect to postgresql db with postgresql://<db-user>:<db-password>@localhost:5432/chainlink
ssh -L 5432:localhost:5432 <user>@<ip-address> 
  • <db-user> the db user name (see postgres.env)
  • <db-password> the db user password (see postgres.env)
  • <user> your ssh username
  • <ip-address> the ip address of the machine where your chainlink node runs

operator contract deployment

cd operator
docker run -it --rm \
    -v $PWD:/projects/operator \
    brownie

inside container

cd operator
brownie pm install OpenZeppelin/[email protected]
brownie pm install smartcontractkit/[email protected]
brownie compile
brownie run deploy

About

Public part of chainlink node setup.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 70.1%
  • Solidity 22.7%
  • Shell 5.2%
  • Dockerfile 2.0%