Everything related to deploying our Chainlink node using docker.
We followed the Running a Chainlink Node tutorial.
Note: This is a development setup with security issues all over. It was created solely for rapid deployment used for smoke testing. This should not be used for production without an architecture overhaul and security hardening.
Tested on a VPS (4 Cores/8GB RAM/200GB SSD) which had a fresh install of Ubuntu 20.04. The steps below will bring up a working Chainlink Node on the Ethereum Rinkeby testnet. Connect to the VPS via ssh and run the following commands.
which docker >/dev/null && echo "docker is installed!" || echo "docker not installed" && curl -sSL https://get.docker.com/ | sh
sudo usermod -aG docker $USER
exec bash
apt install docker-compose -y
apt install git -y
git clone https://github.com/vmtree/chainlink-node.git
cd chainlink-node/
mkdir ~/.chainlink
echo "passwordgoesHERE123###" > ~/.chainlink/.password
echo "[email protected]" > ~/.chainlink/.api
echo "passwordgoesHERE" >> ~/.chainlink/.api
echo "DB_USER=postgres
DB_PW=Password123
DB_NAME=postgresdb
LOG_LEVEL=debug
ETH_CHAIN_ID=4
LINK_CONTRACT_ADDRESS=0x01BE23585060835E02B77ef475b0Cc51aA1e0709
ETH_URL=wss://rinkeby.infura.io/ws/v3/APIKeyGoesHere
ETH_HTTP_URL=https://rinkeby.infura.io/v3/APIKeyGoesHere
MIN_OUTGOING_CONFIRMATIONS=2
CHAINLINK_TLS_PORT=0
SECURE_COOKIES=false
GAS_UPDATER_ENABLED=true
ALLOW_ORIGINS=*" > ~/.chainlink/.env
export $(grep -v '^#' ~/.chainlink/.env | xargs)
docker-compose up -d
After it's running, login to the node and add a bridge with the name "vmt"
that points to your external adapter. Then, you can add the job specification that listens to the Arborist contract for oracle requests. Of course, don't forget to fund your node with ETH.
Some sample .env files which the current node solution is based on.
Contains toml job specs of the external adapters. Chainlink job spec v2 uses DAGs for task pipelines, which is a welcome change from the previous JSON specs.
This job specification details the tasks that the Chainlink node executes during a VMTree update. I had to improvise with this job spec, because I was having some trouble with the values that the Chainlink node was sending to the external adapter. This job spec sends the raw bytes data that it gets from the checkMassUpdate
function call, and the external adapter does manual abi decoding to retrieve the value. The reason is because the Chainlink node (when it did the decode_call
task) was sending floats instead of uint256
words, so instead of getting a full length evm word, the external adapter was getting values like "1.5123123E12". I think the right solution is to use the Chainlink node for decoding, but to decode with bytes32
instead of uint256
, but I hacked together some other stuff instead with a buffer and manually indexing the values.