# README

p2p

The p2p package provides an abstraction around peer-to-peer communication.

Docs:

  • Connection for details on how connections and multiplexing work
  • Peer for details on peer ID, handshakes, and peer exchange
  • Node for details about different types of nodes and how they should work
  • Pex for details on peer discovery and exchange
  • Config for details on some config option

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
Package PEX (Peer exchange) handles all the logic necessary for nodes to share information about their peers to other nodes.

# Functions

MergedChannelIterator produces an iterator that merges the messages from the given channels in arbitrary order.
NewChannel creates a new channel.
NewEndpoint constructs an Endpoint from a types.NetAddress structure.
NewMConnTransport sets up a new MConnection transport.
NewMemoryNetwork creates a new in-memory network.
NewPeerManager creates a new peer manager.
NewPeerUpdates creates a new PeerUpdates subscription.
NewRouter creates a new Router.
No description provided by the author
ParseNodeAddress parses a node address URL into a NodeAddress, normalizing and validating it.
No description provided by the author

# Constants

DefaultScore is the default score for a peer during initialization.
No description provided by the author
No description provided by the author
No description provided by the author
MetricsSubsystem is a subsystem shared by all metrics exposed by this package.
persistent peers.
unconditional peers.
peer observed as bad.
disconnected.
peer observed as good.
connected and ready.
No description provided by the author

# Structs

Channel is a bidirectional channel to exchange Protobuf messages with peers.
ChannelIterator provides a context-aware path for callers (reactors) to process messages from the P2P layer without relying on the implementation details of the P2P layer.
Endpoint represents a transport connection endpoint, either local or remote.
Envelope contains a message with sender/receiver routing info.
ErrCurrentlyDialingOrExistingAddress indicates that we're currently dialing this address or it belongs to an existing peer.
ErrFilterTimeout indicates that a filter operation timed out.
No description provided by the author
No description provided by the author
ErrRejected indicates that a Peer was rejected carrying additional information as to the reason.
No description provided by the author
ErrSwitchConnectToSelf to be raised when trying to connect to itself.
ErrSwitchDuplicatePeerID to be raised when a peer is connecting with a known ID.
ErrSwitchDuplicatePeerIP to be raised whena a peer is connecting with a known IP.
ErrTransportClosed is raised when the Transport has been closed.
MConnTransport is a Transport implementation using the current multiplexed Tendermint protocol ("MConn").
MConnTransportOptions sets options for MConnTransport.
MemoryConnection is an in-memory connection between two transport endpoints.
MemoryNetwork is an in-memory "network" that uses buffered Go channels to communicate between endpoints.
MemoryTransport is an in-memory transport that uses buffered Go channels to communicate between endpoints.
Metrics contains metrics exposed by this package.
NodeAddress is a node address URL.
PeerError is a peer error reported via Channel.Error.
PeerManager manages peer lifecycle information, using a peerStore for underlying storage.
PeerManagerOptions specifies options for a PeerManager.
PeerUpdate is a peer update event sent via PeerUpdates.
PeerUpdates is a peer update subscription with notifications about peer events (currently just status changes).
Router manages peer connections and routes messages between peers and reactor channels.
RouterOptions specifies options for a Router.

# Interfaces

Connection represents an established connection between two endpoints.
Transport is a connection-oriented mechanism for exchanging data with a peer.
Wrapper is a Protobuf message that can contain a variety of inner messages (e.g.

# Type aliases

ChannelCreator allows routers to construct their own channels, either by receiving a reference to Router.OpenChannel or using some kind shim for testing purposes.
No description provided by the author
No description provided by the author
No description provided by the author
PeerEventSubscriber describes the type of the subscription method, to assist in isolating reactors specific construction and lifecycle from the peer manager.
PeerScore is a numeric score assigned to a peer (higher is better).
PeerStatus is a peer status.
Protocol identifies a transport protocol.