BITSONG NODE INSTALL

It is assumed that you have already upgraded your host and secured your ssh access and all ports.

We’re going to install the pre-requisites, then we’ll install and configure Go and finally we’ll install Go-Bitsong, configure it and run it from our snapshot.

Install pre-requisites

sudo apt update
sudo apt install git build-essential ufw curl jq lz4 --yes

Install Go

wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.20.2.linux-amd64.tar.gz
rm go1.20.2.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
cat <> ~/.profile
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source ~/.profile
go version

You will receive this response:
go version go1.20.2 linux/amd64

Install Go-Bitsong
git clone https://github.com/bitsongofficial/go-bitsong.git
cd go-bitsong
git checkout v0.14.0
make install
bitsongd version


You will receive this response:
0.14.0
Init Bitsong
# CHANGE $NODE_NAME with “your node name”
bitsongd config chain-id bitsong-2b
bitsongd init "$NODE_NAME" --chain-id bitsong-2b
Pruning Setting

sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.0026ubtsg"|g' $HOME/.bitsongd/config/app.toml
sed -i 's|^pruning *=.*|pruning = "custom"|g' $HOME/.bitsongd/config/app.toml
sed -i 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|g' $HOME/.bitsongd/config/app.toml
sed -i 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|g' $HOME/.bitsongd/config/app.toml
sed -i 's|^pruning-interval *=.*|pruning-interval = "10"|g' $HOME/.bitsongd/config/app.toml
sed -i 's|^indexer *=.*|indexer = "null"|g' $HOME/.bitsongd/config/config.toml

Download Genesis, Addrbook, Snapshot and extract it
rm $HOME/.bitsongd/config/genesis.json
wget https://snapshot.safeblock.space/bitsong/genesis.json -P $HOME/.bitsongd/config
wget https://snapshot.safeblock.space/bitsong/addrbook.json -P $HOME/.bitsongd/config
wget https://snapshot.safeblock.space/bitsong/bitsong-snapshot_03-12-2023.tar.lz4
lz4 -c -d bitsong-snapshot_03-12-2023.tar.lz4 | tar -x -C $HOME/.bitsongd
rm bitsong-snapshot_03-12-2023.tar.lz4
Create Bitsong Service

# CHANGE $USER with your “username”
sudo tee /etc/systemd/system/bitsongd.service > /dev/null << EOF

[Unit]
Description=Bitsong
After=network-online.target

[Service]
User=$USER
ExecStart=/home/$USER/go/bin/bitsongd start
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
EOF

Start Bitsong Service

Enable bitsong in background:
sudo systemctl enable bitsongd

Start bitsong in background:
sudo systemctl start bitsongd

Check Bitsong Service

sudo journalctl -fu bitsongd -o cat
# Ctrl+C to exit

sudo journalctl -fu bitsongd -o cat | grep index
# Ctrl+C to exit

curl -s http://0.0.0.0:26657/status | jq -r .result.sync_info.catching_up

If response is “true”, you not are synched, wait….
When response is “false”, your node are synched to Bitsongd Network