Documentation ¶
Index ¶
Constants ¶
View Source
const ( CheckQueueBufferSize = 100 NodeQueueBufferSize = 100 GetPeersTickerSeconds = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crawler ¶
type Crawler struct { QuitService // contains filtered or unexported fields }
A crawler has a local node, a set of potential nodes in the nodePool, and connected nodes. Maps are only accessed by one go-routine, mediated by the checkQueue
func NewCrawler ¶
Create a new Crawler using the local RPC server at addr
type Node ¶
type Node struct { Host string P2PPort uint16 RPCPort uint16 LastSeen time.Time ChainID string BlockHeight int BlockHistory map[int]time.Time // when we saw each block NetInfo *ctypes.ResultNetInfo Validator bool // contains filtered or unexported fields }
A node is a peer on the network
func (*Node) SetInfo ¶
func (n *Node) SetInfo(status *ctypes.ResultStatus, netinfo *ctypes.ResultNetInfo)
Set the basic status and chain_id info for a node from RPC responses
type NodeClient ¶
type NodeClient struct {
// contains filtered or unexported fields
}
A node client is used to talk to a node over rpc and websockets
func NewNodeClient ¶
func NewNodeClient(addr string) *NodeClient
Create a new client for the node at the given addr
Click to show internal directories.
Click to hide internal directories.