Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup full node on bitsong-2b chain from scratch #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 102 additions & 1 deletion bitsong-2b/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,105 @@
Inside this repository you can find the Big Bang Upgrade Guide to bitsong-2b and the genesis for the full nodes.

- [Upgrade Guide](./UPGRADE.md)
- [Genesis](./genesis.json)
- [Genesis](./genesis.json)

## Full-Node Setup
- Install useful packages
```
sudo apt update
sudo apt install make clang pkg-config libssl-dev build-essential git jq ncdu bsdmainutils -y < "/dev/null"
```
- Install go language
```
wget -O go1.17.1.linux-amd64.tar.gz https://golang.org/dl/go1.17.1.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz && rm go1.17.1.linux-amd64.tar.gz
echo 'export GOROOT=/usr/local/go' >> $HOME/.bash_profile
echo 'export GOPATH=$HOME/go' >> $HOME/.bash_profile
echo 'export GO111MODULE=on' >> $HOME/.bash_profile
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile && . $HOME/.bash_profile
```
You can check your installation by running `go version`.
It should return `go version go1.17.1 linux/amd64`

- Download Bitsong binary
```
git clone https://github.com/bitsongofficial/go-bitsong.git
```
- Move to go-bitsong directory, checkout in v0.8.0 branch then install the binary
```
cd go-bitsong/
git checkout v0.8.0
make install
```
- Init your node and get the correct genesis.json file
```
bitsongd init YOUR-MONIKER --chain-id bitsong-2b
wget https://github.com/bitsongofficial/networks/raw/master/bitsong-2b/genesis.json -O ~/.bitsongd/config/genesis.json
```
- Fill right persistent peers
```
persistent_peers="[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:15631,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:36656"
sed -i.bak -e "s/^persistent_peers = \"\"/persistent_peers = \"$persistent_peers\"/" $HOME/.bitsongd/config/config.toml
```
- Fill right seeds
```
seeds="[email protected]:26656,[email protected]:26656"
sed -i.bak -e "s/^seeds = \"\"/seeds = \"$seeds\"/" $HOME/.bitsongd/config/config.toml
```
- Start your node
```
bitsongd start
```
## Create your validator
Once you have your full node well settled you can create your validator.
- Create a wallet for your validator
```
bitsongd keys add WALLET-NAME
```
(!! Don't forget to save your mnemonic in a safe place !!)

- Create your validator.
Your node have to be fully synchronized in order to create your validator.
You can check it with
```
curl localhost:26657/status | grep catching_up
```
If this command return false then you can create your validator. Otherwise wait to be fully synchronized.
Finaly run create-validator command
```
bitsongd tx staking create-validator \
--amount=100000000ubtsg \
--pubkey=$(bitsongd tendermint show-validator) \
--moniker="YOUR MONIKER" \
--chain-id=bitsong-2b \
--commission-rate="0" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.10" \
--min-self-delegation="1" \
--from=YOUR-WALLET
```
## Setup a service
Setup a service can be very useful as your validator has to be running everytime.
You can setup it very easly
```
vi /etc/systemd/system/bitsong.service
[Unit]
Description=Bitsong Node
After=network-online.target

[Service]
User=root
ExecStart=/root/go/bin/bitsongd start
Restart=always
RestartSec=3
LimitNOFILE=4096
```
Then run
```
systemctl daemon-reload
systemctl start bitsong
```
You can check your logs to monitor what happend in background by execute:
```
journalctl -u bitsong -f
```