Ensure that your system is up to date and fully patched
Debian & Ubuntu
sudo apt update -y && sudo apt upgrade -yCentOS & Amazon Linux
sudo yum update && sudo yum upgrade -yInstall what we can from the default repository:
Debian & Ubuntu
sudo apt -y install git build-essential net-tools vim apt-transport-https ca-certificates curl wget gnupg2 software-properties-common ntp screen postgresqlCentOS
sudo yum -y install git gcc gcc-c++ make openssl-devel net-tools vim ca-certificates curl wget gnupg2 ntp screen postgresql-server postgresql-contrib yum-utilsAmazon Linux
sudo yum -y install git gcc gcc-c++ make openssl-devel net-tools vim ca-certificates curl wget gnupg2 ntp screen postgresql96-server yum-utilsStart the ntp service
Debian & Ubuntu
sudo /etc/init.d/ntp start
sudo systemctl enable ntpCentOS
sudo systemctl start ntpd
sudo update-rc.d ntpd enableAmazon Linux
sudo /etc/init.d/ntpd start
sudo chkconfig ntpd onDebian
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add -
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"
sudo apt -y update
sudo apt -y install docker-ceUbuntu (17.04+, Artful doesn't have its own release yet, Zesty works fine)
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu zesty stable"
sudo apt -y update
sudo apt -y install docker-ceCentOS
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum -y install docker-ce
sudo systemctl start dockerAmazon Linux
sudo yum -y install docker
sudo /etc/init.d/docker start
sudo chkconfig docker onAllow use of Docker commands without sudo (Not on Amazon Linux)
sudo gpasswd -a $USER docker
su $USER(Optional) Start using screen
screenDownload and install Go:
curl -O https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz
tar -xvf go1.9.2.linux-amd64.tar.gz
sudo mv go /usr/localSet the Go paths:
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
source ~/.profilegit clone https://github.com/ethereum/go-ethereum.git && cd go-ethereum
make geth
./build/bin/geth --rpc --rpcaddr 172.17.0.1 --syncmode "light"Running geth with the --fast option will also work instead of --syncmode "light", but you can't do both
Send it to the background with Ctrl+Z or create a new screen with Ctrl+A, C
Replace 9.6 with your version number. You can find this with "ls /etc/postgresql"
cd /etc/postgresql/9.6/main/If you're setting up the node with different IPs, change them here
sudo sh -c "echo \"listen_addresses = '172.17.0.1'\" >> postgresql.conf"
sudo sh -c "echo \"host all all 172.17.0.0/16 trust\" >> pg_hba.conf"Start PostgreSQL
sudo /etc/init.d/postgresql restart
sudo update-rc.d postgresql enableInit the database
sudo postgresql-setup initdbIf you're setting up the node with different IPs, change them here
sudo su postgres
cd /var/lib/pgsql/data
sh -c "echo \"listen_addresses = '172.17.0.1'\" >> postgresql.conf"
sh -c "echo \"host all all 172.17.0.0/16 trust\" >> pg_hba.conf"
exitStart PostgreSQL
sudo systemctl start postgresql
sudo systemctl enable postgresqlInit the database
sudo service postgresql initdbIf you're setting up the node with different IPs, change them here
sudo su postgres
cd /var/lib/pgsql9/data
sh -c "echo \"listen_addresses = '172.17.0.1'\" >> postgresql.conf"
sh -c "echo \"host all all 172.17.0.0/16 trust\" >> pg_hba.conf"
exitStart PostgreSQL
sudo /etc/init.d/postgresql restart
sudo chkconfig docker oncd
docker pull smartcontract/chainlinktouch .envYou can also use POSTGRES_USER and POSTGRES_PASSWORD environment variables in the .env file if you set up a different user in PostgreSQL
echo "DATABASE_URL=postgresql://postgres@172.17.0.1:5432/nayru_development?encoding=utf8&pool=5&timeout=5000" >> .env
echo "ETHEREUM_URL=http://172.17.0.1:8545" >> .env
echo "ETHEREUM_EXPLORER_URL=https://etherscan.io" >> .envBefore running the next line, please change the password to something that you prefer
echo "PRIVATE_KEY_PASSWORD=passwordchangeme" >> .envRun this to initialize the database:
docker run -it --env-file=.env smartcontract/chainlink rake oracle:initializeIt will ask if you're ready to print coordinator credentials to the screen. You need to actually type "Y" for it to print out the coordinators. Copy them into a text file.
And finally run this to actually start the node:
docker run -t --env-file=.env smartcontract/chainlinkAssignment creations use port 5100 by default, you could also specify a port using -p ####:#### in the command above to expose another port.
Test connection (should be up to date with current Ethereum block):
docker run -it --env-file=.env smartcontract/chainlink rails runner "puts Ethereum::Client.new.current_block_height"If you want to stop the ChainLink node, you need to kill the entire docker container.
First, get a list of running docker containers with:
docker psLook for the line where "image" is set to smartcontract/smartoracle.
Copy the container id and use it in the following command: (e.g. docker kill 23e27b5e63fb)
docker kill CONTAINER_ID