package
0.26.1
Repository: https://github.com/ness-network/ness3.git
Documentation: pkg.go.dev

# Packages

Package gnet is the core networking library */.
Package pex is a toolkit for implementing a peer exchange system.
Package strand is a utility for linearizing method calls, similar to locking.

# Functions

DisconnectCodeToReason maps a disconnect code to a gnet.DisconnectReason.
DisconnectReasonToCode maps a gnet.DisconnectReason to a 16-byte code.
EstimateBlockchainHeight estimates the blockchain sync height.
IsBroadcastFailure returns true if an error indicates that a broadcast operation failed.
New returns a Daemon with primitives allocated.
NewAnnounceBlocksMessage creates message.
NewAnnounceTxnsMessage creates announce txns message.
NewConfig returns a Config with defaults set.
NewConnections creates Connections.
NewDaemonConfig creates daemon config.
NewDisconnectMessage creates message sent to reject previously received message.
NewGetBlocksMessage creates GetBlocksMessage.
NewGetPeersMessage creates GetPeersMessage.
NewGetTxnsMessage creates GetTxnsMessage.
NewGiveBlocksMessage creates GiveBlocksMessage.
NewGivePeersMessage []*pex.Peer is converted to []IPAddr for binary transmission If the size of the message would exceed maxMsgLength, the IPAddr slice is truncated.
NewGiveTxnsMessage creates GiveTxnsMessage.
NewIntroductionMessage creates introduction message.
NewIPAddr returns an IPAddr from an ip:port string.
NewMessageConfig creates message config.
NewMessages creates Messages.
NewMessagesConfig creates messages config.
NewPool creates pool.
NewPoolConfig creates pool config.

# Constants

ConnectionStateConnected connected, but not introduced.
ConnectionStateIntroduced connection has introduced itself.
ConnectionStatePending prior to establishing a connection.

# Variables

ErrConnectionAlreadyConnected attempted to make invalid state transition from connected state.
ErrConnectionAlreadyIntroduced attempted to make invalid state transition from introduced state.
ErrConnectionExists connection exists in Connections.
ErrConnectionGnetIDMismatch gnet ID in argument does not match gnet ID on record.
ErrConnectionIPMirrorExists connection exists for a given base IP and mirror.
ErrConnectionNotExist connection does not exist when performing an operation that requires it to exist.
ErrConnectionStateNotConnected connect state is not "connected".
ErrDisconnectBlockchainPubkeyNotMatched is returned when the blockchain pubkey in introduction does not match.
ErrDisconnectBlockchainPubkeyNotProvided is returned when the blockchain pubkey in introduction is not provided.
ErrDisconnectConnectedTwice connect twice.
ErrDisconnectIdle idle.
ErrDisconnectIntroductionTimeout timeout.
ErrDisconnectInvalidBurnFactor invalid burn factor in introduction message.
ErrDisconnectInvalidExtraData is returned when extra field can't be parsed.
ErrDisconnectInvalidMaxDropletPrecision invalid max droplet precision in introduction message.
ErrDisconnectInvalidMaxTransactionSize invalid max transaction size in introduction message.
ErrDisconnectInvalidUserAgent is returned if the peer provides an invalid user agent.
ErrDisconnectIPLimitReached ip limit reached.
ErrDisconnectIsBlacklisted is blacklisted.
ErrDisconnectMaxOutgoingConnectionsReached is returned when connection pool size is greater than the maximum allowed.
ErrDisconnectNoIntroduction no introduction.
ErrDisconnectPeerlistFull the peerlist is full.
ErrDisconnectReceivedDisconnect received a DisconnectMessage.
ErrDisconnectRequestedByOperator the operator of the node requested a disconnect.
ErrDisconnectSelf self connnect.
ErrDisconnectUnexpectedError this is returned when a seemingly impossible error is encountered, e.g.
ErrDisconnectUnknownReason used when mapping an unknown reason code to an error.
ErrDisconnectVersionNotSupported version is below minimum supported version.
ErrInvalidGnetID invalid gnet ID value used as argument.
ErrNetworkingDisabled is returned if networking is disabled.
ErrNoPeerAcceptsTxn is returned if no peer will propagate a transaction broadcasted with BroadcastUserTransaction.

# Structs

AnnounceBlocksMessage tells a peer our highest known BkSeq.
AnnounceTxnsMessage tells a peer that we have these transactions.
BlockchainProgress is the current blockchain syncing status.
Config subsystem configurations.
ConnectEvent generated when a client connects.
ConnectFailureEvent represent a failure to connect/dial a connection, with context.
Connection a connection's state within the daemon.
ConnectionDetails connection data managed by daemon.
Connections manages a collection of Connection.
Daemon stateful properties of the daemon.
DaemonConfig configuration for the Daemon.
DisconnectEvent generated when a connection terminated.
DisconnectMessage sent to a peer before disconnecting, indicating the reason for disconnect.
GetBlocksMessage sent to request blocks since LastBlock.
GetPeersMessage sent to request peers.
GetTxnsMessage request transactions of given hash.
GiveBlocksMessage sent in response to GetBlocksMessage, or unsolicited.
GivePeersMessage sent in response to GetPeersMessage.
GiveTxnsMessage tells the transaction of given hashes.
GnetConnectionDetails connection data from gnet.
IntroductionMessage is sent on first connect by both parties.
IPAddr compact representation of IP:Port.
MessageConfig config contains a gnet.Message's 4byte prefix and a reference interface.
Messages messages struct.
MessagesConfig slice of MessageConfig.
PeerBlockchainHeight records blockchain height for an address.
PingMessage Sent to keep a connection alive.
PongMessage Sent in reply to a PingMessage.
Pool maintains config and pool.
PoolConfig pool config.

# Interfaces

SendingTxnsMessage send transaction message interface.

# Type aliases

ConnectionState connection state in the state machine Connections have three states: "pending", "connected" and "introduced" A connection in the "pending" state has been selected to establish a TCP connection, but the connection has not been established yet.