Using Systemd
In addition to using the Docker image, there are ways to run nodes with the Linux system daemon as a systemd service. The service will work on most Linux operating systems. However, Debian/Ubuntu is the only environment in which all tests have been completed, and the manual has been written based on this environment.
First, create a service account to run the node service.
adduser BIFROST_SERVICE --system --no-create-home
Next, create a local directory to store the chain data of the BIFROST Network. The directory contains the node binaries and all block information collected from the genesis blocks to the present and additional session keys of the corresponding validator node.
# Add sudo at the beginning if it doesn't work
mkdir -p /var/lib/bifrost-data
After you download the latest node execution binary and move it to the directory you created earlier, you must set permissions to your account.
Testnet
Mainnet
# step 1. Download the latest bifrost-node binary & bifrost-testnet.json
wget "https://github.com/bifrost-platform/bifrost-node/releases/latest/download/bifrost-node"
wget "https://github.com/bifrost-platform/bifrost-node/releases/latest/download/bifrost-testnet.json"
# step 2. Grant execute permission & Move to chain data directory
chmod +x bifrost-node
mv bifrost-node bifrost-testnet.json /var/lib/bifrost-data
# step 3. Set ownership
chown -R BIFROST_SERVICE /var/lib/bifrost-data
# step 1. Download the latest bifrost-node binary & bifrost-mainnet.json
wget "https://github.com/bifrost-platform/bifrost-node/releases/latest/download/bifrost-node"
wget "https://github.com/bifrost-platform/bifrost-node/releases/latest/download/bifrost-mainnet.json"
# step 2. Grant execute permission & Move to chain data directory
chmod +x bifrost-node
mv bifrost-node bifrost-mainnet.json /var/lib/bifrost-data
# step 3. Set ownership
chown -R BIFROST_SERVICE /var/lib/bifrost-data
Next, you need to create a systemd configuration file. In the example below, change
YOUR_NODE_NAME
to the desired name of your node service, and save the file name as /etc/systemd/system/bifrost.service
.Testnet
Mainnet
[Unit]
Description="Bifrost-node systemd service"
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
User=BIFROST_SERVICE
SyslogIdentifier=bifrost
SyslogFacility=local7
KillSignal=SIGHUP
ExecStart=/var/lib/bifrost-data/bifrost-node \
--base-path /var/lib/bifrost-data \
--chain /var/lib/bifrost-data/bifrost-testnet.json \
--port 30333 \
--ws-port 9944 \
--rpc-port 9933 \
--state-pruning archive \
--rpc-cors all \
--rpc-external \
--ws-external \
--ethapi debug,trace,txpool \
--runtime-cache-size 64 \
--name "YOUR_NODE_NAME"
[Install]
WantedBy=multi-user.target
[Unit]
Description="Bifrost-node systemd service"
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
User=BIFROST_SERVICE
SyslogIdentifier=bifrost
SyslogFacility=local7
KillSignal=SIGHUP
ExecStart=/var/lib/bifrost-data/bifrost-node \
--base-path /var/lib/bifrost-data \
--chain /var/lib/bifrost-data/bifrost-mainnet.json \
--port 30333 \
--ws-port 9944 \
--rpc-port 9933 \
--state-pruning archive \
--rpc-cors all \
--rpc-external \
--ws-external \
--ethapi debug,trace,txpool \
--runtime-cache-size 64 \
--name "YOUR_NODE_NAME"
[Install]
WantedBy=multi-user.target
Conversely, to run an endpoint node with non-archive mode enabled, it is necessary to determine the maximum number of past blocks to be indexed, and the number of blocks may be specified after the
--state-pruning
option.Now, with the two lines of the command below, the node service will run in the background.
systemctl enable bifrost.service
systemctl start bifrost.service
As BIFROST Network development continues, it will sometimes be necessary to upgrade your node client. Node operators will be notified on our Discord channel or by personal contacts when upgrades are available and whether they are necessary (some client upgrades are optional).
Before upgrading your node client, please keep a backup file of your chain data to prevent any further data, keys, or credential losses.
# Stop and delete bifrost-node binary
systemctl stop bifrost.service
rm /var/lib/bifrost-data/bifrost-node
# Download the latest bifrost-node binary
wget "https://github.com/bifrost-platform/bifrost-node/releases/latest/download/bifrost-node"
# Grant execute permission & move to chain data directory
chmod +x bifrost-node
chown BIFROST_SERVICE bifrost-node
mv bifrost-node /var/lib/bifrost-data
systemctl restart bifrost.service
Last modified 3mo ago