In this guide we will go through every step to easily set up a Terra node. First of all you need to know the system requirements:
- 2 or more CPU cores
- At least 1TB of disk storage (SSDs are strongly recommended)
- At least 16GB of memory
- At least 100mbps network bandwidth
Update everything with:
sudo apt-get update
sudo apt-get upgrade -yOpen ports 26656 and ssh, then enable the firewall:
sudo ufw allow ssh
sudo ufw allow 26656/tcpset default firewall rules:
sudo ufw default deny incoming
sudo ufw default allow outgoingenable firewall:
sudo ufw enableDownload the repository:
cd ~
git clone https://github.com/terra-project/core.gitInstall:
cd core
make installMove terrad and terracli in the path directory:
sudo mv ~/go/bin/terrad /usr/bin/terrad
sudo mv ~/go/bin/terracli /usr/bin/terracliTest if terrad and terracli works:
terrad version
terracli versionExpected output:
0.4.6Create all the necessary files, change {MONIKER} with a custom moniker
terrad init {MONIKER}Download the genesis files:
curl https://columbus-genesis.s3-ap-northeast-1.amazonaws.com/columbus-4-genesis.json > ~/.terrad/config/genesis.jsonDownload the latest quickSync
Command for pruned archive:
cd ~/.terrad
wget https://get.quicksync.io/{FILENAME} Install liblz4 to extract the file:
sudo apt-get install wget liblz4-tool -yExtract the quicksync:
cd ~/.terrad
lz4 -d {FILENAME} | tar xf -Now you can delete the quicksynck file with
rm {FILENAME}
Edit the config.toml file:
nano ~/.terrad/config/config.tomland set the following value:
seeds = "5d9b8ac70000bd4ab1de3ccaf85eb43f8e315146@seed.terra.delightlabs.io:26656,6d8e943c049a80c161a889cb5fcf3d184215023e@public-seed2.terra.dev:26656,87048bf71526fb92d73733ba3ddb79b7a83ca11e@public-seed.terra.dev:26656"then edit the app.toml file:
nano ~/.terrad/config/app.tomland set the following values:
minimum-gas-prices = "0.01133uluna,0.15uusd,0.104938usdr,169.77ukrw,428.571umnt,0.125ueur,0.98ucny,16.37ujpy,0.11ugbp,10.88uinr,0.19ucad,0.14uchf,0.19uaud,0.2usgd,4.62uthb,1.25usek"
pruning = "everything"Download the address book:
curl https://network.terra.dev/addrbook.json > ~/.terrad/config/addrbook.jsonRun terrad:
cd ~
terrad startInstall npm, nodejs and pm2:
sudo apt-get install nodejs npm -y
sudo npm i -g pm2create the necessary files:
cd ~
touch runNode.sh
chmod +x runNode.shedit the file runNode.sh:
nano runNode.shand put in the following content:
terrad start --tx-gas-hard-limit 10000000then create the terra-node.ecosystem.config.js file:
nano terra-node.ecosystem.config.jsand put in the following content:
module.exports = { apps : [ { name: "terra-node", script: "runNode.sh", exec_mode: "fork", exec_interpreter: "bash"} ] }Run terrad with pm2 process manager
cd ~
pm2 start ./terra-node.ecosystem.config.jsSave the process and setup auto-start at boot:
pm2 save
pm2 startupCheck the status:
pm2 statusCheck the logs:
pm2 logs 0Use ctrl + c to exit from the log view
Wait a few hours, you can check the node status using:
curl -sS localhost:26657/statusexpected output:
{
"jsonrpc": "2.0",
"id": -1,
"result": {...},
"sync_info": {
"latest_block_hash": "...",
"latest_app_hash": "...",
"latest_block_height": "lastBlock",
"latest_block_time": "currentDate",
"earliest_block_hash": "...",
"earliest_app_hash": "",
"earliest_block_height": "1",
"earliest_block_time": "2020-10-03T15:56:10Z",
"catching_up": false
},
"validator_info": {...}
}
}If you see "catching_up": false the node is synchronized, otherwise you will have to wait