Installation
Official docs
https://docs.celestia.org/how-to-guides/consensus-node
System Requirements
Category | Requirements |
---|---|
CPU | 8 cores |
RAM | 24 GB |
Storage | 3 TiB NVME |
Bandwidth | 1 Gbps |
Install dependencies
sudo apt update -y && sudo apt upgrade -y && \
sudo apt install curl tar wget clang pkg-config libssl-dev libleveldb-dev jq build-essential git make lz4 screen unzip -y
Install go
sudo rm -r /usr/local/go
curl https://dl.google.com/go/go1.23.1.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf - ;
cat <<'EOF' >>$HOME/.bashrc
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source $HOME/.bashrc
Set vars
EDIT YOUR MONIKER & YOUR PREFERRED PORT NUMBER
echo "export CHAIN_ID="mocha-4"" >> $HOME/.bashrc
source $HOME/.bashrc
Install binaries
cd $HOME
rm -rf celestia-app
git clone https://github.com/celestiaorg/celestia-app.git
cd celestia-app
git checkout v3.3.1-mocha
make install
Init node
celestia-appd init node --chain-id=$CHAIN_ID
Enable BBR
make enable-bbr
Download genesis
curl -Ls https://testnet.snapshot.silentvalidator.com/celestia-mocha/genesis/genesis.json > $HOME/.celestia-app/config/genesis.json
Set peers
peers=$(curl -sS https://testnet.rpc.celestia-mocha.silentvalidator.com/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}' | paste -sd, -)
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$peers\"|" $HOME/.celestia-app/config/config.toml
echo $peers
Enable indexer (optional)
sed -i -e 's/^indexer = "null"/indexer = "kv"/' $HOME/.celestia-app/config/config.toml
Set up cosmovisor
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.0.0
cat <<'EOF' >>$HOME/.bashrc
export DAEMON_NAME=celestia-appd
export DAEMON_HOME==$HOME/.celestia-app
EOF
source ~/.bashrc
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin
mkdir -p $DAEMON_HOME/cosmovisor/upgrades
cp $(which $DAEMON_NAME) $DAEMON_HOME/cosmovisor/genesis/bin
Set up services
sudo tee /etc/systemd/system/celestia-mocha.service > /dev/null <<EOF
[Unit]
Description=celestia mocha
After=network.target
[Service]
User=$USER
Type=simple
WorkingDirectory=$HOME/.celestia-app
ExecStart=$HOME/go/bin/cosmovisor run run
Restart=on-failure
LimitNOFILE=65535
Environment="DAEMON_NAME=${DAEMON_NAME}"
Environment="DAEMON_HOME=${DAEMON_HOME}"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_LOG_BUFFER_SIZE=512"
Environment="UNSAFE_SKIP_BACKUP=true"
[Install]
WantedBy=multi-user.target
EOF
Download snapshots
cd
wget -O celestia_snapshot.tar.lz4 https://testnet.snapshot.silentvalidator.com/celestia-mocha/snapshot/celestia-mocha_latest.tar.lz4
Decompress snapshots
lz4 -c -d celestia_snapshot.tar.lz4 | tar -xv -C $HOME/.celestia-app
Start the node
sudo systemctl daemon-reload && \
sudo systemctl enable celestia-mocha && \
sudo systemctl restart celestia-mocha && \
sudo journalctl -u celestia-mocha -fn 100
Check sync status
curl -s http://localhost:26657/status | jq .result.sync_info
if "catching_up": false
then the node is synced