BIFROST Network
  • Introduction
  • Bifrost Network Architecture
    • Consensus
    • Cross-Chain Communication Protocol (CCCP)
    • Oracle Service
  • Running a Node
    • Basic-Node Requirements
    • Full-Node Requirements
    • Validator Account Management
    • Guide for Operators
      • Setting up an Endpoint Node
        • Using Docker
        • Using Systemd
      • Setting up a Validator Node
        • Using Docker
        • Using Systemd
      • Setting up a Relayer
        • bifrost-relayer.rs
        • bifrost-relayer.py (Deprecated)
      • Chain Data Snapshots
      • Trouble Shooting
        • Testnet Chain Sync Issue
    • System Monitoring
      • Prometheus and Grafana
      • Sentry
  • Nominators
  • Developer Documentations
    • Ethereum API
      • Ethereum Precompiled Contracts
      • Libraries
      • Developer Environments
    • Bifrost Precompiled Contracts
      • Staking
      • Governance
      • RelayManager
    • Pallet Interfaces
      • BfcStaking
      • BfcUtility
      • BfcOffences
      • RelayManager
    • Client API
      • JSON-RPC API
        • author
        • chain
        • childstate
        • debug
        • eth
        • grandpa
        • net
        • offchain
        • payment
        • rpc
        • state
        • system
        • trace
        • txpool
        • web3
      • Explorer API
      • Runtime API
    • Cross-Chain Transaction and Oracle API
      • Price Oracle Contract API
      • Socket Contract API
    • Testnet Faucet
  • Governance
  • Security
  • Tokens & Assets
    • Unified Token
    • Inflation Model
  • Add Network
    • Pockie
    • MetaMask
  • Bridge
    • Bridge Guide
      • Depositing to the Bifrost Network
      • Withdrawing to another network
    • Glossary
  • Staking
    • Staking Guide
      • Stake BFC
      • Unstake BFC
    • Glossary
      • All Validators
      • My Staking Status
  • Language
    • 바이프로스트 네트워크 가이드
Powered by GitBook
On this page
  • ⚠️ Deprecated
  • What is bifrost-relayer.py?
  • Install Requirements
  • Using Systemd
  • Using Docker
  1. Running a Node
  2. Guide for Operators
  3. Setting up a Relayer

bifrost-relayer.py (Deprecated)

Previousbifrost-relayer.rsNextChain Data Snapshots

Last updated 25 days ago

⚠️ Deprecated

This guide refers to the legacy Python-based relayer (bifrost-relayer.py), which is no longer maintained. It has been completely replaced by the new Rust-based relayer . We strongly recommend all node operators and integrators to migrate to the Rust version for improved performance, security, and long-term support. 👉 See the for the latest instructions.

What is bifrost-relayer.py?

bifrost-relayer.py is the of the Bifrost network's relayer and represents the initial implementation of the CCCP-Relayer. Recently, we have introduced a of the CCCP-Relayer. However, this doesn't imply the end of the legacy relayer, which will continue to be maintained and supported.

Install Requirements

First, you need to get the code to prepare for the relayer execution.

git clone https://github.com/bifrost-platform/bifrost-relayer.py

The common configurations for the bifrost-relayer is provided through the configs/entity.relayer.json file, but the individual settings for each relayer must be set through the configs/entity.relayer.private.json file. (For testnet relayers, use the configs-testnet directory)

Using Systemd

Python version 3.10 is required to run the relayer as a system daemon.

apt install python3.10 python3.10-venv

The required Python packages must be priorly installed. It is recommended to use a virtual environment, and this manual assumes the use of a virtual environment.

cd bifrost-relayer.py

# Install virtualenv package & create virtual environment
python3.10 -m venv ./venv

# activate virtual environment & install dependencies
source venv/bin/activate
pip install -r requirements.txt

# deactivate the virtual environment
deactivate

Next, you need to create a Systemd configuration file. Create the file in the following directory.

sudo vi /etc/systemd/system/bifrost-relayer.service
  • <DIRECTORY_WHERE_BIFROST_RELAYER_LOCATES> : The absolute path to the directory where the installed bifrost-relayer locates.

  • <PATH_TO_BIFROST_RELAYER> : The absolute path to the installed bifrost-relayer.

[Unit]
Description=Bifrost relayer Daemon
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=30
SyslogIdentifier=bifrost-relayer
SyslogFacility=local7
WorkingDirectory=<DIRECTORY_WHERE_BIFROST_RELAYER_LOCATES>
ExecStart=<PATH_TO_BIFROST_RELAYER>/venv/bin/python relayer-launcher.py --slow-relayer --prometheus
KillSignal=SIGHUP

[Install]
WantedBy=multi-user.target
Example
[Unit]
Description=Bifrost relayer Daemon
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=30
SyslogIdentifier=bifrost-relayer
SyslogFacility=local7
WorkingDirectory=/home/ubuntu/example/bifrost-relayer
ExecStart=/home/ubuntu/example/bifrost-relayer/venv/bin/python relayer-launcher.py --slow-relayer --prometheus
KillSignal=SIGHUP

[Install]
WantedBy=multi-user.target

Now, with the two lines of the command below, the relayer will be executed in the background.

systemctl enable bifrost-relayer.service
systemctl start bifrost-relayer.service

To check your running bifrost-relayer service logs, execute the command below.

journalctl -f -u bifrost-relayer

Using Docker

Move to the project root path and build the Docker image.

cd bifrost-relayer.py
docker build -t bifrost-relayer .

Run the built image.

docker run --restart always -d \
    --mount type=bind,source="$(pwd)"/configs,target=/app/configs \
    --name relayer \
    --network host \
    bifrost-relayer
docker run --restart always -d \
    --mount type=bind,source="$(pwd)"/configs-testnet,target=/app/configs-testnet \
    --name relayer \
    --network host \
    bifrost-relayer

To check your running bifrost-relayer container logs, execute the command below.

docker logs -f bifrost-relayer

bifrost-relayer.rs
Rust relayer setup guide
Python implementation
Rust implementation