Bitcanna Node Guide¶
Requirements¶
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¶
Build environment setup¶
Install build packages¶
Install go toolchain¶
- Download and extract go 1.18.5.
- Login as
bcna
. - Configure environment variables for
bcna
.
Build node binary¶
- Login as
bcna
(skip if you're already logged in). - Build and install the binary as the user that will run it.
Configure chain¶
This section is written for mainnet (bitcanna-1); modify the ID, genesis, and seeds as needed.
- Login as
bcna
(skip if you're already logged in). - Initialize config files and dirs. Replace
<moniker>
with a public name for your node. - Download the bitcanna-1
genesis.json
. - Set the chain-id. This will save it in
client.toml
so you won't need--chain-id
again. - (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.
- (Optional) Statesync if you want a head start over syncing from scratch.
- Start syncing blocks!
Create a service¶
A systemd service will keep bcnad
running in the background and restart it if it stops.
- Create the service file with
sudo
using your favorite text editor. - Reload
systemd
to pick up the new service. - Start the service.
- Tail your service logs.
- (Optional) Enable the service. This will set it to start on every boot.