Installation
v.3.1.0
68114ab
be10f9e1362b2f4de45a95c045387949e2acd6ad
Minimum hardware Requirements #
CPU : 4x CPUs
Ram : 8GB RAM
Storage: 100GB of storage (SSD or NVME)
Setting Variables
echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="test"" >> $HOME/.bash_profile
echo "export BITCANNA_CHAIN_ID="bitcanna-dev-1"" >> $HOME/.bash_profile
echo "export BITCANNA_PORT="130"" >> $HOME/.bash_profile
echo "export DAEMON_NAME="bcnad"" >> $HOME/.bash_profile
echo "export DAEMON_HOME=$HOME/.bcna"" >> $HOME/.bash_profile
source $HOME/.bash_profile
Install dependencies
sudo apt update && sudo apt upgrade -y && sudo apt-get install make build-essential gcc git jq chrony lz4 tmux unzip bc -y && sudo apt install -y curl git jq lz4 build-essential unzip
INSTALL GO
ver="1.20.5" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version
# Adding Go's location to profile
cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source $HOME/.profile
go version
Download and build binary
# Clone project repository
cd $HOME
rm -rf bcna
git clone https://github.com/BitCannaGlobal/bcna.git
cd bcna
git checkout v3.1.0
# Build binaries
make build
# Prepare binaries for Cosmovisor
mkdir -p $HOME/.bcna/cosmovisor/genesis/bin
mv build/bcnad $HOME/.bcna/cosmovisor/genesis/bin/
rm -rf build
# Create application 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
Installing Cosmovisor
# Download and install Cosmovisor
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest
# Create 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"
[Install]
WantedBy=multi-user.target
EOF
# Reload Daemon
sudo systemctl daemon-reload
sudo systemctl enable bitcanna.service
Initialize Node & Configuring Node Port
# Set node configuration
bcnad init $MONIKER --chain-id bitcanna-dev-1
bcnad config node tcp://localhost:13057
bcnad config keyring-backend file
# Set custom ports in client.toml
sed -i.bak -e "s%:26457%:${BITCANNA_PORT}57%g" $HOME/.bcna/config/client.toml
# Set custom ports in app.toml
sed -i.bak -e "s%:1317%:${BITCANNA_PORT}17%g;
s%:8080%:${BITCANNA_PORT}80%g;
s%:9090%:${BITCANNA_PORT}90%g;
s%:9091%:${BITCANNA_PORT}91%g;
s%:8545%:${BITCANNA_PORT}45%g;
s%:8546%:${BITCANNA_PORT}46%g;
s%:6065%:${BITCANNA_PORT}65%g" $HOME/.bcna/config/app.toml
# Set custom ports in config.toml file
sed -i.bak -e "s%:26658%:${BITCANNA_PORT}58%g;
s%:26657%:${BITCANNA_PORT}57%g;
s%:6060%:${BITCANNA_PORT}60%g;
s%:26656%:${BITCANNA_PORT}56%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${BITCANNA_PORT}56\"%;
s%:26660%:${BITCANNA_PORT}60%g" $HOME/.bcna/config/config.toml
# Download genesis and addrbook
wget -O $HOME/.bcna/config/genesis.json https://files.nodeshub.online/testnet/bitcanna/genesis.json
wget -O $HOME/.bcna/config/addrbook.json https://files.nodeshub.online/testnet/bitcanna/addrbook.json
# Add Seeds and Peers
SEEDS="https://bitcanna.seeds.nodeshub.online:13056"
PEERS="f28f565a6514340f2506b8f2b4e1d5322c4a26dd@158.180.234.201:26656,d9bfa29e0cf9c4ce0cc9c26d98e5d97228f93b0b@65.109.88.38:14256,97798665c60d3a72d39f4e07c9c0ab3ec88cdea0@185.144.99.37:26656,bd2d16056540a2911e117d86883c4acb2088e91b@193.34.213.222:10656,52074028d45fcf9b2bb264504fa976363f124cea@95.235.136.233:26656,e726816f42831689eab9378d5d577f1d06d25716@169.155.46.44:26656,9ca926169792c5e0dc7cf01520e9bc9a46d62d67@49.12.86.120:26686,ce001dd820b8b838533390372aea4dfc365780d9@192.99.4.66:26866,e881b19770e835de2cfe7e65b71ea3d0fc76b0d0@172.110.97.188:26656,7c00beb4956bc40cd33ced6e2c2ffe07d4fa32e7@95.216.242.82:36656,13c8ab223afee8cb6c5593a7f38160d9f1d34ae0@136.243.104.103:11756,88c6b1fa1c7fef98b4449b769eb2705476586664@65.109.92.241:21326,312237a27c62e21e3ec5e2a075cba0035db3fb66@95.217.42.107:26656,46dddc32cc1cbebb5a4b6cdfdb6aee34fc4a0fc6@65.108.196.251:11356,3cb7bc8d5c448eaa42558347fb6cb03cd414b223@38.242.232.202:26656,bf7db6b0fa14a4dc87fbe18d0c1a8a2472c871d7@212.227.115.137:26656,5a048cab1d183de5c465c56b29a16fd93a8bf9bd@152.53.18.245:27656,32b1cf90be5dc6a01dc2684f0bd97bf052690082@49.13.161.101:26656,3a609bcab56fda1baa921f91318e8c0e7da5b7c5@85.237.193.92:26656,f9b17b392fd2e5630f66f9f9ecf26c43dc486427@194.163.150.204:26656,0a658df9d9fab096983a12e6f878e87281a15ce6@5.189.128.119:27656,09ba537d6563018b97c502979c3478df4decf426@152.53.32.140:2656,1aa010eb8f4217be89194718570050cabb689649@89.117.54.224:26656,66ed3885f2932912df2b04646d2c3d643467719b@212.227.115.165:26656,e8bbbe53969162a893ab67c1eeb40432d57edec6@167.235.102.45:11656,c6658742ae4c889ecf8dee95ca2a8e4b45d46dfd@85.214.208.127:26656,950a1c706034397b43d643cd610db7a3f833d23c@65.109.17.23:56242,dd24d867596646eb109fd5d36beb15797e6fe5d2@195.26.244.117:13056,6ae1dfa46884560e13962d73462e5bda0bb8c019@65.109.33.48:17656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.bcna/config/config.toml
# Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0ubcna\"|" $HOME/.bcna/config/app.toml
# Set pruning and indexer to null
sed -i -e "s/^pruning =./pruning = "custom"/" $HOME/.bcna/config/app.toml sed -i -e "s/^pruning-keep-recent =./pruning-keep-recent = "100"/"
$HOME/.bcna/config/app.toml sed -i -e "s/^pruning-interval =./pruning-interval = "50"/" $HOME/.bcna/config/app.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.bcna/config/config.toml
Download Snapshot
# Back up priv_validator_state.json if needed
cp ~/.bcna/data/priv_validator_state.json ~/.bcna/priv_validator_state.json
# On some tendermint chains
bcnad unsafe-reset-all --home $HOME/.bcna --keep-addr-book
# On other tendermint chains
bcnad tendermint unsafe-reset-all --home $HOME/.bcna --keep-addr-book
curl https://files.nodeshub.online/testnet/bitcanna/snapshot/snap_bitcanna.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.bcna
mv $HOME/.bcna/priv_validator_state.json.backup $HOME/.bcna/data/priv_validator_state.json
sudo systemctl restart bitcanna && sudo journalctl -u bitcanna -f -o cat
Start service and check the logs
sudo systemctl start bitcanna.service && sudo journalctl -u bitcanna -f -o cat
Last updated