Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoHealthyNodesFound = errors.New("healthy node was not found")
)
View Source
var (
ErrorNoSpecifiedNodesFound = errors.New("no specified nodes found")
)
Functions ¶
This section is empty.
Types ¶
type MultiChainNodesStorage ¶
type MultiChainNodesStorage interface {
Add(node Node) error
GetByChainId(chainId int64) (*Node, error)
ToSingleChain(chainId int64) (NodesStorage, error)
}
func NewInmemoryMultiChainNodesStorage ¶
func NewInmemoryMultiChainNodesStorage() MultiChainNodesStorage
type Node ¶
type Node struct {
Rpc *ethclient.Client `fig:"rpc,required"`
RpcUrl string `fig:"rpc,required"`
Ws *ethclient.Client `fig:"ws"`
WsUrl string `fig:"ws"`
ChainId int64 `fig:"chain_id,required"`
}
func (Node) CheckHealth ¶
CheckHealth tries to get current block number and if it fails, returns false (and true otherwise, respectively)
type Noder ¶
type Noder interface {
Nodes() []Node
MultiChainNodesStorage() MultiChainNodesStorage
NodesStorage() NodesStorage
}
type NodesStorage ¶
func NewInmemoryNodesStorage ¶
func NewInmemoryNodesStorage() NodesStorage
Click to show internal directories.
Click to hide internal directories.