June 26, 2022

Celestia Testnet - NodeX

source : opensea.io/azuki

about the project

Celestia is a modular consensus and data network designed to make it easy for anyone to deploy their own blockchain with minimal overhead. Celestia is a minimal blockchain that only orders and publishes transactions, but does not execute them. By separating the layers of consensus and application execution, Celestia modulates the blockchain technology stack and opens up new possibilities for decentralized application developers.

The project raised in the seed round - $1.5 million, led by funds such as the Interchain Foundation, Binance Labs and others

👉 Detailed research from our project team: https://teletype.in/@zloy_mex/8MrUET-V3OF

👉 Link to the announcement: https://blog.celestia.org/celestia-testnet-introduces-alpha-data-availability-api/

👉 Project website: https://celestia.org/

👉 Project Discord: https://discord.gg/cNNCVt9q


equipment requirements

Minimum hardware requirements from the developer

  • 4 processors; the higher the clock speed, the better
  • 8 GB RAM
  • Drive 250 GB SSD
  • Bandwidth: 1Gbps download / 100Mbps download

Node installation

Option 1 ( Automatic installation )

For a fully automatic node installation, use our script, you will be prompted to enter the name of the validator node.

curl https://raw.githubusercontent.com/agonyp/Scripts-ALPHA-Noderunning/main/install-celestia.sh | bash

After executing the script, proceed to create a wallet

Option 2 ( Manual installation )

Updating packages

sudo apt update && sudo apt upgrade -y

Installing the required packages

sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu -y

Installing GO

cd $HOME
ver="1.17.2"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile

Download and compile the node

cd $HOME
git clone https://github.com/celestiaorg/celestia-app
cd celestia-app
git fetch
git checkout v0.5.3
make install
cd $HOME

Set system variables (In the places YOUR_MONIKER and NAME_WALLET, enter your value before execution!)

CELESTIA_CHAIN ​​= "mamaki" 
CELESTIA_NODENAME = "YOUR_MONIKER" 
CELESTIA_WALLET = "WALLET_NAME" 
echo  "
export CELESTIA_CHAIN=${CELESTIA_CHAIN}
export CELESTIA_NODENAME=${CELESTIA_NODENAME}
export CELESTIA_WALLET=${CELESTIA_WALLET}
" >> $HOME/.bash_profile && source $HOME/.bash_profile

Initialize the node

celestia-appd init $CELESTIA_NODENAME --chain-id $CELESTIA_CHAIN
celestia-appd config chain-id $CELESTIA_CHAIN
celestia-appd config keyring-backend test

Downloading the genesis file

wget -O $HOME/.celestia-app/config/genesis.json "https://github.com/celestiaorg/networks/raw/master/mamaki/genesis.json"

Configuring the node

peers=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/mamaki/peers.txt | tr -d '\n' | head -c -1) && echo $peers
sed -i.bak -e "s/^persistent-peers *=.*/persistent-peers = \"$peers\"/" $HOME/.celestia-app/config/config.toml
bpeers="[email protected]:26656"
sed -i.bak -e "s/^bootstrap-peers *=.*/bootstrap-peers = \"$bpeers\"/" $HOME/.celestia-app/config/config.toml
sed -i.bak -e "s/^timeout-commit *=.*/timeout-commit = \"25s\"/" $HOME/.celestia-app/config/config.toml
sed -i.bak -e "s/^skip-timeout-commit *=.*/skip-timeout-commit = false/" $HOME/.celestia-app/config/config.toml
sed -i.bak -e "s/^mode *=.*/mode = \"validator\"/" $HOME/.celestia-app/config/config.toml
sed -i.bak -e "s/^use-legacy =./use-legacy = false/" $HOME/.celestia-app/config/config.toml
sed -i.bak -e"s/^max-connections =./max-connections = 90/" $HOME/.celestia-app/config/config.toml
sed -i.bak -e "s/^pex =./pex = true/" $HOME/.celestia-app/config/config.toml
sed -i.bak -e "s/^peer-gossip-sleep-duration =./peer-gossip-sleep-duration = "2ms"/" $HOME/.celestia-app/config/config.toml
celestia-appd tendermint unsafe-reset-all --home $HOME/.celestia-app

Create a service file

tee  $HOME /celestia-appd.service > /dev/null << EOF
[Unit]
  Description=CELESTIA MAMAKI
  After=network-online.target
[Service]
  User=$USER
  ExecStart=$(which celestia-appd) start
  Restart=on-failure
  RestartSec=10
  LimitNOFILE=65535
[Install]
  WantedBy=multi-user.target
EOF
sudo mv $HOME/celestia-appd.service /etc/systemd/system/

Register and start the service

sudo systemctl enable celestia-appd
 sudo systemctl daemon-reload
 sudo systemctl restart celestia-appd && journalctl -u celestia-appd -f -o cat 

(OPTIONAL) Add command abbreviations

echo 'alias celestia_log="journalctl -u celestia-appd -f -o cat"' >> $HOME/.bash_profile
echo 'alias celestia_sync_stat="curl -s localhost:26657/status | jq .result.sync_info"' >> $HOME/.bash_profile

Update

Updating the binary file:

cd $HOME/celestia-app
git fetch
git checkout v0.5.3
make install

Restarting the node:

sudo systemctl restart celestia-appd

Wallet creation

Importing system variables

source $HOME/.bash_profile

Check the synchronization status (False - synchronized)

curl localhost:26657/status | jq .result.sync_info

Create a wallet

celestia-appd keys add $CELESTIA_WALLET --keyring-backend test

After creating, be sure to save your wallet data, mnemonics and all other lines!

Wallet recovery by seed phrase (optional)

celestia-appd keys add $WALLET --recover

Store wallet information in system variables
Add wallet address

WALLET_ADDRESS=$(celestia-appd keys show $CELESTIA_WALLET -a)

Add valoper address

VALOPER_ADDRESS=$(celestia-appd keys show $CELESTIA_WALLET --bech val -a)

Importing variables into the system

echo 'export WALLET_ADDRESS='${WALLET_ADDRESS} >> $HOME/.bash_profile
echo 'export VALOPER_ADDRESS='${VALOPER_ADDRESS} >> $HOME/.bash_profile
source $HOME/.bash_profile

After synchronization, go to the Discord of the project in faucet and request tokens using

$request YOUR_WALLET

You can check the balance there using

$balance YOUR_WALLET

Validator and Delegation

Create a validator with the command

celestia-appd tx staking create-validator \
 --amount=10000000utia \
 --pubkey=$(celestia-appd tendermint show-validator) \
 --moniker=$CELESTIA_NODENAME \
 --chain-id=$CELESTIA_CHAIN \
 --commission-rate=0.1 \
 --commission-max-rate=0.2 \
 --commission-max-change-rate=0.01 \
 --min-self-delegation="1" \
 --from=$CELESTIA_WALLET

Check validator

celestia-appd q staking validator $VALOPER_ADDRESS

You can delegate tokens with a command (insert the size of the tokens you want, taking into account the gas in the network)

celestia-appd tx staking delegate $VALOPER_ADDRESS 10000000utia --from=$CELESTIA_WALLET --chain-id=$CELESTIA_CHAIN --gas=auto

Back up the "$HOME/.celestia-app/config/priv_validator_key.json" file!


Checking a node in the list of validators

It is possible to check yourself in the list using the link to explorer:

https://celestia.explorers.guru/

You can check the current block height here:

https://celestiascan.vercel.app/


Useful Commands

Check logs

celestia_log
journalctl -fu celestia-appd -o cat

Synchronization check command

сelestia_sync_stat
curl localhost:26657/status | jq .result.sync_info

Stop service

sudo systemctl stop celestia-appd

start service

sudo systemctl start celestia-appd

Restart the service

sudo systemctl restart celestia-appd

Delete node

sudo systemctl stop celestia-appd
 rm -rf $HOME /celestia-appd
 sudo systemctl disable celestia-appd
 sudo  rm /etc/systemd/system/celestia-appd.service

Credit by @nekiy_iz ❤️ @alphateam