Celestia Consensus Node Setup
Install dependencies
Install all required packages for building and running the node (compilers, utilities, monitoring tools, compression libraries).
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y
Install Go
Make sure you set the correct version.
export GOVER="1.24.1"
Install Go (programming language required for building the node).
cd $HOME
wget "https://golang.org/dl/go$GOVER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$GOVER.linux-amd64.tar.gz"
rm "go$GOVER.linux-amd64.tar.gz"
Add PATH if set GO at first time
"export PATH=/usr/local/go/bin:$PATH" >> $SHOME/.bash_profile && source $SHOME/.profile
"export PATH=/usr/local/go/bin:$PATH" >> $SHOME/.bash_profile && source $SHOME/.bash_profile
Clone repository and build
Set current release version.
export VER=
Download the source code, switch to the desired version, and build the binary.
git clone https://github.com/celestiaorg/celestia-app.git
cd celestia-app
git checkout $VER
make build
Configure the setup
Set network parameters.
export CHAIN_ID=celestia
Set your node moniker (name).
export MONIKER=
Set your node folder name:
export FOLDER=".celestia-app"
Initialize the node.
$HOME/celestia-app/build/celestia-appd init $MONIKER --chain-id $CHAIN_ID
Create folder structure for releases and copy binary
Organize binaries by version, move the built binary, and create a symlink for the active release. ℹ️ During the next upgrade, create a new subfolder for the new binary inside the releases folder and simply update the active-release symlink to point to this new binary’s folder. This approach is convenient for both automatic and manual updates, as well as for quickly rolling back to the previous version. Read more
mkdir -p $HOME/$FOLDER/releases/$VER/bin
mv $HOME/celestia-app/build/celestia-appd $HOME/$FOLDER/releases/$VER/bin
ln -sfn $HOME/$FOLDER/releases/$VER $HOME/$FOLDER/active-release
Set PATH environment
Add the active-release binary folder to your PATH so you can run celestia-appd from anywhere.
echo "export PATH=${HOME}/${FOLDER}/active-release/bin:\$PATH" >> $HOME/.bash_profile
source $HOME/.bash_profile
Custom ports
If you run multiple nodes on the same server, set a custom port prefix or leave it default 266.
export CUSTOM_PORT_PREF=266
Update ports in config.toml.
sed -i.bak \
-e "s|^\([[:space:]]*\)proxy_app *=.*|\1proxy_app = \"tcp://127.0.0.1:36658\"|g" \
-e "s|^\([[:space:]]*\)laddr *= \"tcp://127.0.0.1:26657\"|\1laddr = \"tcp://127.0.0.1:${CUSTOM_PORT_PREF}57\"|g" \
-e "s|^\([[:space:]]*\)grpc_laddr *=.*|\1grpc_laddr = \"tcp://127.0.0.1:${CUSTOM_PORT_PREF}98\"|g" \
-e "s|^\([[:space:]]*\)laddr *= \"tcp://0.0.0.0:26656\"|\1laddr = \"tcp://0.0.0.0:${CUSTOM_PORT_PREF}56\"|g" \
-e "s|^\([[:space:]]*\)external_address *=.*|\1external_address = \"$(wget -qO- eth0.me):${CUSTOM_PORT_PREF}56\"|g" \
-e "s|^\([[:space:]]*\)prometheus_listen_addr *=.*|\1prometheus_listen_addr = \"127.0.0.1:${CUSTOM_PORT_PREF}60\"|g" \
-e "s|^\([[:space:]]*\)pprof_laddr|\1#pprof_laddr|g" \
-e "s|prometheus = false|prometheus = true|g" \
$HOME/$FOLDER/config/config.toml
Update ports in app.toml.
sed -i.bak \
-e "s%^\([[:space:]]*\)address = \"tcp://localhost:1317\"%\1address = \"tcp://127.0.0.1:${CUSTOM_PORT_PREF}17\"%g" \
-e "s%^\([[:space:]]*\)address = \"localhost:9090\"%\1address = \"127.0.0.1:${CUSTOM_PORT_PREF}90\"%g" \
-e "s%^\([[:space:]]*\)address = \"0.0.0.0:9091\"%\1address = \"127.0.0.1:${CUSTOM_PORT_PREF}91\"%g" \
$HOME/$FOLDER/config/app.toml
Update client RPC address in client.toml.
sed -i.bak \
-e "s%^\([[:space:]]*\)node = \"tcp://localhost:26657\"%\1node = \"tcp://localhost:${CUSTOM_PORT_PREF}57\"%g" \
$HOME/$FOLDER/config/client.toml
Set pruning
Enable pruning to reduce disk usage by deleting old blocks.
sed -i -e "s/^\([[:space:]]*\)pruning *=.*/\1pruning = \"custom\"/" $HOME/$FOLDER/config/app.toml
sed -i -e "s/^\([[:space:]]*\)pruning-keep-recent *=.*/\1pruning-keep-recent = \"100\"/" $HOME/$FOLDER/config/app.toml
sed -i -e "s/^\([[:space:]]*\)pruning-interval *=.*/\1pruning-interval = \"10\"/" $HOME/$FOLDER/config/app.toml
Enable bad peer filtering.
sed -i -e "s/^\([[:space:]]*\)filter_peers *=.*/\1filter_peers = \"true\"/" $HOME/$FOLDER/config/config.toml
Set chain-id
Configure chain-id for the client.
sed -i.bak -e "s/^\([[:space:]]*\)chain-id *=.*/\1chain-id = \"${CHAIN_ID}\"/;" $HOME/$FOLDER/config/client.toml
Set keyring-backend [optional]
Change key storage backend (e.g., use os instead of file).
sed -i.bak -e "s/^\([[:space:]]*\)keyring-backend *=.*/\1keyring-backend = \"os\"/;" $HOME/$FOLDER/config/client.toml
Set minimal gas-price
Define the minimum gas price for transactions.
sed -i.bak -e "s/^\([[:space:]]*\)minimum-gas-prices *=.*/\1minimum-gas-prices = \"0.0025utia\"/;" $HOME/$FOLDER/config/app.toml
Turn off RPC indexing [optional]
Disables transaction indexing to save disk space.
export STATUS="null"
sed -i -e "s/^indexer *=.*/indexer = \"$STATUS\"/" $HOME/$FOLDER/config/config.toml
Add live peers
Add peers to config.toml for network connectivity.
Hightower peer:
74c06e4118336bf59489d9fd7f9903e18a76c3fa@208.73.202.78:10456
ℹ️ We scan our nodes for live peers and select up to 15 of the best ones.
PEERS="bb2db68b8f591f6f6dc8fe1a74ae17c832c66890@tia.loomnode.cloud:26656,3b5781469fb0014f9293833cfcd0de13be188fbd@180.189.55.7:26656,46c4dca5705b7fb55a56f942b87052ee3fd2ced9@69.10.38.42:26656,ce8ef33db1b9134353ecc0d1ea48d1b8d20f485a@216.66.49.4:20257,faaa78120174a332e385411457dc0dc47a66a013@135.181.21.165:28656,0f7fea6ba71798a9daccf4c38622d8c97f747067@65.21.84.223:11656,79a1a8857a5342212655432a04777845cc912e28@161.118.209.33:26656,3ceaccb5f88544d371403b4f10da4a1accd49a0f@164.152.161.14:26656,e61f3f4a311203cb11c1e5699a3e49722c9d564c@207.229.99.32:40656,f94804b1c70f3d3dba6c8355d2a938ab9c719f2a@217.28.48.238:11656,b212d5740b2e11e54f56b072dc13b6134650cfb5@164.152.161.214:26656,ae70fd00ab841ca2f70b9b2dcc6d65dbe9a534a3@65.108.232.104:11656,2ae2d3d0b97c4fcd134decb202ac241cd2f44735@37.252.186.118:2000,490d99c7136d7af7c95fb9f9394d6b005212f271@129.154.205.7:26656,5deeddca390a7dd3b54b46e02794ae74b03cd0bd@207.229.99.33:40656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/$FOLDER/config/config.toml
Turn on snapshot [optional]
Enable automatic state snapshot creation every N blocks.
export INTERVAL=1000
sed -i.bak -e "s/^snapshot-interval *=.*/snapshot-interval = \"$INTERVAL\"/" $HOME/$FOLDER/config/app.toml
Download genesis
Download the network genesis file.
wget -O $HOME/$FOLDER/config/genesis.json https://snapshot01.at.htw.tech/celestia/mainnet/genesis.json --inet4-only
Download addrbook
Download the network addrbook file.
wget -O $HOME/$FOLDER/config/addrbook.json https://snapshot01.at.htw.tech/celestia/mainnet/addrbook.json --inet4-only
Donload Snapshot
Download the latest network snapshot here.
Create systemd service
Create a systemd service file for auto-start and managing the node.
tee /etc/systemd/system/celestia-appd.service > /dev/null <<EOF
[Unit]
Description=Celestia Mainnet node
After=network-online.target
[Service]
User=$USER
LimitNOFILE=1000000
ExecStart=$HOME/$FOLDER/active-release/bin/celestia-appd start
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target
EOF
Start the node
Reload systemd configs, enable the service at boot, start the node and follow logs.
systemctl daemon-reload
systemctl enable celestia-appd
systemctl restart celestia-appd && journalctl -o cat -fu celestia-appd