Documentation ¶
Index ¶
Constants ¶
const ( ErrMsgTooLarge = iota ErrDecode ErrInvalidMsgCode ErrProtocolVersionMismatch ErrNetworkIdMismatch ErrGenesisBlockMismatch ErrNoStatusMsg ErrExtraStatusMsg ErrSuspendedPeer )
const ProtocolMaxMsgSize = 10 * 1024 * 1024 // Maximum cap on the size of a protocol message
Variables ¶
var ProtocolLengths = []uint64{0x100}
Number of implemented message corresponding to different protocol versions.
var ProtocolName = "poker"
Official short name of the protocol used during capability negotiation.
var ProtocolVersions = []uint{poker1}
Supported versions of the eth protocol (first is primary).
Functions ¶
This section is empty.
Types ¶
type Peer ¶
type Peer struct { ID string *p2p.Peer RW p2p.MsgReadWriter // contains filtered or unexported fields }
func (*Peer) Handshake ¶
Handshake executes the eth protocol handshake, negotiating version number, network IDs, difficulties, head and genesis blocks.
type PeerInfo ¶
type PeerInfo struct {
Version int `json:"version"`
}
PeerInfo represents a short summary of the Ethereum sub-protocol metadata known about a connected peer.
type PeerSet ¶
type PeerSet struct {
// contains filtered or unexported fields
}
peerSet represents the collection of active peers currently participating in the Ethereum sub-protocol.
func NewPeerSet ¶
func NewPeerSet() *PeerSet
newPeerSet creates a new peer set to track the active participants.
func (*PeerSet) CenterPeer ¶
Peer retrieves the registered peer with the given id.
func (*PeerSet) Close ¶
func (ps *PeerSet) Close()
Close disconnects all peers. No new peers can be registered after Close has returned.
func (*PeerSet) Register ¶
Register injects a new peer into the working set, or returns an error if the peer is already known.
func (*PeerSet) Unregister ¶
Unregister removes a remote peer from the active set, disabling any further actions to/from that particular entity.
type Poker ¶
type Poker struct {
// contains filtered or unexported fields
}
func (*Poker) APIs ¶
APIs returns the collection of RPC services the ethereum package offers. NOTE, some of these services probably need to be moved to somewhere else.
func (*Poker) Protocols ¶
Protocols implements node.Service, returning all the currently configured network protocols to start.
type ProtocolManager ¶
type ProtocolManager struct { SubProtocols []p2p.Protocol // contains filtered or unexported fields }
func NewProtocolManager ¶
func NewProtocolManager(networkId uint64, node *node.Node) (*ProtocolManager, error)
func (*ProtocolManager) Start ¶
func (pm *ProtocolManager) Start(maxPeers int)
func (*ProtocolManager) Stop ¶
func (pm *ProtocolManager) Stop()