A centralized blockchain bridge relayer that aims to connect two blockchains (Proof Of Concept: POC)
git clone https://github.com/AlyraButerin/bridge-relay-poc
cd bridge-relay-poc
This project uses poetry
to manage dependencies.
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install poetry==1.8.3
poetry install
There are 3 files at root level.
- .env
- .env.config.dev
- .env.config.prod
Set your private key for PK_* Set your project id for PROJECT_ID_* (see: https://dashboard.alchemy.com/)
- copy sample.env to .env
- copy sample.env.config.dev to .env.config.dev
- update .env.config.dev values
- copy sample.env.config.prod to .env.config.prod
- update .env.config.prod values
There are 4 files at the location: src/config
- abi_dev.json
- abi.json
- bridge_relayer_config_dev.toml
- bridge_relayer_config.toml
- edit bridge_relayer_config_dev.toml and bridge_relayer_config.toml
- set smart contract's address and genesis block values
- edit abi.json and abi_dev.json
- add the abi for each chain_id
For the POC we'll use the docker version as described in the official documentation Installing RabbitMQ
# latest RabbitMQ 3.13
docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.13-management
You need to run 2 event listeners and 1 event task listener.
Example: 2 event listeners, one for each blockchain
- chain id 441 (Allfeat)
- chain id 11155111 (Sepolia)
Note: Add --debug to enable the debug
In a new terminal execute:
poetry run python bin/event_listener.py --chain_id 441
In a new terminal execute:
poetry run python bin/event_listener.py --chain_id 11155111
You need to run at least 1 listener, but you can increase the amount of listener as needed.
In a new terminal execute:
poetry run python bin/task_listener.py --watch