Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Error while creating Hermes relayer client between Earth and Mars chains (in IBC Tutorial) #4391

Open
Srutip04 opened this issue Oct 17, 2024 · 7 comments
Labels
type:bug Something isn't working

Comments

@Srutip04
Copy link

Srutip04 commented Oct 17, 2024

Title: Error while creating Hermes relayer client between Earth and Mars chains

Description:

I am trying to configure a Hermes relayer between two chains, Earth and Mars, using the Ignite CLI. During the configuration process, I encountered an error while attempting to create a client. Below are the details of the issue:

Steps to Reproduce:

  1. Run the following command to configure the Hermes relayer:

    ignite relayer hermes configure "earth" "http://localhost:26657" "http://localhost:9090" "mars" "http://localhost:26659" "http://localhost:9092" --chain-a-faucet "http://0.0.0.0:4500" --chain-b-faucet "http://0.0.0.0:4501" --chain-a-port-id "blog" --chain-b-port-id "blog" --channel-version "blog-1"
  2. Confirm the reuse of the existing configuration file.

  3. Observe the following error message after the configuration:

    ✘ Error while running command /tmp/hermes3270493899 --config=/root/.ignite/relayer/hermes/earth_mars --json create client --host-chain=earth --reference-chain=mars: exit status 1
    
image

Expected Behavior:

I expected the command to successfully create a client between the Earth and Mars chains.

Actual Behavior:

The command fails with an error indicating that it exited with status 1.

Environment:

image

Additional Information:

  • I have already checked the following:
    • Both chains (Earth and Mars) are running and accessible.
    • The RPC and gRPC addresses provided in the command are correct.
    • I have sufficient balance in both relayer wallets.
@chen4903
Copy link
Contributor

chen4903 commented Nov 11, 2024

I have the same problem. These are my logs:

Hermes earth <-> mars config already exist at /Users/levi/.ignite/relayer/hermes/earth_mars. Do you want to reuse this config file: y
Hermes config created at /Users/levi/.ignite/relayer/hermes/earth_mars
Chain earth relayer wallet: cosmos18vjc7lncuf2qe9ed6785g5dmyx0a5fywre2nx9
New balance from faucet: 100000stake,5token
? Chain mars doesn't have a default Hermes key. Type your mnemonic to continue or type enter to generate a new one: (optional) 
New mnemonic generated: leisure public rug short wire inherit doctor thought license believe radio grocery pride field observe narrow kit host three age emerge female true fire
Chain mars key created
Chain mars relayer wallet: cosmos19xdsskuetmplf5atejh0y6rthxvd5wrh2qy8pl
New balance from faucet: 100000stake,5token
✘ Error while running command /var/folders/c4/p5jlhrr966gg3dn3lz6wkknr0000gn/T/hermes1093786263 --config=/Users/levi/.ignite/relayer/hermes/earth_mars --json create client --reference-chain=mars --host-chain=earth: exit status 1

@Srutip04 We can fix it by this:

Hermes earth <-> mars config already exist at /Users/levi/.ignite/relayer/hermes/earth_mars. Do you want to reuse this config file: N

Now it is working:

✗ Hermes earth <-> mars config already exist at /Users/levi/.ignite/relayer/hermes/earth_mars. Do you want to reuse this config file: 
Hermes config created at /Users/levi/.ignite/relayer/hermes/earth_mars
Chain earth relayer wallet: cosmos18vjc7lncuf2qe9ed6785g5dmyx0a5fywre2nx9
New balance from faucet: 200000stake,10token
Chain mars relayer wallet: cosmos19xdsskuetmplf5atejh0y6rthxvd5wrh2qy8pl
New balance from faucet: 200000stake,10token
Client '07-tendermint-0' created (earth -> mars)
Client 07-tendermint-0' created (mars -> earth)
Connection 'earth (connection-0) <-> mars (connection-0)' created
Channel 'earth (channel-0) <-> mars (channel-0)' created

btw, I don't know the core reason of it, maybe someone could provide some ideas?

@chen4903
Copy link
Contributor

Oh no, when I delete the cache rm -rf ~/.ignite/relayer and retry, it is fail:

aefaefaefeaf _ 1.1
Hermes config created at /Users/levi/.ignite/relayer/hermes/earth_mars
The Hermes configuration file at path '/Users/levi/.ignite/relayer/hermes/earth_mars' is invalid, reason: parse error: invalid CosmosSdk config: invalid trust threshold: 0/0 for key `chains` at line 60 column 1
Please see the example configuration for detailed information about the supported configuration options: https://github.com/informalsystems/hermes/blob/master/config.toml
✘ Error while running command /var/folders/c4/p5jlhrr966gg3dn3lz6wkknr0000gn/T/hermes252080209 --config=/Users/levi/.ignite/relayer/hermes/earth_mars --json keys list --chain=earth: exit status 1

@stanlysamuel
Copy link

@chen4903
In your case, you need to update your configuration file /Users/levi/.ignite/relayer/hermes/earth_mars contents as follows:

Replace trust_threshold = {denominator = '0', numerator = '0'} with trust_threshold = {denominator = '3', numerator = '2'} in all occurences.

After this run the command:

ignite relayer hermes configure "earth" "http://localhost:26657" "http://localhost:9090" "mars" "http://localhost:26659" "http://localhost:9092" --chain-a-faucet "http://0.0.0.0:4500" --chain-b-faucet "http://0.0.0.0:4501" --chain-a-port-id "blog" --chain-b-port-id "blog" --channel-version "blog-1"

(I have flattened it as compared to what was mentioned in the doc)

You will get the error that @Srutip04 has mentioned.

Please note that you also need to update the earth.yml file to:

version: 1
build:
  proto:
    path: proto
    third_party_paths:
    - third_party/proto
    - proto_vendor
accounts:
- name: alice
  coins:
  - 1000token
  - 100000000stake
- name: bob
  coins:
  - 500token
  - 100000000stake
faucet:
  name: bob
  coins:
  - 5token
  - 100000stake
  host: :4500
genesis:
  chain_id: earth
validators:
- name: alice
  bonded: 100000000stake
  app:
    api:
      address: :1317
    grpc:
      address: :9090
    grpc-web:
      address: :9091
  config:
    p2p:
      laddr: :26656
    rpc:
      laddr: :26657
      pprof_laddr: :6060
  home: $HOME/.earth

This is wrongly mentioned in the doc.

I agree with @Srutip04 that this error exists even after fixing all the bugs, as I mentioned above i.e.,

  • Both chains (Earth and Mars) are running and accessible.
  • The RPC and gRPC addresses provided in the command are correct.
  • I have sufficient balance in both relayer wallets.

@stanlysamuel
Copy link

Hi @chen4903 and @Srutip04 ,

Here is a solution to the above problem that worked for me. Thanks to a member of the Hermes team (@ljoss17) for helping me out with this. The problem is that Ignite does not generate the correct config file for Hermes.

You can update the config file as follows:

[global]
log_level = 'error'

[mode]
[mode.clients]
enabled = true
refresh = true
misbehaviour = true

[mode.connections]
enabled = true

[mode.channels]
enabled = true

[mode.packets]
enabled = true
clear_interval = 100
clear_on_start = true
tx_confirmation = true
auto_register_counterparty_payee = false

[rest]
enabled = false
host = '127.0.0.1'
port = 3000

[telemetry]
enabled = false
host = '127.0.0.1'
port = 3001

[[chains]]
id = 'earth'
type = 'CosmosSdk'
ccv_consumer_chain = false
rpc_addr = 'http://localhost:26657'
grpc_addr = 'http://localhost:9090'
event_source = {batch_delay = '500ms', mode = 'push', url = 'ws://localhost:26657/websocket'}
rpc_timeout = '10s'
trusted_node = true
account_prefix = 'cosmos'
key_name = 'wallet'
address_type = {derivation = 'cosmos'}
key_store_type = 'Test'
store_prefix = 'ibc'
default_gas = 1000000
max_gas = 10000000
gas_price = {denom = 'stake', price = 0.001}
gas_multiplier = 1.2
max_msg_num = 30
max_tx_size = 2097152
clock_drift = '5s'
max_block_time = '30s'
trusting_period = '14days'
trust_threshold = {denominator = '3', numerator = '2'}
memo_prefix = ''
sequential_batch_tx = false

[[chains]]
id = 'mars'
type = 'CosmosSdk'
ccv_consumer_chain = false
rpc_addr = 'http://localhost:26659'
grpc_addr = 'http://localhost:9092'
event_source = {batch_delay = '500ms', mode = 'push', url = 'ws://localhost:26659/websocket'}
rpc_timeout = '10s'
trusted_node = true
account_prefix = 'cosmos'
key_name = 'wallet'
address_type = {derivation = 'cosmos'}
key_store_type = 'Test'
store_prefix = 'ibc'
default_gas = 1000000
max_gas = 10000000
gas_price = {denom = 'stake', price = 0.001}
gas_multiplier = 1.2
max_msg_num = 30
max_tx_size = 2097152
clock_drift = '5s'
max_block_time = '30s'
trusting_period = '14days'
trust_threshold = {denominator = '3', numerator = '2'}
memo_prefix = ''
sequential_batch_tx = false

Then run:

ignite relayer hermes configure \
"earth" "http://localhost:26657/" "http://localhost:9090/" \
"mars" "http://localhost:26659/" "http://localhost:9092/" \      
--chain-a-faucet "http://0.0.0.0:4500/" \
--chain-b-faucet "http://0.0.0.0:4501/" \
--chain-a-port-id "transfer" \
--chain-b-port-id "transfer"

followed by:

ignite relayer hermes start "earth" "mars"

Now the command works:

planetd tx blog send-ibc-post transfer channel-1 "Hello" "Hello Mars, I'm Alice from Earth" --from alice --chain-id earth --home ~/.earth

Please update the port as transfer and the channel as the correct one based on the one generated for you.

@chen4903
Copy link
Contributor

Re You can update the config file as follows:: Could I know the file name of it? This is my project:

.
├── api
├── app
├── buf.work.yaml
├── cmd
├── config.yml
├── docs
├── earth.yml
├── go.mod
├── go.sum
├── mars.yml
├── proto
├── readme.md
├── testutil
├── tools
└── x

@stanlysamuel
Copy link

@chen4903 I think it is created in this path that you mentioned in an earlier comment:
/Users/levi/.ignite/relayer/hermes/earth_mars

@chen4903
Copy link
Contributor

chen4903 commented Dec 13, 2024

Hi @stanlysamuel . I follow your advice, but I meet a new error:

$ ignite relayer hermes configure "earth" "http://localhost:26657" "http://localhost:9090" "mars" "http://localhost:26659" "http://localhost:9092" --chain-a-faucet "http://0.0.0.0:4500" --chain-b-faucet "http://0.0.0.0:4501" --chain-a-port-id "blog" --chain-b-port-id "blog" --channel-version "blog-1"
aefaefaefeaf _ 1.1
? Hermes earth <-> mars config already exist at /Users/levi/.ignite/relayer/hermes/earth_mars. Do you want to reuse this config file? [y/N] y█
Hermes config created at /Users/levi/.ignite/relayer/hermes/earth_mars
Chain earth relayer wallet: cosmos18vjc7lncuf2qe9ed6785g5dmyx0a5fywre2nx9
✘ Faucet is not operational: Bad Gateway

btw, I think manually modifying the Ignite configuration file is not the ultimate solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Status: To Discuss
Development

No branches or pull requests

3 participants