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. This directory contains the node binary and block information collected from the genesis block to the present.
# 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 of the binary and ownership of the directory. You can check the latest releases by going to our GitHub repository under the releases page.
# 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/download/latest/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
Run the Node Service
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 in the following directory.
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.
To check your running bifrost-node service logs, execute the command below.
journalctl -f -u bifrost-node
If the node service has successfully been executed, the chain information will be shown as the following.
2023-07-19 17:02:53 BIFROST Network
2023-07-19 17:02:53 ✌️ version 1.2.3-0d1811a5e80
2023-07-19 17:02:53 ❤️ by bifrost-platform, 2022-2023
2023-07-19 17:02:53 📋 Chain specification: BIFROST Development
2023-07-19 17:02:53 🏷 Node name: jolly-grandfather-7771
2023-07-19 17:02:53 👤 Role: AUTHORITY
2023-07-19 17:02:53 💾 Database: RocksDb at /var/folders/vg/xzyl_nmd77x5kcvbryssc5gm0000gn/T/substrateutNaBp/chains/dev/db/full
2023-07-19 17:02:53 ⛓ Native runtime: thebifrost-dev-301 (bifrost-dev-1.tx1.au1)
2023-07-19 17:02:53 🔨 Initializing Genesis block/state (state: 0x7c59…74e5, header-hash: 0x469c…993b)
2023-07-19 17:02:53 🔨 Running Frontier DB migration from version 1 to version 2. Please wait.
2023-07-19 17:02:53 ✔️ Successful Frontier DB migration from version 1 to version 2 (0 entries).
2023-07-19 17:02:53 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2023-07-19 17:02:54 Using default protocol ID "sup" because none is configured in the chain specs
2023-07-19 17:02:54 🏷 Local node identity is: 12D3KooWLvfoahrVYuwGjvNKyyWgkWSvBT9TofHvNGdiexgS3hRL
2023-07-19 17:02:54 💻 Operating system: macos
2023-07-19 17:02:54 💻 CPU architecture: aarch64
2023-07-19 17:02:54 📦 Highest known block at #0
2023-07-19 17:02:54 〽️ Prometheus exporter started at 127.0.0.1:9615
2023-07-19 17:02:54 Running JSON-RPC HTTP server: addr=127.0.0.1:9933, allowed origins=["*"]
2023-07-19 17:02:54 Running JSON-RPC WS server: addr=127.0.0.1:9944, allowed origins=["*"]
Since chain data needs to be synced starting from the genesis block, the information that it is currently syncing will be shown as the following output. You can proceed to the next steps only when the sync is complete, and it may take up to several days at most.
To quickly synchronize your chain data, follow this link.
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-node.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-node.service