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:
Interaction points between rollmint and cosmos-sdk are limited to
NodeandRPC Client.Nodecurrently needs to satisfyServiceinterface from tendermint (actually, onlyStartmethod matters).RPC Clientneeds to implementtendermint/rpc/client.ClientinterfaceCurrently we're creating
RPC clientexplicitly 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
Nodeinterface:This way, each concrete implementation of
Nodeinterface will be able to provide concrete implementation of RPC Client.Note: trying to create single
rpc.Clientimplementation working with multiple node types leads to very bad "abstraction" ofNode.Concrete tasks:
Nodeinterface #662FullNode#663LightNode#664