Run Relayers
Steps to set up your own Snowbridge message relayers.
Last updated
Steps to set up your own Snowbridge message relayers.
Last updated
The first thing you will need is an AWS account. Register if you do not have an account yet.
Clone the infrastructure repository:
git clone https://github.com/Snowfork/snowbridge-relayers-infra.git
Install Ansible and its dependencies:
brew install pipx
pipx install --include-deps ansible boto3 botocore
pipx ensurepath
ansible-galaxy collection install amazon.aws
On the AWS console, under the EC2 section, create an ED25519 key pair called snowbridge-relayers-key
.
In the snowbridge-relayers-infra
directory, create a .envrc file with the following values:
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_ACCOUNT_ID=
export AWS_DEFAULT_REGION=eu-central-1
Add your AWS access key ID, secret access key and account ID.
Run command from inside the snowbridge-relayers-infra
directory:
ansible-playbook -i inventory/message-relayers/aws_ec2.yml infra.yml
It will create an EC2 instance to run the relayers on.
Add the following plaintext secrets to AWS secrets manager:
snowbridge/dwellir-eth-node-api-key
snowbridge/dwellir-polkadot-node-api-key
snowbridge/chainalysis-api-key
snowbridge/asset-hub-ethereum-relay
snowbridge/asset-hub-parachain-relay
Ask for API keys for dwellir-eth-node-api-key
, dwellir-polkadot-node-api-key
and chainalysis-api-key
in Snowbridge Relayer Telegram group: https://t.me/+I8Iel-Eaxcw3NjU0 (keys will be DM'ed to you).
The asset-hub-ethereum-relay
is a private key for an prefunded account on Polkadot BridgeHub. To retrieve the private key from an account on Polkadot with seedphrase "cat cow milk...", use subkey:
./target/release/subkey inspect "cat cow milk..."
Use the secret seed hash as the snowbridge/asset-hub-ethereum-relay
secret.
The asset-hub-parachain-relay
is a private key for a funded account on Ethereum.
The Ethereum and Polkadot BridgeHub account should be funded with $10 each, at least.
Once you have set up all of the above, ask for a relayer ID and relayer count in Snowbridge Relayer Telegram group: https://t.me/+I8Iel-Eaxcw3NjU0. Add the key and ID in your .envrc
file. Example .envrc file.
Once you have added all the secrets, you can deploy your relayers:
ssh-agent bash
ssh-add /path/to/snowbridge-relayers-key.pem
ansible-playbook -i inventory/message-relayers/aws_ec2.yml relayers.yml
Once it has completed, ssh into your instance.
ssh -i message-relayers-key.pem [email protected]
Check that you see no relayer errors for each relayer:
sudo journalctl -fu snowbridge-asset-hub-ethereum-relay --since today
sudo journalctl -fu snowbridge-asset-hub-parachain-relay --since today
Once the relayer has started up successfully, all relaying parties should increment their relayer count config and redeploy their relayer config. This action will be prompted in the TG group.
To set up monitoring, register an account with PagerDuty.
Once registered, create a new service: Services -> Services Directory. Click on New. Call the service "Snowbridge Message Relayers"
Under service "Snowbridge Message Relayers", click on Integrations. Add a new Amazon Cloudwatch integration. Copy the integration URL.
In your snowbridge-relayers-infra
project, copy the URL to your .envrc file:
export PAGER_URL=https://events.eu.pagerduty.com/integration/xxx/enqueue
Now run the Ansible script to create all the necessary metrics, alarms, topic and subscription on AWS:
git pull
ssh-agent bash
ssh-add /path/to/snowbridge-relayers-key.pem
ansible-playbook -i inventory/message-relayers/aws_ec2.yml alarm.yml
Test the alarms by trigging a failure condition (i.e. change the URL of one of the service endpoints to an invalid value).
To upgrade the relayer, run the following commands:
git pull
ssh-agent bash
ssh-add /path/to/snowbridge-relayers-key.pem
ansible-playbook -i inventory/message-relayers/aws_ec2.yml relayers.yml --start-at "Upload binary"