export HERMES_CONFIG="<choose path for hermes config>/config.toml"
touch $HERMES_CONFIG
如果您不指定文件路径,则默认读取 ~/.hermes/config.toml。
例子:
[global]
log_level = 'info'
[mode]
[mode.clients]
enabled = true
refresh = true
misbehaviour = true
[mode.connections]
enabled = false
[mode.channels]
enabled = false
[mode.packets]
enabled = true
clear_interval = 10
clear_on_start = false
tx_confirmation = true
[telemetry]
enabled = false
host = '127.0.0.1'
port = 3001
[[chains]]
id = 'namada-test.0a4c6786dbda39f786' # set your chain ID
type = 'namada'
rpc_addr = 'http://127.0.0.1:27657' # set the IP and the port of the chain
grpc_addr = 'http://127.0.0.1:9090' # not used for now
event_source = { mode = 'push', url = 'ws://127.0.0.1:27657/websocket', batch_delay = '500ms' } # set the IP and the port of the chain
account_prefix = '' # not used
key_name = 'relayer' # The key is an account name you made
store_prefix = 'ibc'
gas_price = { price = 0.001, denom = 'nam' } # not used for now
[[chains]]
id = 'namada-test.647287156defa8728c'
type = 'namada'
rpc_addr = 'http://127.0.0.1:28657'
grpc_addr = 'http://127.0.0.1:9090'
event_source = { mode = 'push', url = 'ws://127.0.0.1:28657/websocket', batch_delay = '500ms' }
account_prefix = ''
key_name = 'relayer'
store_prefix = 'ibc'
gas_price = { price = 0.001, denom = 'nam' }
cp $HOME/.local/share/namada/$CHAIN_A_ID/wallet.toml ~/.hermes/namada_wallet/$CHAIN_A_ID/wallet.toml
# Make sure this is done for both wallets on each chain!
当创建完成时,您可以看到通道 ID。例如,以下文本显示在 Chain A namada-test.0a4c6786dbda39f786 上已创建了 ID 为 7 的通道,并且在 Chain B namada-test.647287156defa8728c 上已创建了 ID 为 12 的通道。您将需要通道 ID 来通过 IBC 进行转移。这意味着您必须为从 Chain A 到 Chain B 的转移指定 channel-7 作为通道 ID(前缀 channel- 总是必需的)。同样,您必须为从 Chain B 到 Chain A 的转移指定 channel-12 作为通道 ID。
git clone https://github.com/heliaxdev/hermes.git
git checkout $TAG # The branch is the same as our Hermes
cd hermes
./scripts/setup-namada $NAMADA_DIR $CHAIN_ID_A $CHAIN_ID_B
# create a channel
hermes --config $HERMES_CONFIG \
create channel \
--a-chain $CHAIN_A_ID \
--b-chain $CHAIN_B_ID \
--a-port transfer \
--b-port transfer \
--new-client-connection --yes
# Run Hermes
hermes --config $HERMES_CONFIG start