Ensure that your systems are up to date and fully patched
Debian & Ubuntu
sudo apt update -y && sudo apt upgrade -yCentOS & Amazon Linux
sudo yum update && sudo yum upgrade -yTake note of the IP addresses for each machine (run ifconfig), since the instructions can't assume what they will be.
Fill in with the actual IP when required. These will be noted by:
GETH_NODE_IPfor the machine running GethPOSTGRES_IPfor the machine running PostgreSQLCHAINLINK_IPfor the machine running the ChainLink node
Debian
sudo apt -y install git build-essential net-tools vim curl ntp screenUbuntu
sudo apt -y install ntp screen software-properties-commonCentOS & Amazon Linux
sudo yum -y install git gcc gcc-c++ make openssl-devel net-tools vim curl ntp screen 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 onSet up swap file
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo su
echo '/swapfile none swap sw 0 0' >> /etc/fstab
exit
sudo /sbin/shutdown -r nowsudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereumDownload 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 ~/.profileReplace GETH_NODE_IP with the IP of the machine running the Geth node
git clone https://github.com/ethereum/go-ethereum.git && cd go-ethereum
make gethAlso try running --syncmode "light" if storage usage is too high.
Ubuntu
geth --fast --cache=16 --rpc --rpcaddr GETH_NODE_IP --ipcdisableAll others
./build/bin/geth --fast --cache=16 --rpc --rpcaddr GETH_NODE_IP --ipcdisableDebian & Ubuntu
sudo apt -y install net-tools vim screen postgresqlCentOS
sudo yum -y install net-tools vim screen postgresql-server postgresql-contrib yum-utilsAmazon Linux
sudo yum -y install net-tools vim screen postgresql96-server yum-utilsReplace 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. Replace CHAINLINK_IP and CHAINLINK_IP/## with the IP of the machine running the ChainLink node. The /## should be the prefix for the subnet mask.
sudo sh -c "echo \"listen_addresses = 'CHAINLINK_IP'\" >> postgresql.conf"
sudo sh -c "echo \"host all all CHAINLINK_IP/## 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. Replace CHAINLINK_IP and CHAINLINK_IP/## with the IP of the machine running the ChainLink node. The /## should be the prefix for the subnet mask.
sudo su postgres
cd /var/lib/pgsql/data
sh -c "echo \"listen_addresses = 'CHAINLINK_IP'\" >> postgresql.conf"
sh -c "echo \"host all all CHAINLINK_IP/## 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 onDebian & Ubuntu
sudo apt -y install net-tools vim apt-transport-https ca-certificates curl gnupg2 software-properties-common screenCentOS
sudo yum -y install net-tools vim ca-certificates curl gnupg2 screen yum-utilsAmazon Linux
sudo yum -y install net-tools vim ca-certificates curl gnupg2 screen yum-utilsDebian
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
sudo gpasswd -a $USER docker
su $USERdocker 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. Replace POSTGRES_IP with the IP of the server running PostgreSQL and GETH_NODE_IP with the IP of the machine running the Geth node
echo "DATABASE_URL=postgresql://postgres@POSTGRES_IP:5432/nayru_development?encoding=utf8&pool=5&timeout=5000" >> .env
echo "ETHEREUM_URL=http://GETH_NODE_IP: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/chainlink