package
0.0.0-20250119000602-809120120630
Repository: https://github.com/n42blockchain/n42.git
Documentation: pkg.go.dev
# Packages
Package discover implements the Node Discovery Protocol.
No description provided by the author
No description provided by the author
Package enr implements Ethereum Node Records as defined in EIP-778.
Package leakybucket implements a scalable leaky bucket algorithm.
Package netutil contains extensions to the net package.
Package peers provides information about peers at the Ethereum consensus protocol level.
Package types contains all the respective p2p types that are required for sync but cannot be represented as a protobuf schema.
# Functions
AllTopics returns all topics stored in our gossip mapping.
ExtractGossipDigest extracts the relevant fork digest from the gossip topic.
GossipTopicMappings is a function to return the assigned data type versioned by epoch.
MakePeer from multiaddress string.
MsgID is a content addressable ID function.
MultiAddressBuilder takes in an ip address string and port to produce a go multiaddr format.
NewService initializes a new p2p service compatible with shared.Service interface.
PeersFromStringAddrs converts peer raw ENRs into multiaddrs for p2p.
SerializeENR takes the enr record in its key-value form and serializes it.
TopicDeconstructor splits the provided topic to its logical sub-sections.
TopicFromMessage constructs the rpc topic from the provided message type and epoch.
VerifyTopicMapping verifies that the topic and its accompanying message type is correct.
# Constants
BlockTopicFormat is the topic format for the block subnet.
BodiesByRangeMessageName specifies the name for the Bodies by range message topic.
ExitBlockTopicFormat is the topic format for the voluntary exit.
GoodbyeMessageName specifies the name for the goodbye message topic.
GossipBlockMessage is the name for the block message type.
GossipExitMessage is the name for the voluntary exit message type.
todo.
GossipProtocolAndDigest represents the protocol and fork digest prefix in a gossip topic.
GossipTransactionMessage is the name for the transaction message type.
HeadersByRangeMessageName specifies the name for the Headers by range message topic.
PingMessageName Specifies the name for the ping message topic.
RPCBodiesDataTopicV1 defines the v1 topic for the Bodies rpc method.
RPCGoodByeTopicV1 defines the v1 topic for the goodbye rpc method.
RPCHeadersDataTopicV1 defines the v1 topic for the Headers rpc method.
RPCPingTopicV1 defines the v1 topic for the ping rpc method.
V1 RPC Topics RPCStatusTopicV1 defines the v1 topic for the status rpc method.
SchemaVersionV1 specifies the schema version for our rpc protocol ID.
StatusMessageName specifies the name for the status message topic.
TransactionTopicFormat is the topic format for the block subnet.
# Variables
ErrMessageNotMapped occurs on a Broadcast attempt when a message has not been defined in the GossipTypeMapping.
GossipTypeMapping is the inverse of GossipTopicMappings so that an arbitrary protobuf message can be mapped to a protocol ID string.
RPCTopicMappings map the base message type to the rpc request.
# Interfaces
Broadcaster broadcasts messages to peers over the p2p pubsub protocol.
ConnectionHandler configures p2p to handle connections with a peer.
EncodingProvider provides p2p network encoding.
Listener defines the discovery V5 network interface that is used to communicate with other peers.
P2P represents the full p2p interface composed of all of the sub-interfaces.
PeerManager abstracts some peer management methods from libp2p.
PeersProvider abstracts obtaining our current list of known peers status.
PingProvider returns the metadata related information for the local peer.
PubSubProvider provides the p2p pubsub protocol.
PubSubTopicUser provides way to join, use and leave PubSub topics.
Sender abstracts the sending functionality from libp2p.
SenderEncoder allows sending functionality from libp2p as well as encoding for requests and responses.
SetStreamHandler configures p2p to handle streams of a certain topic ID.
# Type aliases
RPCTopic is a type used to denote and represent a req/resp topic.