From 18a96a93565ac91336c0f24bf1c3b5bb94ebc7bc Mon Sep 17 00:00:00 2001 From: Clara van Staden Date: Tue, 22 Oct 2024 17:52:59 +0000 Subject: [PATCH] GITBOOK-90: change request with no subject merged in GitBook --- docs/SUMMARY.md | 1 + docs/operations/run-relayers.md | 110 ++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 docs/operations/run-relayers.md diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 1921293157..c5091e4ad5 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -42,3 +42,4 @@ * [Governance and Operational Processes](operations/governance-and-operational-processes.md) * [General Governance Updates](operations/governance-updates.md) * [Test Runtime Upgrades](operations/test-runtime-upgrades.md) +* [Run Relayers](operations/run-relayers.md) diff --git a/docs/operations/run-relayers.md b/docs/operations/run-relayers.md new file mode 100644 index 0000000000..793009aafa --- /dev/null +++ b/docs/operations/run-relayers.md @@ -0,0 +1,110 @@ +--- +description: Steps to set up your own Snowbridge message relayers. +--- + +# Run Relayers + +## AWS Account + +The first thing you will need is an AWS account. [Register](https://signin.aws.amazon.com/signup?request\_type=register) if you do not have an account yet. + +## Clone infra Repo + +Clone the infrastructure repository: + +```sh +git clone https://github.com/Snowfork/snowbrige-relayers-infra.git +``` + +## Install Ansible & dependencies + +Install Ansible and its dependencies: + +```sh +brew install pipx +pipx install --include-deps ansible boto3 botocore +pipx ensurepath +``` + +## Create AWS Key Pair + +On the AWS console, under the EC2 section, create an ED25519 key pair called `snowbridge-relayers-key`. + +### Set AWS Env variables + +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. + +## Create EC2 instance + +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 Secrets + +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 +``` + +### Lodestar, Polkadot Nodes & Chainalysis Key + +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](https://t.me/+I8Iel-Eaxcw3NjU0) + +### Ethereum Relay Key + +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](https://docs.substrate.io/reference/command-line-tools/subkey/): + +``` +./target/release/subkey inspect "cat cow milk..." +``` + +Use the secret seed hash as the `snowbridge/asset-hub-ethereum-relay` secret. + +### Parachain Relay Key + +The `asset-hub-parachain-relay` is a private key for a funded account on Ethereum. + +## Install Relayers + +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 ubuntu@xxx.eu-central-1.compute.amazonaws.com +``` + +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 +``` + +### Monitoring + +TODO +