Актуально
February 12, 2023

Babilon Chain

1.Подготовка сервера - Server Preparation

Обновление и установка зависимостей - Upgrade and install dependencies

sudo apt update && sudo apt upgrade -y && \
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y

Installing Go

ver="1.19.1" && \
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 && \
go version

2.Работа с бинарным файлом и настройка - Working with a binary file and setting up

Cloning a repository

# Download the installation setup configuration
git clone https://github.com/babylonchain/babylon
cd babylon
git checkout v0.5.0
make install

Initializing

babylond init <name_moniker> --chain-id bbn-test-1

Download genesis

wget https://github.com/babylonchain/networks/raw/main/bbn-test-1/genesis.tar.bz2
tar -xjf genesis.tar.bz2 && rm genesis.tar.bz2
mv genesis.json ~/.babylond/config/genesis.json

Correct the configuration file

external_address=$(wget -qO- eth0.me)
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.babylond/config/config.toml

sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025ubbn\"/;" ~/.babylond/config/app.toml

PEERS="88bed747abef320552d84d02947d0dd2b6d9c71c@babylon-testnet.nodejumper.io:44656,[email protected]:30656,[email protected]:55656,[email protected]:41656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:27656,[email protected]:47656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:20656,[email protected]:17896,[email protected]:26656,[email protected]:26656,[email protected]:20656,[email protected]:26656,[email protected]:20656,[email protected]:60556,[email protected]:20656,[email protected]:26656,[email protected]:14656,[email protected]:55706,[email protected]:26656,[email protected]:14656,[email protected]:44656,[email protected]:29056,[email protected]:26656,[email protected]:27116"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.babylond/config/config.toml

SEEDS="[email protected]:26656,[email protected]:26656"
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.babylond/config/config.toml

Prunning `app.toml'

pruning="custom"
pruning_keep_recent="1000"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.babylond/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.babylond/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.babylond/config/app.toml

Create a service file

sudo tee /etc/systemd/system/babylond.service > /dev/null << EOF
[Unit]
Description=Babylon Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which babylond) start
Restart=on-failure
RestartSec=10
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
EOF

Launch

sudo systemctl daemon-reload
sudo systemctl enable babylond
sudo systemctl start babylond

sudo journalctl -u babylond -f --no-hostname -o cat

3.Создание валидатора и генерация кошелька - Creating a validator and generating a wallet

Wallet

# создать кошелек
babylond  keys add <name_wallet> --keyring-backend os

# восстановить кошелек (после команды вставить seed)
babylond  keys add <name_wallet> --recover --keyring-backend os

Creating a validator

babylond tx staking create-validator \
--amount=9000000ubbn \
--pubkey=$(babylond tendermint show-validator) \
--moniker="$NODE_MONIKER" \
--chain-id=bbn-test1 \
--commission-rate=0.1 \
--commission-max-rate=0.2 \
--commission-max-change-rate=0.05 \
--min-self-delegation=1 \
--fees=10000ubbn \
--from=wallet \
-y

4. Удаление - Delete

Deleting

systemctl stop babylond && \
systemctl disable babylond && \
rm /etc/systemd/system/babylond.service && \
systemctl daemon-reload && \
cd $HOME && \
rm -rf .babylond babylon && \
rm -rf $(which babylond)