Manual Installation
Let's explore the manual installation process as we set up a node with Cosmovisor!
Install Dependencies
Update system package and install build tools
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential fail2ban ufw
sudo apt -qy upgrade
Secure Setup
π’
While this step is optional, it is strongly recommended for those running on the mainnet to take a closer look, as it plays a crucial role in ensuring basic security. If you don't want to, you can skip ahead to configure moniker.
Setup ssh for bitcanna user replace YOUR_PUBLIC_SSH_KEY with your own!
sudo adduser bitcanna --disabled-password -q
sudo usermod -aG sudo bitcanna
sudo -u bitcanna bash -c 'mkdir -p ~/.ssh && echo "YOUR_PUBLIC_SSH_KEY" >> ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys'
Configure Moniker
Replace <your-moniker-name> with your own validator name
MONIKER="<your-moniker-name>"
Install Go
install go version 1.21.1
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.21.1.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)
Build Binaries
Cloning project repository & Compile binaries
cd $HOME
rm -rf bcna
git clone https://github.com/BitCannaGlobal/bcna.git
cd bcna
git checkout v3.1.0
make build
Latest commit : be10f9e1362b2f4de45a95c045387949e2acd6ad
Prepare binaries for cosmovisor
mkdir -p $HOME/.bcna/cosmovisor/genesis/bin
mv build/bcnad $HOME/.bcna/cosmovisor/genesis/bin/
rm -rf build
Create symlinks
sudo ln -s $HOME/.bcna/cosmovisor/genesis $HOME/.bcna/cosmovisor/current -f
sudo ln -s $HOME/.bcna/cosmovisor/current/bin/bcnad /usr/local/bin/bcnad -f
Cosmovisor Setup
Install cosmovisor
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0
Create Service
Create a systemd service
sudo tee /etc/systemd/system/bitcanna.service > /dev/null << EOF
[Unit]
Description=bitcanna node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.bcna"
Environment="DAEMON_NAME=bcnad"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$HOME/.bcna/cosmovisor/current/bin"
[Install]
WantedBy=multi-user.target
EOF
Enable Service
Enable bitcanna systemd service
sudo systemctl daemon-reload
sudo systemctl enable bitcanna
Initialize Node
Setting node configuration
bcnad config chain-id bitcanna-1
bcnad config keyring-backend file
bcnad config node tcp://localhost:11757
Initialize node
bcnad init $MONIKER --chain-id bitcanna-1
Download Genesis & Addrbook
Download genesis & addrbook file
curl -Ls https://snap.nodex.one/bitcanna/genesis.json > $HOME/.bcna/config/genesis.json
curl -Ls https://snap.nodex.one/bitcanna/addrbook.json > $HOME/.bcna/config/addrbook.json
sha256sum genesis.json
: cd7449a199e71c400778f894abb00874badda572ac5443b7ec48bb0aad052f29
Configure Seeds
Setting up a seed peers
sed -i -e "s|^seeds *=.*|seeds = \"5f5cfac5c38506fbb4275c19e87c4107ec48808d@seeds.nodex.one:11710\"|" $HOME/.bcna/config/config.toml
Configure Gas Prices
Setting up a gas prices
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0ubcna\"|" $HOME/.bcna/config/app.toml
Pruning Setting
Configure pruning setting
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
$HOME/.bcna/config/app.toml
Custom Port
Please note that updating the port is optional!
Configure a custom port
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:11758\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:11757\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:11760\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:11756\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":11766\"%" $HOME/.bcna/config/config.toml
sed -i -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:11717\"%; s%^address = \":8080\"%address = \":11780\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:11790\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:11791\"%; s%:8545%:11745%; s%:8546%:11746%; s%:6065%:11765%" $HOME/.bcna/config/app.toml
Download Snapshots
Download latest chain snapshot
curl -L https://snap.nodex.one/bitcanna/bitcanna-latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.bcna
[[ -f $HOME/.bcna/data/upgrade-info.json ]] && cp $HOME/.bcna/data/upgrade-info.json $HOME/.bcna/cosmovisor/genesis/upgrade-info.json
Start Service
Letss f*cking goooo!
sudo systemctl start bitcanna