Skip to content

Commit

Permalink
GITBOOK-97: Run relayers upgrade process
Browse files Browse the repository at this point in the history
  • Loading branch information
Clara van Staden authored and gitbook-bot committed Oct 28, 2024
1 parent 1d7d73e commit f2bb710
Showing 1 changed file with 32 additions and 15 deletions.
47 changes: 32 additions & 15 deletions docs/operations/run-relayers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@ description: Steps to set up your own Snowbridge message relayers.

# Run Relayers

## AWS Account
1. [Setup](run-relayers.md#id-1.-setup)
2. [Upgrade](run-relayers.md#id-2.-upgrade)

## 1. Setup

### 1.1 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
### 1.2 Clone infra repo

Clone the [infrastructure repository](https://github.com/Snowfork/snowbrige-relayers-infra):

```sh
git clone https://github.com/Snowfork/snowbridge-relayers-infra.git
```

## Install Ansible & dependencies
### 1.3 Install Ansible & dependencies

Install Ansible and its dependencies:

Expand All @@ -27,11 +32,11 @@ pipx ensurepath
ansible-galaxy collection install amazon.aws
```

## Create AWS Key Pair
### 1.4 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
### 1.5 Set AWS env variables

In the `snowbridge-relayers-infra` directory, create a .envrc file with the following values:

Expand All @@ -44,15 +49,17 @@ export AWS_DEFAULT_REGION=eu-central-1

Add your AWS access key ID, secret access key and account ID.

## Create EC2 instance
### 1.6 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
### 1.7 Add secrets

Add the following plaintext secrets to AWS secrets manager:

Expand All @@ -66,11 +73,11 @@ snowbridge/asset-hub-parachain-relay

<figure><img src="../.gitbook/assets/Screenshot 2024-10-22 at 19.44.27.png" alt="" width="563"><figcaption><p>Example of how to add an AWS secret.</p></figcaption></figure>

### Lodestar, Polkadot Nodes & Chainalysis Key
#### 1.7.1 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) (keys will be DM'ed to you).

### Ethereum Relay Key
#### 1.7.2 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/):

Expand All @@ -80,19 +87,19 @@ The `asset-hub-ethereum-relay` is a private key for an prefunded account on Polk

Use the secret seed hash as the `snowbridge/asset-hub-ethereum-relay` secret.

### Parachain Relay Key
#### 1.7.3 Parachain relayer key

The `asset-hub-parachain-relay` is a private key for a funded account on Ethereum.

## Fund Relayer Accounts
### 1.8 Fund relayer accounts

The Ethereum and Polkadot BridgeHub account should be funded with $10 each, at least.

## Set Relayer Number
### 1.9 Set relayer number

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](https://t.me/+I8Iel-Eaxcw3NjU0). Add the key and ID in your `.envrc` file. [Example .envrc file](https://github.com/Snowfork/snowbrige-relayers-infra/blob/main/.envrc-example#L5-L6).

## Install Relayers
### 1.10 Install Relayers

Once you have added all the secrets, you can deploy your relayers:

Expand All @@ -115,11 +122,21 @@ sudo journalctl -fu snowbridge-asset-hub-ethereum-relay --since today
sudo journalctl -fu snowbridge-asset-hub-parachain-relay --since today
```

### Increment Relayer count
### 1.11 Increment Relayer count

Once the relayer has started up successfully, all relaying parties should increment their [relayer count config and redeploy](https://github.com/Snowfork/snowbrige-relayers-infra/blob/main/.envrc-example#L5-L6) their relayer config. This action will be prompted in the TG group.

### Monitoring
### 1.12 Monitoring

TODO

## 2. Upgrade

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"
```

0 comments on commit f2bb710

Please sign in to comment.