Bone-beta-1

Upgrades

This release includes new versions of Bor (v1.1.0-bone-beta-1) and Heimdall (v1.0.2-bone-beta-1). We have added a new CLI in Bor and have also changed the way Bor is deployed to follow DevOps best practices and make it easier to manage the processes. This upgrade is backward-incompatible. Please ensure that all Puppynet nodes are upgraded before the release of the next version, which will contain hardforks.

Deployment changes

Changes in Bor:

  1. Provide a new approach to install Bor binary with a shell script: GitHub - shibaone/install 79.

  2. Recommended default Bor home is changed from ~/.bor to /var/lib/bor.

  3. bor/start.sh will be retired. We recommend moving flags from start.sh to /var/lib/bor/config.toml, which will be the single config file for all Bor configurations. Example config toml files can be found in GitHub -shibaone/launch: Shibarium network mainnet v1 launch.

  4. A new user named Bor will be created during package installation if it doesn’t exist. This user will be running the Bor service.

  5. Move bor.service file from /etc/systemd/system to /lib/systemd/system.

  6. CLI flag changes. For validators who want to continue setting Bor configs through CLI, see appendix for detailed changes.

  7. Bor profiles can be used with new hosts only, please note existing installations will not be able to take advantage of the profiles.

  8. Bor packaging installation is now simplified to sudo dpkg -i bor-$version-$arch.deb

  9. Bor profile installation for new hosts is accomplished by running sudo dpkg -i bor-$network-$nodetype-config_$version-$arch.deb

Changes in Heimdall:

  1. Provide a new approach to install Heimdall binary with a shell script: GitHub - shibaone/install.

  2. Remove bridge binary and add it as a subcommand in heimdalld.

  3. Remove heimdalld-rest-server.service and heimdalld-bridge.service, and move heimdalld.service file from /etc/systemd/system to /lib/systemd/system.

  4. Change default heimdall home from ~/.heimdalld to /var/lib/heimdall.

  5. A new user named heimdall will be created during package installation if it doesn’t exist. This user will be running the Heimdall service.

  6. Heimdall packaging installation is now simplified to sudo dpkg -i heimdalld-$version-$arch.deb

  7. Heimdall profile installation for new hosts is accomplished by running sudo dpkg -i heimdalld-$network-$nodetype-config_$version-$arch.deb

Upgrade instructions

Steps to migrate to the new version:

  1. Stop all the services

sudo service bor stop
sudo service heimdalld stop
sudo service heimdalld-bridge stop
sudo service heimdalld-rest-server stop
  1. Go version upgrade

#Install Go version
#curl -o go-install.sh <https://raw.githubusercontent.com/shibaone/node-ansible/master/go-install.sh> && chmod +x go-install.sh && ./go-install.sh
#check path and version
which go
go version
#Output - go version go1.21.8 linux/amd64  &  /usr/local/go/bin/go

#OR
sudo rm -rf /usr/local/go
wget <https://golang.org/dl/go1.21.8.linux-amd64.tar.gz>
sudo tar -C /usr/local -xzf go1.21.8.linux-amd64.tar.gz
echo "export GOPATH=$HOME/go" >> ~/.profile
echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin" >> ~/.profile
echo "export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin" >> ~/.bashrc
echo "export GOPATH=$HOME/go" >> ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin" >> ~/.bash_profile
source ~/.profile

OR

wget <https://raw.githubusercontent.com/maticnetwork/node-ansible/master/go-install.sh>
bash go-install.sh
source /home/ubuntu/.bashrc

3. Install Heimdall and Bor with a version tag, network name ( puppynet,shibarium) and node type (sentry, validator, or archive).

# Replace the network and node type
curl -L <https://raw.githubusercontent.com/shibaone/install/puppynet/heimdall.sh> | bash -s -- v1.0.2-bone-beta-1 <network> <node_type>


curl -L <https://raw.githubusercontent.com/shibaone/install/puppynet/bor.sh> | bash -s -- v1.1.0-bone <network> <node_type>

4. Set the old Bor home directory path and export it. This will be used, whenever needed, moving forward.

# Note: in this case, the old Bor directory is `~/.bor`.
#       Modify it according to your setup.


export OLD_BOR_HOME=/data/bor
sudo chown -R bor $OLD_BOR_HOME
sudo ln -nfs $OLD_BOR_HOME/data /var/lib/bor/data
sudo ln -nfs $OLD_BOR_HOME/keystore /var/lib/bor/keystore # only for validator node
sudo ln -nfs $OLD_BOR_HOME/password.txt /var/lib/bor/password.txt # only for validator node
sudo ln -nfs $OLD_BOR_HOME/address.txt /var/lib/bor/address.txt # only for validator node
sudo chown -R bor /var/lib/bor


export OLD_HEIMDALL_HOME=/data/heimdalld


sudo chown -R heimdall $OLD_HEIMDALL_HOME
sudo rm -rf /var/lib/heimdall
sudo ln -nfs $OLD_HEIMDALL_HOME /var/lib/heimdall


sudo chown -R heimdall /var/lib/heimdall

5. Check Heimdall & Bor Version

# Check version
/usr/bin/bor version
# Output - v1.1.0--bone-puppynet-beta-1

#check path and version 
/usr/bin/heimdalld version

#Output - v1.0.2-bone-beta-1 &  /usr/bin/

6. Create backup for service

cd ~
mkdir backup
# Use the path of your bor.service file
sudo mv /etc/systemd/system/bor.service ./backup
sudo mv /etc/systemd/system/heimdalld.service ./backup
sudo mv /etc/systemd/system/heimdalld-rest-server.service ./backup
sudo mv /etc/systemd/system/heimdalld-bridge.service ./backup

7. Check and edit bor.service file to make any changes if required. You can skip this step if the Bor package is installed with the correct network and node type arguments in step 2. Check and edit heimdalld.service file to make any changes if required (like adding bridge flag --bridge --all for validators).

sudo vi /lib/systemd/system/bor.service
sudo vi /lib/systemd/system/heimdalld.service

Example of bor.service file:

[Unit]
  Description=bor
  StartLimitIntervalSec=500
  StartLimitBurst=5

[Service]
  Restart=on-failure
  RestartSec=5s
  ExecStart=/usr/bin/bor server -config "/var/lib/bor/config.toml"
  Type=simple
  KillSignal=SIGINT
  User=bor
  TimeoutStopSec=120

[Install]
  WantedBy=multi-user.target

Example of heimdall.service file:

#Example heimdalld.service file for reference
[Unit]
  Description=heimdalld
  StartLimitIntervalSec=500
  StartLimitBurst=5
  
[Service]
  Restart=on-failure
  RestartSec=5s
  WorkingDirectory=/usr/bin
  ExecStart=/usr/bin/heimdalld start --home /var/lib/heimdall \\
    --chain=puppynet \\
    --rest-server
  Type=simple
  LimitNOFILE=65536
  User=heimdall
  
[Install]
  WantedBy=multi-user.target

8. Migrating to config.toml from start.sh:

Example usage: network name ( puppynet,shibarium) and node type (sentry, validator, or archive)

git clone <https://github.com/shibaone/bor.git> # If not already cloned
cd bor
git fetch
git checkout tags/v1.1.0-bone-beta-1
make bor
cd scripts

# Note: Running this command will output a config.toml which will have
#       values populated from the start.sh. Also, the script demands
#       for path to start.sh, validator address (if required) and path
#       to static-nodes.json if not found in the default location.
$ BOR_DIR=/var/lib/bor ./getconfig.sh
...
* Path to start.sh: /home/ubuntu/node/bor/start.sh
* Your validator address (e.g. 0xca67a8D767e45056DC92384b488E9Af654d78DE2), or press Enter to skip if running a sentry node: 0xca67a8D767e45056DC92384b488E9Af654d78DE2
* You dont have '~/.bor/data/bor/static-nodes.json' file. If you want to use static nodes, enter the path to 'static-nodes.json' here (press Enter to skip): /home/ubuntu/my/path/static-nodes.json


Thank you, your inputs are:
Path to start.sh: /home/ubuntu/node/bor/start.sh
Address: 0xca67a8D767e45056DC92384b488E9Af654d78DE2
Path to the config file: **/home/ubuntu/node/bor-start-config.toml**
...


# Note: We're considering /home/ubuntu as our home directory. Please
#       update the commands to use your home directory before proceeding. 
#       Copy the newly created file from the output above
#       (Path to the config file) to /var/lib/bor/config.toml
sudo cp **/home/ubuntu/node/bor-start-config.toml** /var/lib/bor/config.toml


#network name ( puppynet), and node type (sentry/sentry/bor, sentry/validator/bor, without-sentry/bor or archive).
#example --


sudo cp packaging/templates/<network_name>/<node_type>/config.toml /var/lib/bor/


sudo chown bor /var/lib/bor/config.toml

9. For better monitoring of the overall network and conditions of the node, we have hosted the ethstats dashboard. We would advise all the nodes to use the public endpoint for sending data (if you’re not sending it to some other internal endpoint). The endpoint can be configured in the config file itself and is of the format: <node_identifier>:testnet@bor-eth-stat.shibariumscan.io:3000 ex- ethstats = "Explorer-archive-rpc:testnet@bor-eth-stat.shibariumscan.io:3000” We would encourage users to use non-existing and understandable identifiers. This dashboard would also help us in alerting in case the nodes are not working properly (e.g. if they’re constantly out of sync). Open the file /var/lib/bor/config.toml in your favorite text editor and edit the value for ethstats:

ethstats = "<node_identifier>:testnet@bor-eth-stat.shibariumscan.io:3000"

10. Ensure that all the values have been populated correctly in Bor config file /var/lib/bor/config.toml. If you want to change any config options, you can edit the file. If you are not migrating from an old start.sh, the default values populated should work out of the box for a sentry node. For validator nodes, you might want to update some of the flags like: etherbase, unlock, password, keystore, maxpeers, static-nodes, ethstats, and additional telemetry configuration (from older start.sh based config).

11. Restart system processes:

sudo systemctl daemon-reload
sudo systemctl start heimdalld.service
journalctl -u heimdalld.service -f # Monitor heimdall service

sudo systemctl start bor
journalctl -u bor.service -f # Monitor bor service

Last updated