relayer
relayer copied to clipboard
[SPEC] CosmWasm Relayer
Overview
We want to have a relayer system for CosmWasm contracts. This systems would be able to connect to CW chains, listen to the events on smart contracts, and any other RPC related tasks we are currently leveraging in the relayer.
Capabilities
- Ability to connect to CosmWasm chains.
- Ability to connect to a specific CosmWasm contract.
- Ability to listen to events / transactions on contracts.
- Ability to submit transcations.
Checklist
- [ ] Use the tendermint RPC client or build an RPC client that connects to CosmWasm chains and returns chain data. (jsonrpsee)
- [ ] Create a new event watcher trait for CosmWasm contract chains.
Related Tasks
- [ ] https://github.com/webb-tools/relayer/issues/139
- [ ] https://github.com/webb-tools/relayer/issues/186
Resources
- https://docs.cosmwasm.com/docs/1.0/architecture/query/
- https://docs.tendermint.com/master/rpc/
- https://github.com/informalsystems/tendermint-rs/tree/master/rpc
Isuess/Open Questions
- How to listen to events in Rust and Typescript?
- If there only exists a Typescript library for doing so, can we leverage this to reduce the need for custom code? Or is it more beneficial to build from scratch?
An idea for a minimal relayer client abstraction.
- Listen to new blocks.
- Query the block results using this method
- Verify what data we have access to from the event? Is there a contract identifiable in the data?
- Otherwise, we just parse each event and filter if it is relevant for us.
- Then we pass the filtered events to another channel or another function.