package
1.2.0
Repository: https://github.com/pugdag/pugdagd.git
Documentation: pkg.go.dev

# README

wire

ISC License GoDoc

Package wire implements the kaspa wire protocol.

Kaspa Message Overview

The kaspa protocol consists of exchanging messages between peers. Each message is preceded by a header which identifies information about it such as which kaspa network it is a part of, its type, how big it is, and a checksum to verify validity. All encoding and decoding of message headers is handled by this package.

To accomplish this, there is a generic interface for kaspa messages named Message which allows messages of any type to be read, written, or passed around through channels, functions, etc. In addition, concrete implementations of most all kaspa messages are provided. All of the details of marshalling and unmarshalling to and from the wire using kaspa encoding are handled so the caller doesn't have to concern themselves with the specifics.

Reading Messages Example

In order to unmarshal kaspa messages from the wire, use the ReadMessage function. It accepts any io.Reader, but typically this will be a net.Conn to a remote node running a kaspa peer. Example syntax is:

	// Use the most recent protocol version supported by the package and the
	// main kaspa network.
	pver := wire.ProtocolVersion
	kaspanet := wire.Mainnet

	// Reads and validates the next kaspa message from conn using the
	// protocol version pver and the kaspa network kaspanet. The returns
	// are a appmessage.Message, a []byte which contains the unmarshalled
	// raw payload, and a possible error.
	msg, rawPayload, err := wire.ReadMessage(conn, pver, kaspanet)
	if err != nil {
		// Log and handle the error
	}

See the package documentation for details on determining the message type.

Writing Messages Example

In order to marshal kaspa messages to the wire, use the WriteMessage function. It accepts any io.Writer, but typically this will be a net.Conn to a remote node running a kaspa peer. Example syntax to request addresses from a remote peer is:

	// Use the most recent protocol version supported by the package and the
	// main bitcoin network.
	pver := wire.ProtocolVersion
	kaspanet := wire.Mainnet

	// Create a new getaddr kaspa message.
	msg := wire.NewMsgGetAddr()

	// Writes a kaspa message msg to conn using the protocol version
	// pver, and the kaspa network kaspanet. The return is a possible
	// error.
	err := wire.WriteMessage(conn, msg, pver, kaspanet)
	if err != nil {
		// Log and handle the error
	}

# Functions

BlockHeaderToDomainBlockHeader converts a MsgBlockHeader to externalapi.BlockHeader.
BlockWithTrustedDataToDomainBlockWithTrustedData converts *MsgBlockWithTrustedData to *externalapi.BlockWithTrustedData.
DomainBlockHeaderToBlockHeader converts an externalapi.BlockHeader to MsgBlockHeader.
DomainBlockToMsgBlock converts an externalapi.DomainBlock to MsgBlock.
DomainBlockToRPCBlock converts DomainBlocks to RPCBlocks.
DomainBlockWithTrustedDataToBlockWithTrustedData converts *externalapi.BlockWithTrustedData to *MsgBlockWithTrustedData.
DomainBlockWithTrustedDataToBlockWithTrustedDataV4 converts a set of *externalapi.DomainBlock, daa window indices and ghostdag data indices to *MsgBlockWithTrustedDataV4.
DomainOutpointAndUTXOEntryPairsToOutpointAndUTXOEntryPairs converts domain OutpointAndUTXOEntryPairs to OutpointAndUTXOEntryPairs.
DomainPruningPointProofToMsgPruningPointProof converts *externalapi.PruningPointProof to *MsgPruningPointProof.
DomainTransactionToMsgTx converts an externalapi.DomainTransaction into an MsgTx.
DomainTransactionToRPCTransaction converts DomainTransactions to RPCTransactions.
DomainTrustedDataToTrustedData converts *externalapi.BlockWithTrustedData to *MsgBlockWithTrustedData.
GHOSTDAGHashPairToDomainGHOSTDAGHashPair converts *BlockGHOSTDAGDataHashPair to *externalapi.BlockGHOSTDAGDataHashPair.
MsgBlockToDomainBlock converts a MsgBlock to externalapi.DomainBlock.
MsgPruningPointProofToDomainPruningPointProof converts *MsgPruningPointProof to *externalapi.PruningPointProof.
MsgTxToDomainTransaction converts an MsgTx into externalapi.DomainTransaction.
NewAddPeerRequestMessage returns a instance of the message.
NewAddPeerResponseMessage returns a instance of the message.
NewBanRequestMessage returns an instance of the message.
NewBanResponseMessage returns a instance of the message.
NewBlockAddedNotificationMessage returns a instance of the message.
NewBlockHeader returns a new MsgBlockHeader using the provided version, previous block hash, hash merkle root, accepted ID merkle root, difficulty bits, and nonce used to generate the block with defaults or calclulated values for the remaining fields.
NewBlockHeadersMessage returns a new kaspa BlockHeaders message.
NewEstimateNetworkHashesPerSecondRequestMessage returns a instance of the message.
NewEstimateNetworkHashesPerSecondResponseMessage returns a instance of the message.
NewFinalityConflictNotificationMessage returns a instance of the message.
NewFinalityConflictResolvedNotificationMessage returns a instance of the message.
NewGetBalanceByAddressRequest returns a instance of the message.
NewGetBalanceByAddressResponse returns an instance of the message.
NewGetBalancesByAddressesRequest returns a instance of the message.
NewGetBalancesByAddressesResponse returns an instance of the message.
NewGetBlockCountRequestMessage returns a instance of the message.
NewGetBlockCountResponseMessage returns a instance of the message.
NewGetBlockDAGInfoRequestMessage returns a instance of the message.
NewGetBlockDAGInfoResponseMessage returns a instance of the message.
NewGetBlockRequestMessage returns a instance of the message.
NewGetBlockResponseMessage returns a instance of the message.
NewGetBlocksRequestMessage returns a instance of the message.
NewGetBlocksResponseMessage returns a instance of the message.
NewGetBlockTemplateRequestMessage returns a instance of the message.
NewGetBlockTemplateResponseMessage returns a instance of the message.
NewGetCoinSupplyRequestMessage returns a instance of the message.
NewGetCoinSupplyResponseMessage returns a instance of the message.
NewGetConnectedPeerInfoRequestMessage returns a instance of the message.
NewGetConnectedPeerInfoResponseMessage returns a instance of the message.
NewGetCurrentNetworkRequestMessage returns a instance of the message.
NewGetCurrentNetworkResponseMessage returns a instance of the message.
NewGetHeadersRequestMessage returns a instance of the message.
NewGetHeadersResponseMessage returns a instance of the message.
NewGetInfoRequestMessage returns a instance of the message.
NewGetInfoResponseMessage returns a instance of the message.
NewGetMempoolEntriesByAddressesRequestMessage returns a instance of the message.
NewGetMempoolEntriesByAddressesResponseMessage returns a instance of the message.
NewGetMempoolEntriesRequestMessage returns a instance of the message.
NewGetMempoolEntriesResponseMessage returns a instance of the message.
NewGetMempoolEntryRequestMessage returns a instance of the message.
NewGetMempoolEntryResponseMessage returns a instance of the message.
NewGetPeerAddressesRequestMessage returns a instance of the message.
NewGetPeerAddressesResponseMessage returns a instance of the message.
NewGetSelectedTipHashRequestMessage returns a instance of the message.
NewGetSelectedTipHashResponseMessage returns a instance of the message.
NewGetSubnetworkRequestMessage returns a instance of the message.
NewGetSubnetworkResponseMessage returns a instance of the message.
NewGetUTXOsByAddressesRequestMessage returns a instance of the message.
NewGetUTXOsByAddressesResponseMessage returns a instance of the message.
NewGetVirtualSelectedParentBlueScoreRequestMessage returns a instance of the message.
NewGetVirtualSelectedParentBlueScoreResponseMessage returns a instance of the message.
NewGetVirtualSelectedParentChainFromBlockRequestMessage returns a instance of the message.
NewGetVirtualSelectedParentChainFromBlockResponseMessage returns a instance of the message.
NewMsgAddresses returns a new kaspa Addresses message that conforms to the Message interface.
NewMsgBlock returns a new kaspa block message that conforms to the Message interface.
NewMsgBlockLocator returns a new kaspa locator message that conforms to the Message interface.
NewMsgBlockWithTrustedData returns a new MsgBlockWithTrustedData.
NewMsgBlockWithTrustedDataV4 returns a new MsgBlockWithTrustedDataV4.
NewMsgDoneBlocksWithTrustedData returns a new kaspa DoneBlocksWithTrustedData message that conforms to the Message interface.
NewMsgDoneHeaders returns a new kaspa DoneIBDBlocks message that conforms to the Message interface.
NewMsgDonePruningPointUTXOSetChunks returns a new MsgDonePruningPointUTXOSetChunks.
NewMsgIBDBlock returns a new kaspa ibdblock message that conforms to the Message interface.
NewMsgIBDBlockLocator returns a new kaspa ibdBlockLocator message.
NewMsgIBDBlockLocatorHighestHash returns a new BlockLocatorHighestHash message.
NewMsgIBDBlockLocatorHighestHashNotFound returns a new IBDBlockLocatorHighestHashNotFound message.
NewMsgIBDChainBlockLocator returns a new kaspa locator message that conforms to the Message interface.
NewMsgIBDRequestChainBlockLocator returns a new IBDRequestChainBlockLocator message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.
NewMsgInvBlock returns a new kaspa invrelblk message that conforms to the Message interface.
NewMsgInvTransaction returns a new kaspa TxInv message that conforms to the Message interface.
NewMsgPing returns a new kaspa ping message that conforms to the Message interface.
NewMsgPong returns a new kaspa pong message that conforms to the Message interface.
NewMsgPruningPointProof returns a new MsgPruningPointProof.
NewMsgPruningPoints returns a new MsgPruningPoints.
NewMsgPruningPointUTXOSetChunk returns a new MsgPruningPointUTXOSetChunk.
NewMsgReady returns a new kaspa Ready message that conforms to the Message interface.
NewMsgReject returns a new kaspa Reject message that conforms to the Message interface.
NewMsgRequestAddresses returns a new kaspa RequestAddresses message that conforms to the Message interface.
NewMsgRequestAnticone returns a new kaspa RequestPastDiff message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.
NewMsgRequestBlockLocator returns a new RequestBlockLocator message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.
NewMsgRequestIBDBlocks returns a new MsgRequestIBDBlocks.
NewMsgRequestNextHeaders returns a new kaspa RequestNextHeaders message that conforms to the Message interface.
NewMsgRequestNextPruningPointAndItsAnticoneBlocks returns a new kaspa RequestNextPruningPointAndItsAnticoneBlocks message that conforms to the Message interface.
NewMsgRequestNextPruningPointUTXOSetChunk returns a new MsgRequestNextPruningPointUTXOSetChunk.
NewMsgRequestPruningPointAndItsAnticone returns a new MsgRequestPruningPointAndItsAnticone.
NewMsgRequestPruningPointProof returns a new MsgRequestPruningPointProof.
NewMsgRequestPruningPointUTXOSet returns a new MsgRequestPruningPointUTXOSet.
NewMsgRequestRelayBlocks returns a new kaspa RequestRelayBlocks message that conforms to the Message interface.
NewMsgRequestTransactions returns a new kaspa RequestTransactions message that conforms to the Message interface.
NewMsgRequstHeaders returns a new kaspa RequestHeaders message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.
NewMsgTransactionNotFound returns a new kaspa transactionsnotfound message that conforms to the Message interface.
NewMsgTrustedData returns a new MsgTrustedData.
NewMsgUnexpectedPruningPoint returns a new kaspa UnexpectedPruningPoint message.
NewMsgVerAck returns a new kaspa verack message that conforms to the Message interface.
NewMsgVersion returns a new kaspa version message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.
NewNativeMsgTx returns a new tx message in the native subnetwork.
NewNativeMsgTxWithLocktime returns a new tx message in the native subnetwork with a locktime.
NewNetAddress returns a new NetAddress using the provided TCP address and supported services with defaults for the remaining fields.
NewNetAddressIPPort returns a new NetAddress using the provided IP, port, and supported services with defaults for the remaining fields.
NewNetAddressTimestamp returns a new NetAddress using the provided timestamp, IP, port, and supported services.
NewNewBlockTemplateNotificationMessage returns an instance of the message.
NewNotifyBlockAddedRequestMessage returns a instance of the message.
NewNotifyBlockAddedResponseMessage returns a instance of the message.
NewNotifyFinalityConflictsRequestMessage returns a instance of the message.
NewNotifyFinalityConflictsResponseMessage returns a instance of the message.
NewNotifyNewBlockTemplateRequestMessage returns an instance of the message.
NewNotifyNewBlockTemplateResponseMessage returns an instance of the message.
NewNotifyPruningPointUTXOSetOverrideRequestMessage returns a instance of the message.
NewNotifyPruningPointUTXOSetOverrideResponseMessage returns a instance of the message.
NewNotifyUTXOsChangedRequestMessage returns a instance of the message.
NewNotifyUTXOsChangedResponseMessage returns a instance of the message.
NewNotifyVirtualDaaScoreChangedRequestMessage returns a instance of the message.
NewNotifyVirtualDaaScoreChangedResponseMessage returns a instance of the message.
NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage returns a instance of the message.
NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage returns a instance of the message.
NewNotifyVirtualSelectedParentChainChangedRequestMessage returns an instance of the message.
NewNotifyVirtualSelectedParentChainChangedResponseMessage returns a instance of the message.
NewOutpoint returns a new kaspa transaction outpoint point with the provided hash and index.
NewPruningPointUTXOSetOverrideNotificationMessage returns a instance of the message.
NewRegistryMsgTx creates a new MsgTx that registers a new subnetwork.
NewResolveFinalityConflictRequestMessage returns a instance of the message.
NewResolveFinalityConflictResponseMessage returns a instance of the message.
NewShutDownRequestMessage returns a instance of the message.
NewShutDownResponseMessage returns a instance of the message.
NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage returns a instance of the message.
NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage returns a instance of the message.
NewStopNotifyingUTXOsChangedRequestMessage returns a instance of the message.
NewStopNotifyingUTXOsChangedResponseMessage returns a instance of the message.
NewSubmitBlockRequestMessage returns a instance of the message.
NewSubmitBlockResponseMessage returns an instance of the message.
NewSubmitTransactionRequestMessage returns a instance of the message.
NewSubmitTransactionResponseMessage returns a instance of the message.
NewSubnetworkMsgTx returns a new tx message in the specified subnetwork with specified gas and payload.
NewTxIn returns a new kaspa transaction input with the provided previous outpoint point and signature script with a default sequence of MaxTxInSequenceNum.
NewTxOut returns a new kaspa transaction output with the provided transaction value and public key script.
NewUnbanRequestMessage returns an instance of the message.
NewUnbanResponseMessage returns a instance of the message.
NewUTXOsChangedNotificationMessage returns a instance of the message.
NewVirtualDaaScoreChangedNotificationMessage returns a instance of the message.
NewVirtualSelectedParentBlueScoreChangedNotificationMessage returns a instance of the message.
NewVirtualSelectedParentChainChangedNotificationMessage returns a instance of the message.
OutpointAndUTXOEntryPairsToDomainOutpointAndUTXOEntryPairs converts OutpointAndUTXOEntryPairs to domain OutpointAndUTXOEntryPairs.
RPCBlockToDomainBlock converts `block` into a DomainBlock.
RPCErrorf formats according to a format specifier and returns the string as an RPCError.
RPCOutpointToDomainOutpoint converts RPCOutpoint to DomainOutpoint.
RPCTransactionToDomainTransaction converts RPCTransactions to DomainTransactions.
RPCUTXOEntryToUTXOEntry converts RPCUTXOEntry to UTXOEntry.
TrustedDataDataDAABlockV4ToTrustedDataDataDAAHeader converts *TrustedDataDAAHeader to *externalapi.TrustedDataDataDAAHeader.
ValidateUserAgent checks userAgent length against MaxUserAgentLen.

# Constants

BaseBlockHeaderPayload is the base number of bytes a block header can be, not including the list of parent block headers.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
rpc.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
protocol.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
Commands used in kaspa message headers which describe the type of message.
DefaultServices describes the default services that are supported by the server.
Devnet represents the development test network.
Mainnet represents the main kaspa network.
MaxAddressesPerMsg is the maximum number of addresses that can be in a single kaspa Addresses message (MsgAddresses).
MaxBlockHeaderPayload is the maximum number of bytes a block header can be.
MaxBlockLocatorsPerMsg is the maximum number of block locator hashes allowed per message.
MaxInvPerMsg is the maximum number of inventory vectors that can be in any type of kaspa inv message.
MaxInvPerRequestTransactionsMsg is the maximum number of hashes that can be in a single CmdInvTransaction message.
MaxInvPerTxInvMsg is the maximum number of hashes that can be in a single CmdInvTransaction message.
32MB.
MaxNumParentBlocks is the maximum number of parent blocks a block can reference.
MaxPrevOutIndex is the maximum index the index field of a previous outpoint can be.
MaxRequestRelayBlocksHashes is the maximum number of hashes that can be in a single RequestRelayBlocks message.
MaxUserAgentLen is the maximum allowed length for the user agent field in a version message (MsgVersion).
MinTxOutPayload is the minimum payload size for a transaction output.
RejectReason constants Not using iota, since in the .proto file those are hardcoded.
RejectReason constants Not using iota, since in the .proto file those are hardcoded.
RejectReason constants Not using iota, since in the .proto file those are hardcoded.
SFNodeBit5 is a flag used to indicate a peer supports a service defined by bit 5.
SFNodeBloom is a flag used to indicate a peer supports bloom filtering.
SFNodeCF is a flag used to indicate a peer supports committed filters (CFs).
SFNodeGetUTXO is a flag used to indicate a peer supports the getutxos and utxos commands (BIP0064).
SFNodeNetwork is a flag used to indicate a peer is a full node.
SFNodeXthin is a flag used to indicate a peer supports xthin blocks.
Simnet represents the simulation test network.
Testnet represents the test network.

# Variables

DefaultUserAgent for appmessage in the stack.
ProtocolMessageCommandToString maps all MessageCommands to their string representation.
RPCMessageCommandToString maps all MessageCommands to their string representation.

# Structs

AcceptedTransactionIDs is a part of the GetVirtualSelectedParentChainFromBlockResponseMessage and VirtualSelectedParentChainChangedNotificationMessage appmessages.
AddPeerRequestMessage is an appmessage corresponding to its respective RPC message.
AddPeerResponseMessage is an appmessage corresponding to its respective RPC message.
BalancesByAddressesEntry represents the balance of some address.
BanRequestMessage is an appmessage corresponding to its respective RPC message.
BanResponseMessage is an appmessage corresponding to its respective RPC message.
BlockAddedNotificationMessage is an appmessage corresponding to its respective RPC message.
BlockGHOSTDAGData is an appmessage representation of externalapi.BlockGHOSTDAGData.
BlockGHOSTDAGDataHashPair is an appmessage representation of externalapi.BlockGHOSTDAGDataHashPair.
BlockHeadersMessage represents a kaspa BlockHeaders message.
BluesAnticoneSizes is an appmessage representation of the BluesAnticoneSizes part of GHOSTDAG data.
EstimateNetworkHashesPerSecondRequestMessage is an appmessage corresponding to its respective RPC message.
EstimateNetworkHashesPerSecondResponseMessage is an appmessage corresponding to its respective RPC message.
FinalityConflictNotificationMessage is an appmessage corresponding to its respective RPC message.
FinalityConflictResolvedNotificationMessage is an appmessage corresponding to its respective RPC message.
GetBalanceByAddressRequestMessage is an appmessage corresponding to its respective RPC message.
GetBalanceByAddressResponseMessage is an appmessage corresponding to its respective RPC message.
GetBalancesByAddressesRequestMessage is an appmessage corresponding to its respective RPC message.
GetBalancesByAddressesResponseMessage is an appmessage corresponding to its respective RPC message.
GetBlockCountRequestMessage is an appmessage corresponding to its respective RPC message.
GetBlockCountResponseMessage is an appmessage corresponding to its respective RPC message.
GetBlockDAGInfoRequestMessage is an appmessage corresponding to its respective RPC message.
GetBlockDAGInfoResponseMessage is an appmessage corresponding to its respective RPC message.
GetBlockRequestMessage is an appmessage corresponding to its respective RPC message.
GetBlockResponseMessage is an appmessage corresponding to its respective RPC message.
GetBlocksRequestMessage is an appmessage corresponding to its respective RPC message.
GetBlocksResponseMessage is an appmessage corresponding to its respective RPC message.
GetBlockTemplateRequestMessage is an appmessage corresponding to its respective RPC message.
GetBlockTemplateResponseMessage is an appmessage corresponding to its respective RPC message.
GetCoinSupplyRequestMessage is an appmessage corresponding to its respective RPC message.
GetCoinSupplyResponseMessage is an appmessage corresponding to its respective RPC message.
GetConnectedPeerInfoMessage holds information about a connected peer.
GetConnectedPeerInfoRequestMessage is an appmessage corresponding to its respective RPC message.
GetConnectedPeerInfoResponseMessage is an appmessage corresponding to its respective RPC message.
GetCurrentNetworkRequestMessage is an appmessage corresponding to its respective RPC message.
GetCurrentNetworkResponseMessage is an appmessage corresponding to its respective RPC message.
GetHeadersRequestMessage is an appmessage corresponding to its respective RPC message.
GetHeadersResponseMessage is an appmessage corresponding to its respective RPC message.
GetInfoRequestMessage is an appmessage corresponding to its respective RPC message.
GetInfoResponseMessage is an appmessage corresponding to its respective RPC message.
GetMempoolEntriesByAddressesRequestMessage is an appmessage corresponding to its respective RPC message.
GetMempoolEntriesByAddressesResponseMessage is an appmessage corresponding to its respective RPC message.
GetMempoolEntriesRequestMessage is an appmessage corresponding to its respective RPC message.
GetMempoolEntriesResponseMessage is an appmessage corresponding to its respective RPC message.
GetMempoolEntryRequestMessage is an appmessage corresponding to its respective RPC message.
GetMempoolEntryResponseMessage is an appmessage corresponding to its respective RPC message.
GetPeerAddressesKnownAddressMessage is an appmessage corresponding to its respective RPC message.
GetPeerAddressesRequestMessage is an appmessage corresponding to its respective RPC message.
GetPeerAddressesResponseMessage is an appmessage corresponding to its respective RPC message.
GetSelectedTipHashRequestMessage is an appmessage corresponding to its respective RPC message.
GetSelectedTipHashResponseMessage is an appmessage corresponding to its respective RPC message.
GetSubnetworkRequestMessage is an appmessage corresponding to its respective RPC message.
GetSubnetworkResponseMessage is an appmessage corresponding to its respective RPC message.
GetUTXOsByAddressesRequestMessage is an appmessage corresponding to its respective RPC message.
GetUTXOsByAddressesResponseMessage is an appmessage corresponding to its respective RPC message.
GetVirtualSelectedParentBlueScoreRequestMessage is an appmessage corresponding to its respective RPC message.
GetVirtualSelectedParentBlueScoreResponseMessage is an appmessage corresponding to its respective RPC message.
GetVirtualSelectedParentChainFromBlockRequestMessage is an appmessage corresponding to its respective RPC message.
GetVirtualSelectedParentChainFromBlockResponseMessage is an appmessage corresponding to its respective RPC message.
MempoolEntry represents a transaction in the mempool.
MempoolEntryByAddress represents MempoolEntries associated with some address.
MessageError describes an issue with a message.
MsgAddresses implements the Message interface and represents a kaspa Addresses message.
MsgBlock implements the Message interface and represents a kaspa block message.
MsgBlockHeader defines information about a block and is used in the kaspa block (MsgBlock) and headers (MsgHeader) messages.
MsgBlockLocator implements the Message interface and represents a kaspa locator message.
MsgBlockWithTrustedData represents a kaspa BlockWithTrustedData message.
MsgBlockWithTrustedDataV4 represents a kaspa BlockWithTrustedDataV4 message.
MsgDoneBlocksWithTrustedData implements the Message interface and represents a kaspa DoneBlocksWithTrustedData message This message has no payload.
MsgDoneHeaders implements the Message interface and represents a kaspa DoneHeaders message.
MsgDonePruningPointUTXOSetChunks represents a kaspa DonePruningPointUTXOSetChunks message.
MsgIBDBlock implements the Message interface and represents a kaspa ibdblock message.
MsgIBDBlockLocator represents a kaspa ibdBlockLocator message.
MsgIBDBlockLocatorHighestHash represents a kaspa BlockLocatorHighestHash message.
MsgIBDBlockLocatorHighestHashNotFound represents a kaspa BlockLocatorHighestHashNotFound message.
MsgIBDChainBlockLocator implements the Message interface and represents a kaspa locator message.
MsgInvRelayBlock implements the Message interface and represents a kaspa block inventory message.
MsgInvTransaction implements the Message interface and represents a kaspa TxInv message.
MsgPing implements the Message interface and represents a kaspa ping message.
MsgPong implements the Message interface and represents a kaspa pong message which is used primarily to confirm that a connection is still valid in response to a kaspa ping message (MsgPing).
MsgPruningPointProof represents a kaspa PruningPointProof message.
MsgPruningPoints represents a kaspa PruningPoints message.
MsgPruningPointUTXOSetChunk represents a kaspa PruningPointUTXOSetChunk message.
MsgReady implements the Message interface and represents a kaspa Ready message.
MsgReject implements the Message interface and represents a kaspa Reject message.
MsgRequestAddresses implements the Message interface and represents a kaspa RequestAddresses message.
MsgRequestAnticone implements the Message interface and represents a kaspa RequestHeaders message.
MsgRequestBlockLocator implements the Message interface and represents a kaspa RequestBlockLocator message.
MsgRequestHeaders implements the Message interface and represents a kaspa RequestHeaders message.
MsgRequestIBDBlocks implements the Message interface and represents a kaspa RequestIBDBlocks message.
MsgRequestIBDChainBlockLocator implements the Message interface and represents a kaspa IBDRequestChainBlockLocator message.
MsgRequestNextHeaders implements the Message interface and represents a kaspa RequestNextHeaders message.
MsgRequestNextPruningPointAndItsAnticoneBlocks implements the Message interface and represents a kaspa RequestNextPruningPointAndItsAnticoneBlocks message.
MsgRequestNextPruningPointUTXOSetChunk represents a kaspa RequestNextPruningPointUTXOSetChunk message.
MsgRequestPruningPointAndItsAnticone represents a kaspa RequestPruningPointAndItsAnticone message.
MsgRequestPruningPointProof represents a kaspa RequestPruningPointProof message.
MsgRequestPruningPointUTXOSet represents a kaspa RequestPruningPointUTXOSet message.
MsgRequestRelayBlocks implements the Message interface and represents a kaspa RequestRelayBlocks message.
MsgRequestTransactions implements the Message interface and represents a kaspa RequestTransactions message.
MsgTransactionNotFound defines a kaspa TransactionNotFound message which is sent in response to a RequestTransactions message if any of the requested data in not available on the peer.
MsgTrustedData represents a kaspa TrustedData message.
MsgTx implements the Message interface and represents a kaspa tx message.
MsgUnexpectedPruningPoint represents a kaspa UnexpectedPruningPoint message.
MsgVerAck defines a kaspa verack message which is used for a peer to acknowledge a version message (MsgVersion) after it has used the information to negotiate parameters.
MsgVersion implements the Message interface and represents a kaspa version message.
NetAddress defines information about a peer on the network including the time it was last seen, the services it supports, its IP address, and port.
NewBlockTemplateNotificationMessage is an appmessage corresponding to its respective RPC message.
NotifyBlockAddedRequestMessage is an appmessage corresponding to its respective RPC message.
NotifyBlockAddedResponseMessage is an appmessage corresponding to its respective RPC message.
NotifyFinalityConflictsRequestMessage is an appmessage corresponding to its respective RPC message.
NotifyFinalityConflictsResponseMessage is an appmessage corresponding to its respective RPC message.
NotifyNewBlockTemplateRequestMessage is an appmessage corresponding to its respective RPC message.
NotifyNewBlockTemplateResponseMessage is an appmessage corresponding to its respective RPC message.
NotifyPruningPointUTXOSetOverrideRequestMessage is an appmessage corresponding to its respective RPC message.
NotifyPruningPointUTXOSetOverrideResponseMessage is an appmessage corresponding to its respective RPC message.
NotifyUTXOsChangedRequestMessage is an appmessage corresponding to its respective RPC message.
NotifyUTXOsChangedResponseMessage is an appmessage corresponding to its respective RPC message.
NotifyVirtualDaaScoreChangedRequestMessage is an appmessage corresponding to its respective RPC message.
NotifyVirtualDaaScoreChangedResponseMessage is an appmessage corresponding to its respective RPC message.
NotifyVirtualSelectedParentBlueScoreChangedRequestMessage is an appmessage corresponding to its respective RPC message.
NotifyVirtualSelectedParentBlueScoreChangedResponseMessage is an appmessage corresponding to its respective RPC message.
NotifyVirtualSelectedParentChainChangedRequestMessage is an appmessage corresponding to its respective RPC message.
NotifyVirtualSelectedParentChainChangedResponseMessage is an appmessage corresponding to its respective RPC message.
Outpoint defines a kaspa data type that is used to track previous transaction outputs.
OutpointAndUTXOEntryPair is an outpoint along with its respective UTXO entry.
PruningPointUTXOSetOverrideNotificationMessage is an appmessage corresponding to its respective RPC message.
ResolveFinalityConflictRequestMessage is an appmessage corresponding to its respective RPC message.
ResolveFinalityConflictResponseMessage is an appmessage corresponding to its respective RPC message.
RPCBlock is a pugdagd block representation meant to be used over RPC.
RPCBlockHeader is a pugdagd block header representation meant to be used over RPC.
RPCBlockLevelParents holds parent hashes for one block level.
RPCBlockVerboseData holds verbose data about a block.
RPCError represents an error arriving from the RPC.
RPCOutpoint is a pugdagd outpoint representation meant to be used over RPC.
RPCScriptPublicKey is a pugdagd ScriptPublicKey representation.
RPCTransaction is a pugdagd transaction representation meant to be used over RPC.
RPCTransactionInput is a pugdagd transaction input representation meant to be used over RPC.
RPCTransactionInputVerboseData holds data about a transaction input.
RPCTransactionOutput is a pugdagd transaction output representation meant to be used over RPC.
RPCTransactionOutputVerboseData holds data about a transaction output.
RPCTransactionVerboseData holds verbose data about a transaction.
RPCUTXOEntry is a pugdagd utxo entry representation meant to be used over RPC.
ShutDownRequestMessage is an appmessage corresponding to its respective RPC message.
ShutDownResponseMessage is an appmessage corresponding to its respective RPC message.
StopNotifyingPruningPointUTXOSetOverrideRequestMessage is an appmessage corresponding to its respective RPC message.
StopNotifyingPruningPointUTXOSetOverrideResponseMessage is an appmessage corresponding to its respective RPC message.
StopNotifyingUTXOsChangedRequestMessage is an appmessage corresponding to its respective RPC message.
StopNotifyingUTXOsChangedResponseMessage is an appmessage corresponding to its respective RPC message.
SubmitBlockRequestMessage is an appmessage corresponding to its respective RPC message.
SubmitBlockResponseMessage is an appmessage corresponding to its respective RPC message.
SubmitTransactionRequestMessage is an appmessage corresponding to its respective RPC message.
SubmitTransactionResponseMessage is an appmessage corresponding to its respective RPC message.
TrustedDataDAAHeader is an appmessage representation of externalapi.TrustedDataDataDAAHeader.
TrustedDataDataDAABlock is an appmessage representation of externalapi.TrustedDataDataDAABlock.
TxIn defines a kaspa transaction input.
TxLoc holds locator data for the offset and length of where a transaction is located within a MsgBlock data buffer.
TxOut defines a kaspa transaction output.
UnbanRequestMessage is an appmessage corresponding to its respective RPC message.
UnbanResponseMessage is an appmessage corresponding to its respective RPC message.
UTXOEntry houses details about an individual transaction output in a UTXO.
UTXOsByAddressesEntry represents a UTXO of some address.
UTXOsChangedNotificationMessage is an appmessage corresponding to its respective RPC message.
VirtualDaaScoreChangedNotificationMessage is an appmessage corresponding to its respective RPC message.
VirtualSelectedParentBlueScoreChangedNotificationMessage is an appmessage corresponding to its respective RPC message.
VirtualSelectedParentChainChangedNotificationMessage is an appmessage corresponding to its respective RPC message.

# Interfaces

Message is an interface that describes a kaspa message.

# Type aliases

KaspaNet represents which kaspa network a message belongs to.
MessageCommand is a number in the header of a message that represents its type.
RejectReason describes the reason why a block sent by SubmitBlock was rejected.
ServiceFlag identifies services supported by a kaspa peer.