Skip to content

Bitcanna Node Guide


This guide is written for Ubuntu 22.04.

User setup

Best practice is to run node software on an isolated unprivileged user. We'll create the bcna user in this guide; if your username is different change it wherever it appears.

Create the bcna user

sudo useradd -m -s /bin/bash bcna

Build environment setup

Install build packages

sudo apt install -y build-essential git unzip curl

Install go toolchain

  1. Download and extract go 1.18.5.
    curl -fsSL | sudo tar -xzC /usr/local
  2. Login as bcna.
    sudo su -l bcna
  3. Configure environment variables for bcna.
    cat <<EOF >> ~/.bashrc
    export GOROOT=/usr/local/go
    export GOPATH=\$HOME/go
    export GO111MODULE=on
    export PATH=\$PATH:/usr/local/go/bin:\$HOME/go/bin
    source ~/.bashrc
    go version  # should output "go version go1.18.5 linux/amd64"

Build node binary

  1. Login as bcna (skip if you're already logged in).
    sudo su -l bcna
  2. Build and install the binary as the user that will run it.
    git clone
    cd bcna
    git checkout v1.5.3
    make install
    bcnad version  # should output "1.5.3"

Configure chain

This section is written for mainnet (bitcanna-1); modify the ID, genesis, and seeds as needed.

  1. Login as bcna (skip if you're already logged in).
    sudo su -l bcna
  2. Initialize config files and dirs. Replace <moniker> with a public name for your node.
    bcnad init --chain-id bitcanna-1 <moniker>
  3. Download the bitcanna-1 genesis.json.
    curl -fsSL -o $HOME/.bcna/config/genesis.json
  4. Set the chain-id. This will save it in client.toml so you won't need --chain-id again.
    bcnad config chain-id bitcanna-1
  5. (Optional) Configure some seeds. This will help your node find peers.
    sed -i 's/^seeds =.*/seeds = "[email protected]:26656,[email protected]:26656"/' $HOME/.bcna/config/config.toml

Start the node

Congrats! You're ready to go.

  1. (Optional) Statesync if you want a head start over syncing from scratch.
  2. Start syncing blocks!
    bcnad start

Create a service

A systemd service will keep bcnad running in the background and restart it if it stops.

  1. Create the service file with sudo using your favorite text editor.
    ExecStart=/home/bcna/go/bin/bcnad start
  2. Reload systemd to pick up the new service.
    sudo systemctl daemon-reload
  3. Start the service.
    sudo systemctl start bcnad
  4. Tail your service logs.
    sudo journalctl -fu bcnad
  5. (Optional) Enable the service. This will set it to start on every boot.
    sudo systemctl enable bcnad