Skip to content

Refactor RPC Client creation #661

@tzdybal

Description

@tzdybal

Interaction points between rollmint and cosmos-sdk are limited to Node and RPC Client.

  • Node currently needs to satisfy Service interface from tendermint (actually, only Start method matters).
  • RPC Client needs to implement tendermint/rpc/client.Client interface

Currently we're creating RPC client explicitly in cosmos-sdk:

https://github.com/celestiaorg/cosmos-sdk-rollmint/blob/81666de7b66b8bc1af8b5d532be853c4e84bc137/server/start.go#L359-L360

This code is "owned"/changed by us anyways, so we can easily change it.
Proposed change is to create minimalistic Node interface:

type Node interface {
    Start() error
    GetClient() rpc.Client
}

This way, each concrete implementation of Node interface will be able to provide concrete implementation of RPC Client.
Note: trying to create single rpc.Client implementation working with multiple node types leads to very bad "abstraction" of Node.

Concrete tasks:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions