Skip to content

Commit

Permalink
allow Scaffolding Mode and Customization Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
PolkachuIntern committed Sep 24, 2022
1 parent 5ab5dbc commit d05b3d0
Show file tree
Hide file tree
Showing 28 changed files with 97 additions and 44 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,23 @@ ansible-playbook main_hermes_install.yml

### Hermes deployment

You will want to maintain your own `mainnet.toml.j2` file in the `hermes_config` playbook
Here are two modes to deploy Hermes. For the Scaffolding Mode, you will specify a list of networks in the inventory file. For the Customization Mode, you will maintain your own jinja template.

For both, you will need to specify `key_name`, `memo` and a list of target ips in the inventory file. Examples are provided in the sample file.

```bash
ansible-playbook main_hermes_config.yml -e "target=mainnet"
ansible-playbook main_hermes_config.yml -e "target=testnet"
```

#### Scaffolding Mode

This mode is suitable if you just want to get the relay going quickly among a few networks.

You will fill in the list of networks you want to relay in the `mainnet_networks` or `testnet_networks` variables in the inventory file. The scaffolded config file will relay any channels among these networks.

#### Customization Mode

This mode is suitable when you connect lots of different networks and you want to fine-tune how they connect with each other.

You will leave `mainnet_networks` or `testnet_networks` blank in the inventory file. You will customize the `mainnet.toml.j2` or `testnet.toml.j2` using our files as the starting point.
7 changes: 5 additions & 2 deletions inventory.sample.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ ansible_user=ubuntu
ansible_port=22
ansible_ssh_private_key_file="~/.ssh/id_rsa"

# Relay Memo
memo: 'Relayed by Polkachu'
# Relay
key_name="relayer"
memo='Relayed by Polkachu'
mainnet_networks=[]
testnet_networks=[]

# You will add more
juno_ip="10.0.0.2"
Expand Down
12 changes: 11 additions & 1 deletion roles/hermes_config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,23 @@
group: '{{ ansible_user }}'
state: directory

- name: Copy hermes config script
- name: Copy hermes config script with customization
template:
src: '{{ target }}.toml.j2'
dest: '/home/{{ ansible_user }}/.hermes/{{ target }}.toml'
owner: '{{ ansible_user }}'
group: '{{ ansible_user }}'
mode: '0644'
when: mainnet_networks is not defined or mainnet_networks|length == 0

- name: Copy hermes config script with scaffolding
template:
src: 'scaffold.toml.j2'
dest: '/home/{{ ansible_user }}/.hermes/{{ target }}.toml'
owner: '{{ ansible_user }}'
group: '{{ ansible_user }}'
mode: '0644'
when: mainnet_networks is defined and mainnet_networks|length > 0

- name: create hermes systemd unit
become: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws:/{{ agoric_ip }}:14457/websocket'

rpc_timeout = '20s'
account_prefix = 'agoric'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 300000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws:/{{ akash_ip }}:12857/websocket'

rpc_timeout = '20s'
account_prefix = 'akash'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ axelar_ip }}:15157/websocket'

rpc_timeout = '20s'
account_prefix = 'axelar'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 200000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ bitcanna_ip }}:13057/websocket'

rpc_timeout = '20s'
account_prefix = 'bcna'
key_name = 'relayer'
key_name = '{{ key_name }}'
store_prefix = 'ibc'
address_type = { derivation = 'cosmos' }
default_gas = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ cheqd_ip }}:16157/websocket'

rpc_timeout = '30s'
account_prefix = 'cheqd'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = {derivation = 'cosmos'}
store_prefix = 'ibc'
default_gas = 1000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ chihuahua_ip }}:12957/websocket'

rpc_timeout = '20s'
account_prefix = 'chihuahua'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 300000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ cosmos_ip }}:14957/websocket'

rpc_timeout = '20s'
account_prefix = 'cosmos'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 300000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ crescent_ip }}:14557/websocket'

rpc_timeout = '20s'
account_prefix = 'cre'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 400000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ evmos_ip }}:13457/websocket'

rpc_timeout = '20s'
account_prefix = 'evmos'
key_name = 'relayer'
key_name = '{{ key_name }}'
store_prefix = 'ibc'
address_type = { derivation = 'ethermint', proto_type = { pk_type = '/ethermint.crypto.v1.ethsecp256k1.PubKey' } }
default_gas = 400000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ gravity_ip }}:14257/websocket'

rpc_timeout = '20s'
account_prefix = 'gravity'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 300000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ injective_ip }}:14357/websocket'

rpc_timeout = '20s'
account_prefix = 'inj'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'ethermint', proto_type = { pk_type = '/injective.crypto.v1beta1.ethsecp256k1.PubKey' } }
store_prefix = 'ibc'
default_gas = 400000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ juno_ip }}:12657/websocket'

rpc_timeout = '20s'
account_prefix = 'juno'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 300000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ kichain_ip }}:13557/websocket'

rpc_timeout = '20s'
account_prefix = 'ki'
key_name = 'relayer'
key_name = '{{ key_name }}'
store_prefix = 'ibc'
address_type = { derivation = 'cosmos' }
default_gas = 300000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ kujira_ip }}:11857/websocket'

rpc_timeout = '20s'
account_prefix = 'kujira'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 300000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ osmosis_ip }}:12557/websocket'

rpc_timeout = '20s'
account_prefix = 'osmo'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 400000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ secret_ip }}:17157/websocket'

rpc_timeout = '30s'
account_prefix = 'secret'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ sifchain_ip }}:13257/websocket'

rpc_timeout = '20s'
account_prefix = 'sif'
key_name = 'relayer'
key_name = '{{ key_name }}'
store_prefix = 'ibc'
address_type = { derivation = 'cosmos' }
default_gas = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ stargaze_ip }}:13757/websocket'

rpc_timeout = '20s'
account_prefix = 'stars'
key_name = 'relayer'
key_name = '{{ key_name }}'
store_prefix = 'ibc'
address_type = { derivation = 'cosmos' }
default_gas = 300000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ umee_ip }}:12257/websocket'

rpc_timeout = '20s'
account_prefix = 'stride'
key_name = 'relayer'
key_name = '{{ key_name }}'
store_prefix = 'ibc'
address_type = { derivation = 'cosmos' }
default_gas = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ terra2_ip }}:11757/websocket'

rpc_timeout = '20s'
account_prefix = 'terra'
key_name = 'relayer'
key_name = '{{ key_name }}'
address_type = { derivation = 'cosmos' }
store_prefix = 'ibc'
default_gas = 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ umee_ip }}:13657/websocket'

rpc_timeout = '20s'
account_prefix = 'umee'
key_name = 'relayer'
key_name = '{{ key_name }}'
store_prefix = 'ibc'
address_type = { derivation = 'cosmos' }
default_gas = 100000
Expand Down
2 changes: 1 addition & 1 deletion roles/hermes_config/templates/hermes.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After=network.target
[Service]
Type=simple
User={{ ansible_user }}
ExecStart=/usr/local/bin/hermes --config /home/ubuntu/.hermes/{{ target }}.toml start
ExecStart=/usr/local/bin/hermes --config /home/{{ ansible_user }}/.hermes/{{ target }}.toml start
Restart=always
RestartSec=5

Expand Down
Loading

0 comments on commit d05b3d0

Please sign in to comment.