-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GITBOOK-90: change request with no subject merged in GitBook
- Loading branch information
1 parent
a997d03
commit 18a96a9
Showing
2 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 [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 | ||
``` | ||
|
||
### Monitoring | ||
|
||
TODO | ||
|