bitcanna-dev-4
Note: STATESYNC won't works because trusting is breaking (because we back in time on a snapshot) so you can jump directly to: https://hackmd.io/g7pENy73RFKkcCYIKFzZrw#Download-a-snapshot
You can run a node in seconds using our StateSync script. Download and run it. You should wait until you see that block production is stabilized, then press CTLR + C
cd ~
wget https://raw.githubusercontent.com/BitCannaGlobal/cosmos-statesync_client/main/statesync_DEVNET_client_linux_new.sh
bash statesync_DEVNET_client_linux_existing.sh
You need to perform some extra steps to save your config and keys (node & validator)
cosmovisor
by bcnad
if applies)
sudo service cosmovisor stop
cp -R .bcna/config/ ./config/
cd ~
wget https://raw.githubusercontent.com/BitCannaGlobal/cosmos-statesync_client/main/statesync_DEVNET_client_linux_existing.sh
bash statesync_DEVNET_client_linux_existing.sh
cp -R ./config/ .bcna/
cosmovisor
by bcnad
if applies)
sudo service cosmovisor start
cosmovisor
by bcnad
if applies)
sudo service cosmovisor stop
cd $HOME/.bcna
rm -rf data
wget http://144.91.127.5:80/devnet-backup.tar
tar xvf devnet-backup.tar
cd ~
bitcanna-dev-4
cd ~
rm -f bcnad
wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.4.4-pre/bcna_linux_amd64.tar.gz
sha256sum bcna_linux_amd64.tar.gz
It must return: abde24a797f6676498440878ff1ac38593b16b39161ea38e9dc935b146e566e5
1.4.4-pre
rm -f ./bcnad
tar zxvf bcna_linux_amd64.tar.gz
rm bcna_linux_amd64.tar.gz
chmod +x bcnad
./bcnad version
Set the chain-id param
bcnad config chain-id bitcanna-dev-4
bcnad
; you can choose the name (we advice you use one word) bcnad keys add MyFirstAddress
name: MyFirstAddress
type: local
address: bcna14shzreglay98us0hep44hhhuy7dm43snv38plr
pubkey: bcnapub1addwnpepqvtpzyugupvcu773rzdcvhele6e22txy2zr235dn7uf8t2mlqcarcyx2gg9
mnemonic: ""
threshold: 0
pubkeys: []
Important write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.
deposit daring slim glide spend dolphin expire shadow cluster weed orphan work 420 section client friend yellow west hamster torch settle island opinion gloom
Your address will look something similar like this: bcna14shzreglay98us0hep44hhhuy7dm43snv38plr
Initialize the folders: change Moniker by your validator name (use quotes for two or more separated words "Royal Queen Seeds")
bcnad init Moniker --chain-id bitcanna-dev-4
This will create a $HOME/.bcna
folder
Download the Genesis genesis.json
file
cd $HOME
curl -s https://raw.githubusercontent.com/BitCannaGlobal/testnet-bcna-cosmos/main/instructions/bitcanna-dev-4/genesis.json > ~/.bcna/config/genesis.json
Ensure you have the correct file. Run the SHA256SUM test:
sha256sum $HOME/.bcna/config/genesis.json
<output> f667a9a89bc00a77548e29ff11c14c3f551b3b2faa809c3e3dd48af68a3a140b
Add to config.toml file the server SEEDs:
sed -E -i 's/seeds = \".*\"/seeds = \"3fde4e73ef3fba3418dde89bffe0057508fc5706@144.91.127.5:26656\"/' $HOME/.bcna/config/config.toml
sed -E -i 's/persistent_peers = \".*\"/persistent_peers = \"d0de90dd8b40dfe231a65875069a31c534359c95@188.166.126.81:26656,4ccc6689a4d2590f6b60e34a3a3e70e0888bbcc0@144.91.89.66:26656\"/' $HOME/.bcna/config/config.toml
You can set the minimum gas prices for transactions to be accepted into your node’s mempool. This sets a lower bound on gas prices, preventing spam.
sed -E -i 's/minimum-gas-prices = \".*\"/minimum-gas-prices = \"0.001ubcna\"/' $HOME/.bcna/config/app.toml
Open the P2P port (26656 by default)
sudo ufw allow 26656
Delete data folder if exist
cd $HOME/.bcna
rm -rf data
Download the snapshot (17GB)
wget http://144.91.127.5:80/devnet-backup.tar.gz
Extract it
tar xvf devnet-backup.tar.gz
cd ~
Service creation
Ensure that you stopped the previous test with CTRL+C.
With all configurations ready, you can start your blockchain node with a single command (bcnad start
). In this tutorial, however, you will find a simple way to set up systemd
to run the node daemon with auto-restart.
Setup bcnad
systemd service (copy and paste all to create the file service):
cd $HOME
echo "[Unit]
Description=BitCanna Node
After=network-online.target
[Service]
User=${USER}
ExecStart=$(which bcnad) start
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
" >bcnad.service
Enable and activate the BCNAD service.
sudo mv bcnad.service /lib/systemd/system/
sudo systemctl enable bcnad.service && sudo systemctl start bcnad.service
Check the logs to see if it is working:
sudo journalctl -u bcnad -f
catching_up = true
the node is syncing. Also you can compare your current block with the last synced block of another node or at our Web-wallet:
curl -s localhost:26657/status | jq .result.sync_info.catching_up
#true output is syncing - false is synced
curl -s localhost:26657/status | jq .result.sync_info.latest_block_height
#this output is your last block synced
curl -s "https://rpc-testnet.bitcanna.io/status?" | jq .result.sync_info.latest_block_height
#this output the public node last block synced