Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Why does Hermes need both rpc_addr and websocket_addr? #2658

Closed
5 tasks
ImJeremyHe opened this issue Sep 21, 2022 · 7 comments
Closed
5 tasks

Why does Hermes need both rpc_addr and websocket_addr? #2658

ImJeremyHe opened this issue Sep 21, 2022 · 7 comments
Labels
A: question Admin: further information is requested
Milestone

Comments

@ImJeremyHe
Copy link

ImJeremyHe commented Sep 21, 2022

Summary

hermes is an implementation on relayer delivering the message between chains.
And I thought it would be enough for a node to provide a gRPC service only.

After some exploration, I found rpc_addr is related to check the latest status of a chain for relayer. Is there any trait for me to implement a rpc service?

Problem Definition

Proposal

Acceptance Criteria


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@romac
Copy link
Member

romac commented Sep 21, 2022

Hermes depends on both the gRPC endpoints exposed by the Cosmos SDK as well as the JSON-RPC and WebSocket endpoints exposed by Tendermint. As such you currently need to specify all three of rpc_addr, grpc_addr and websocket_addr in the configuration.

Can you get into more details as to what is the problem with the RPC endpoint? Is the chain you are working with not Tendermint-based?

@romac romac changed the title why hermes requires listening to rpc_addr and websocket_addr Why does Hermes need both rpc_addr and websocket_addr? Sep 21, 2022
@romac
Copy link
Member

romac commented Sep 21, 2022

As per your original question: at the moment there is no way to mock just the light client, but you can either:

a) write your own implementation of the ChainEndpoint trait
b) implement a RPC proxy manually which exposes the same API as Tendermint and configure its URL as the rpc_addr

As for the WebSocket endpoint, you may not need it if you go with option (a) but you will still need to implement the ChainEndpoint::init_event_monitor method for it return a channel through which the relayer can listen for IBC events.

@romac romac added the A: question Admin: further information is requested label Sep 21, 2022
@ImJeremyHe
Copy link
Author

ImJeremyHe commented Sep 21, 2022

Thank you for your reply.
The chain I am working with is not built by Cosmos SDK.
Is hermes only designed for Cosmos SDK chain? I want to use hermes as the relayer in my chain, where can I find the Tendermint APIs?
Is this trait?
https://github.com/informalsystems/tendermint-rs/blob/2f2e86868de1c4b5f820c5f6b15e4f48e35a118d/rpc/src/client.rs#L43

@adizere
Copy link
Member

adizere commented Sep 27, 2022

Is hermes only designed for Cosmos SDK chain?

At the moment, yes. Many teams are working on forks to support non-SDK, eg Composable Finance to support Substrate (Polkadot ecosystem) networks: https://github.com/ComposableFi/ibc-rs/commits/master.

This module captures all the relayer dependencies towards a network (eg Cosmos SDK networks) including Tendermint-level dependencies: https://github.com/informalsystems/ibc-rs/blob/1d56e6db85a25f0c14dd80a6336266118d4c0ead/crates/relayer/src/chain/cosmos.rs#L1

The trait ChainEndpoint is the relevant one. Importantly, we're re-architecting Hermes to provide better support for relaying on non-SDK networks (#2478).

What is the network you're looking to support?

@plafer
Copy link
Contributor

plafer commented Sep 28, 2022

Technically your chain doesn't need to be built on the Cosmos SDK to work with hermes; it only needs to expose the same gRPC endpoints as the SDK. You can look at basecoin for an example of how that might be implemented.

@ImJeremyHe
Copy link
Author

Technically your chain doesn't need to be built on the Cosmos SDK to work with hermes; it only needs to expose the same gRPC endpoints as the SDK. You can look at basecoin for an example of how that might be implemented.

basecoin is the application built on tendermint. Hermes needs rpc_addr which is exposed by tendermint.

@plafer
Copy link
Contributor

plafer commented Sep 29, 2022

basecoin is the application built on tendermint.

That's right.

Hermes needs rpc_addr which is exposed by tendermint.

That's correct, but insufficient. It also needs some gRPC endpoints, which are exposed by the application (e.g. basecoin). So essentially you will need to implement the rpc endpoints coming from tendermint as well as some additional gRPC endpoints exposed directly by the application.

@informalsystems informalsystems locked and limited conversation to collaborators Sep 30, 2022
@adizere adizere converted this issue into discussion #2685 Sep 30, 2022
@adizere adizere added this to the v1.1 milestone Sep 30, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
A: question Admin: further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants