Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBadGenesis = fmt.Errorf("bad genesis block")
ErrBadGenesis is the error returned when a mismatch in genesis blocks happens.
Functions ¶
This section is empty.
Types ¶
type GetTipSetFunc ¶
type HelloMessage ¶
type HelloMessage struct { HeaviestTipSetCids []cid.Cid HeaviestTipSetHeight abi.ChainEpoch HeaviestTipSetWeight fbig.Int GenesisHash cid.Cid }
HelloMessage is the data structure of a single message in the hello protocol.
func (*HelloMessage) MarshalCBOR ¶
func (t *HelloMessage) MarshalCBOR(w io.Writer) error
func (*HelloMessage) UnmarshalCBOR ¶
func (t *HelloMessage) UnmarshalCBOR(r io.Reader) (err error)
type HelloProtocolHandler ¶
type HelloProtocolHandler struct {
// contains filtered or unexported fields
}
HelloProtocolHandler implements the 'Hello' protocol handler.
Upon connecting to a new node, we send them a message containing some information about the state of our chain, and receive the same information from them. This is used to initiate a chainsync and detect connections to forks.
func NewHelloProtocolHandler ¶
func NewHelloProtocolHandler(h host.Host, peerMgr peermgr.IPeerMgr, exchange exchange.Client, chainStore *chain.Store, messageStore *chain.MessageStore, gen cid.Cid, helloTimeOut time.Duration, ) *HelloProtocolHandler
NewHelloProtocolHandler creates a new instance of the hello protocol `Handler` and registers it to the given `host.Host`.
func (*HelloProtocolHandler) Register ¶
func (h *HelloProtocolHandler) Register(peerDiscoveredCallback PeerDiscoveredCallback)
Register registers the handler with the network.
type LatencyMessage ¶
LatencyMessage is written in response to a hello message for measuring peer latency.
func (*LatencyMessage) MarshalCBOR ¶
func (t *LatencyMessage) MarshalCBOR(w io.Writer) error
func (*LatencyMessage) UnmarshalCBOR ¶
func (t *LatencyMessage) UnmarshalCBOR(r io.Reader) (err error)