Skip to content

Commit d05b3d0

Browse files
allow Scaffolding Mode and Customization Mode
1 parent 5ab5dbc commit d05b3d0

28 files changed

+97
-44
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,23 @@ ansible-playbook main_hermes_install.yml
2727

2828
### Hermes deployment
2929

30-
You will want to maintain your own `mainnet.toml.j2` file in the `hermes_config` playbook
30+
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.
31+
32+
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.
3133

3234
```bash
3335
ansible-playbook main_hermes_config.yml -e "target=mainnet"
36+
ansible-playbook main_hermes_config.yml -e "target=testnet"
3437
```
38+
39+
#### Scaffolding Mode
40+
41+
This mode is suitable if you just want to get the relay going quickly among a few networks.
42+
43+
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.
44+
45+
#### Customization Mode
46+
47+
This mode is suitable when you connect lots of different networks and you want to fine-tune how they connect with each other.
48+
49+
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.

inventory.sample.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ ansible_user=ubuntu
66
ansible_port=22
77
ansible_ssh_private_key_file="~/.ssh/id_rsa"
88

9-
# Relay Memo
10-
memo: 'Relayed by Polkachu'
9+
# Relay
10+
key_name="relayer"
11+
memo='Relayed by Polkachu'
12+
mainnet_networks=[]
13+
testnet_networks=[]
1114

1215
# You will add more
1316
juno_ip="10.0.0.2"

roles/hermes_config/tasks/main.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,23 @@
66
group: '{{ ansible_user }}'
77
state: directory
88

9-
- name: Copy hermes config script
9+
- name: Copy hermes config script with customization
1010
template:
1111
src: '{{ target }}.toml.j2'
1212
dest: '/home/{{ ansible_user }}/.hermes/{{ target }}.toml'
1313
owner: '{{ ansible_user }}'
1414
group: '{{ ansible_user }}'
1515
mode: '0644'
16+
when: mainnet_networks is not defined or mainnet_networks|length == 0
17+
18+
- name: Copy hermes config script with scaffolding
19+
template:
20+
src: 'scaffold.toml.j2'
21+
dest: '/home/{{ ansible_user }}/.hermes/{{ target }}.toml'
22+
owner: '{{ ansible_user }}'
23+
group: '{{ ansible_user }}'
24+
mode: '0644'
25+
when: mainnet_networks is defined and mainnet_networks|length > 0
1626

1727
- name: create hermes systemd unit
1828
become: true

roles/hermes_config/templates/fragments/agoric.toml.j2 renamed to roles/hermes_config/templates/fragments/mainnet/agoric.toml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ websocket_addr = 'ws:/{{ agoric_ip }}:14457/websocket'
66

77
rpc_timeout = '20s'
88
account_prefix = 'agoric'
9-
key_name = 'relayer'
9+
key_name = '{{ key_name }}'
1010
address_type = { derivation = 'cosmos' }
1111
store_prefix = 'ibc'
1212
default_gas = 300000

roles/hermes_config/templates/fragments/akash.toml.j2 renamed to roles/hermes_config/templates/fragments/mainnet/akash.toml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ websocket_addr = 'ws:/{{ akash_ip }}:12857/websocket'
66

77
rpc_timeout = '20s'
88
account_prefix = 'akash'
9-
key_name = 'relayer'
9+
key_name = '{{ key_name }}'
1010
address_type = { derivation = 'cosmos' }
1111
store_prefix = 'ibc'
1212
default_gas = 100000

roles/hermes_config/templates/fragments/axelar.toml.j2 renamed to roles/hermes_config/templates/fragments/mainnet/axelar.toml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ axelar_ip }}:15157/websocket'
66

77
rpc_timeout = '20s'
88
account_prefix = 'axelar'
9-
key_name = 'relayer'
9+
key_name = '{{ key_name }}'
1010
address_type = { derivation = 'cosmos' }
1111
store_prefix = 'ibc'
1212
default_gas = 200000

roles/hermes_config/templates/fragments/bitcanna.toml.j2 renamed to roles/hermes_config/templates/fragments/mainnet/bitcanna.toml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ bitcanna_ip }}:13057/websocket'
66

77
rpc_timeout = '20s'
88
account_prefix = 'bcna'
9-
key_name = 'relayer'
9+
key_name = '{{ key_name }}'
1010
store_prefix = 'ibc'
1111
address_type = { derivation = 'cosmos' }
1212
default_gas = 100000

roles/hermes_config/templates/fragments/cheqd.toml.j2 renamed to roles/hermes_config/templates/fragments/mainnet/cheqd.toml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ cheqd_ip }}:16157/websocket'
66

77
rpc_timeout = '30s'
88
account_prefix = 'cheqd'
9-
key_name = 'relayer'
9+
key_name = '{{ key_name }}'
1010
address_type = {derivation = 'cosmos'}
1111
store_prefix = 'ibc'
1212
default_gas = 1000000

roles/hermes_config/templates/fragments/chihuahua.toml.j2 renamed to roles/hermes_config/templates/fragments/mainnet/chihuahua.toml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ chihuahua_ip }}:12957/websocket'
66

77
rpc_timeout = '20s'
88
account_prefix = 'chihuahua'
9-
key_name = 'relayer'
9+
key_name = '{{ key_name }}'
1010
address_type = { derivation = 'cosmos' }
1111
store_prefix = 'ibc'
1212
default_gas = 300000

roles/hermes_config/templates/fragments/cosmos.toml.j2 renamed to roles/hermes_config/templates/fragments/mainnet/cosmos.toml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ websocket_addr = 'ws://{{ cosmos_ip }}:14957/websocket'
66

77
rpc_timeout = '20s'
88
account_prefix = 'cosmos'
9-
key_name = 'relayer'
9+
key_name = '{{ key_name }}'
1010
address_type = { derivation = 'cosmos' }
1111
store_prefix = 'ibc'
1212
default_gas = 300000

0 commit comments

Comments
 (0)