package
0.19.0-rc4
Repository: https://github.com/eeonevision/tendermint.git
Documentation: pkg.go.dev

# 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

Uses nacl's secret_box to encrypt a net.Conn.
No description provided by the author
No description provided by the author
No description provided by the author
Taken from taipei-torrent.

# Functions

No description provided by the author
Connect2Switches will connect switches i and j via net.Pipe().
No description provided by the author
No description provided by the author
DefaultFuzzConnConfig returns the default config.
DefaultPeerConfig returns the default config.
FuzzConn creates a new FuzzedConnection.
FuzzConnAfter creates a new FuzzedConnection.
FuzzConnAfterFromConfig creates a new FuzzedConnection from a config.
FuzzConnFromConfig creates a new FuzzedConnection from a config.
IDAddressString returns id@hostPort.
LoadOrGenNodeKey attempts to load the NodeKey from the given filePath.
MakeConnectedSwitches returns n switches, connected according to the connect func.
MakePoWTarget returns the big-endian encoding of 2^(targetBits - difficulty) - 1.
No description provided by the author
No description provided by the author
No description provided by the author
skipUPNP: If true, does not try getUPNPExternalAddress().
NewNetAddress returns a new NetAddress using the provided TCP address.
NewNetAddressIPPort returns a new NetAddress using the provided IP and port number.
NewNetAddressString returns a new NetAddress using the provided address in the form of "ID@IP:Port".
NewNetAddressStrings returns an array of NetAddress'es build using the provided strings.
NewNetAddressStringWithOptionalID returns a new NetAddress using the provided address in the form of "ID@IP:Port", where the ID is optional.
NewPeerSet creates a new peerSet with a list of initial capacity of 256 items.
NewSwitch creates a new Switch with the given config.
PubKeyToID returns the ID corresponding to the given PubKey.
StartSwitches calls sw.Start() for each given switch.

# Constants

FuzzModeDelay is a mode in which we randomly sleep.
FuzzModeDrop is a mode in which we randomly drop reads/writes, connections or sleep.
IDByteLength is the length of a crypto.Address.
No description provided by the author

# Variables

No description provided by the author
No description provided by the author

# Structs

No description provided by the author
Implements Listener.
No description provided by the author
FuzzConnConfig is a FuzzedConnection configuration.
FuzzedConnection wraps any net.Conn and depending on the mode either delays reads/writes or randomly drops reads/writes/connections.
NetAddress defines information about a peer on the network including its ID, IP address, and port.
NodeInfo is the basic node information exchanged between two peers during the Tendermint P2P handshake.
NodeKey is the persistent peer key.
PeerConfig is a Peer configuration.
PeerSet is a special structure for keeping a table of peers.
Switch handles peer connections and exposes an API to receive incoming messages on `Reactors`.

# Interfaces

An AddrBook represents an address book from the pex package, which is used to store peer addresses.
IPeerSet has a (immutable) subset of the methods of PeerSet.
No description provided by the author
Peer is an interface representing a peer connected on a reactor.
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
ID is a hex-encoded crypto.Address.