appmessage

package
v0.0.0-...-decf009 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2023 License: ISC Imports: 19 Imported by: 0

README

wire

ISC License GoDoc

Package wire implements the kash wire protocol.

Kash Message Overview

The kash protocol consists of exchanging messages between peers. Each message is preceded by a header which identifies information about it such as which kash 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 kash 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
	}

Documentation

Overview

Package appmessage implements the kash appmessage protocol.

At a high level, this package provides support for marshalling and unmarshalling supported kash messages to and from the appmessage. This package does not deal with the specifics of message handling such as what to do when a message is received. This provides the caller with a high level of flexibility.

Kash Message Overview

The kash protocol consists of exchanging messages between peers. Each message is preceded by a header which identifies information about it such as which kash 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 of the currently supported kaspa messages are provided. For these supported messages, all of the details of marshalling and unmarshalling to and from the appmessage using kaspa encoding are handled so the caller doesn't have to concern themselves with the specifics.

Message Interaction

The following provides a quick summary of how the kaspa messages are intended to interact with one another. As stated above, these interactions are not directly handled by this package.

The initial handshake consists of two peers sending each other a version message (MsgVersion) followed by responding with a verack message (MsgVerAck). Both peers use the information in the version message (MsgVersion) to negotiate things such as protocol version and supported services with each other. Once the initial handshake is complete, the following chart indicates message interactions in no particular order.

Peer A Sends                            Peer B Responds
----------------------------------------------------------------------------
getaddr message (MsgRequestAddresses)       addr message (MsgAddresses)
getblockinvs message (MsgGetBlockInvs)  inv message (MsgInv)
inv message (MsgInv)                    getdata message (MsgGetData)
getdata message (MsgGetData)            block message (MsgBlock) -or-
                                        tx message (MsgTx) -or-
                                        notfound message (MsgNotFound)
ping message (MsgPing)                  pong message (MsgPong)

Common Parameters

There are several common parameters that arise when using this package to read and write kaspa messages. The following sections provide a quick overview of these parameters so the next sections can build on them.

Protocol Version

The protocol version should be negotiated with the remote peer at a higher level than this package via the version (MsgVersion) message exchange, however, this package provides the appmessage.ProtocolVersion constant which indicates the latest protocol version this package supports and is typically the value to use for all outbound connections before a potentially lower protocol version is negotiated.

Kash Network

The kaspa network is a magic number which is used to identify the start of a message and which kaspa network the message applies to. This package provides the following constants:

appmessage.Mainnet
appmessage.Testnet (Test network)
appmessage.Simnet  (Simulation test network)
appmessage.Devnet  (Development network)

Determining Message Type

As discussed in the kaspa message overview section, this package reads and writes kaspa messages using a generic interface named Message. In order to determine the actual concrete type of the message, use a type switch or type assertion. An example of a type switch follows:

// Assumes msg is already a valid concrete message such as one created
// via NewMsgVersion or read via ReadMessage.
switch msg := msg.(type) {
case *appmessage.MsgVersion:
	// The message is a pointer to a MsgVersion struct.
	fmt.Printf("Protocol version: %d", msg.ProtocolVersion)
case *appmessage.MsgBlock:
	// The message is a pointer to a MsgBlock struct.
	fmt.Printf("Number of tx in block: %d", msg.Header.TxnCount)
}

Reading Messages

In order to unmarshall kaspa messages from the appmessage, 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:

// 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 := appmessage.ReadMessage(conn, pver, kaspaNet)
if err != nil {
	// Log and handle the error
}

Writing Messages

In order to marshall kaspa messages to the appmessage, 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:

// Create a new getaddr kaspa message.
msg := appmessage.NewMsgRequestAddresses()

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

Errors

Errors returned by this package are either the raw errors provided by underlying calls to read/write from streams such as io.EOF, io.ErrUnexpectedEOF, and io.ErrShortWrite, or of type appmessage.MessageError. This allows the caller to differentiate between general IO errors and malformed messages through type assertions.

Index

Constants

View Source
const (
	// MaxPrevOutIndex is the maximum index the index field of a previous
	// outpoint can be.
	MaxPrevOutIndex uint32 = 0xffffffff

	// MinTxOutPayload is the minimum payload size for a transaction output.
	// Value 8 bytes + version 2 bytes + Varint for ScriptPublicKey length 1 byte.
	MinTxOutPayload = 11
)
View Source
const BaseBlockHeaderPayload = 25 + 3*(externalapi.DomainHashSize)

BaseBlockHeaderPayload is the base number of bytes a block header can be, not including the list of parent block headers. Version 4 bytes + Timestamp 8 bytes + Bits 4 bytes + Nonce 8 bytes + + NumParentBlocks 1 byte + HashMerkleRoot hash + + AcceptedIDMerkleRoot hash + UTXOCommitment hash. To get total size of block header len(ParentHashes) * externalapi.DomainHashSize should be added to this value

View Source
const (
	// DefaultServices describes the default services that are supported by
	// the server.
	DefaultServices = SFNodeNetwork | SFNodeBloom | SFNodeCF
)
View Source
const MaxAddressesPerMsg = 1000

MaxAddressesPerMsg is the maximum number of addresses that can be in a single kash Addresses message (MsgAddresses).

MaxBlockHeaderPayload is the maximum number of bytes a block header can be. BaseBlockHeaderPayload + up to MaxNumParentBlocks hashes of parent blocks

View Source
const MaxBlockLocatorsPerMsg = 500

MaxBlockLocatorsPerMsg is the maximum number of block locator hashes allowed per message.

View Source
const MaxInvPerMsg = 1 << 17

MaxInvPerMsg is the maximum number of inventory vectors that can be in any type of kash inv message.

View Source
const MaxInvPerRequestTransactionsMsg = MaxInvPerMsg

MaxInvPerRequestTransactionsMsg is the maximum number of hashes that can be in a single CmdInvTransaction message.

View Source
const MaxInvPerTxInvMsg = MaxInvPerMsg

MaxInvPerTxInvMsg is the maximum number of hashes that can be in a single CmdInvTransaction message.

View Source
const MaxMessagePayload = 1024 * 1024 * 32 // 32MB

MaxMessagePayload is the maximum bytes a message can be regardless of other individual limits imposed by messages themselves.

View Source
const MaxNumParentBlocks = 255

MaxNumParentBlocks is the maximum number of parent blocks a block can reference. Currently set to 255 as the maximum number NumParentBlocks can be due to it being a byte

View Source
const MaxRequestRelayBlocksHashes = MaxInvPerMsg

MaxRequestRelayBlocksHashes is the maximum number of hashes that can be in a single RequestRelayBlocks message.

View Source
const MaxUserAgentLen = 256

MaxUserAgentLen is the maximum allowed length for the user agent field in a version message (MsgVersion).

Variables

View Source
var DefaultUserAgent = fmt.Sprintf("/kashd:%s/", version.Version())

DefaultUserAgent for appmessage in the stack

View Source
var ProtocolMessageCommandToString = map[MessageCommand]string{
	CmdVersion:                             "Version",
	CmdVerAck:                              "VerAck",
	CmdRequestAddresses:                    "RequestAddresses",
	CmdAddresses:                           "Addresses",
	CmdRequestHeaders:                      "CmdRequestHeaders",
	CmdBlock:                               "Block",
	CmdTx:                                  "Tx",
	CmdPing:                                "Ping",
	CmdPong:                                "Pong",
	CmdRequestBlockLocator:                 "RequestBlockLocator",
	CmdBlockLocator:                        "BlockLocator",
	CmdInvRelayBlock:                       "InvRelayBlock",
	CmdRequestRelayBlocks:                  "RequestRelayBlocks",
	CmdInvTransaction:                      "InvTransaction",
	CmdRequestTransactions:                 "RequestTransactions",
	CmdDoneHeaders:                         "DoneHeaders",
	CmdTransactionNotFound:                 "TransactionNotFound",
	CmdReject:                              "Reject",
	CmdRequestNextHeaders:                  "RequestNextHeaders",
	CmdRequestPruningPointUTXOSet:          "RequestPruningPointUTXOSet",
	CmdPruningPointUTXOSetChunk:            "PruningPointUTXOSetChunk",
	CmdUnexpectedPruningPoint:              "UnexpectedPruningPoint",
	CmdIBDBlockLocator:                     "IBDBlockLocator",
	CmdIBDBlockLocatorHighestHash:          "IBDBlockLocatorHighestHash",
	CmdIBDBlockLocatorHighestHashNotFound:  "IBDBlockLocatorHighestHashNotFound",
	CmdBlockHeaders:                        "BlockHeaders",
	CmdRequestNextPruningPointUTXOSetChunk: "RequestNextPruningPointUTXOSetChunk",
	CmdDonePruningPointUTXOSetChunks:       "DonePruningPointUTXOSetChunks",
	CmdBlockWithTrustedData:                "BlockWithTrustedData",
	CmdDoneBlocksWithTrustedData:           "DoneBlocksWithTrustedData",
	CmdRequestPruningPointAndItsAnticone:   "RequestPruningPointAndItsAnticoneHeaders",
	CmdIBDBlock:                            "IBDBlock",
	CmdRequestIBDBlocks:                    "RequestIBDBlocks",
	CmdPruningPoints:                       "PruningPoints",
	CmdRequestPruningPointProof:            "RequestPruningPointProof",
	CmdPruningPointProof:                   "PruningPointProof",
	CmdReady:                               "Ready",
	CmdTrustedData:                         "TrustedData",
	CmdBlockWithTrustedDataV4:              "BlockWithTrustedDataV4",
	CmdRequestNextPruningPointAndItsAnticoneBlocks: "RequestNextPruningPointAndItsAnticoneBlocks",
	CmdRequestIBDChainBlockLocator:                 "RequestIBDChainBlockLocator",
	CmdIBDChainBlockLocator:                        "IBDChainBlockLocator",
	CmdRequestAnticone:                             "RequestAnticone",
}

ProtocolMessageCommandToString maps all MessageCommands to their string representation

View Source
var RPCMessageCommandToString = map[MessageCommand]string{
	CmdGetCurrentNetworkRequestMessage:                            "GetCurrentNetworkRequest",
	CmdGetCurrentNetworkResponseMessage:                           "GetCurrentNetworkResponse",
	CmdSubmitBlockRequestMessage:                                  "SubmitBlockRequest",
	CmdSubmitBlockResponseMessage:                                 "SubmitBlockResponse",
	CmdGetBlockTemplateRequestMessage:                             "GetBlockTemplateRequest",
	CmdGetBlockTemplateResponseMessage:                            "GetBlockTemplateResponse",
	CmdGetBlockTemplateTransactionMessage:                         "CmdGetBlockTemplateTransaction",
	CmdNotifyBlockAddedRequestMessage:                             "NotifyBlockAddedRequest",
	CmdNotifyBlockAddedResponseMessage:                            "NotifyBlockAddedResponse",
	CmdBlockAddedNotificationMessage:                              "BlockAddedNotification",
	CmdGetPeerAddressesRequestMessage:                             "GetPeerAddressesRequest",
	CmdGetPeerAddressesResponseMessage:                            "GetPeerAddressesResponse",
	CmdGetSelectedTipHashRequestMessage:                           "GetSelectedTipHashRequest",
	CmdGetSelectedTipHashResponseMessage:                          "GetSelectedTipHashResponse",
	CmdGetMempoolEntryRequestMessage:                              "GetMempoolEntryRequest",
	CmdGetMempoolEntryResponseMessage:                             "GetMempoolEntryResponse",
	CmdGetConnectedPeerInfoRequestMessage:                         "GetConnectedPeerInfoRequest",
	CmdGetConnectedPeerInfoResponseMessage:                        "GetConnectedPeerInfoResponse",
	CmdAddPeerRequestMessage:                                      "AddPeerRequest",
	CmdAddPeerResponseMessage:                                     "AddPeerResponse",
	CmdSubmitTransactionRequestMessage:                            "SubmitTransactionRequest",
	CmdSubmitTransactionResponseMessage:                           "SubmitTransactionResponse",
	CmdNotifyVirtualSelectedParentChainChangedRequestMessage:      "NotifyVirtualSelectedParentChainChangedRequest",
	CmdNotifyVirtualSelectedParentChainChangedResponseMessage:     "NotifyVirtualSelectedParentChainChangedResponse",
	CmdVirtualSelectedParentChainChangedNotificationMessage:       "VirtualSelectedParentChainChangedNotification",
	CmdGetBlockRequestMessage:                                     "GetBlockRequest",
	CmdGetBlockResponseMessage:                                    "GetBlockResponse",
	CmdGetSubnetworkRequestMessage:                                "GetSubnetworkRequest",
	CmdGetSubnetworkResponseMessage:                               "GetSubnetworkResponse",
	CmdGetVirtualSelectedParentChainFromBlockRequestMessage:       "GetVirtualSelectedParentChainFromBlockRequest",
	CmdGetVirtualSelectedParentChainFromBlockResponseMessage:      "GetVirtualSelectedParentChainFromBlockResponse",
	CmdGetBlocksRequestMessage:                                    "GetBlocksRequest",
	CmdGetBlocksResponseMessage:                                   "GetBlocksResponse",
	CmdGetBlockCountRequestMessage:                                "GetBlockCountRequest",
	CmdGetBlockCountResponseMessage:                               "GetBlockCountResponse",
	CmdGetBlockDAGInfoRequestMessage:                              "GetBlockDAGInfoRequest",
	CmdGetBlockDAGInfoResponseMessage:                             "GetBlockDAGInfoResponse",
	CmdResolveFinalityConflictRequestMessage:                      "ResolveFinalityConflictRequest",
	CmdResolveFinalityConflictResponseMessage:                     "ResolveFinalityConflictResponse",
	CmdNotifyFinalityConflictsRequestMessage:                      "NotifyFinalityConflictsRequest",
	CmdNotifyFinalityConflictsResponseMessage:                     "NotifyFinalityConflictsResponse",
	CmdFinalityConflictNotificationMessage:                        "FinalityConflictNotification",
	CmdFinalityConflictResolvedNotificationMessage:                "FinalityConflictResolvedNotification",
	CmdGetMempoolEntriesRequestMessage:                            "GetMempoolEntriesRequest",
	CmdGetMempoolEntriesResponseMessage:                           "GetMempoolEntriesResponse",
	CmdGetHeadersRequestMessage:                                   "GetHeadersRequest",
	CmdGetHeadersResponseMessage:                                  "GetHeadersResponse",
	CmdNotifyUTXOsChangedRequestMessage:                           "NotifyUTXOsChangedRequest",
	CmdNotifyUTXOsChangedResponseMessage:                          "NotifyUTXOsChangedResponse",
	CmdUTXOsChangedNotificationMessage:                            "UTXOsChangedNotification",
	CmdStopNotifyingUTXOsChangedRequestMessage:                    "StopNotifyingUTXOsChangedRequest",
	CmdStopNotifyingUTXOsChangedResponseMessage:                   "StopNotifyingUTXOsChangedResponse",
	CmdGetUTXOsByAddressesRequestMessage:                          "GetUTXOsByAddressesRequest",
	CmdGetUTXOsByAddressesResponseMessage:                         "GetUTXOsByAddressesResponse",
	CmdGetBalanceByAddressRequestMessage:                          "GetBalanceByAddressRequest",
	CmdGetBalanceByAddressResponseMessage:                         "GetBalancesByAddressResponse",
	CmdGetVirtualSelectedParentBlueScoreRequestMessage:            "GetVirtualSelectedParentBlueScoreRequest",
	CmdGetVirtualSelectedParentBlueScoreResponseMessage:           "GetVirtualSelectedParentBlueScoreResponse",
	CmdNotifyVirtualSelectedParentBlueScoreChangedRequestMessage:  "NotifyVirtualSelectedParentBlueScoreChangedRequest",
	CmdNotifyVirtualSelectedParentBlueScoreChangedResponseMessage: "NotifyVirtualSelectedParentBlueScoreChangedResponse",
	CmdVirtualSelectedParentBlueScoreChangedNotificationMessage:   "VirtualSelectedParentBlueScoreChangedNotification",
	CmdBanRequestMessage:                                          "BanRequest",
	CmdBanResponseMessage:                                         "BanResponse",
	CmdUnbanRequestMessage:                                        "UnbanRequest",
	CmdUnbanResponseMessage:                                       "UnbanResponse",
	CmdGetInfoRequestMessage:                                      "GetInfoRequest",
	CmdGetInfoResponseMessage:                                     "GeInfoResponse",
	CmdNotifyPruningPointUTXOSetOverrideRequestMessage:            "NotifyPruningPointUTXOSetOverrideRequest",
	CmdNotifyPruningPointUTXOSetOverrideResponseMessage:           "NotifyPruningPointUTXOSetOverrideResponse",
	CmdPruningPointUTXOSetOverrideNotificationMessage:             "PruningPointUTXOSetOverrideNotification",
	CmdStopNotifyingPruningPointUTXOSetOverrideRequestMessage:     "StopNotifyingPruningPointUTXOSetOverrideRequest",
	CmdStopNotifyingPruningPointUTXOSetOverrideResponseMessage:    "StopNotifyingPruningPointUTXOSetOverrideResponse",
	CmdEstimateNetworkHashesPerSecondRequestMessage:               "EstimateNetworkHashesPerSecondRequest",
	CmdEstimateNetworkHashesPerSecondResponseMessage:              "EstimateNetworkHashesPerSecondResponse",
	CmdNotifyVirtualDaaScoreChangedRequestMessage:                 "NotifyVirtualDaaScoreChangedRequest",
	CmdNotifyVirtualDaaScoreChangedResponseMessage:                "NotifyVirtualDaaScoreChangedResponse",
	CmdVirtualDaaScoreChangedNotificationMessage:                  "VirtualDaaScoreChangedNotification",
	CmdGetBalancesByAddressesRequestMessage:                       "GetBalancesByAddressesRequest",
	CmdGetBalancesByAddressesResponseMessage:                      "GetBalancesByAddressesResponse",
	CmdNotifyNewBlockTemplateRequestMessage:                       "NotifyNewBlockTemplateRequest",
	CmdNotifyNewBlockTemplateResponseMessage:                      "NotifyNewBlockTemplateResponse",
	CmdNewBlockTemplateNotificationMessage:                        "NewBlockTemplateNotification",
	CmdGetMempoolEntriesByAddressesRequestMessage:                 "GetMempoolEntriesByAddressesRequest",
	CmdGetMempoolEntriesByAddressesResponseMessage:                "GetMempoolEntriesByAddressesResponse",
	CmdGetCoinSupplyRequestMessage:                                "GetCoinSupplyRequest",
	CmdGetCoinSupplyResponseMessage:                               "GetCoinSupplyResponse",
}

RPCMessageCommandToString maps all MessageCommands to their string representation

Functions

func BlockHeaderToDomainBlockHeader

func BlockHeaderToDomainBlockHeader(blockHeader *MsgBlockHeader) externalapi.BlockHeader

BlockHeaderToDomainBlockHeader converts a MsgBlockHeader to externalapi.BlockHeader

func BlockWithTrustedDataToDomainBlockWithTrustedData

func BlockWithTrustedDataToDomainBlockWithTrustedData(block *MsgBlockWithTrustedData) *externalapi.BlockWithTrustedData

BlockWithTrustedDataToDomainBlockWithTrustedData converts *MsgBlockWithTrustedData to *externalapi.BlockWithTrustedData

func GHOSTDAGHashPairToDomainGHOSTDAGHashPair

func GHOSTDAGHashPairToDomainGHOSTDAGHashPair(datum *BlockGHOSTDAGDataHashPair) *externalapi.BlockGHOSTDAGDataHashPair

GHOSTDAGHashPairToDomainGHOSTDAGHashPair converts *BlockGHOSTDAGDataHashPair to *externalapi.BlockGHOSTDAGDataHashPair

func MsgBlockToDomainBlock

func MsgBlockToDomainBlock(msgBlock *MsgBlock) *externalapi.DomainBlock

MsgBlockToDomainBlock converts a MsgBlock to externalapi.DomainBlock

func MsgPruningPointProofToDomainPruningPointProof

func MsgPruningPointProofToDomainPruningPointProof(pruningPointProofMessage *MsgPruningPointProof) *externalapi.PruningPointProof

MsgPruningPointProofToDomainPruningPointProof converts *MsgPruningPointProof to *externalapi.PruningPointProof

func MsgTxToDomainTransaction

func MsgTxToDomainTransaction(msgTx *MsgTx) *externalapi.DomainTransaction

MsgTxToDomainTransaction converts an MsgTx into externalapi.DomainTransaction

func OutpointAndUTXOEntryPairsToDomainOutpointAndUTXOEntryPairs

func OutpointAndUTXOEntryPairsToDomainOutpointAndUTXOEntryPairs(
	outpointAndUTXOEntryPairs []*OutpointAndUTXOEntryPair) []*externalapi.OutpointAndUTXOEntryPair

OutpointAndUTXOEntryPairsToDomainOutpointAndUTXOEntryPairs converts OutpointAndUTXOEntryPairs to domain OutpointAndUTXOEntryPairs

func RPCBlockToDomainBlock

func RPCBlockToDomainBlock(block *RPCBlock) (*externalapi.DomainBlock, error)

RPCBlockToDomainBlock converts `block` into a DomainBlock

func RPCOutpointToDomainOutpoint

func RPCOutpointToDomainOutpoint(outpoint *RPCOutpoint) (*externalapi.DomainOutpoint, error)

RPCOutpointToDomainOutpoint converts RPCOutpoint to DomainOutpoint

func RPCTransactionToDomainTransaction

func RPCTransactionToDomainTransaction(rpcTransaction *RPCTransaction) (*externalapi.DomainTransaction, error)

RPCTransactionToDomainTransaction converts RPCTransactions to DomainTransactions

func RPCUTXOEntryToUTXOEntry

func RPCUTXOEntryToUTXOEntry(entry *RPCUTXOEntry) (externalapi.UTXOEntry, error)

RPCUTXOEntryToUTXOEntry converts RPCUTXOEntry to UTXOEntry

func TrustedDataDataDAABlockV4ToTrustedDataDataDAAHeader

func TrustedDataDataDAABlockV4ToTrustedDataDataDAAHeader(daaBlock *TrustedDataDAAHeader) *externalapi.TrustedDataDataDAAHeader

TrustedDataDataDAABlockV4ToTrustedDataDataDAAHeader converts *TrustedDataDAAHeader to *externalapi.TrustedDataDataDAAHeader

func ValidateUserAgent

func ValidateUserAgent(userAgent string) error

ValidateUserAgent checks userAgent length against MaxUserAgentLen

Types

type AcceptedTransactionIDs

type AcceptedTransactionIDs struct {
	AcceptingBlockHash     string
	AcceptedTransactionIDs []string
}

AcceptedTransactionIDs is a part of the GetVirtualSelectedParentChainFromBlockResponseMessage and VirtualSelectedParentChainChangedNotificationMessage appmessages

type AddPeerRequestMessage

type AddPeerRequestMessage struct {
	Address     string
	IsPermanent bool
	// contains filtered or unexported fields
}

AddPeerRequestMessage is an appmessage corresponding to its respective RPC message

func NewAddPeerRequestMessage

func NewAddPeerRequestMessage(address string, isPermanent bool) *AddPeerRequestMessage

NewAddPeerRequestMessage returns a instance of the message

func (*AddPeerRequestMessage) Command

func (msg *AddPeerRequestMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*AddPeerRequestMessage) MessageNumber

func (b *AddPeerRequestMessage) MessageNumber() uint64

func (*AddPeerRequestMessage) ReceivedAt

func (b *AddPeerRequestMessage) ReceivedAt() time.Time

func (*AddPeerRequestMessage) SetMessageNumber

func (b *AddPeerRequestMessage) SetMessageNumber(messageNumber uint64)

func (*AddPeerRequestMessage) SetReceivedAt

func (b *AddPeerRequestMessage) SetReceivedAt(receivedAt time.Time)

type AddPeerResponseMessage

type AddPeerResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

AddPeerResponseMessage is an appmessage corresponding to its respective RPC message

func NewAddPeerResponseMessage

func NewAddPeerResponseMessage() *AddPeerResponseMessage

NewAddPeerResponseMessage returns a instance of the message

func (*AddPeerResponseMessage) Command

func (msg *AddPeerResponseMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*AddPeerResponseMessage) MessageNumber

func (b *AddPeerResponseMessage) MessageNumber() uint64

func (*AddPeerResponseMessage) ReceivedAt

func (b *AddPeerResponseMessage) ReceivedAt() time.Time

func (*AddPeerResponseMessage) SetMessageNumber

func (b *AddPeerResponseMessage) SetMessageNumber(messageNumber uint64)

func (*AddPeerResponseMessage) SetReceivedAt

func (b *AddPeerResponseMessage) SetReceivedAt(receivedAt time.Time)

type BalancesByAddressesEntry

type BalancesByAddressesEntry struct {
	Address     string
	KSHBalance  uint64
	KUSDBalance uint64
	KRVBalance  uint64
}

BalancesByAddressesEntry represents the balance of some address

type BanRequestMessage

type BanRequestMessage struct {
	IP string
	// contains filtered or unexported fields
}

BanRequestMessage is an appmessage corresponding to its respective RPC message

func NewBanRequestMessage

func NewBanRequestMessage(ip string) *BanRequestMessage

NewBanRequestMessage returns an instance of the message

func (*BanRequestMessage) Command

func (msg *BanRequestMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*BanRequestMessage) MessageNumber

func (b *BanRequestMessage) MessageNumber() uint64

func (*BanRequestMessage) ReceivedAt

func (b *BanRequestMessage) ReceivedAt() time.Time

func (*BanRequestMessage) SetMessageNumber

func (b *BanRequestMessage) SetMessageNumber(messageNumber uint64)

func (*BanRequestMessage) SetReceivedAt

func (b *BanRequestMessage) SetReceivedAt(receivedAt time.Time)

type BanResponseMessage

type BanResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

BanResponseMessage is an appmessage corresponding to its respective RPC message

func NewBanResponseMessage

func NewBanResponseMessage() *BanResponseMessage

NewBanResponseMessage returns a instance of the message

func (*BanResponseMessage) Command

func (msg *BanResponseMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*BanResponseMessage) MessageNumber

func (b *BanResponseMessage) MessageNumber() uint64

func (*BanResponseMessage) ReceivedAt

func (b *BanResponseMessage) ReceivedAt() time.Time

func (*BanResponseMessage) SetMessageNumber

func (b *BanResponseMessage) SetMessageNumber(messageNumber uint64)

func (*BanResponseMessage) SetReceivedAt

func (b *BanResponseMessage) SetReceivedAt(receivedAt time.Time)

type BlockAddedNotificationMessage

type BlockAddedNotificationMessage struct {
	Block *RPCBlock
	// contains filtered or unexported fields
}

BlockAddedNotificationMessage is an appmessage corresponding to its respective RPC message

func NewBlockAddedNotificationMessage

func NewBlockAddedNotificationMessage(block *RPCBlock) *BlockAddedNotificationMessage

NewBlockAddedNotificationMessage returns a instance of the message

func (*BlockAddedNotificationMessage) Command

Command returns the protocol command string for the message

func (*BlockAddedNotificationMessage) MessageNumber

func (b *BlockAddedNotificationMessage) MessageNumber() uint64

func (*BlockAddedNotificationMessage) ReceivedAt

func (b *BlockAddedNotificationMessage) ReceivedAt() time.Time

func (*BlockAddedNotificationMessage) SetMessageNumber

func (b *BlockAddedNotificationMessage) SetMessageNumber(messageNumber uint64)

func (*BlockAddedNotificationMessage) SetReceivedAt

func (b *BlockAddedNotificationMessage) SetReceivedAt(receivedAt time.Time)

type BlockGHOSTDAGData

type BlockGHOSTDAGData struct {
	BlueScore          uint64
	BlueWork           *big.Int
	SelectedParent     *externalapi.DomainHash
	MergeSetBlues      []*externalapi.DomainHash
	MergeSetReds       []*externalapi.DomainHash
	BluesAnticoneSizes []*BluesAnticoneSizes
}

BlockGHOSTDAGData is an appmessage representation of externalapi.BlockGHOSTDAGData

type BlockGHOSTDAGDataHashPair

type BlockGHOSTDAGDataHashPair struct {
	Hash         *externalapi.DomainHash
	GHOSTDAGData *BlockGHOSTDAGData
}

BlockGHOSTDAGDataHashPair is an appmessage representation of externalapi.BlockGHOSTDAGDataHashPair

type BlockHeadersMessage

type BlockHeadersMessage struct {
	BlockHeaders []*MsgBlockHeader
	// contains filtered or unexported fields
}

BlockHeadersMessage represents a kash BlockHeaders message

func NewBlockHeadersMessage

func NewBlockHeadersMessage(blockHeaders []*MsgBlockHeader) *BlockHeadersMessage

NewBlockHeadersMessage returns a new kash BlockHeaders message

func (*BlockHeadersMessage) Command

func (msg *BlockHeadersMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*BlockHeadersMessage) MessageNumber

func (b *BlockHeadersMessage) MessageNumber() uint64

func (*BlockHeadersMessage) ReceivedAt

func (b *BlockHeadersMessage) ReceivedAt() time.Time

func (*BlockHeadersMessage) SetMessageNumber

func (b *BlockHeadersMessage) SetMessageNumber(messageNumber uint64)

func (*BlockHeadersMessage) SetReceivedAt

func (b *BlockHeadersMessage) SetReceivedAt(receivedAt time.Time)

type BluesAnticoneSizes

type BluesAnticoneSizes struct {
	BlueHash     *externalapi.DomainHash
	AnticoneSize externalapi.KType
}

BluesAnticoneSizes is an appmessage representation of the BluesAnticoneSizes part of GHOSTDAG data.

type EstimateNetworkHashesPerSecondRequestMessage

type EstimateNetworkHashesPerSecondRequestMessage struct {
	StartHash  string
	WindowSize uint32
	// contains filtered or unexported fields
}

EstimateNetworkHashesPerSecondRequestMessage is an appmessage corresponding to its respective RPC message

func NewEstimateNetworkHashesPerSecondRequestMessage

func NewEstimateNetworkHashesPerSecondRequestMessage(startHash string, windowSize uint32) *EstimateNetworkHashesPerSecondRequestMessage

NewEstimateNetworkHashesPerSecondRequestMessage returns a instance of the message

func (*EstimateNetworkHashesPerSecondRequestMessage) Command

Command returns the protocol command string for the message

func (*EstimateNetworkHashesPerSecondRequestMessage) MessageNumber

func (b *EstimateNetworkHashesPerSecondRequestMessage) MessageNumber() uint64

func (*EstimateNetworkHashesPerSecondRequestMessage) ReceivedAt

func (b *EstimateNetworkHashesPerSecondRequestMessage) ReceivedAt() time.Time

func (*EstimateNetworkHashesPerSecondRequestMessage) SetMessageNumber

func (b *EstimateNetworkHashesPerSecondRequestMessage) SetMessageNumber(messageNumber uint64)

func (*EstimateNetworkHashesPerSecondRequestMessage) SetReceivedAt

func (b *EstimateNetworkHashesPerSecondRequestMessage) SetReceivedAt(receivedAt time.Time)

type EstimateNetworkHashesPerSecondResponseMessage

type EstimateNetworkHashesPerSecondResponseMessage struct {
	NetworkHashesPerSecond uint64

	Error *RPCError
	// contains filtered or unexported fields
}

EstimateNetworkHashesPerSecondResponseMessage is an appmessage corresponding to its respective RPC message

func NewEstimateNetworkHashesPerSecondResponseMessage

func NewEstimateNetworkHashesPerSecondResponseMessage(networkHashesPerSecond uint64) *EstimateNetworkHashesPerSecondResponseMessage

NewEstimateNetworkHashesPerSecondResponseMessage returns a instance of the message

func (*EstimateNetworkHashesPerSecondResponseMessage) Command

Command returns the protocol command string for the message

func (*EstimateNetworkHashesPerSecondResponseMessage) MessageNumber

func (b *EstimateNetworkHashesPerSecondResponseMessage) MessageNumber() uint64

func (*EstimateNetworkHashesPerSecondResponseMessage) ReceivedAt

func (b *EstimateNetworkHashesPerSecondResponseMessage) ReceivedAt() time.Time

func (*EstimateNetworkHashesPerSecondResponseMessage) SetMessageNumber

func (b *EstimateNetworkHashesPerSecondResponseMessage) SetMessageNumber(messageNumber uint64)

func (*EstimateNetworkHashesPerSecondResponseMessage) SetReceivedAt

func (b *EstimateNetworkHashesPerSecondResponseMessage) SetReceivedAt(receivedAt time.Time)

type FinalityConflictNotificationMessage

type FinalityConflictNotificationMessage struct {
	ViolatingBlockHash string
	// contains filtered or unexported fields
}

FinalityConflictNotificationMessage is an appmessage corresponding to its respective RPC message

func NewFinalityConflictNotificationMessage

func NewFinalityConflictNotificationMessage(violatingBlockHash string) *FinalityConflictNotificationMessage

NewFinalityConflictNotificationMessage returns a instance of the message

func (*FinalityConflictNotificationMessage) Command

Command returns the protocol command string for the message

func (*FinalityConflictNotificationMessage) MessageNumber

func (b *FinalityConflictNotificationMessage) MessageNumber() uint64

func (*FinalityConflictNotificationMessage) ReceivedAt

func (b *FinalityConflictNotificationMessage) ReceivedAt() time.Time

func (*FinalityConflictNotificationMessage) SetMessageNumber

func (b *FinalityConflictNotificationMessage) SetMessageNumber(messageNumber uint64)

func (*FinalityConflictNotificationMessage) SetReceivedAt

func (b *FinalityConflictNotificationMessage) SetReceivedAt(receivedAt time.Time)

type FinalityConflictResolvedNotificationMessage

type FinalityConflictResolvedNotificationMessage struct {
	FinalityBlockHash string
	// contains filtered or unexported fields
}

FinalityConflictResolvedNotificationMessage is an appmessage corresponding to its respective RPC message

func NewFinalityConflictResolvedNotificationMessage

func NewFinalityConflictResolvedNotificationMessage(finalityBlockHash string) *FinalityConflictResolvedNotificationMessage

NewFinalityConflictResolvedNotificationMessage returns a instance of the message

func (*FinalityConflictResolvedNotificationMessage) Command

Command returns the protocol command string for the message

func (*FinalityConflictResolvedNotificationMessage) MessageNumber

func (b *FinalityConflictResolvedNotificationMessage) MessageNumber() uint64

func (*FinalityConflictResolvedNotificationMessage) ReceivedAt

func (b *FinalityConflictResolvedNotificationMessage) ReceivedAt() time.Time

func (*FinalityConflictResolvedNotificationMessage) SetMessageNumber

func (b *FinalityConflictResolvedNotificationMessage) SetMessageNumber(messageNumber uint64)

func (*FinalityConflictResolvedNotificationMessage) SetReceivedAt

func (b *FinalityConflictResolvedNotificationMessage) SetReceivedAt(receivedAt time.Time)

type GetBalanceByAddressRequestMessage

type GetBalanceByAddressRequestMessage struct {
	Address string
	// contains filtered or unexported fields
}

GetBalanceByAddressRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetBalanceByAddressRequest

func NewGetBalanceByAddressRequest(address string) *GetBalanceByAddressRequestMessage

NewGetBalanceByAddressRequest returns a instance of the message

func (*GetBalanceByAddressRequestMessage) Command

Command returns the protocol command string for the message

func (*GetBalanceByAddressRequestMessage) MessageNumber

func (b *GetBalanceByAddressRequestMessage) MessageNumber() uint64

func (*GetBalanceByAddressRequestMessage) ReceivedAt

func (b *GetBalanceByAddressRequestMessage) ReceivedAt() time.Time

func (*GetBalanceByAddressRequestMessage) SetMessageNumber

func (b *GetBalanceByAddressRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetBalanceByAddressRequestMessage) SetReceivedAt

func (b *GetBalanceByAddressRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetBalanceByAddressResponseMessage

type GetBalanceByAddressResponseMessage struct {
	KSHBalance  uint64
	KUSDBalance uint64
	KRVBalance  uint64
	Error       *RPCError
	// contains filtered or unexported fields
}

GetBalanceByAddressResponseMessage is an appmessage corresponding to its respective RPC message. It includes balances for KSH, KUSD, and KRV.

func NewGetBalanceByAddressResponse

func NewGetBalanceByAddressResponse(kshBalance, kusdBalance, krvBalance uint64) *GetBalanceByAddressResponseMessage

NewGetBalanceByAddressResponse returns an instance of the message with specified balances for KSH, KUSD, and KRV.

func (*GetBalanceByAddressResponseMessage) Command

Command returns the protocol command string for the message

func (*GetBalanceByAddressResponseMessage) MessageNumber

func (b *GetBalanceByAddressResponseMessage) MessageNumber() uint64

func (*GetBalanceByAddressResponseMessage) ReceivedAt

func (b *GetBalanceByAddressResponseMessage) ReceivedAt() time.Time

func (*GetBalanceByAddressResponseMessage) SetMessageNumber

func (b *GetBalanceByAddressResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetBalanceByAddressResponseMessage) SetReceivedAt

func (b *GetBalanceByAddressResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetBalancesByAddressesRequestMessage

type GetBalancesByAddressesRequestMessage struct {
	Addresses []string
	// contains filtered or unexported fields
}

GetBalancesByAddressesRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetBalancesByAddressesRequest

func NewGetBalancesByAddressesRequest(addresses []string) *GetBalancesByAddressesRequestMessage

NewGetBalancesByAddressesRequest returns a instance of the message

func (*GetBalancesByAddressesRequestMessage) Command

Command returns the protocol command string for the message

func (*GetBalancesByAddressesRequestMessage) MessageNumber

func (b *GetBalancesByAddressesRequestMessage) MessageNumber() uint64

func (*GetBalancesByAddressesRequestMessage) ReceivedAt

func (b *GetBalancesByAddressesRequestMessage) ReceivedAt() time.Time

func (*GetBalancesByAddressesRequestMessage) SetMessageNumber

func (b *GetBalancesByAddressesRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetBalancesByAddressesRequestMessage) SetReceivedAt

func (b *GetBalancesByAddressesRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetBalancesByAddressesResponseMessage

type GetBalancesByAddressesResponseMessage struct {
	Entries []*BalancesByAddressesEntry

	Error *RPCError
	// contains filtered or unexported fields
}

GetBalancesByAddressesResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetBalancesByAddressesResponse

func NewGetBalancesByAddressesResponse(entries []*BalancesByAddressesEntry) *GetBalancesByAddressesResponseMessage

NewGetBalancesByAddressesResponse returns an instance of the message

func (*GetBalancesByAddressesResponseMessage) Command

Command returns the protocol command string for the message

func (*GetBalancesByAddressesResponseMessage) MessageNumber

func (b *GetBalancesByAddressesResponseMessage) MessageNumber() uint64

func (*GetBalancesByAddressesResponseMessage) ReceivedAt

func (b *GetBalancesByAddressesResponseMessage) ReceivedAt() time.Time

func (*GetBalancesByAddressesResponseMessage) SetMessageNumber

func (b *GetBalancesByAddressesResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetBalancesByAddressesResponseMessage) SetReceivedAt

func (b *GetBalancesByAddressesResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetBlockCountRequestMessage

type GetBlockCountRequestMessage struct {
	// contains filtered or unexported fields
}

GetBlockCountRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetBlockCountRequestMessage

func NewGetBlockCountRequestMessage() *GetBlockCountRequestMessage

NewGetBlockCountRequestMessage returns a instance of the message

func (*GetBlockCountRequestMessage) Command

Command returns the protocol command string for the message

func (*GetBlockCountRequestMessage) MessageNumber

func (b *GetBlockCountRequestMessage) MessageNumber() uint64

func (*GetBlockCountRequestMessage) ReceivedAt

func (b *GetBlockCountRequestMessage) ReceivedAt() time.Time

func (*GetBlockCountRequestMessage) SetMessageNumber

func (b *GetBlockCountRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetBlockCountRequestMessage) SetReceivedAt

func (b *GetBlockCountRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetBlockCountResponseMessage

type GetBlockCountResponseMessage struct {
	BlockCount  uint64
	HeaderCount uint64

	Error *RPCError
	// contains filtered or unexported fields
}

GetBlockCountResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetBlockCountResponseMessage

func NewGetBlockCountResponseMessage(syncInfo *externalapi.SyncInfo) *GetBlockCountResponseMessage

NewGetBlockCountResponseMessage returns a instance of the message

func (*GetBlockCountResponseMessage) Command

Command returns the protocol command string for the message

func (*GetBlockCountResponseMessage) MessageNumber

func (b *GetBlockCountResponseMessage) MessageNumber() uint64

func (*GetBlockCountResponseMessage) ReceivedAt

func (b *GetBlockCountResponseMessage) ReceivedAt() time.Time

func (*GetBlockCountResponseMessage) SetMessageNumber

func (b *GetBlockCountResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetBlockCountResponseMessage) SetReceivedAt

func (b *GetBlockCountResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetBlockDAGInfoRequestMessage

type GetBlockDAGInfoRequestMessage struct {
	// contains filtered or unexported fields
}

GetBlockDAGInfoRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetBlockDAGInfoRequestMessage

func NewGetBlockDAGInfoRequestMessage() *GetBlockDAGInfoRequestMessage

NewGetBlockDAGInfoRequestMessage returns a instance of the message

func (*GetBlockDAGInfoRequestMessage) Command

Command returns the protocol command string for the message

func (*GetBlockDAGInfoRequestMessage) MessageNumber

func (b *GetBlockDAGInfoRequestMessage) MessageNumber() uint64

func (*GetBlockDAGInfoRequestMessage) ReceivedAt

func (b *GetBlockDAGInfoRequestMessage) ReceivedAt() time.Time

func (*GetBlockDAGInfoRequestMessage) SetMessageNumber

func (b *GetBlockDAGInfoRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetBlockDAGInfoRequestMessage) SetReceivedAt

func (b *GetBlockDAGInfoRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetBlockDAGInfoResponseMessage

type GetBlockDAGInfoResponseMessage struct {
	NetworkName         string
	BlockCount          uint64
	HeaderCount         uint64
	TipHashes           []string
	VirtualParentHashes []string
	Difficulty          float64
	PastMedianTime      int64
	PruningPointHash    string
	VirtualDAAScore     uint64

	Error *RPCError
	// contains filtered or unexported fields
}

GetBlockDAGInfoResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetBlockDAGInfoResponseMessage

func NewGetBlockDAGInfoResponseMessage() *GetBlockDAGInfoResponseMessage

NewGetBlockDAGInfoResponseMessage returns a instance of the message

func (*GetBlockDAGInfoResponseMessage) Command

Command returns the protocol command string for the message

func (*GetBlockDAGInfoResponseMessage) MessageNumber

func (b *GetBlockDAGInfoResponseMessage) MessageNumber() uint64

func (*GetBlockDAGInfoResponseMessage) ReceivedAt

func (b *GetBlockDAGInfoResponseMessage) ReceivedAt() time.Time

func (*GetBlockDAGInfoResponseMessage) SetMessageNumber

func (b *GetBlockDAGInfoResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetBlockDAGInfoResponseMessage) SetReceivedAt

func (b *GetBlockDAGInfoResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetBlockRequestMessage

type GetBlockRequestMessage struct {
	Hash                string
	IncludeTransactions bool
	// contains filtered or unexported fields
}

GetBlockRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetBlockRequestMessage

func NewGetBlockRequestMessage(hash string, includeTransactions bool) *GetBlockRequestMessage

NewGetBlockRequestMessage returns a instance of the message

func (*GetBlockRequestMessage) Command

func (msg *GetBlockRequestMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*GetBlockRequestMessage) MessageNumber

func (b *GetBlockRequestMessage) MessageNumber() uint64

func (*GetBlockRequestMessage) ReceivedAt

func (b *GetBlockRequestMessage) ReceivedAt() time.Time

func (*GetBlockRequestMessage) SetMessageNumber

func (b *GetBlockRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetBlockRequestMessage) SetReceivedAt

func (b *GetBlockRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetBlockResponseMessage

type GetBlockResponseMessage struct {
	Block *RPCBlock

	Error *RPCError
	// contains filtered or unexported fields
}

GetBlockResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetBlockResponseMessage

func NewGetBlockResponseMessage() *GetBlockResponseMessage

NewGetBlockResponseMessage returns a instance of the message

func (*GetBlockResponseMessage) Command

func (msg *GetBlockResponseMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*GetBlockResponseMessage) MessageNumber

func (b *GetBlockResponseMessage) MessageNumber() uint64

func (*GetBlockResponseMessage) ReceivedAt

func (b *GetBlockResponseMessage) ReceivedAt() time.Time

func (*GetBlockResponseMessage) SetMessageNumber

func (b *GetBlockResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetBlockResponseMessage) SetReceivedAt

func (b *GetBlockResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetBlockTemplateRequestMessage

type GetBlockTemplateRequestMessage struct {
	PayAddress string
	ExtraData  string
	// contains filtered or unexported fields
}

GetBlockTemplateRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetBlockTemplateRequestMessage

func NewGetBlockTemplateRequestMessage(payAddress, extraData string) *GetBlockTemplateRequestMessage

NewGetBlockTemplateRequestMessage returns a instance of the message

func (*GetBlockTemplateRequestMessage) Command

Command returns the protocol command string for the message

func (*GetBlockTemplateRequestMessage) MessageNumber

func (b *GetBlockTemplateRequestMessage) MessageNumber() uint64

func (*GetBlockTemplateRequestMessage) ReceivedAt

func (b *GetBlockTemplateRequestMessage) ReceivedAt() time.Time

func (*GetBlockTemplateRequestMessage) SetMessageNumber

func (b *GetBlockTemplateRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetBlockTemplateRequestMessage) SetReceivedAt

func (b *GetBlockTemplateRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetBlockTemplateResponseMessage

type GetBlockTemplateResponseMessage struct {
	Block    *RPCBlock
	IsSynced bool

	Error *RPCError
	// contains filtered or unexported fields
}

GetBlockTemplateResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetBlockTemplateResponseMessage

func NewGetBlockTemplateResponseMessage(block *RPCBlock, isSynced bool) *GetBlockTemplateResponseMessage

NewGetBlockTemplateResponseMessage returns a instance of the message

func (*GetBlockTemplateResponseMessage) Command

Command returns the protocol command string for the message

func (*GetBlockTemplateResponseMessage) MessageNumber

func (b *GetBlockTemplateResponseMessage) MessageNumber() uint64

func (*GetBlockTemplateResponseMessage) ReceivedAt

func (b *GetBlockTemplateResponseMessage) ReceivedAt() time.Time

func (*GetBlockTemplateResponseMessage) SetMessageNumber

func (b *GetBlockTemplateResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetBlockTemplateResponseMessage) SetReceivedAt

func (b *GetBlockTemplateResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetBlocksRequestMessage

type GetBlocksRequestMessage struct {
	LowHash             string
	IncludeBlocks       bool
	IncludeTransactions bool
	// contains filtered or unexported fields
}

GetBlocksRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetBlocksRequestMessage

func NewGetBlocksRequestMessage(lowHash string, includeBlocks bool,
	includeTransactions bool) *GetBlocksRequestMessage

NewGetBlocksRequestMessage returns a instance of the message

func (*GetBlocksRequestMessage) Command

func (msg *GetBlocksRequestMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*GetBlocksRequestMessage) MessageNumber

func (b *GetBlocksRequestMessage) MessageNumber() uint64

func (*GetBlocksRequestMessage) ReceivedAt

func (b *GetBlocksRequestMessage) ReceivedAt() time.Time

func (*GetBlocksRequestMessage) SetMessageNumber

func (b *GetBlocksRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetBlocksRequestMessage) SetReceivedAt

func (b *GetBlocksRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetBlocksResponseMessage

type GetBlocksResponseMessage struct {
	BlockHashes []string
	Blocks      []*RPCBlock

	Error *RPCError
	// contains filtered or unexported fields
}

GetBlocksResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetBlocksResponseMessage

func NewGetBlocksResponseMessage() *GetBlocksResponseMessage

NewGetBlocksResponseMessage returns a instance of the message

func (*GetBlocksResponseMessage) Command

Command returns the protocol command string for the message

func (*GetBlocksResponseMessage) MessageNumber

func (b *GetBlocksResponseMessage) MessageNumber() uint64

func (*GetBlocksResponseMessage) ReceivedAt

func (b *GetBlocksResponseMessage) ReceivedAt() time.Time

func (*GetBlocksResponseMessage) SetMessageNumber

func (b *GetBlocksResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetBlocksResponseMessage) SetReceivedAt

func (b *GetBlocksResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetCoinSupplyRequestMessage

type GetCoinSupplyRequestMessage struct {
	// contains filtered or unexported fields
}

GetCoinSupplyRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetCoinSupplyRequestMessage

func NewGetCoinSupplyRequestMessage() *GetCoinSupplyRequestMessage

NewGetCoinSupplyRequestMessage returns a instance of the message

func (*GetCoinSupplyRequestMessage) Command

Command returns the protocol command string for the message

func (*GetCoinSupplyRequestMessage) MessageNumber

func (b *GetCoinSupplyRequestMessage) MessageNumber() uint64

func (*GetCoinSupplyRequestMessage) ReceivedAt

func (b *GetCoinSupplyRequestMessage) ReceivedAt() time.Time

func (*GetCoinSupplyRequestMessage) SetMessageNumber

func (b *GetCoinSupplyRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetCoinSupplyRequestMessage) SetReceivedAt

func (b *GetCoinSupplyRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetCoinSupplyResponseMessage

type GetCoinSupplyResponseMessage struct {
	MaxSompi             uint64
	KSHCirculatingSompi  uint64
	KUSDCirculatingSompi uint64
	KRVCirculatingSompi  uint64

	Error *RPCError
	// contains filtered or unexported fields
}

GetCoinSupplyResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetCoinSupplyResponseMessage

func NewGetCoinSupplyResponseMessage(maxSompi uint64, kshcirculatingSompi uint64,
	kusdcirculatingSompi uint64, krvcirculatingSompi uint64) *GetCoinSupplyResponseMessage

NewGetCoinSupplyResponseMessage returns a instance of the message

func (*GetCoinSupplyResponseMessage) Command

Command returns the protocol command string for the message

func (*GetCoinSupplyResponseMessage) MessageNumber

func (b *GetCoinSupplyResponseMessage) MessageNumber() uint64

func (*GetCoinSupplyResponseMessage) ReceivedAt

func (b *GetCoinSupplyResponseMessage) ReceivedAt() time.Time

func (*GetCoinSupplyResponseMessage) SetMessageNumber

func (b *GetCoinSupplyResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetCoinSupplyResponseMessage) SetReceivedAt

func (b *GetCoinSupplyResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetConnectedPeerInfoMessage

type GetConnectedPeerInfoMessage struct {
	ID                        string
	Address                   string
	LastPingDuration          int64
	IsOutbound                bool
	TimeOffset                int64
	UserAgent                 string
	AdvertisedProtocolVersion uint32
	TimeConnected             int64
	IsIBDPeer                 bool
}

GetConnectedPeerInfoMessage holds information about a connected peer

type GetConnectedPeerInfoRequestMessage

type GetConnectedPeerInfoRequestMessage struct {
	// contains filtered or unexported fields
}

GetConnectedPeerInfoRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetConnectedPeerInfoRequestMessage

func NewGetConnectedPeerInfoRequestMessage() *GetConnectedPeerInfoRequestMessage

NewGetConnectedPeerInfoRequestMessage returns a instance of the message

func (*GetConnectedPeerInfoRequestMessage) Command

Command returns the protocol command string for the message

func (*GetConnectedPeerInfoRequestMessage) MessageNumber

func (b *GetConnectedPeerInfoRequestMessage) MessageNumber() uint64

func (*GetConnectedPeerInfoRequestMessage) ReceivedAt

func (b *GetConnectedPeerInfoRequestMessage) ReceivedAt() time.Time

func (*GetConnectedPeerInfoRequestMessage) SetMessageNumber

func (b *GetConnectedPeerInfoRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetConnectedPeerInfoRequestMessage) SetReceivedAt

func (b *GetConnectedPeerInfoRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetConnectedPeerInfoResponseMessage

type GetConnectedPeerInfoResponseMessage struct {
	Infos []*GetConnectedPeerInfoMessage
	Error *RPCError
	// contains filtered or unexported fields
}

GetConnectedPeerInfoResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetConnectedPeerInfoResponseMessage

func NewGetConnectedPeerInfoResponseMessage(infos []*GetConnectedPeerInfoMessage) *GetConnectedPeerInfoResponseMessage

NewGetConnectedPeerInfoResponseMessage returns a instance of the message

func (*GetConnectedPeerInfoResponseMessage) Command

Command returns the protocol command string for the message

func (*GetConnectedPeerInfoResponseMessage) MessageNumber

func (b *GetConnectedPeerInfoResponseMessage) MessageNumber() uint64

func (*GetConnectedPeerInfoResponseMessage) ReceivedAt

func (b *GetConnectedPeerInfoResponseMessage) ReceivedAt() time.Time

func (*GetConnectedPeerInfoResponseMessage) SetMessageNumber

func (b *GetConnectedPeerInfoResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetConnectedPeerInfoResponseMessage) SetReceivedAt

func (b *GetConnectedPeerInfoResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetCurrentNetworkRequestMessage

type GetCurrentNetworkRequestMessage struct {
	// contains filtered or unexported fields
}

GetCurrentNetworkRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetCurrentNetworkRequestMessage

func NewGetCurrentNetworkRequestMessage() *GetCurrentNetworkRequestMessage

NewGetCurrentNetworkRequestMessage returns a instance of the message

func (*GetCurrentNetworkRequestMessage) Command

Command returns the protocol command string for the message

func (*GetCurrentNetworkRequestMessage) MessageNumber

func (b *GetCurrentNetworkRequestMessage) MessageNumber() uint64

func (*GetCurrentNetworkRequestMessage) ReceivedAt

func (b *GetCurrentNetworkRequestMessage) ReceivedAt() time.Time

func (*GetCurrentNetworkRequestMessage) SetMessageNumber

func (b *GetCurrentNetworkRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetCurrentNetworkRequestMessage) SetReceivedAt

func (b *GetCurrentNetworkRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetCurrentNetworkResponseMessage

type GetCurrentNetworkResponseMessage struct {
	CurrentNetwork string

	Error *RPCError
	// contains filtered or unexported fields
}

GetCurrentNetworkResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetCurrentNetworkResponseMessage

func NewGetCurrentNetworkResponseMessage(currentNetwork string) *GetCurrentNetworkResponseMessage

NewGetCurrentNetworkResponseMessage returns a instance of the message

func (*GetCurrentNetworkResponseMessage) Command

Command returns the protocol command string for the message

func (*GetCurrentNetworkResponseMessage) MessageNumber

func (b *GetCurrentNetworkResponseMessage) MessageNumber() uint64

func (*GetCurrentNetworkResponseMessage) ReceivedAt

func (b *GetCurrentNetworkResponseMessage) ReceivedAt() time.Time

func (*GetCurrentNetworkResponseMessage) SetMessageNumber

func (b *GetCurrentNetworkResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetCurrentNetworkResponseMessage) SetReceivedAt

func (b *GetCurrentNetworkResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetHeadersRequestMessage

type GetHeadersRequestMessage struct {
	StartHash   string
	Limit       uint64
	IsAscending bool
	// contains filtered or unexported fields
}

GetHeadersRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetHeadersRequestMessage

func NewGetHeadersRequestMessage(startHash string, limit uint64, isAscending bool) *GetHeadersRequestMessage

NewGetHeadersRequestMessage returns a instance of the message

func (*GetHeadersRequestMessage) Command

Command returns the protocol command string for the message

func (*GetHeadersRequestMessage) MessageNumber

func (b *GetHeadersRequestMessage) MessageNumber() uint64

func (*GetHeadersRequestMessage) ReceivedAt

func (b *GetHeadersRequestMessage) ReceivedAt() time.Time

func (*GetHeadersRequestMessage) SetMessageNumber

func (b *GetHeadersRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetHeadersRequestMessage) SetReceivedAt

func (b *GetHeadersRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetHeadersResponseMessage

type GetHeadersResponseMessage struct {
	Headers []string

	Error *RPCError
	// contains filtered or unexported fields
}

GetHeadersResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetHeadersResponseMessage

func NewGetHeadersResponseMessage(headers []string) *GetHeadersResponseMessage

NewGetHeadersResponseMessage returns a instance of the message

func (*GetHeadersResponseMessage) Command

Command returns the protocol command string for the message

func (*GetHeadersResponseMessage) MessageNumber

func (b *GetHeadersResponseMessage) MessageNumber() uint64

func (*GetHeadersResponseMessage) ReceivedAt

func (b *GetHeadersResponseMessage) ReceivedAt() time.Time

func (*GetHeadersResponseMessage) SetMessageNumber

func (b *GetHeadersResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetHeadersResponseMessage) SetReceivedAt

func (b *GetHeadersResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetInfoRequestMessage

type GetInfoRequestMessage struct {
	// contains filtered or unexported fields
}

GetInfoRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetInfoRequestMessage

func NewGetInfoRequestMessage() *GetInfoRequestMessage

NewGetInfoRequestMessage returns a instance of the message

func (*GetInfoRequestMessage) Command

func (msg *GetInfoRequestMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*GetInfoRequestMessage) MessageNumber

func (b *GetInfoRequestMessage) MessageNumber() uint64

func (*GetInfoRequestMessage) ReceivedAt

func (b *GetInfoRequestMessage) ReceivedAt() time.Time

func (*GetInfoRequestMessage) SetMessageNumber

func (b *GetInfoRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetInfoRequestMessage) SetReceivedAt

func (b *GetInfoRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetInfoResponseMessage

type GetInfoResponseMessage struct {
	P2PID         string
	MempoolSize   uint64
	ServerVersion string
	IsUtxoIndexed bool
	IsSynced      bool

	Error *RPCError
	// contains filtered or unexported fields
}

GetInfoResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetInfoResponseMessage

func NewGetInfoResponseMessage(p2pID string, mempoolSize uint64, serverVersion string, isUtxoIndexed bool, isSynced bool) *GetInfoResponseMessage

NewGetInfoResponseMessage returns a instance of the message

func (*GetInfoResponseMessage) Command

func (msg *GetInfoResponseMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*GetInfoResponseMessage) MessageNumber

func (b *GetInfoResponseMessage) MessageNumber() uint64

func (*GetInfoResponseMessage) ReceivedAt

func (b *GetInfoResponseMessage) ReceivedAt() time.Time

func (*GetInfoResponseMessage) SetMessageNumber

func (b *GetInfoResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetInfoResponseMessage) SetReceivedAt

func (b *GetInfoResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetMempoolEntriesByAddressesRequestMessage

type GetMempoolEntriesByAddressesRequestMessage struct {
	Addresses             []string
	IncludeOrphanPool     bool
	FilterTransactionPool bool
	// contains filtered or unexported fields
}

GetMempoolEntriesByAddressesRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetMempoolEntriesByAddressesRequestMessage

func NewGetMempoolEntriesByAddressesRequestMessage(addresses []string, includeOrphanPool bool, filterTransactionPool bool) *GetMempoolEntriesByAddressesRequestMessage

NewGetMempoolEntriesByAddressesRequestMessage returns a instance of the message

func (*GetMempoolEntriesByAddressesRequestMessage) Command

Command returns the protocol command string for the message

func (*GetMempoolEntriesByAddressesRequestMessage) MessageNumber

func (b *GetMempoolEntriesByAddressesRequestMessage) MessageNumber() uint64

func (*GetMempoolEntriesByAddressesRequestMessage) ReceivedAt

func (b *GetMempoolEntriesByAddressesRequestMessage) ReceivedAt() time.Time

func (*GetMempoolEntriesByAddressesRequestMessage) SetMessageNumber

func (b *GetMempoolEntriesByAddressesRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetMempoolEntriesByAddressesRequestMessage) SetReceivedAt

func (b *GetMempoolEntriesByAddressesRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetMempoolEntriesByAddressesResponseMessage

type GetMempoolEntriesByAddressesResponseMessage struct {
	Entries []*MempoolEntryByAddress

	Error *RPCError
	// contains filtered or unexported fields
}

GetMempoolEntriesByAddressesResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetMempoolEntriesByAddressesResponseMessage

func NewGetMempoolEntriesByAddressesResponseMessage(entries []*MempoolEntryByAddress) *GetMempoolEntriesByAddressesResponseMessage

NewGetMempoolEntriesByAddressesResponseMessage returns a instance of the message

func (*GetMempoolEntriesByAddressesResponseMessage) Command

Command returns the protocol command string for the message

func (*GetMempoolEntriesByAddressesResponseMessage) MessageNumber

func (b *GetMempoolEntriesByAddressesResponseMessage) MessageNumber() uint64

func (*GetMempoolEntriesByAddressesResponseMessage) ReceivedAt

func (b *GetMempoolEntriesByAddressesResponseMessage) ReceivedAt() time.Time

func (*GetMempoolEntriesByAddressesResponseMessage) SetMessageNumber

func (b *GetMempoolEntriesByAddressesResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetMempoolEntriesByAddressesResponseMessage) SetReceivedAt

func (b *GetMempoolEntriesByAddressesResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetMempoolEntriesRequestMessage

type GetMempoolEntriesRequestMessage struct {
	IncludeOrphanPool     bool
	FilterTransactionPool bool
	// contains filtered or unexported fields
}

GetMempoolEntriesRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetMempoolEntriesRequestMessage

func NewGetMempoolEntriesRequestMessage(includeOrphanPool bool, filterTransactionPool bool) *GetMempoolEntriesRequestMessage

NewGetMempoolEntriesRequestMessage returns a instance of the message

func (*GetMempoolEntriesRequestMessage) Command

Command returns the protocol command string for the message

func (*GetMempoolEntriesRequestMessage) MessageNumber

func (b *GetMempoolEntriesRequestMessage) MessageNumber() uint64

func (*GetMempoolEntriesRequestMessage) ReceivedAt

func (b *GetMempoolEntriesRequestMessage) ReceivedAt() time.Time

func (*GetMempoolEntriesRequestMessage) SetMessageNumber

func (b *GetMempoolEntriesRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetMempoolEntriesRequestMessage) SetReceivedAt

func (b *GetMempoolEntriesRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetMempoolEntriesResponseMessage

type GetMempoolEntriesResponseMessage struct {
	Entries []*MempoolEntry

	Error *RPCError
	// contains filtered or unexported fields
}

GetMempoolEntriesResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetMempoolEntriesResponseMessage

func NewGetMempoolEntriesResponseMessage(entries []*MempoolEntry) *GetMempoolEntriesResponseMessage

NewGetMempoolEntriesResponseMessage returns a instance of the message

func (*GetMempoolEntriesResponseMessage) Command

Command returns the protocol command string for the message

func (*GetMempoolEntriesResponseMessage) MessageNumber

func (b *GetMempoolEntriesResponseMessage) MessageNumber() uint64

func (*GetMempoolEntriesResponseMessage) ReceivedAt

func (b *GetMempoolEntriesResponseMessage) ReceivedAt() time.Time

func (*GetMempoolEntriesResponseMessage) SetMessageNumber

func (b *GetMempoolEntriesResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetMempoolEntriesResponseMessage) SetReceivedAt

func (b *GetMempoolEntriesResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetMempoolEntryRequestMessage

type GetMempoolEntryRequestMessage struct {
	TxID                  string
	IncludeOrphanPool     bool
	FilterTransactionPool bool
	// contains filtered or unexported fields
}

GetMempoolEntryRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetMempoolEntryRequestMessage

func NewGetMempoolEntryRequestMessage(txID string, includeOrphanPool bool, filterTransactionPool bool) *GetMempoolEntryRequestMessage

NewGetMempoolEntryRequestMessage returns a instance of the message

func (*GetMempoolEntryRequestMessage) Command

Command returns the protocol command string for the message

func (*GetMempoolEntryRequestMessage) MessageNumber

func (b *GetMempoolEntryRequestMessage) MessageNumber() uint64

func (*GetMempoolEntryRequestMessage) ReceivedAt

func (b *GetMempoolEntryRequestMessage) ReceivedAt() time.Time

func (*GetMempoolEntryRequestMessage) SetMessageNumber

func (b *GetMempoolEntryRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetMempoolEntryRequestMessage) SetReceivedAt

func (b *GetMempoolEntryRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetMempoolEntryResponseMessage

type GetMempoolEntryResponseMessage struct {
	Entry *MempoolEntry

	Error *RPCError
	// contains filtered or unexported fields
}

GetMempoolEntryResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetMempoolEntryResponseMessage

func NewGetMempoolEntryResponseMessage(fee uint64, transaction *RPCTransaction, isOrphan bool) *GetMempoolEntryResponseMessage

NewGetMempoolEntryResponseMessage returns a instance of the message

func (*GetMempoolEntryResponseMessage) Command

Command returns the protocol command string for the message

func (*GetMempoolEntryResponseMessage) MessageNumber

func (b *GetMempoolEntryResponseMessage) MessageNumber() uint64

func (*GetMempoolEntryResponseMessage) ReceivedAt

func (b *GetMempoolEntryResponseMessage) ReceivedAt() time.Time

func (*GetMempoolEntryResponseMessage) SetMessageNumber

func (b *GetMempoolEntryResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetMempoolEntryResponseMessage) SetReceivedAt

func (b *GetMempoolEntryResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetPeerAddressesKnownAddressMessage

type GetPeerAddressesKnownAddressMessage struct {
	Addr string
}

GetPeerAddressesKnownAddressMessage is an appmessage corresponding to its respective RPC message

type GetPeerAddressesRequestMessage

type GetPeerAddressesRequestMessage struct {
	// contains filtered or unexported fields
}

GetPeerAddressesRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetPeerAddressesRequestMessage

func NewGetPeerAddressesRequestMessage() *GetPeerAddressesRequestMessage

NewGetPeerAddressesRequestMessage returns a instance of the message

func (*GetPeerAddressesRequestMessage) Command

Command returns the protocol command string for the message

func (*GetPeerAddressesRequestMessage) MessageNumber

func (b *GetPeerAddressesRequestMessage) MessageNumber() uint64

func (*GetPeerAddressesRequestMessage) ReceivedAt

func (b *GetPeerAddressesRequestMessage) ReceivedAt() time.Time

func (*GetPeerAddressesRequestMessage) SetMessageNumber

func (b *GetPeerAddressesRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetPeerAddressesRequestMessage) SetReceivedAt

func (b *GetPeerAddressesRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetPeerAddressesResponseMessage

type GetPeerAddressesResponseMessage struct {
	Addresses       []*GetPeerAddressesKnownAddressMessage
	BannedAddresses []*GetPeerAddressesKnownAddressMessage

	Error *RPCError
	// contains filtered or unexported fields
}

GetPeerAddressesResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetPeerAddressesResponseMessage

func NewGetPeerAddressesResponseMessage(addresses []*GetPeerAddressesKnownAddressMessage, bannedAddresses []*GetPeerAddressesKnownAddressMessage) *GetPeerAddressesResponseMessage

NewGetPeerAddressesResponseMessage returns a instance of the message

func (*GetPeerAddressesResponseMessage) Command

Command returns the protocol command string for the message

func (*GetPeerAddressesResponseMessage) MessageNumber

func (b *GetPeerAddressesResponseMessage) MessageNumber() uint64

func (*GetPeerAddressesResponseMessage) ReceivedAt

func (b *GetPeerAddressesResponseMessage) ReceivedAt() time.Time

func (*GetPeerAddressesResponseMessage) SetMessageNumber

func (b *GetPeerAddressesResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetPeerAddressesResponseMessage) SetReceivedAt

func (b *GetPeerAddressesResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetSelectedTipHashRequestMessage

type GetSelectedTipHashRequestMessage struct {
	// contains filtered or unexported fields
}

GetSelectedTipHashRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetSelectedTipHashRequestMessage

func NewGetSelectedTipHashRequestMessage() *GetSelectedTipHashRequestMessage

NewGetSelectedTipHashRequestMessage returns a instance of the message

func (*GetSelectedTipHashRequestMessage) Command

Command returns the protocol command string for the message

func (*GetSelectedTipHashRequestMessage) MessageNumber

func (b *GetSelectedTipHashRequestMessage) MessageNumber() uint64

func (*GetSelectedTipHashRequestMessage) ReceivedAt

func (b *GetSelectedTipHashRequestMessage) ReceivedAt() time.Time

func (*GetSelectedTipHashRequestMessage) SetMessageNumber

func (b *GetSelectedTipHashRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetSelectedTipHashRequestMessage) SetReceivedAt

func (b *GetSelectedTipHashRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetSelectedTipHashResponseMessage

type GetSelectedTipHashResponseMessage struct {
	SelectedTipHash string

	Error *RPCError
	// contains filtered or unexported fields
}

GetSelectedTipHashResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetSelectedTipHashResponseMessage

func NewGetSelectedTipHashResponseMessage(selectedTipHash string) *GetSelectedTipHashResponseMessage

NewGetSelectedTipHashResponseMessage returns a instance of the message

func (*GetSelectedTipHashResponseMessage) Command

Command returns the protocol command string for the message

func (*GetSelectedTipHashResponseMessage) MessageNumber

func (b *GetSelectedTipHashResponseMessage) MessageNumber() uint64

func (*GetSelectedTipHashResponseMessage) ReceivedAt

func (b *GetSelectedTipHashResponseMessage) ReceivedAt() time.Time

func (*GetSelectedTipHashResponseMessage) SetMessageNumber

func (b *GetSelectedTipHashResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetSelectedTipHashResponseMessage) SetReceivedAt

func (b *GetSelectedTipHashResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetSubnetworkRequestMessage

type GetSubnetworkRequestMessage struct {
	SubnetworkID string
	// contains filtered or unexported fields
}

GetSubnetworkRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetSubnetworkRequestMessage

func NewGetSubnetworkRequestMessage(subnetworkID string) *GetSubnetworkRequestMessage

NewGetSubnetworkRequestMessage returns a instance of the message

func (*GetSubnetworkRequestMessage) Command

Command returns the protocol command string for the message

func (*GetSubnetworkRequestMessage) MessageNumber

func (b *GetSubnetworkRequestMessage) MessageNumber() uint64

func (*GetSubnetworkRequestMessage) ReceivedAt

func (b *GetSubnetworkRequestMessage) ReceivedAt() time.Time

func (*GetSubnetworkRequestMessage) SetMessageNumber

func (b *GetSubnetworkRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetSubnetworkRequestMessage) SetReceivedAt

func (b *GetSubnetworkRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetSubnetworkResponseMessage

type GetSubnetworkResponseMessage struct {
	GasLimit uint64

	Error *RPCError
	// contains filtered or unexported fields
}

GetSubnetworkResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetSubnetworkResponseMessage

func NewGetSubnetworkResponseMessage(gasLimit uint64) *GetSubnetworkResponseMessage

NewGetSubnetworkResponseMessage returns a instance of the message

func (*GetSubnetworkResponseMessage) Command

Command returns the protocol command string for the message

func (*GetSubnetworkResponseMessage) MessageNumber

func (b *GetSubnetworkResponseMessage) MessageNumber() uint64

func (*GetSubnetworkResponseMessage) ReceivedAt

func (b *GetSubnetworkResponseMessage) ReceivedAt() time.Time

func (*GetSubnetworkResponseMessage) SetMessageNumber

func (b *GetSubnetworkResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetSubnetworkResponseMessage) SetReceivedAt

func (b *GetSubnetworkResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetUTXOsByAddressesRequestMessage

type GetUTXOsByAddressesRequestMessage struct {
	Addresses []string
	// contains filtered or unexported fields
}

GetUTXOsByAddressesRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetUTXOsByAddressesRequestMessage

func NewGetUTXOsByAddressesRequestMessage(addresses []string) *GetUTXOsByAddressesRequestMessage

NewGetUTXOsByAddressesRequestMessage returns a instance of the message

func (*GetUTXOsByAddressesRequestMessage) Command

Command returns the protocol command string for the message

func (*GetUTXOsByAddressesRequestMessage) MessageNumber

func (b *GetUTXOsByAddressesRequestMessage) MessageNumber() uint64

func (*GetUTXOsByAddressesRequestMessage) ReceivedAt

func (b *GetUTXOsByAddressesRequestMessage) ReceivedAt() time.Time

func (*GetUTXOsByAddressesRequestMessage) SetMessageNumber

func (b *GetUTXOsByAddressesRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetUTXOsByAddressesRequestMessage) SetReceivedAt

func (b *GetUTXOsByAddressesRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetUTXOsByAddressesResponseMessage

type GetUTXOsByAddressesResponseMessage struct {
	Entries []*UTXOsByAddressesEntry

	Error *RPCError
	// contains filtered or unexported fields
}

GetUTXOsByAddressesResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetUTXOsByAddressesResponseMessage

func NewGetUTXOsByAddressesResponseMessage(entries []*UTXOsByAddressesEntry) *GetUTXOsByAddressesResponseMessage

NewGetUTXOsByAddressesResponseMessage returns a instance of the message

func (*GetUTXOsByAddressesResponseMessage) Command

Command returns the protocol command string for the message

func (*GetUTXOsByAddressesResponseMessage) MessageNumber

func (b *GetUTXOsByAddressesResponseMessage) MessageNumber() uint64

func (*GetUTXOsByAddressesResponseMessage) ReceivedAt

func (b *GetUTXOsByAddressesResponseMessage) ReceivedAt() time.Time

func (*GetUTXOsByAddressesResponseMessage) SetMessageNumber

func (b *GetUTXOsByAddressesResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetUTXOsByAddressesResponseMessage) SetReceivedAt

func (b *GetUTXOsByAddressesResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetVirtualSelectedParentBlueScoreRequestMessage

type GetVirtualSelectedParentBlueScoreRequestMessage struct {
	// contains filtered or unexported fields
}

GetVirtualSelectedParentBlueScoreRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetVirtualSelectedParentBlueScoreRequestMessage

func NewGetVirtualSelectedParentBlueScoreRequestMessage() *GetVirtualSelectedParentBlueScoreRequestMessage

NewGetVirtualSelectedParentBlueScoreRequestMessage returns a instance of the message

func (*GetVirtualSelectedParentBlueScoreRequestMessage) Command

Command returns the protocol command string for the message

func (*GetVirtualSelectedParentBlueScoreRequestMessage) MessageNumber

func (b *GetVirtualSelectedParentBlueScoreRequestMessage) MessageNumber() uint64

func (*GetVirtualSelectedParentBlueScoreRequestMessage) ReceivedAt

func (b *GetVirtualSelectedParentBlueScoreRequestMessage) ReceivedAt() time.Time

func (*GetVirtualSelectedParentBlueScoreRequestMessage) SetMessageNumber

func (b *GetVirtualSelectedParentBlueScoreRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetVirtualSelectedParentBlueScoreRequestMessage) SetReceivedAt

func (b *GetVirtualSelectedParentBlueScoreRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetVirtualSelectedParentBlueScoreResponseMessage

type GetVirtualSelectedParentBlueScoreResponseMessage struct {
	BlueScore uint64

	Error *RPCError
	// contains filtered or unexported fields
}

GetVirtualSelectedParentBlueScoreResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetVirtualSelectedParentBlueScoreResponseMessage

func NewGetVirtualSelectedParentBlueScoreResponseMessage(blueScore uint64) *GetVirtualSelectedParentBlueScoreResponseMessage

NewGetVirtualSelectedParentBlueScoreResponseMessage returns a instance of the message

func (*GetVirtualSelectedParentBlueScoreResponseMessage) Command

Command returns the protocol command string for the message

func (*GetVirtualSelectedParentBlueScoreResponseMessage) MessageNumber

func (b *GetVirtualSelectedParentBlueScoreResponseMessage) MessageNumber() uint64

func (*GetVirtualSelectedParentBlueScoreResponseMessage) ReceivedAt

func (b *GetVirtualSelectedParentBlueScoreResponseMessage) ReceivedAt() time.Time

func (*GetVirtualSelectedParentBlueScoreResponseMessage) SetMessageNumber

func (b *GetVirtualSelectedParentBlueScoreResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetVirtualSelectedParentBlueScoreResponseMessage) SetReceivedAt

func (b *GetVirtualSelectedParentBlueScoreResponseMessage) SetReceivedAt(receivedAt time.Time)

type GetVirtualSelectedParentChainFromBlockRequestMessage

type GetVirtualSelectedParentChainFromBlockRequestMessage struct {
	StartHash                     string
	IncludeAcceptedTransactionIDs bool
	// contains filtered or unexported fields
}

GetVirtualSelectedParentChainFromBlockRequestMessage is an appmessage corresponding to its respective RPC message

func NewGetVirtualSelectedParentChainFromBlockRequestMessage

func NewGetVirtualSelectedParentChainFromBlockRequestMessage(
	startHash string, includeAcceptedTransactionIDs bool) *GetVirtualSelectedParentChainFromBlockRequestMessage

NewGetVirtualSelectedParentChainFromBlockRequestMessage returns a instance of the message

func (*GetVirtualSelectedParentChainFromBlockRequestMessage) Command

Command returns the protocol command string for the message

func (*GetVirtualSelectedParentChainFromBlockRequestMessage) MessageNumber

func (b *GetVirtualSelectedParentChainFromBlockRequestMessage) MessageNumber() uint64

func (*GetVirtualSelectedParentChainFromBlockRequestMessage) ReceivedAt

func (b *GetVirtualSelectedParentChainFromBlockRequestMessage) ReceivedAt() time.Time

func (*GetVirtualSelectedParentChainFromBlockRequestMessage) SetMessageNumber

func (b *GetVirtualSelectedParentChainFromBlockRequestMessage) SetMessageNumber(messageNumber uint64)

func (*GetVirtualSelectedParentChainFromBlockRequestMessage) SetReceivedAt

func (b *GetVirtualSelectedParentChainFromBlockRequestMessage) SetReceivedAt(receivedAt time.Time)

type GetVirtualSelectedParentChainFromBlockResponseMessage

type GetVirtualSelectedParentChainFromBlockResponseMessage struct {
	RemovedChainBlockHashes []string
	AddedChainBlockHashes   []string
	AcceptedTransactionIDs  []*AcceptedTransactionIDs

	Error *RPCError
	// contains filtered or unexported fields
}

GetVirtualSelectedParentChainFromBlockResponseMessage is an appmessage corresponding to its respective RPC message

func NewGetVirtualSelectedParentChainFromBlockResponseMessage

func NewGetVirtualSelectedParentChainFromBlockResponseMessage(removedChainBlockHashes,
	addedChainBlockHashes []string, acceptedTransactionIDs []*AcceptedTransactionIDs) *GetVirtualSelectedParentChainFromBlockResponseMessage

NewGetVirtualSelectedParentChainFromBlockResponseMessage returns a instance of the message

func (*GetVirtualSelectedParentChainFromBlockResponseMessage) Command

Command returns the protocol command string for the message

func (*GetVirtualSelectedParentChainFromBlockResponseMessage) MessageNumber

func (b *GetVirtualSelectedParentChainFromBlockResponseMessage) MessageNumber() uint64

func (*GetVirtualSelectedParentChainFromBlockResponseMessage) ReceivedAt

func (b *GetVirtualSelectedParentChainFromBlockResponseMessage) ReceivedAt() time.Time

func (*GetVirtualSelectedParentChainFromBlockResponseMessage) SetMessageNumber

func (b *GetVirtualSelectedParentChainFromBlockResponseMessage) SetMessageNumber(messageNumber uint64)

func (*GetVirtualSelectedParentChainFromBlockResponseMessage) SetReceivedAt

func (b *GetVirtualSelectedParentChainFromBlockResponseMessage) SetReceivedAt(receivedAt time.Time)

type KashNet

type KashNet uint32

KashNet represents which kaspa network a message belongs to.

const (
	// Mainnet represents the main kaspa network.
	Mainnet KashNet = 0x3ddcf71d

	// Testnet represents the test network.
	Testnet KashNet = 0xddb8af8f

	// Simnet represents the simulation test network.
	Simnet KashNet = 0x374dcf1c

	// Devnet represents the development test network.
	Devnet KashNet = 0x732d87e1
)

Constants used to indicate the message kaspa network. They can also be used to seek to the next message when a stream's state is unknown, but this package does not provide that functionality since it's generally a better idea to simply disconnect clients that are misbehaving over TCP.

func (KashNet) String

func (n KashNet) String() string

String returns the KashNet in human-readable form.

type MempoolEntry

type MempoolEntry struct {
	Fee         uint64
	Transaction *RPCTransaction
	IsOrphan    bool
}

MempoolEntry represents a transaction in the mempool.

type MempoolEntryByAddress

type MempoolEntryByAddress struct {
	Address   string
	Receiving []*MempoolEntry
	Sending   []*MempoolEntry
}

MempoolEntryByAddress represents MempoolEntries associated with some address

type Message

type Message interface {
	Command() MessageCommand
	MessageNumber() uint64
	SetMessageNumber(index uint64)
	ReceivedAt() time.Time
	SetReceivedAt(receivedAt time.Time)
}

Message is an interface that describes a kaspa message. A type that implements Message has complete control over the representation of its data and may therefore contain additional or fewer fields than those which are used directly in the protocol encoded message.

type MessageCommand

type MessageCommand uint32

MessageCommand is a number in the header of a message that represents its type.

const (
	// protocol
	CmdVersion MessageCommand = iota
	CmdVerAck
	CmdRequestAddresses
	CmdAddresses
	CmdRequestHeaders
	CmdBlock
	CmdTx
	CmdPing
	CmdPong
	CmdRequestBlockLocator
	CmdBlockLocator
	CmdInvRelayBlock
	CmdRequestRelayBlocks
	CmdInvTransaction
	CmdRequestTransactions
	CmdDoneHeaders
	CmdTransactionNotFound
	CmdReject
	CmdRequestNextHeaders
	CmdRequestPruningPointUTXOSet
	CmdPruningPointUTXOSetChunk
	CmdUnexpectedPruningPoint
	CmdIBDBlockLocator
	CmdIBDBlockLocatorHighestHash
	CmdIBDBlockLocatorHighestHashNotFound
	CmdBlockHeaders
	CmdRequestNextPruningPointUTXOSetChunk
	CmdDonePruningPointUTXOSetChunks
	CmdBlockWithTrustedData
	CmdDoneBlocksWithTrustedData
	CmdRequestPruningPointAndItsAnticone
	CmdIBDBlock
	CmdRequestIBDBlocks
	CmdPruningPoints
	CmdRequestPruningPointProof
	CmdPruningPointProof
	CmdReady
	CmdTrustedData
	CmdBlockWithTrustedDataV4
	CmdRequestNextPruningPointAndItsAnticoneBlocks
	CmdRequestIBDChainBlockLocator
	CmdIBDChainBlockLocator
	CmdRequestAnticone

	// rpc
	CmdGetCurrentNetworkRequestMessage
	CmdGetCurrentNetworkResponseMessage
	CmdSubmitBlockRequestMessage
	CmdSubmitBlockResponseMessage
	CmdGetBlockTemplateRequestMessage
	CmdGetBlockTemplateResponseMessage
	CmdGetBlockTemplateTransactionMessage
	CmdNotifyBlockAddedRequestMessage
	CmdNotifyBlockAddedResponseMessage
	CmdBlockAddedNotificationMessage
	CmdGetPeerAddressesRequestMessage
	CmdGetPeerAddressesResponseMessage
	CmdGetSelectedTipHashRequestMessage
	CmdGetSelectedTipHashResponseMessage
	CmdGetMempoolEntryRequestMessage
	CmdGetMempoolEntryResponseMessage
	CmdGetConnectedPeerInfoRequestMessage
	CmdGetConnectedPeerInfoResponseMessage
	CmdAddPeerRequestMessage
	CmdAddPeerResponseMessage
	CmdSubmitTransactionRequestMessage
	CmdSubmitTransactionResponseMessage
	CmdNotifyVirtualSelectedParentChainChangedRequestMessage
	CmdNotifyVirtualSelectedParentChainChangedResponseMessage
	CmdVirtualSelectedParentChainChangedNotificationMessage
	CmdGetBlockRequestMessage
	CmdGetBlockResponseMessage
	CmdGetSubnetworkRequestMessage
	CmdGetSubnetworkResponseMessage
	CmdGetVirtualSelectedParentChainFromBlockRequestMessage
	CmdGetVirtualSelectedParentChainFromBlockResponseMessage
	CmdGetBlocksRequestMessage
	CmdGetBlocksResponseMessage
	CmdGetBlockCountRequestMessage
	CmdGetBlockCountResponseMessage
	CmdGetBlockDAGInfoRequestMessage
	CmdGetBlockDAGInfoResponseMessage
	CmdResolveFinalityConflictRequestMessage
	CmdResolveFinalityConflictResponseMessage
	CmdNotifyFinalityConflictsRequestMessage
	CmdNotifyFinalityConflictsResponseMessage
	CmdFinalityConflictNotificationMessage
	CmdFinalityConflictResolvedNotificationMessage
	CmdGetMempoolEntriesRequestMessage
	CmdGetMempoolEntriesResponseMessage
	CmdShutDownRequestMessage
	CmdShutDownResponseMessage
	CmdGetHeadersRequestMessage
	CmdGetHeadersResponseMessage
	CmdNotifyUTXOsChangedRequestMessage
	CmdNotifyUTXOsChangedResponseMessage
	CmdUTXOsChangedNotificationMessage
	CmdStopNotifyingUTXOsChangedRequestMessage
	CmdStopNotifyingUTXOsChangedResponseMessage
	CmdGetUTXOsByAddressesRequestMessage
	CmdGetUTXOsByAddressesResponseMessage
	CmdGetBalanceByAddressRequestMessage
	CmdGetBalanceByAddressResponseMessage
	CmdGetVirtualSelectedParentBlueScoreRequestMessage
	CmdGetVirtualSelectedParentBlueScoreResponseMessage
	CmdNotifyVirtualSelectedParentBlueScoreChangedRequestMessage
	CmdNotifyVirtualSelectedParentBlueScoreChangedResponseMessage
	CmdVirtualSelectedParentBlueScoreChangedNotificationMessage
	CmdBanRequestMessage
	CmdBanResponseMessage
	CmdUnbanRequestMessage
	CmdUnbanResponseMessage
	CmdGetInfoRequestMessage
	CmdGetInfoResponseMessage
	CmdNotifyPruningPointUTXOSetOverrideRequestMessage
	CmdNotifyPruningPointUTXOSetOverrideResponseMessage
	CmdPruningPointUTXOSetOverrideNotificationMessage
	CmdStopNotifyingPruningPointUTXOSetOverrideRequestMessage
	CmdStopNotifyingPruningPointUTXOSetOverrideResponseMessage
	CmdEstimateNetworkHashesPerSecondRequestMessage
	CmdEstimateNetworkHashesPerSecondResponseMessage
	CmdNotifyVirtualDaaScoreChangedRequestMessage
	CmdNotifyVirtualDaaScoreChangedResponseMessage
	CmdVirtualDaaScoreChangedNotificationMessage
	CmdGetBalancesByAddressesRequestMessage
	CmdGetBalancesByAddressesResponseMessage
	CmdNotifyNewBlockTemplateRequestMessage
	CmdNotifyNewBlockTemplateResponseMessage
	CmdNewBlockTemplateNotificationMessage
	CmdGetMempoolEntriesByAddressesRequestMessage
	CmdGetMempoolEntriesByAddressesResponseMessage
	CmdGetCoinSupplyRequestMessage
	CmdGetCoinSupplyResponseMessage
)

Commands used in kash message headers which describe the type of message.

func (MessageCommand) String

func (cmd MessageCommand) String() string

type MessageError

type MessageError struct {
	Func        string // Function name
	Description string // Human readable description of the issue
}

MessageError describes an issue with a message. An example of some potential issues are messages from the wrong kash network, invalid commands, mismatched checksums, and exceeding max payloads.

This provides a mechanism for the caller to type assert the error to differentiate between general io errors such as io.EOF and issues that resulted from malformed messages.

func (*MessageError) Error

func (e *MessageError) Error() string

Error satisfies the error interface and prints human-readable errors.

type MsgAddresses

type MsgAddresses struct {
	AddressList []*NetAddress
	// contains filtered or unexported fields
}

MsgAddresses implements the Message interface and represents a kash Addresses message.

func NewMsgAddresses

func NewMsgAddresses(addressList []*NetAddress) *MsgAddresses

NewMsgAddresses returns a new kash Addresses message that conforms to the Message interface. See MsgAddresses for details.

func (*MsgAddresses) Command

func (msg *MsgAddresses) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgAddresses) MessageNumber

func (b *MsgAddresses) MessageNumber() uint64

func (*MsgAddresses) ReceivedAt

func (b *MsgAddresses) ReceivedAt() time.Time

func (*MsgAddresses) SetMessageNumber

func (b *MsgAddresses) SetMessageNumber(messageNumber uint64)

func (*MsgAddresses) SetReceivedAt

func (b *MsgAddresses) SetReceivedAt(receivedAt time.Time)

type MsgBlock

type MsgBlock struct {
	Header       MsgBlockHeader
	Transactions []*MsgTx
	// contains filtered or unexported fields
}

MsgBlock implements the Message interface and represents a kash block message. It is used to deliver block and transaction information in response to a getdata message (MsgGetData) for a given block hash.

func DomainBlockToMsgBlock

func DomainBlockToMsgBlock(domainBlock *externalapi.DomainBlock) *MsgBlock

DomainBlockToMsgBlock converts an externalapi.DomainBlock to MsgBlock

func NewMsgBlock

func NewMsgBlock(blockHeader *MsgBlockHeader) *MsgBlock

NewMsgBlock returns a new kash block message that conforms to the Message interface. See MsgBlock for details.

func (*MsgBlock) AddTransaction

func (msg *MsgBlock) AddTransaction(tx *MsgTx)

AddTransaction adds a transaction to the message.

func (*MsgBlock) ClearTransactions

func (msg *MsgBlock) ClearTransactions()

ClearTransactions removes all transactions from the message.

func (*MsgBlock) Command

func (msg *MsgBlock) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgBlock) ConvertToPartial

func (msg *MsgBlock) ConvertToPartial(subnetworkID *externalapi.DomainSubnetworkID)

ConvertToPartial clears out all the payloads of the subnetworks that are incompatible with the given subnetwork ID. Note: this operation modifies the block in place.

func (*MsgBlock) MaxPayloadLength

func (msg *MsgBlock) MaxPayloadLength(pver uint32) uint32

MaxPayloadLength returns the maximum length the payload can be for the receiver. This is part of the Message interface implementation.

func (*MsgBlock) MessageNumber

func (b *MsgBlock) MessageNumber() uint64

func (*MsgBlock) ReceivedAt

func (b *MsgBlock) ReceivedAt() time.Time

func (*MsgBlock) SetMessageNumber

func (b *MsgBlock) SetMessageNumber(messageNumber uint64)

func (*MsgBlock) SetReceivedAt

func (b *MsgBlock) SetReceivedAt(receivedAt time.Time)

type MsgBlockHeader

type MsgBlockHeader struct {

	// Version of the block. This is not the same as the protocol version.
	Version uint16

	// Parents are the parent block hashes of the block in the DAG per superblock level.
	Parents []externalapi.BlockLevelParents

	// HashMerkleRoot is the merkle tree reference to hash of all transactions for the block.
	HashMerkleRoot *externalapi.DomainHash

	// AcceptedIDMerkleRoot is merkle tree reference to hash all transactions
	// accepted form the block.Blues
	AcceptedIDMerkleRoot *externalapi.DomainHash

	// UTXOCommitment is an ECMH UTXO commitment to the block UTXO.
	UTXOCommitment *externalapi.DomainHash

	// Time the block was created.
	Timestamp mstime.Time

	// Difficulty target for the block.
	Bits uint32

	// Nonce used to generate the block.
	Nonce uint64

	// DAASCore is the DAA score of the block.
	DAAScore uint64

	BlueScore uint64

	// BlueWork is the blue work of the block.
	BlueWork *big.Int

	PruningPoint *externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgBlockHeader defines information about a block and is used in the kash block (MsgBlock) and headers (MsgHeader) messages.

func DomainBlockHeaderToBlockHeader

func DomainBlockHeaderToBlockHeader(domainBlockHeader externalapi.BlockHeader) *MsgBlockHeader

DomainBlockHeaderToBlockHeader converts an externalapi.BlockHeader to MsgBlockHeader

func NewBlockHeader

func NewBlockHeader(version uint16, parents []externalapi.BlockLevelParents, hashMerkleRoot *externalapi.DomainHash,
	acceptedIDMerkleRoot *externalapi.DomainHash, utxoCommitment *externalapi.DomainHash, bits uint32, nonce,
	daaScore, blueScore uint64, blueWork *big.Int, pruningPoint *externalapi.DomainHash) *MsgBlockHeader

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.

func (*MsgBlockHeader) BlockHash

func (h *MsgBlockHeader) BlockHash() *externalapi.DomainHash

BlockHash computes the block identifier hash for the given block header.

func (*MsgBlockHeader) MessageNumber

func (b *MsgBlockHeader) MessageNumber() uint64

func (*MsgBlockHeader) ReceivedAt

func (b *MsgBlockHeader) ReceivedAt() time.Time

func (*MsgBlockHeader) SetMessageNumber

func (b *MsgBlockHeader) SetMessageNumber(messageNumber uint64)

func (*MsgBlockHeader) SetReceivedAt

func (b *MsgBlockHeader) SetReceivedAt(receivedAt time.Time)

type MsgBlockLocator

type MsgBlockLocator struct {
	BlockLocatorHashes []*externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgBlockLocator implements the Message interface and represents a kash locator message. It is used to find the blockLocator of a peer that is syncing with you.

func NewMsgBlockLocator

func NewMsgBlockLocator(locatorHashes []*externalapi.DomainHash) *MsgBlockLocator

NewMsgBlockLocator returns a new kash locator message that conforms to the Message interface. See MsgBlockLocator for details.

func (*MsgBlockLocator) Command

func (msg *MsgBlockLocator) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgBlockLocator) MessageNumber

func (b *MsgBlockLocator) MessageNumber() uint64

func (*MsgBlockLocator) ReceivedAt

func (b *MsgBlockLocator) ReceivedAt() time.Time

func (*MsgBlockLocator) SetMessageNumber

func (b *MsgBlockLocator) SetMessageNumber(messageNumber uint64)

func (*MsgBlockLocator) SetReceivedAt

func (b *MsgBlockLocator) SetReceivedAt(receivedAt time.Time)

type MsgBlockWithTrustedData

type MsgBlockWithTrustedData struct {
	Block        *MsgBlock
	DAAScore     uint64
	DAAWindow    []*TrustedDataDataDAABlock
	GHOSTDAGData []*BlockGHOSTDAGDataHashPair
	// contains filtered or unexported fields
}

MsgBlockWithTrustedData represents a kash BlockWithTrustedData message

func DomainBlockWithTrustedDataToBlockWithTrustedData

func DomainBlockWithTrustedDataToBlockWithTrustedData(block *externalapi.BlockWithTrustedData) *MsgBlockWithTrustedData

DomainBlockWithTrustedDataToBlockWithTrustedData converts *externalapi.BlockWithTrustedData to *MsgBlockWithTrustedData

func NewMsgBlockWithTrustedData

func NewMsgBlockWithTrustedData() *MsgBlockWithTrustedData

NewMsgBlockWithTrustedData returns a new MsgBlockWithTrustedData.

func (*MsgBlockWithTrustedData) Command

func (msg *MsgBlockWithTrustedData) Command() MessageCommand

Command returns the protocol command string for the message

func (*MsgBlockWithTrustedData) MessageNumber

func (b *MsgBlockWithTrustedData) MessageNumber() uint64

func (*MsgBlockWithTrustedData) ReceivedAt

func (b *MsgBlockWithTrustedData) ReceivedAt() time.Time

func (*MsgBlockWithTrustedData) SetMessageNumber

func (b *MsgBlockWithTrustedData) SetMessageNumber(messageNumber uint64)

func (*MsgBlockWithTrustedData) SetReceivedAt

func (b *MsgBlockWithTrustedData) SetReceivedAt(receivedAt time.Time)

type MsgBlockWithTrustedDataV4

type MsgBlockWithTrustedDataV4 struct {
	Block               *MsgBlock
	DAAWindowIndices    []uint64
	GHOSTDAGDataIndices []uint64
	// contains filtered or unexported fields
}

MsgBlockWithTrustedDataV4 represents a kash BlockWithTrustedDataV4 message

func DomainBlockWithTrustedDataToBlockWithTrustedDataV4

func DomainBlockWithTrustedDataToBlockWithTrustedDataV4(block *externalapi.DomainBlock, daaWindowIndices, ghostdagDataIndices []uint64) *MsgBlockWithTrustedDataV4

DomainBlockWithTrustedDataToBlockWithTrustedDataV4 converts a set of *externalapi.DomainBlock, daa window indices and ghostdag data indices to *MsgBlockWithTrustedDataV4

func NewMsgBlockWithTrustedDataV4

func NewMsgBlockWithTrustedDataV4() *MsgBlockWithTrustedDataV4

NewMsgBlockWithTrustedDataV4 returns a new MsgBlockWithTrustedDataV4.

func (*MsgBlockWithTrustedDataV4) Command

Command returns the protocol command string for the message

func (*MsgBlockWithTrustedDataV4) MessageNumber

func (b *MsgBlockWithTrustedDataV4) MessageNumber() uint64

func (*MsgBlockWithTrustedDataV4) ReceivedAt

func (b *MsgBlockWithTrustedDataV4) ReceivedAt() time.Time

func (*MsgBlockWithTrustedDataV4) SetMessageNumber

func (b *MsgBlockWithTrustedDataV4) SetMessageNumber(messageNumber uint64)

func (*MsgBlockWithTrustedDataV4) SetReceivedAt

func (b *MsgBlockWithTrustedDataV4) SetReceivedAt(receivedAt time.Time)

type MsgDoneBlocksWithTrustedData

type MsgDoneBlocksWithTrustedData struct {
	// contains filtered or unexported fields
}

MsgDoneBlocksWithTrustedData implements the Message interface and represents a kash DoneBlocksWithTrustedData message

This message has no payload.

func NewMsgDoneBlocksWithTrustedData

func NewMsgDoneBlocksWithTrustedData() *MsgDoneBlocksWithTrustedData

NewMsgDoneBlocksWithTrustedData returns a new kash DoneBlocksWithTrustedData message that conforms to the Message interface.

func (*MsgDoneBlocksWithTrustedData) Command

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgDoneBlocksWithTrustedData) MessageNumber

func (b *MsgDoneBlocksWithTrustedData) MessageNumber() uint64

func (*MsgDoneBlocksWithTrustedData) ReceivedAt

func (b *MsgDoneBlocksWithTrustedData) ReceivedAt() time.Time

func (*MsgDoneBlocksWithTrustedData) SetMessageNumber

func (b *MsgDoneBlocksWithTrustedData) SetMessageNumber(messageNumber uint64)

func (*MsgDoneBlocksWithTrustedData) SetReceivedAt

func (b *MsgDoneBlocksWithTrustedData) SetReceivedAt(receivedAt time.Time)

type MsgDoneHeaders

type MsgDoneHeaders struct {
	// contains filtered or unexported fields
}

MsgDoneHeaders implements the Message interface and represents a kash DoneHeaders message. It is used to notify the IBD syncing peer that the syncer sent all the requested headers.

This message has no payload.

func NewMsgDoneHeaders

func NewMsgDoneHeaders() *MsgDoneHeaders

NewMsgDoneHeaders returns a new kash DoneIBDBlocks message that conforms to the Message interface.

func (*MsgDoneHeaders) Command

func (msg *MsgDoneHeaders) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgDoneHeaders) MessageNumber

func (b *MsgDoneHeaders) MessageNumber() uint64

func (*MsgDoneHeaders) ReceivedAt

func (b *MsgDoneHeaders) ReceivedAt() time.Time

func (*MsgDoneHeaders) SetMessageNumber

func (b *MsgDoneHeaders) SetMessageNumber(messageNumber uint64)

func (*MsgDoneHeaders) SetReceivedAt

func (b *MsgDoneHeaders) SetReceivedAt(receivedAt time.Time)

type MsgDonePruningPointUTXOSetChunks

type MsgDonePruningPointUTXOSetChunks struct {
	// contains filtered or unexported fields
}

MsgDonePruningPointUTXOSetChunks represents a kash DonePruningPointUTXOSetChunks message

func NewMsgDonePruningPointUTXOSetChunks

func NewMsgDonePruningPointUTXOSetChunks() *MsgDonePruningPointUTXOSetChunks

NewMsgDonePruningPointUTXOSetChunks returns a new MsgDonePruningPointUTXOSetChunks.

func (*MsgDonePruningPointUTXOSetChunks) Command

Command returns the protocol command string for the message

func (*MsgDonePruningPointUTXOSetChunks) MessageNumber

func (b *MsgDonePruningPointUTXOSetChunks) MessageNumber() uint64

func (*MsgDonePruningPointUTXOSetChunks) ReceivedAt

func (b *MsgDonePruningPointUTXOSetChunks) ReceivedAt() time.Time

func (*MsgDonePruningPointUTXOSetChunks) SetMessageNumber

func (b *MsgDonePruningPointUTXOSetChunks) SetMessageNumber(messageNumber uint64)

func (*MsgDonePruningPointUTXOSetChunks) SetReceivedAt

func (b *MsgDonePruningPointUTXOSetChunks) SetReceivedAt(receivedAt time.Time)

type MsgIBDBlock

type MsgIBDBlock struct {
	*MsgBlock
	// contains filtered or unexported fields
}

MsgIBDBlock implements the Message interface and represents a kash ibdblock message. It is used to deliver block and transaction information in response to a RequestIBDBlocks message (MsgRequestIBDBlocks).

func NewMsgIBDBlock

func NewMsgIBDBlock(msgBlock *MsgBlock) *MsgIBDBlock

NewMsgIBDBlock returns a new kash ibdblock message that conforms to the Message interface. See MsgIBDBlock for details.

func (*MsgIBDBlock) Command

func (msg *MsgIBDBlock) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgIBDBlock) MaxPayloadLength

func (msg *MsgIBDBlock) MaxPayloadLength(pver uint32) uint32

MaxPayloadLength returns the maximum length the payload can be for the receiver. This is part of the Message interface implementation.

func (*MsgIBDBlock) MessageNumber

func (b *MsgIBDBlock) MessageNumber() uint64

func (*MsgIBDBlock) ReceivedAt

func (b *MsgIBDBlock) ReceivedAt() time.Time

func (*MsgIBDBlock) SetMessageNumber

func (b *MsgIBDBlock) SetMessageNumber(messageNumber uint64)

func (*MsgIBDBlock) SetReceivedAt

func (b *MsgIBDBlock) SetReceivedAt(receivedAt time.Time)

type MsgIBDBlockLocator

type MsgIBDBlockLocator struct {
	TargetHash         *externalapi.DomainHash
	BlockLocatorHashes []*externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgIBDBlockLocator represents a kash ibdBlockLocator message

func NewMsgIBDBlockLocator

func NewMsgIBDBlockLocator(targetHash *externalapi.DomainHash,
	blockLocatorHashes []*externalapi.DomainHash) *MsgIBDBlockLocator

NewMsgIBDBlockLocator returns a new kaspa ibdBlockLocator message

func (*MsgIBDBlockLocator) Command

func (msg *MsgIBDBlockLocator) Command() MessageCommand

Command returns the protocol command string for the message

func (*MsgIBDBlockLocator) MessageNumber

func (b *MsgIBDBlockLocator) MessageNumber() uint64

func (*MsgIBDBlockLocator) ReceivedAt

func (b *MsgIBDBlockLocator) ReceivedAt() time.Time

func (*MsgIBDBlockLocator) SetMessageNumber

func (b *MsgIBDBlockLocator) SetMessageNumber(messageNumber uint64)

func (*MsgIBDBlockLocator) SetReceivedAt

func (b *MsgIBDBlockLocator) SetReceivedAt(receivedAt time.Time)

type MsgIBDBlockLocatorHighestHash

type MsgIBDBlockLocatorHighestHash struct {
	HighestHash *externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgIBDBlockLocatorHighestHash represents a kaspa BlockLocatorHighestHash message

func NewMsgIBDBlockLocatorHighestHash

func NewMsgIBDBlockLocatorHighestHash(highestHash *externalapi.DomainHash) *MsgIBDBlockLocatorHighestHash

NewMsgIBDBlockLocatorHighestHash returns a new BlockLocatorHighestHash message

func (*MsgIBDBlockLocatorHighestHash) Command

Command returns the protocol command string for the message

func (*MsgIBDBlockLocatorHighestHash) MessageNumber

func (b *MsgIBDBlockLocatorHighestHash) MessageNumber() uint64

func (*MsgIBDBlockLocatorHighestHash) ReceivedAt

func (b *MsgIBDBlockLocatorHighestHash) ReceivedAt() time.Time

func (*MsgIBDBlockLocatorHighestHash) SetMessageNumber

func (b *MsgIBDBlockLocatorHighestHash) SetMessageNumber(messageNumber uint64)

func (*MsgIBDBlockLocatorHighestHash) SetReceivedAt

func (b *MsgIBDBlockLocatorHighestHash) SetReceivedAt(receivedAt time.Time)

type MsgIBDBlockLocatorHighestHashNotFound

type MsgIBDBlockLocatorHighestHashNotFound struct {
	// contains filtered or unexported fields
}

MsgIBDBlockLocatorHighestHashNotFound represents a kaspa BlockLocatorHighestHashNotFound message

func NewMsgIBDBlockLocatorHighestHashNotFound

func NewMsgIBDBlockLocatorHighestHashNotFound() *MsgIBDBlockLocatorHighestHashNotFound

NewMsgIBDBlockLocatorHighestHashNotFound returns a new IBDBlockLocatorHighestHashNotFound message

func (*MsgIBDBlockLocatorHighestHashNotFound) Command

Command returns the protocol command string for the message

func (*MsgIBDBlockLocatorHighestHashNotFound) MessageNumber

func (b *MsgIBDBlockLocatorHighestHashNotFound) MessageNumber() uint64

func (*MsgIBDBlockLocatorHighestHashNotFound) ReceivedAt

func (b *MsgIBDBlockLocatorHighestHashNotFound) ReceivedAt() time.Time

func (*MsgIBDBlockLocatorHighestHashNotFound) SetMessageNumber

func (b *MsgIBDBlockLocatorHighestHashNotFound) SetMessageNumber(messageNumber uint64)

func (*MsgIBDBlockLocatorHighestHashNotFound) SetReceivedAt

func (b *MsgIBDBlockLocatorHighestHashNotFound) SetReceivedAt(receivedAt time.Time)

type MsgIBDChainBlockLocator

type MsgIBDChainBlockLocator struct {
	BlockLocatorHashes []*externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgIBDChainBlockLocator implements the Message interface and represents a kaspa locator message. It is used to find the blockLocator of a peer that is syncing with you.

func NewMsgIBDChainBlockLocator

func NewMsgIBDChainBlockLocator(locatorHashes []*externalapi.DomainHash) *MsgIBDChainBlockLocator

NewMsgIBDChainBlockLocator returns a new kaspa locator message that conforms to the Message interface. See MsgBlockLocator for details.

func (*MsgIBDChainBlockLocator) Command

func (msg *MsgIBDChainBlockLocator) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgIBDChainBlockLocator) MessageNumber

func (b *MsgIBDChainBlockLocator) MessageNumber() uint64

func (*MsgIBDChainBlockLocator) ReceivedAt

func (b *MsgIBDChainBlockLocator) ReceivedAt() time.Time

func (*MsgIBDChainBlockLocator) SetMessageNumber

func (b *MsgIBDChainBlockLocator) SetMessageNumber(messageNumber uint64)

func (*MsgIBDChainBlockLocator) SetReceivedAt

func (b *MsgIBDChainBlockLocator) SetReceivedAt(receivedAt time.Time)

type MsgInvRelayBlock

type MsgInvRelayBlock struct {
	Hash *externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgInvRelayBlock implements the Message interface and represents a kaspa block inventory message. It is used to notify the network about new block by sending their hash, and let the receiving node decide if it needs it.

func NewMsgInvBlock

func NewMsgInvBlock(hash *externalapi.DomainHash) *MsgInvRelayBlock

NewMsgInvBlock returns a new kaspa invrelblk message that conforms to the Message interface. See MsgInvRelayBlock for details.

func (*MsgInvRelayBlock) Command

func (msg *MsgInvRelayBlock) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgInvRelayBlock) MessageNumber

func (b *MsgInvRelayBlock) MessageNumber() uint64

func (*MsgInvRelayBlock) ReceivedAt

func (b *MsgInvRelayBlock) ReceivedAt() time.Time

func (*MsgInvRelayBlock) SetMessageNumber

func (b *MsgInvRelayBlock) SetMessageNumber(messageNumber uint64)

func (*MsgInvRelayBlock) SetReceivedAt

func (b *MsgInvRelayBlock) SetReceivedAt(receivedAt time.Time)

type MsgInvTransaction

type MsgInvTransaction struct {
	TxIDs []*externalapi.DomainTransactionID
	// contains filtered or unexported fields
}

MsgInvTransaction implements the Message interface and represents a kaspa TxInv message. It is used to notify the network about new transactions by sending their ID, and let the receiving node decide if it needs it.

func NewMsgInvTransaction

func NewMsgInvTransaction(ids []*externalapi.DomainTransactionID) *MsgInvTransaction

NewMsgInvTransaction returns a new kaspa TxInv message that conforms to the Message interface. See MsgInvTransaction for details.

func (*MsgInvTransaction) Command

func (msg *MsgInvTransaction) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgInvTransaction) MessageNumber

func (b *MsgInvTransaction) MessageNumber() uint64

func (*MsgInvTransaction) ReceivedAt

func (b *MsgInvTransaction) ReceivedAt() time.Time

func (*MsgInvTransaction) SetMessageNumber

func (b *MsgInvTransaction) SetMessageNumber(messageNumber uint64)

func (*MsgInvTransaction) SetReceivedAt

func (b *MsgInvTransaction) SetReceivedAt(receivedAt time.Time)

type MsgPing

type MsgPing struct {

	// Unique value associated with message that is used to identify
	// specific ping message.
	Nonce uint64
	// contains filtered or unexported fields
}

MsgPing implements the Message interface and represents a kaspa ping message.

For versions BIP0031Version and earlier, it is used primarily to confirm that a connection is still valid. A transmission error is typically interpreted as a closed connection and that the peer should be removed. For versions AFTER BIP0031Version it contains an identifier which can be returned in the pong message to determine network timing.

The payload for this message just consists of a nonce used for identifying it later.

func NewMsgPing

func NewMsgPing(nonce uint64) *MsgPing

NewMsgPing returns a new kaspa ping message that conforms to the Message interface. See MsgPing for details.

func (*MsgPing) Command

func (msg *MsgPing) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgPing) MessageNumber

func (b *MsgPing) MessageNumber() uint64

func (*MsgPing) ReceivedAt

func (b *MsgPing) ReceivedAt() time.Time

func (*MsgPing) SetMessageNumber

func (b *MsgPing) SetMessageNumber(messageNumber uint64)

func (*MsgPing) SetReceivedAt

func (b *MsgPing) SetReceivedAt(receivedAt time.Time)

type MsgPong

type MsgPong struct {

	// Unique value associated with message that is used to identify
	// specific ping message.
	Nonce uint64
	// contains filtered or unexported fields
}

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).

This message was not added until protocol versions AFTER BIP0031Version.

func NewMsgPong

func NewMsgPong(nonce uint64) *MsgPong

NewMsgPong returns a new kaspa pong message that conforms to the Message interface. See MsgPong for details.

func (*MsgPong) Command

func (msg *MsgPong) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgPong) MessageNumber

func (b *MsgPong) MessageNumber() uint64

func (*MsgPong) ReceivedAt

func (b *MsgPong) ReceivedAt() time.Time

func (*MsgPong) SetMessageNumber

func (b *MsgPong) SetMessageNumber(messageNumber uint64)

func (*MsgPong) SetReceivedAt

func (b *MsgPong) SetReceivedAt(receivedAt time.Time)

type MsgPruningPointProof

type MsgPruningPointProof struct {
	Headers [][]*MsgBlockHeader
	// contains filtered or unexported fields
}

MsgPruningPointProof represents a kaspa PruningPointProof message

func DomainPruningPointProofToMsgPruningPointProof

func DomainPruningPointProofToMsgPruningPointProof(pruningPointProof *externalapi.PruningPointProof) *MsgPruningPointProof

DomainPruningPointProofToMsgPruningPointProof converts *externalapi.PruningPointProof to *MsgPruningPointProof

func NewMsgPruningPointProof

func NewMsgPruningPointProof(headers [][]*MsgBlockHeader) *MsgPruningPointProof

NewMsgPruningPointProof returns a new MsgPruningPointProof.

func (*MsgPruningPointProof) Command

func (msg *MsgPruningPointProof) Command() MessageCommand

Command returns the protocol command string for the message

func (*MsgPruningPointProof) MessageNumber

func (b *MsgPruningPointProof) MessageNumber() uint64

func (*MsgPruningPointProof) ReceivedAt

func (b *MsgPruningPointProof) ReceivedAt() time.Time

func (*MsgPruningPointProof) SetMessageNumber

func (b *MsgPruningPointProof) SetMessageNumber(messageNumber uint64)

func (*MsgPruningPointProof) SetReceivedAt

func (b *MsgPruningPointProof) SetReceivedAt(receivedAt time.Time)

type MsgPruningPointUTXOSetChunk

type MsgPruningPointUTXOSetChunk struct {
	OutpointAndUTXOEntryPairs []*OutpointAndUTXOEntryPair
	// contains filtered or unexported fields
}

MsgPruningPointUTXOSetChunk represents a kaspa PruningPointUTXOSetChunk message

func NewMsgPruningPointUTXOSetChunk

func NewMsgPruningPointUTXOSetChunk(outpointAndUTXOEntryPairs []*OutpointAndUTXOEntryPair) *MsgPruningPointUTXOSetChunk

NewMsgPruningPointUTXOSetChunk returns a new MsgPruningPointUTXOSetChunk.

func (*MsgPruningPointUTXOSetChunk) Command

Command returns the protocol command string for the message

func (*MsgPruningPointUTXOSetChunk) MessageNumber

func (b *MsgPruningPointUTXOSetChunk) MessageNumber() uint64

func (*MsgPruningPointUTXOSetChunk) ReceivedAt

func (b *MsgPruningPointUTXOSetChunk) ReceivedAt() time.Time

func (*MsgPruningPointUTXOSetChunk) SetMessageNumber

func (b *MsgPruningPointUTXOSetChunk) SetMessageNumber(messageNumber uint64)

func (*MsgPruningPointUTXOSetChunk) SetReceivedAt

func (b *MsgPruningPointUTXOSetChunk) SetReceivedAt(receivedAt time.Time)

type MsgPruningPoints

type MsgPruningPoints struct {
	Headers []*MsgBlockHeader
	// contains filtered or unexported fields
}

MsgPruningPoints represents a kaspa PruningPoints message

func NewMsgPruningPoints

func NewMsgPruningPoints(headers []*MsgBlockHeader) *MsgPruningPoints

NewMsgPruningPoints returns a new MsgPruningPoints.

func (*MsgPruningPoints) Command

func (msg *MsgPruningPoints) Command() MessageCommand

Command returns the protocol command string for the message

func (*MsgPruningPoints) MessageNumber

func (b *MsgPruningPoints) MessageNumber() uint64

func (*MsgPruningPoints) ReceivedAt

func (b *MsgPruningPoints) ReceivedAt() time.Time

func (*MsgPruningPoints) SetMessageNumber

func (b *MsgPruningPoints) SetMessageNumber(messageNumber uint64)

func (*MsgPruningPoints) SetReceivedAt

func (b *MsgPruningPoints) SetReceivedAt(receivedAt time.Time)

type MsgReady

type MsgReady struct {
	// contains filtered or unexported fields
}

MsgReady implements the Message interface and represents a kaspa Ready message. It is used to notify that the peer is ready to receive messages.

This message has no payload.

func NewMsgReady

func NewMsgReady() *MsgReady

NewMsgReady returns a new kaspa Ready message that conforms to the Message interface.

func (*MsgReady) Command

func (msg *MsgReady) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgReady) MessageNumber

func (b *MsgReady) MessageNumber() uint64

func (*MsgReady) ReceivedAt

func (b *MsgReady) ReceivedAt() time.Time

func (*MsgReady) SetMessageNumber

func (b *MsgReady) SetMessageNumber(messageNumber uint64)

func (*MsgReady) SetReceivedAt

func (b *MsgReady) SetReceivedAt(receivedAt time.Time)

type MsgReject

type MsgReject struct {
	Reason string
	// contains filtered or unexported fields
}

MsgReject implements the Message interface and represents a kaspa Reject message. It is used to notify peers why they are banned.

func NewMsgReject

func NewMsgReject(reason string) *MsgReject

NewMsgReject returns a new kaspa Reject message that conforms to the Message interface.

func (*MsgReject) Command

func (msg *MsgReject) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgReject) MessageNumber

func (b *MsgReject) MessageNumber() uint64

func (*MsgReject) ReceivedAt

func (b *MsgReject) ReceivedAt() time.Time

func (*MsgReject) SetMessageNumber

func (b *MsgReject) SetMessageNumber(messageNumber uint64)

func (*MsgReject) SetReceivedAt

func (b *MsgReject) SetReceivedAt(receivedAt time.Time)

type MsgRequestAddresses

type MsgRequestAddresses struct {
	IncludeAllSubnetworks bool
	SubnetworkID          *externalapi.DomainSubnetworkID
	// contains filtered or unexported fields
}

MsgRequestAddresses implements the Message interface and represents a kaspa RequestAddresses message. It is used to request a list of known active peers on the network from a peer to help identify potential nodes. The list is returned via one or more addr messages (MsgAddresses).

This message has no payload.

func NewMsgRequestAddresses

func NewMsgRequestAddresses(includeAllSubnetworks bool, subnetworkID *externalapi.DomainSubnetworkID) *MsgRequestAddresses

NewMsgRequestAddresses returns a new kaspa RequestAddresses message that conforms to the Message interface. See MsgRequestAddresses for details.

func (*MsgRequestAddresses) Command

func (msg *MsgRequestAddresses) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgRequestAddresses) MessageNumber

func (b *MsgRequestAddresses) MessageNumber() uint64

func (*MsgRequestAddresses) ReceivedAt

func (b *MsgRequestAddresses) ReceivedAt() time.Time

func (*MsgRequestAddresses) SetMessageNumber

func (b *MsgRequestAddresses) SetMessageNumber(messageNumber uint64)

func (*MsgRequestAddresses) SetReceivedAt

func (b *MsgRequestAddresses) SetReceivedAt(receivedAt time.Time)

type MsgRequestAnticone

type MsgRequestAnticone struct {
	BlockHash   *externalapi.DomainHash
	ContextHash *externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgRequestAnticone implements the Message interface and represents a kaspa RequestHeaders message. It is used to request the set past(ContextHash) \cap anticone(BlockHash)

func NewMsgRequestAnticone

func NewMsgRequestAnticone(blockHash, contextHash *externalapi.DomainHash) *MsgRequestAnticone

NewMsgRequestAnticone returns a new kaspa RequestPastDiff message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.

func (*MsgRequestAnticone) Command

func (msg *MsgRequestAnticone) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgRequestAnticone) MessageNumber

func (b *MsgRequestAnticone) MessageNumber() uint64

func (*MsgRequestAnticone) ReceivedAt

func (b *MsgRequestAnticone) ReceivedAt() time.Time

func (*MsgRequestAnticone) SetMessageNumber

func (b *MsgRequestAnticone) SetMessageNumber(messageNumber uint64)

func (*MsgRequestAnticone) SetReceivedAt

func (b *MsgRequestAnticone) SetReceivedAt(receivedAt time.Time)

type MsgRequestBlockLocator

type MsgRequestBlockLocator struct {
	HighHash *externalapi.DomainHash
	Limit    uint32
	// contains filtered or unexported fields
}

MsgRequestBlockLocator implements the Message interface and represents a kaspa RequestBlockLocator message. It is used to request a block locator between low and high hash. The locator is returned via a locator message (MsgBlockLocator).

func NewMsgRequestBlockLocator

func NewMsgRequestBlockLocator(highHash *externalapi.DomainHash, limit uint32) *MsgRequestBlockLocator

NewMsgRequestBlockLocator returns a new RequestBlockLocator message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.

func (*MsgRequestBlockLocator) Command

func (msg *MsgRequestBlockLocator) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgRequestBlockLocator) MessageNumber

func (b *MsgRequestBlockLocator) MessageNumber() uint64

func (*MsgRequestBlockLocator) ReceivedAt

func (b *MsgRequestBlockLocator) ReceivedAt() time.Time

func (*MsgRequestBlockLocator) SetMessageNumber

func (b *MsgRequestBlockLocator) SetMessageNumber(messageNumber uint64)

func (*MsgRequestBlockLocator) SetReceivedAt

func (b *MsgRequestBlockLocator) SetReceivedAt(receivedAt time.Time)

type MsgRequestHeaders

type MsgRequestHeaders struct {
	LowHash  *externalapi.DomainHash
	HighHash *externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgRequestHeaders implements the Message interface and represents a kaspa RequestHeaders message. It is used to request a list of blocks starting after the low hash and until the high hash.

func NewMsgRequstHeaders

func NewMsgRequstHeaders(lowHash, highHash *externalapi.DomainHash) *MsgRequestHeaders

NewMsgRequstHeaders returns a new kaspa RequestHeaders message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.

func (*MsgRequestHeaders) Command

func (msg *MsgRequestHeaders) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgRequestHeaders) MessageNumber

func (b *MsgRequestHeaders) MessageNumber() uint64

func (*MsgRequestHeaders) ReceivedAt

func (b *MsgRequestHeaders) ReceivedAt() time.Time

func (*MsgRequestHeaders) SetMessageNumber

func (b *MsgRequestHeaders) SetMessageNumber(messageNumber uint64)

func (*MsgRequestHeaders) SetReceivedAt

func (b *MsgRequestHeaders) SetReceivedAt(receivedAt time.Time)

type MsgRequestIBDBlocks

type MsgRequestIBDBlocks struct {
	Hashes []*externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgRequestIBDBlocks implements the Message interface and represents a kaspa RequestIBDBlocks message. It is used to request blocks as part of the IBD protocol.

func NewMsgRequestIBDBlocks

func NewMsgRequestIBDBlocks(hashes []*externalapi.DomainHash) *MsgRequestIBDBlocks

NewMsgRequestIBDBlocks returns a new MsgRequestIBDBlocks.

func (*MsgRequestIBDBlocks) Command

func (msg *MsgRequestIBDBlocks) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgRequestIBDBlocks) MessageNumber

func (b *MsgRequestIBDBlocks) MessageNumber() uint64

func (*MsgRequestIBDBlocks) ReceivedAt

func (b *MsgRequestIBDBlocks) ReceivedAt() time.Time

func (*MsgRequestIBDBlocks) SetMessageNumber

func (b *MsgRequestIBDBlocks) SetMessageNumber(messageNumber uint64)

func (*MsgRequestIBDBlocks) SetReceivedAt

func (b *MsgRequestIBDBlocks) SetReceivedAt(receivedAt time.Time)

type MsgRequestIBDChainBlockLocator

type MsgRequestIBDChainBlockLocator struct {
	HighHash *externalapi.DomainHash
	LowHash  *externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgRequestIBDChainBlockLocator implements the Message interface and represents a kaspa IBDRequestChainBlockLocator message. It is used to request a block locator between low and high hash. The locator is returned via a locator message (MsgIBDChainBlockLocator).

func NewMsgIBDRequestChainBlockLocator

func NewMsgIBDRequestChainBlockLocator(highHash, lowHash *externalapi.DomainHash) *MsgRequestIBDChainBlockLocator

NewMsgIBDRequestChainBlockLocator returns a new IBDRequestChainBlockLocator message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.

func (*MsgRequestIBDChainBlockLocator) Command

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgRequestIBDChainBlockLocator) MessageNumber

func (b *MsgRequestIBDChainBlockLocator) MessageNumber() uint64

func (*MsgRequestIBDChainBlockLocator) ReceivedAt

func (b *MsgRequestIBDChainBlockLocator) ReceivedAt() time.Time

func (*MsgRequestIBDChainBlockLocator) SetMessageNumber

func (b *MsgRequestIBDChainBlockLocator) SetMessageNumber(messageNumber uint64)

func (*MsgRequestIBDChainBlockLocator) SetReceivedAt

func (b *MsgRequestIBDChainBlockLocator) SetReceivedAt(receivedAt time.Time)

type MsgRequestNextHeaders

type MsgRequestNextHeaders struct {
	// contains filtered or unexported fields
}

MsgRequestNextHeaders implements the Message interface and represents a kaspa RequestNextHeaders message. It is used to notify the IBD syncer peer to send more headers.

This message has no payload.

func NewMsgRequestNextHeaders

func NewMsgRequestNextHeaders() *MsgRequestNextHeaders

NewMsgRequestNextHeaders returns a new kaspa RequestNextHeaders message that conforms to the Message interface.

func (*MsgRequestNextHeaders) Command

func (msg *MsgRequestNextHeaders) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgRequestNextHeaders) MessageNumber

func (b *MsgRequestNextHeaders) MessageNumber() uint64

func (*MsgRequestNextHeaders) ReceivedAt

func (b *MsgRequestNextHeaders) ReceivedAt() time.Time

func (*MsgRequestNextHeaders) SetMessageNumber

func (b *MsgRequestNextHeaders) SetMessageNumber(messageNumber uint64)

func (*MsgRequestNextHeaders) SetReceivedAt

func (b *MsgRequestNextHeaders) SetReceivedAt(receivedAt time.Time)

type MsgRequestNextPruningPointAndItsAnticoneBlocks

type MsgRequestNextPruningPointAndItsAnticoneBlocks struct {
	// contains filtered or unexported fields
}

MsgRequestNextPruningPointAndItsAnticoneBlocks implements the Message interface and represents a kaspa RequestNextPruningPointAndItsAnticoneBlocks message. It is used to notify the IBD syncer peer to send more blocks from the pruning anticone.

This message has no payload.

func NewMsgRequestNextPruningPointAndItsAnticoneBlocks

func NewMsgRequestNextPruningPointAndItsAnticoneBlocks() *MsgRequestNextPruningPointAndItsAnticoneBlocks

NewMsgRequestNextPruningPointAndItsAnticoneBlocks returns a new kaspa RequestNextPruningPointAndItsAnticoneBlocks message that conforms to the Message interface.

func (*MsgRequestNextPruningPointAndItsAnticoneBlocks) Command

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgRequestNextPruningPointAndItsAnticoneBlocks) MessageNumber

func (b *MsgRequestNextPruningPointAndItsAnticoneBlocks) MessageNumber() uint64

func (*MsgRequestNextPruningPointAndItsAnticoneBlocks) ReceivedAt

func (b *MsgRequestNextPruningPointAndItsAnticoneBlocks) ReceivedAt() time.Time

func (*MsgRequestNextPruningPointAndItsAnticoneBlocks) SetMessageNumber

func (b *MsgRequestNextPruningPointAndItsAnticoneBlocks) SetMessageNumber(messageNumber uint64)

func (*MsgRequestNextPruningPointAndItsAnticoneBlocks) SetReceivedAt

func (b *MsgRequestNextPruningPointAndItsAnticoneBlocks) SetReceivedAt(receivedAt time.Time)

type MsgRequestNextPruningPointUTXOSetChunk

type MsgRequestNextPruningPointUTXOSetChunk struct {
	// contains filtered or unexported fields
}

MsgRequestNextPruningPointUTXOSetChunk represents a kaspa RequestNextPruningPointUTXOSetChunk message

func NewMsgRequestNextPruningPointUTXOSetChunk

func NewMsgRequestNextPruningPointUTXOSetChunk() *MsgRequestNextPruningPointUTXOSetChunk

NewMsgRequestNextPruningPointUTXOSetChunk returns a new MsgRequestNextPruningPointUTXOSetChunk.

func (*MsgRequestNextPruningPointUTXOSetChunk) Command

Command returns the protocol command string for the message

func (*MsgRequestNextPruningPointUTXOSetChunk) MessageNumber

func (b *MsgRequestNextPruningPointUTXOSetChunk) MessageNumber() uint64

func (*MsgRequestNextPruningPointUTXOSetChunk) ReceivedAt

func (b *MsgRequestNextPruningPointUTXOSetChunk) ReceivedAt() time.Time

func (*MsgRequestNextPruningPointUTXOSetChunk) SetMessageNumber

func (b *MsgRequestNextPruningPointUTXOSetChunk) SetMessageNumber(messageNumber uint64)

func (*MsgRequestNextPruningPointUTXOSetChunk) SetReceivedAt

func (b *MsgRequestNextPruningPointUTXOSetChunk) SetReceivedAt(receivedAt time.Time)

type MsgRequestPruningPointAndItsAnticone

type MsgRequestPruningPointAndItsAnticone struct {
	// contains filtered or unexported fields
}

MsgRequestPruningPointAndItsAnticone represents a kash RequestPruningPointAndItsAnticone message

func NewMsgRequestPruningPointAndItsAnticone

func NewMsgRequestPruningPointAndItsAnticone() *MsgRequestPruningPointAndItsAnticone

NewMsgRequestPruningPointAndItsAnticone returns a new MsgRequestPruningPointAndItsAnticone.

func (*MsgRequestPruningPointAndItsAnticone) Command

Command returns the protocol command string for the message

func (*MsgRequestPruningPointAndItsAnticone) MessageNumber

func (b *MsgRequestPruningPointAndItsAnticone) MessageNumber() uint64

func (*MsgRequestPruningPointAndItsAnticone) ReceivedAt

func (b *MsgRequestPruningPointAndItsAnticone) ReceivedAt() time.Time

func (*MsgRequestPruningPointAndItsAnticone) SetMessageNumber

func (b *MsgRequestPruningPointAndItsAnticone) SetMessageNumber(messageNumber uint64)

func (*MsgRequestPruningPointAndItsAnticone) SetReceivedAt

func (b *MsgRequestPruningPointAndItsAnticone) SetReceivedAt(receivedAt time.Time)

type MsgRequestPruningPointProof

type MsgRequestPruningPointProof struct {
	// contains filtered or unexported fields
}

MsgRequestPruningPointProof represents a kaspa RequestPruningPointProof message

func NewMsgRequestPruningPointProof

func NewMsgRequestPruningPointProof() *MsgRequestPruningPointProof

NewMsgRequestPruningPointProof returns a new MsgRequestPruningPointProof.

func (*MsgRequestPruningPointProof) Command

Command returns the protocol command string for the message

func (*MsgRequestPruningPointProof) MessageNumber

func (b *MsgRequestPruningPointProof) MessageNumber() uint64

func (*MsgRequestPruningPointProof) ReceivedAt

func (b *MsgRequestPruningPointProof) ReceivedAt() time.Time

func (*MsgRequestPruningPointProof) SetMessageNumber

func (b *MsgRequestPruningPointProof) SetMessageNumber(messageNumber uint64)

func (*MsgRequestPruningPointProof) SetReceivedAt

func (b *MsgRequestPruningPointProof) SetReceivedAt(receivedAt time.Time)

type MsgRequestPruningPointUTXOSet

type MsgRequestPruningPointUTXOSet struct {
	PruningPointHash *externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgRequestPruningPointUTXOSet represents a kaspa RequestPruningPointUTXOSet message

func NewMsgRequestPruningPointUTXOSet

func NewMsgRequestPruningPointUTXOSet(pruningPointHash *externalapi.DomainHash) *MsgRequestPruningPointUTXOSet

NewMsgRequestPruningPointUTXOSet returns a new MsgRequestPruningPointUTXOSet

func (*MsgRequestPruningPointUTXOSet) Command

Command returns the protocol command string for the message

func (*MsgRequestPruningPointUTXOSet) MessageNumber

func (b *MsgRequestPruningPointUTXOSet) MessageNumber() uint64

func (*MsgRequestPruningPointUTXOSet) ReceivedAt

func (b *MsgRequestPruningPointUTXOSet) ReceivedAt() time.Time

func (*MsgRequestPruningPointUTXOSet) SetMessageNumber

func (b *MsgRequestPruningPointUTXOSet) SetMessageNumber(messageNumber uint64)

func (*MsgRequestPruningPointUTXOSet) SetReceivedAt

func (b *MsgRequestPruningPointUTXOSet) SetReceivedAt(receivedAt time.Time)

type MsgRequestRelayBlocks

type MsgRequestRelayBlocks struct {
	Hashes []*externalapi.DomainHash
	// contains filtered or unexported fields
}

MsgRequestRelayBlocks implements the Message interface and represents a kaspa RequestRelayBlocks message. It is used to request blocks as part of the block relay protocol.

func NewMsgRequestRelayBlocks

func NewMsgRequestRelayBlocks(hashes []*externalapi.DomainHash) *MsgRequestRelayBlocks

NewMsgRequestRelayBlocks returns a new kaspa RequestRelayBlocks message that conforms to the Message interface. See MsgRequestRelayBlocks for details.

func (*MsgRequestRelayBlocks) Command

func (msg *MsgRequestRelayBlocks) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgRequestRelayBlocks) MessageNumber

func (b *MsgRequestRelayBlocks) MessageNumber() uint64

func (*MsgRequestRelayBlocks) ReceivedAt

func (b *MsgRequestRelayBlocks) ReceivedAt() time.Time

func (*MsgRequestRelayBlocks) SetMessageNumber

func (b *MsgRequestRelayBlocks) SetMessageNumber(messageNumber uint64)

func (*MsgRequestRelayBlocks) SetReceivedAt

func (b *MsgRequestRelayBlocks) SetReceivedAt(receivedAt time.Time)

type MsgRequestTransactions

type MsgRequestTransactions struct {
	IDs []*externalapi.DomainTransactionID
	// contains filtered or unexported fields
}

MsgRequestTransactions implements the Message interface and represents a kaspa RequestTransactions message. It is used to request transactions as part of the transactions relay protocol.

func NewMsgRequestTransactions

func NewMsgRequestTransactions(ids []*externalapi.DomainTransactionID) *MsgRequestTransactions

NewMsgRequestTransactions returns a new kaspa RequestTransactions message that conforms to the Message interface. See MsgRequestTransactions for details.

func (*MsgRequestTransactions) Command

func (msg *MsgRequestTransactions) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgRequestTransactions) MessageNumber

func (b *MsgRequestTransactions) MessageNumber() uint64

func (*MsgRequestTransactions) ReceivedAt

func (b *MsgRequestTransactions) ReceivedAt() time.Time

func (*MsgRequestTransactions) SetMessageNumber

func (b *MsgRequestTransactions) SetMessageNumber(messageNumber uint64)

func (*MsgRequestTransactions) SetReceivedAt

func (b *MsgRequestTransactions) SetReceivedAt(receivedAt time.Time)

type MsgTransactionNotFound

type MsgTransactionNotFound struct {
	ID *externalapi.DomainTransactionID
	// contains filtered or unexported fields
}

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.

func NewMsgTransactionNotFound

func NewMsgTransactionNotFound(id *externalapi.DomainTransactionID) *MsgTransactionNotFound

NewMsgTransactionNotFound returns a new kaspa transactionsnotfound message that conforms to the Message interface. See MsgTransactionNotFound for details.

func (*MsgTransactionNotFound) Command

func (msg *MsgTransactionNotFound) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgTransactionNotFound) MessageNumber

func (b *MsgTransactionNotFound) MessageNumber() uint64

func (*MsgTransactionNotFound) ReceivedAt

func (b *MsgTransactionNotFound) ReceivedAt() time.Time

func (*MsgTransactionNotFound) SetMessageNumber

func (b *MsgTransactionNotFound) SetMessageNumber(messageNumber uint64)

func (*MsgTransactionNotFound) SetReceivedAt

func (b *MsgTransactionNotFound) SetReceivedAt(receivedAt time.Time)

type MsgTrustedData

type MsgTrustedData struct {
	DAAWindow    []*TrustedDataDAAHeader
	GHOSTDAGData []*BlockGHOSTDAGDataHashPair
	// contains filtered or unexported fields
}

MsgTrustedData represents a kaspa TrustedData message

func DomainTrustedDataToTrustedData

func DomainTrustedDataToTrustedData(domainDAAWindow []*externalapi.TrustedDataDataDAAHeader, domainGHOSTDAGData []*externalapi.BlockGHOSTDAGDataHashPair) *MsgTrustedData

DomainTrustedDataToTrustedData converts *externalapi.BlockWithTrustedData to *MsgBlockWithTrustedData

func NewMsgTrustedData

func NewMsgTrustedData() *MsgTrustedData

NewMsgTrustedData returns a new MsgTrustedData.

func (*MsgTrustedData) Command

func (msg *MsgTrustedData) Command() MessageCommand

Command returns the protocol command string for the message

func (*MsgTrustedData) MessageNumber

func (b *MsgTrustedData) MessageNumber() uint64

func (*MsgTrustedData) ReceivedAt

func (b *MsgTrustedData) ReceivedAt() time.Time

func (*MsgTrustedData) SetMessageNumber

func (b *MsgTrustedData) SetMessageNumber(messageNumber uint64)

func (*MsgTrustedData) SetReceivedAt

func (b *MsgTrustedData) SetReceivedAt(receivedAt time.Time)

type MsgTx

type MsgTx struct {
	Version      uint16
	TxIn         []*TxIn
	TxOut        []*TxOut
	LockTime     uint64
	SubnetworkID externalapi.DomainSubnetworkID
	Gas          uint64
	Payload      []byte
	// contains filtered or unexported fields
}

MsgTx implements the Message interface and represents a kaspa tx message. It is used to deliver transaction information in response to a getdata message (MsgGetData) for a given transaction.

Use the AddTxIn and AddTxOut functions to build up the list of transaction inputs and outputs.

func DomainTransactionToMsgTx

func DomainTransactionToMsgTx(domainTransaction *externalapi.DomainTransaction) *MsgTx

DomainTransactionToMsgTx converts an externalapi.DomainTransaction into an MsgTx

func NewNativeMsgTx

func NewNativeMsgTx(version uint16, txIn []*TxIn, txOut []*TxOut) *MsgTx

NewNativeMsgTx returns a new tx message in the native subnetwork

func NewNativeMsgTxWithLocktime

func NewNativeMsgTxWithLocktime(version uint16, txIn []*TxIn, txOut []*TxOut, locktime uint64) *MsgTx

NewNativeMsgTxWithLocktime returns a new tx message in the native subnetwork with a locktime.

See newMsgTx for further documntation of the parameters

func NewRegistryMsgTx

func NewRegistryMsgTx(version uint16, txIn []*TxIn, txOut []*TxOut, gasLimit uint64) *MsgTx

NewRegistryMsgTx creates a new MsgTx that registers a new subnetwork

func NewSubnetworkMsgTx

func NewSubnetworkMsgTx(version uint16, txIn []*TxIn, txOut []*TxOut, subnetworkID *externalapi.DomainSubnetworkID,
	gas uint64, payload []byte) *MsgTx

NewSubnetworkMsgTx returns a new tx message in the specified subnetwork with specified gas and payload

func (*MsgTx) AddTxIn

func (msg *MsgTx) AddTxIn(ti *TxIn)

AddTxIn adds a transaction input to the message.

func (*MsgTx) AddTxOut

func (msg *MsgTx) AddTxOut(to *TxOut)

AddTxOut adds a transaction output to the message.

func (*MsgTx) Command

func (msg *MsgTx) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgTx) Copy

func (msg *MsgTx) Copy() *MsgTx

Copy creates a deep copy of a transaction so that the original does not get modified when the copy is manipulated.

func (*MsgTx) IsCoinBase

func (msg *MsgTx) IsCoinBase() bool

IsCoinBase determines whether or not a transaction is a coinbase transaction. A coinbase transaction is a special transaction created by miners that distributes fees and block subsidy to the previous blocks' miners, and to specify the scriptPubKey that will be used to pay the current miner in future blocks. Each input of the coinbase transaction should set index to maximum value and reference the relevant block id, instead of previous transaction id.

func (*MsgTx) IsSubnetworkCompatible

func (msg *MsgTx) IsSubnetworkCompatible(subnetworkID *externalapi.DomainSubnetworkID) bool

IsSubnetworkCompatible return true iff subnetworkID is one or more of the following: 1. The SupportsAll subnetwork (full node) 2. The native subnetwork 3. The transaction's subnetwork

func (*MsgTx) MaxPayloadLength

func (msg *MsgTx) MaxPayloadLength(pver uint32) uint32

MaxPayloadLength returns the maximum length the payload can be for the receiver. This is part of the Message interface implementation.

func (*MsgTx) MessageNumber

func (b *MsgTx) MessageNumber() uint64

func (*MsgTx) ReceivedAt

func (b *MsgTx) ReceivedAt() time.Time

func (*MsgTx) SetMessageNumber

func (b *MsgTx) SetMessageNumber(messageNumber uint64)

func (*MsgTx) SetReceivedAt

func (b *MsgTx) SetReceivedAt(receivedAt time.Time)

func (*MsgTx) TxHash

func (msg *MsgTx) TxHash() *externalapi.DomainHash

TxHash generates the Hash for the transaction.

func (*MsgTx) TxID

func (msg *MsgTx) TxID() *externalapi.DomainTransactionID

TxID generates the Hash for the transaction without the signature script, gas and payload fields.

type MsgUnexpectedPruningPoint

type MsgUnexpectedPruningPoint struct {
	// contains filtered or unexported fields
}

MsgUnexpectedPruningPoint represents a kaspa UnexpectedPruningPoint message

func NewMsgUnexpectedPruningPoint

func NewMsgUnexpectedPruningPoint() *MsgUnexpectedPruningPoint

NewMsgUnexpectedPruningPoint returns a new kaspa UnexpectedPruningPoint message

func (*MsgUnexpectedPruningPoint) Command

Command returns the protocol command string for the message

func (*MsgUnexpectedPruningPoint) MessageNumber

func (b *MsgUnexpectedPruningPoint) MessageNumber() uint64

func (*MsgUnexpectedPruningPoint) ReceivedAt

func (b *MsgUnexpectedPruningPoint) ReceivedAt() time.Time

func (*MsgUnexpectedPruningPoint) SetMessageNumber

func (b *MsgUnexpectedPruningPoint) SetMessageNumber(messageNumber uint64)

func (*MsgUnexpectedPruningPoint) SetReceivedAt

func (b *MsgUnexpectedPruningPoint) SetReceivedAt(receivedAt time.Time)

type MsgVerAck

type MsgVerAck struct {
	// contains filtered or unexported fields
}

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. It implements the Message interface.

This message has no payload.

func NewMsgVerAck

func NewMsgVerAck() *MsgVerAck

NewMsgVerAck returns a new kaspa verack message that conforms to the Message interface.

func (*MsgVerAck) Command

func (msg *MsgVerAck) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgVerAck) MessageNumber

func (b *MsgVerAck) MessageNumber() uint64

func (*MsgVerAck) ReceivedAt

func (b *MsgVerAck) ReceivedAt() time.Time

func (*MsgVerAck) SetMessageNumber

func (b *MsgVerAck) SetMessageNumber(messageNumber uint64)

func (*MsgVerAck) SetReceivedAt

func (b *MsgVerAck) SetReceivedAt(receivedAt time.Time)

type MsgVersion

type MsgVersion struct {

	// Version of the protocol the node is using.
	ProtocolVersion uint32

	// The peer's network (mainnet, testnet, etc.)
	Network string

	// Bitfield which identifies the enabled services.
	Services ServiceFlag

	// Time the message was generated. This is encoded as an int64 on the appmessage.
	Timestamp mstime.Time

	// Address of the local peer.
	Address *NetAddress

	// The peer unique ID
	ID *id.ID

	// The user agent that generated messsage. This is a encoded as a varString
	// on the appmessage. This has a max length of MaxUserAgentLen.
	UserAgent string

	// Don't announce transactions to peer.
	DisableRelayTx bool

	// The subnetwork of the generator of the version message. Should be nil in full nodes
	SubnetworkID *externalapi.DomainSubnetworkID
	// contains filtered or unexported fields
}

MsgVersion implements the Message interface and represents a kaspa version message. It is used for a peer to advertise itself as soon as an outbound connection is made. The remote peer then uses this information along with its own to negotiate. The remote peer must then respond with a version message of its own containing the negotiated values followed by a verack message (MsgVerAck). This exchange must take place before any further communication is allowed to proceed.

func NewMsgVersion

func NewMsgVersion(addr *NetAddress, id *id.ID, network string,
	subnetworkID *externalapi.DomainSubnetworkID, protocolVersion uint32) *MsgVersion

NewMsgVersion returns a new kaspa version message that conforms to the Message interface using the passed parameters and defaults for the remaining fields.

func (*MsgVersion) AddService

func (msg *MsgVersion) AddService(service ServiceFlag)

AddService adds service as a supported service by the peer generating the message.

func (*MsgVersion) AddUserAgent

func (msg *MsgVersion) AddUserAgent(name string, version string,
	comments ...string)

AddUserAgent adds a user agent to the user agent string for the version message. The version string is not defined to any strict format, although it is recommended to use the form "major.minor.revision" e.g. "2.6.41".

func (*MsgVersion) Command

func (msg *MsgVersion) Command() MessageCommand

Command returns the protocol command string for the message. This is part of the Message interface implementation.

func (*MsgVersion) HasService

func (msg *MsgVersion) HasService(service ServiceFlag) bool

HasService returns whether the specified service is supported by the peer that generated the message.

func (*MsgVersion) MessageNumber

func (b *MsgVersion) MessageNumber() uint64

func (*MsgVersion) ReceivedAt

func (b *MsgVersion) ReceivedAt() time.Time

func (*MsgVersion) SetMessageNumber

func (b *MsgVersion) SetMessageNumber(messageNumber uint64)

func (*MsgVersion) SetReceivedAt

func (b *MsgVersion) SetReceivedAt(receivedAt time.Time)

type NetAddress

type NetAddress struct {
	// Last time the address was seen.
	Timestamp mstime.Time

	// IP address of the peer.
	IP net.IP

	// Port the peer is using. This is encoded in big endian on the appmessage
	// which differs from most everything else.
	Port uint16
}

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.

func NewNetAddress

func NewNetAddress(addr *net.TCPAddr) *NetAddress

NewNetAddress returns a new NetAddress using the provided TCP address and supported services with defaults for the remaining fields.

func NewNetAddressIPPort

func NewNetAddressIPPort(ip net.IP, port uint16) *NetAddress

NewNetAddressIPPort returns a new NetAddress using the provided IP, port, and supported services with defaults for the remaining fields.

func NewNetAddressTimestamp

func NewNetAddressTimestamp(
	timestamp mstime.Time, ip net.IP, port uint16) *NetAddress

NewNetAddressTimestamp returns a new NetAddress using the provided timestamp, IP, port, and supported services. The timestamp is rounded to single millisecond precision.

func (NetAddress) String

func (na NetAddress) String() string

func (*NetAddress) TCPAddress

func (na *NetAddress) TCPAddress() *net.TCPAddr

TCPAddress converts the NetAddress to *net.TCPAddr

type NewBlockTemplateNotificationMessage

type NewBlockTemplateNotificationMessage struct {
	// contains filtered or unexported fields
}

NewBlockTemplateNotificationMessage is an appmessage corresponding to its respective RPC message

func NewNewBlockTemplateNotificationMessage

func NewNewBlockTemplateNotificationMessage() *NewBlockTemplateNotificationMessage

NewNewBlockTemplateNotificationMessage returns an instance of the message

func (*NewBlockTemplateNotificationMessage) Command

Command returns the protocol command string for the message

func (*NewBlockTemplateNotificationMessage) MessageNumber

func (b *NewBlockTemplateNotificationMessage) MessageNumber() uint64

func (*NewBlockTemplateNotificationMessage) ReceivedAt

func (b *NewBlockTemplateNotificationMessage) ReceivedAt() time.Time

func (*NewBlockTemplateNotificationMessage) SetMessageNumber

func (b *NewBlockTemplateNotificationMessage) SetMessageNumber(messageNumber uint64)

func (*NewBlockTemplateNotificationMessage) SetReceivedAt

func (b *NewBlockTemplateNotificationMessage) SetReceivedAt(receivedAt time.Time)

type NotifyBlockAddedRequestMessage

type NotifyBlockAddedRequestMessage struct {
	// contains filtered or unexported fields
}

NotifyBlockAddedRequestMessage is an appmessage corresponding to its respective RPC message

func NewNotifyBlockAddedRequestMessage

func NewNotifyBlockAddedRequestMessage() *NotifyBlockAddedRequestMessage

NewNotifyBlockAddedRequestMessage returns a instance of the message

func (*NotifyBlockAddedRequestMessage) Command

Command returns the protocol command string for the message

func (*NotifyBlockAddedRequestMessage) MessageNumber

func (b *NotifyBlockAddedRequestMessage) MessageNumber() uint64

func (*NotifyBlockAddedRequestMessage) ReceivedAt

func (b *NotifyBlockAddedRequestMessage) ReceivedAt() time.Time

func (*NotifyBlockAddedRequestMessage) SetMessageNumber

func (b *NotifyBlockAddedRequestMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyBlockAddedRequestMessage) SetReceivedAt

func (b *NotifyBlockAddedRequestMessage) SetReceivedAt(receivedAt time.Time)

type NotifyBlockAddedResponseMessage

type NotifyBlockAddedResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

NotifyBlockAddedResponseMessage is an appmessage corresponding to its respective RPC message

func NewNotifyBlockAddedResponseMessage

func NewNotifyBlockAddedResponseMessage() *NotifyBlockAddedResponseMessage

NewNotifyBlockAddedResponseMessage returns a instance of the message

func (*NotifyBlockAddedResponseMessage) Command

Command returns the protocol command string for the message

func (*NotifyBlockAddedResponseMessage) MessageNumber

func (b *NotifyBlockAddedResponseMessage) MessageNumber() uint64

func (*NotifyBlockAddedResponseMessage) ReceivedAt

func (b *NotifyBlockAddedResponseMessage) ReceivedAt() time.Time

func (*NotifyBlockAddedResponseMessage) SetMessageNumber

func (b *NotifyBlockAddedResponseMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyBlockAddedResponseMessage) SetReceivedAt

func (b *NotifyBlockAddedResponseMessage) SetReceivedAt(receivedAt time.Time)

type NotifyFinalityConflictsRequestMessage

type NotifyFinalityConflictsRequestMessage struct {
	// contains filtered or unexported fields
}

NotifyFinalityConflictsRequestMessage is an appmessage corresponding to its respective RPC message

func NewNotifyFinalityConflictsRequestMessage

func NewNotifyFinalityConflictsRequestMessage() *NotifyFinalityConflictsRequestMessage

NewNotifyFinalityConflictsRequestMessage returns a instance of the message

func (*NotifyFinalityConflictsRequestMessage) Command

Command returns the protocol command string for the message

func (*NotifyFinalityConflictsRequestMessage) MessageNumber

func (b *NotifyFinalityConflictsRequestMessage) MessageNumber() uint64

func (*NotifyFinalityConflictsRequestMessage) ReceivedAt

func (b *NotifyFinalityConflictsRequestMessage) ReceivedAt() time.Time

func (*NotifyFinalityConflictsRequestMessage) SetMessageNumber

func (b *NotifyFinalityConflictsRequestMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyFinalityConflictsRequestMessage) SetReceivedAt

func (b *NotifyFinalityConflictsRequestMessage) SetReceivedAt(receivedAt time.Time)

type NotifyFinalityConflictsResponseMessage

type NotifyFinalityConflictsResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

NotifyFinalityConflictsResponseMessage is an appmessage corresponding to its respective RPC message

func NewNotifyFinalityConflictsResponseMessage

func NewNotifyFinalityConflictsResponseMessage() *NotifyFinalityConflictsResponseMessage

NewNotifyFinalityConflictsResponseMessage returns a instance of the message

func (*NotifyFinalityConflictsResponseMessage) Command

Command returns the protocol command string for the message

func (*NotifyFinalityConflictsResponseMessage) MessageNumber

func (b *NotifyFinalityConflictsResponseMessage) MessageNumber() uint64

func (*NotifyFinalityConflictsResponseMessage) ReceivedAt

func (b *NotifyFinalityConflictsResponseMessage) ReceivedAt() time.Time

func (*NotifyFinalityConflictsResponseMessage) SetMessageNumber

func (b *NotifyFinalityConflictsResponseMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyFinalityConflictsResponseMessage) SetReceivedAt

func (b *NotifyFinalityConflictsResponseMessage) SetReceivedAt(receivedAt time.Time)

type NotifyNewBlockTemplateRequestMessage

type NotifyNewBlockTemplateRequestMessage struct {
	// contains filtered or unexported fields
}

NotifyNewBlockTemplateRequestMessage is an appmessage corresponding to its respective RPC message

func NewNotifyNewBlockTemplateRequestMessage

func NewNotifyNewBlockTemplateRequestMessage() *NotifyNewBlockTemplateRequestMessage

NewNotifyNewBlockTemplateRequestMessage returns an instance of the message

func (*NotifyNewBlockTemplateRequestMessage) Command

Command returns the protocol command string for the message

func (*NotifyNewBlockTemplateRequestMessage) MessageNumber

func (b *NotifyNewBlockTemplateRequestMessage) MessageNumber() uint64

func (*NotifyNewBlockTemplateRequestMessage) ReceivedAt

func (b *NotifyNewBlockTemplateRequestMessage) ReceivedAt() time.Time

func (*NotifyNewBlockTemplateRequestMessage) SetMessageNumber

func (b *NotifyNewBlockTemplateRequestMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyNewBlockTemplateRequestMessage) SetReceivedAt

func (b *NotifyNewBlockTemplateRequestMessage) SetReceivedAt(receivedAt time.Time)

type NotifyNewBlockTemplateResponseMessage

type NotifyNewBlockTemplateResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

NotifyNewBlockTemplateResponseMessage is an appmessage corresponding to its respective RPC message

func NewNotifyNewBlockTemplateResponseMessage

func NewNotifyNewBlockTemplateResponseMessage() *NotifyNewBlockTemplateResponseMessage

NewNotifyNewBlockTemplateResponseMessage returns an instance of the message

func (*NotifyNewBlockTemplateResponseMessage) Command

Command returns the protocol command string for the message

func (*NotifyNewBlockTemplateResponseMessage) MessageNumber

func (b *NotifyNewBlockTemplateResponseMessage) MessageNumber() uint64

func (*NotifyNewBlockTemplateResponseMessage) ReceivedAt

func (b *NotifyNewBlockTemplateResponseMessage) ReceivedAt() time.Time

func (*NotifyNewBlockTemplateResponseMessage) SetMessageNumber

func (b *NotifyNewBlockTemplateResponseMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyNewBlockTemplateResponseMessage) SetReceivedAt

func (b *NotifyNewBlockTemplateResponseMessage) SetReceivedAt(receivedAt time.Time)

type NotifyPruningPointUTXOSetOverrideRequestMessage

type NotifyPruningPointUTXOSetOverrideRequestMessage struct {
	// contains filtered or unexported fields
}

NotifyPruningPointUTXOSetOverrideRequestMessage is an appmessage corresponding to its respective RPC message

func NewNotifyPruningPointUTXOSetOverrideRequestMessage

func NewNotifyPruningPointUTXOSetOverrideRequestMessage() *NotifyPruningPointUTXOSetOverrideRequestMessage

NewNotifyPruningPointUTXOSetOverrideRequestMessage returns a instance of the message

func (*NotifyPruningPointUTXOSetOverrideRequestMessage) Command

Command returns the protocol command string for the message

func (*NotifyPruningPointUTXOSetOverrideRequestMessage) MessageNumber

func (b *NotifyPruningPointUTXOSetOverrideRequestMessage) MessageNumber() uint64

func (*NotifyPruningPointUTXOSetOverrideRequestMessage) ReceivedAt

func (b *NotifyPruningPointUTXOSetOverrideRequestMessage) ReceivedAt() time.Time

func (*NotifyPruningPointUTXOSetOverrideRequestMessage) SetMessageNumber

func (b *NotifyPruningPointUTXOSetOverrideRequestMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyPruningPointUTXOSetOverrideRequestMessage) SetReceivedAt

func (b *NotifyPruningPointUTXOSetOverrideRequestMessage) SetReceivedAt(receivedAt time.Time)

type NotifyPruningPointUTXOSetOverrideResponseMessage

type NotifyPruningPointUTXOSetOverrideResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

NotifyPruningPointUTXOSetOverrideResponseMessage is an appmessage corresponding to its respective RPC message

func NewNotifyPruningPointUTXOSetOverrideResponseMessage

func NewNotifyPruningPointUTXOSetOverrideResponseMessage() *NotifyPruningPointUTXOSetOverrideResponseMessage

NewNotifyPruningPointUTXOSetOverrideResponseMessage returns a instance of the message

func (*NotifyPruningPointUTXOSetOverrideResponseMessage) Command

Command returns the protocol command string for the message

func (*NotifyPruningPointUTXOSetOverrideResponseMessage) MessageNumber

func (b *NotifyPruningPointUTXOSetOverrideResponseMessage) MessageNumber() uint64

func (*NotifyPruningPointUTXOSetOverrideResponseMessage) ReceivedAt

func (b *NotifyPruningPointUTXOSetOverrideResponseMessage) ReceivedAt() time.Time

func (*NotifyPruningPointUTXOSetOverrideResponseMessage) SetMessageNumber

func (b *NotifyPruningPointUTXOSetOverrideResponseMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyPruningPointUTXOSetOverrideResponseMessage) SetReceivedAt

func (b *NotifyPruningPointUTXOSetOverrideResponseMessage) SetReceivedAt(receivedAt time.Time)

type NotifyUTXOsChangedRequestMessage

type NotifyUTXOsChangedRequestMessage struct {
	Addresses  []string
	AssetTypes []uint32
	// contains filtered or unexported fields
}

NotifyUTXOsChangedRequestMessage is an appmessage corresponding to its respective RPC message

func NewNotifyUTXOsChangedRequestMessage

func NewNotifyUTXOsChangedRequestMessage(addresses []string, assetTypes []uint32) *NotifyUTXOsChangedRequestMessage

NewNotifyUTXOsChangedRequestMessage returns a instance of the message

func (*NotifyUTXOsChangedRequestMessage) Command

Command returns the protocol command string for the message

func (*NotifyUTXOsChangedRequestMessage) MessageNumber

func (b *NotifyUTXOsChangedRequestMessage) MessageNumber() uint64

func (*NotifyUTXOsChangedRequestMessage) ReceivedAt

func (b *NotifyUTXOsChangedRequestMessage) ReceivedAt() time.Time

func (*NotifyUTXOsChangedRequestMessage) SetMessageNumber

func (b *NotifyUTXOsChangedRequestMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyUTXOsChangedRequestMessage) SetReceivedAt

func (b *NotifyUTXOsChangedRequestMessage) SetReceivedAt(receivedAt time.Time)

type NotifyUTXOsChangedResponseMessage

type NotifyUTXOsChangedResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

NotifyUTXOsChangedResponseMessage is an appmessage corresponding to its respective RPC message

func NewNotifyUTXOsChangedResponseMessage

func NewNotifyUTXOsChangedResponseMessage() *NotifyUTXOsChangedResponseMessage

NewNotifyUTXOsChangedResponseMessage returns a instance of the message

func (*NotifyUTXOsChangedResponseMessage) Command

Command returns the protocol command string for the message

func (*NotifyUTXOsChangedResponseMessage) MessageNumber

func (b *NotifyUTXOsChangedResponseMessage) MessageNumber() uint64

func (*NotifyUTXOsChangedResponseMessage) ReceivedAt

func (b *NotifyUTXOsChangedResponseMessage) ReceivedAt() time.Time

func (*NotifyUTXOsChangedResponseMessage) SetMessageNumber

func (b *NotifyUTXOsChangedResponseMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyUTXOsChangedResponseMessage) SetReceivedAt

func (b *NotifyUTXOsChangedResponseMessage) SetReceivedAt(receivedAt time.Time)

type NotifyVirtualDaaScoreChangedRequestMessage

type NotifyVirtualDaaScoreChangedRequestMessage struct {
	// contains filtered or unexported fields
}

NotifyVirtualDaaScoreChangedRequestMessage is an appmessage corresponding to its respective RPC message

func NewNotifyVirtualDaaScoreChangedRequestMessage

func NewNotifyVirtualDaaScoreChangedRequestMessage() *NotifyVirtualDaaScoreChangedRequestMessage

NewNotifyVirtualDaaScoreChangedRequestMessage returns a instance of the message

func (*NotifyVirtualDaaScoreChangedRequestMessage) Command

Command returns the protocol command string for the message

func (*NotifyVirtualDaaScoreChangedRequestMessage) MessageNumber

func (b *NotifyVirtualDaaScoreChangedRequestMessage) MessageNumber() uint64

func (*NotifyVirtualDaaScoreChangedRequestMessage) ReceivedAt

func (b *NotifyVirtualDaaScoreChangedRequestMessage) ReceivedAt() time.Time

func (*NotifyVirtualDaaScoreChangedRequestMessage) SetMessageNumber

func (b *NotifyVirtualDaaScoreChangedRequestMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyVirtualDaaScoreChangedRequestMessage) SetReceivedAt

func (b *NotifyVirtualDaaScoreChangedRequestMessage) SetReceivedAt(receivedAt time.Time)

type NotifyVirtualDaaScoreChangedResponseMessage

type NotifyVirtualDaaScoreChangedResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

NotifyVirtualDaaScoreChangedResponseMessage is an appmessage corresponding to its respective RPC message

func NewNotifyVirtualDaaScoreChangedResponseMessage

func NewNotifyVirtualDaaScoreChangedResponseMessage() *NotifyVirtualDaaScoreChangedResponseMessage

NewNotifyVirtualDaaScoreChangedResponseMessage returns a instance of the message

func (*NotifyVirtualDaaScoreChangedResponseMessage) Command

Command returns the protocol command string for the message

func (*NotifyVirtualDaaScoreChangedResponseMessage) MessageNumber

func (b *NotifyVirtualDaaScoreChangedResponseMessage) MessageNumber() uint64

func (*NotifyVirtualDaaScoreChangedResponseMessage) ReceivedAt

func (b *NotifyVirtualDaaScoreChangedResponseMessage) ReceivedAt() time.Time

func (*NotifyVirtualDaaScoreChangedResponseMessage) SetMessageNumber

func (b *NotifyVirtualDaaScoreChangedResponseMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyVirtualDaaScoreChangedResponseMessage) SetReceivedAt

func (b *NotifyVirtualDaaScoreChangedResponseMessage) SetReceivedAt(receivedAt time.Time)

type NotifyVirtualSelectedParentBlueScoreChangedRequestMessage

type NotifyVirtualSelectedParentBlueScoreChangedRequestMessage struct {
	// contains filtered or unexported fields
}

NotifyVirtualSelectedParentBlueScoreChangedRequestMessage is an appmessage corresponding to its respective RPC message

func NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage

func NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage() *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage

NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage returns a instance of the message

func (*NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) Command

Command returns the protocol command string for the message

func (*NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) MessageNumber

func (b *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) MessageNumber() uint64

func (*NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) ReceivedAt

func (b *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) ReceivedAt() time.Time

func (*NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) SetMessageNumber

func (b *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) SetReceivedAt

func (b *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) SetReceivedAt(receivedAt time.Time)

type NotifyVirtualSelectedParentBlueScoreChangedResponseMessage

type NotifyVirtualSelectedParentBlueScoreChangedResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

NotifyVirtualSelectedParentBlueScoreChangedResponseMessage is an appmessage corresponding to its respective RPC message

func NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage

func NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage() *NotifyVirtualSelectedParentBlueScoreChangedResponseMessage

NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage returns a instance of the message

func (*NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) Command

Command returns the protocol command string for the message

func (*NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) MessageNumber

func (b *NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) MessageNumber() uint64

func (*NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) ReceivedAt

func (b *NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) ReceivedAt() time.Time

func (*NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) SetMessageNumber

func (b *NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) SetReceivedAt

func (b *NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) SetReceivedAt(receivedAt time.Time)

type NotifyVirtualSelectedParentChainChangedRequestMessage

type NotifyVirtualSelectedParentChainChangedRequestMessage struct {
	IncludeAcceptedTransactionIDs bool
	// contains filtered or unexported fields
}

NotifyVirtualSelectedParentChainChangedRequestMessage is an appmessage corresponding to its respective RPC message

func NewNotifyVirtualSelectedParentChainChangedRequestMessage

func NewNotifyVirtualSelectedParentChainChangedRequestMessage(
	includeAcceptedTransactionIDs bool) *NotifyVirtualSelectedParentChainChangedRequestMessage

NewNotifyVirtualSelectedParentChainChangedRequestMessage returns an instance of the message

func (*NotifyVirtualSelectedParentChainChangedRequestMessage) Command

Command returns the protocol command string for the message

func (*NotifyVirtualSelectedParentChainChangedRequestMessage) MessageNumber

func (b *NotifyVirtualSelectedParentChainChangedRequestMessage) MessageNumber() uint64

func (*NotifyVirtualSelectedParentChainChangedRequestMessage) ReceivedAt

func (b *NotifyVirtualSelectedParentChainChangedRequestMessage) ReceivedAt() time.Time

func (*NotifyVirtualSelectedParentChainChangedRequestMessage) SetMessageNumber

func (b *NotifyVirtualSelectedParentChainChangedRequestMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyVirtualSelectedParentChainChangedRequestMessage) SetReceivedAt

func (b *NotifyVirtualSelectedParentChainChangedRequestMessage) SetReceivedAt(receivedAt time.Time)

type NotifyVirtualSelectedParentChainChangedResponseMessage

type NotifyVirtualSelectedParentChainChangedResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

NotifyVirtualSelectedParentChainChangedResponseMessage is an appmessage corresponding to its respective RPC message

func NewNotifyVirtualSelectedParentChainChangedResponseMessage

func NewNotifyVirtualSelectedParentChainChangedResponseMessage() *NotifyVirtualSelectedParentChainChangedResponseMessage

NewNotifyVirtualSelectedParentChainChangedResponseMessage returns a instance of the message

func (*NotifyVirtualSelectedParentChainChangedResponseMessage) Command

Command returns the protocol command string for the message

func (*NotifyVirtualSelectedParentChainChangedResponseMessage) MessageNumber

func (b *NotifyVirtualSelectedParentChainChangedResponseMessage) MessageNumber() uint64

func (*NotifyVirtualSelectedParentChainChangedResponseMessage) ReceivedAt

func (b *NotifyVirtualSelectedParentChainChangedResponseMessage) ReceivedAt() time.Time

func (*NotifyVirtualSelectedParentChainChangedResponseMessage) SetMessageNumber

func (b *NotifyVirtualSelectedParentChainChangedResponseMessage) SetMessageNumber(messageNumber uint64)

func (*NotifyVirtualSelectedParentChainChangedResponseMessage) SetReceivedAt

func (b *NotifyVirtualSelectedParentChainChangedResponseMessage) SetReceivedAt(receivedAt time.Time)

type Outpoint

type Outpoint struct {
	TxID  externalapi.DomainTransactionID
	Index uint32
}

Outpoint defines a kaspa data type that is used to track previous transaction outputs.

func NewOutpoint

func NewOutpoint(txID *externalapi.DomainTransactionID, index uint32) *Outpoint

NewOutpoint returns a new kaspa transaction outpoint point with the provided hash and index.

func (Outpoint) String

func (o Outpoint) String() string

String returns the Outpoint in the human-readable form "txID:index".

type OutpointAndUTXOEntryPair

type OutpointAndUTXOEntryPair struct {
	Outpoint  *Outpoint
	UTXOEntry *UTXOEntry
}

OutpointAndUTXOEntryPair is an outpoint along with its respective UTXO entry

func DomainOutpointAndUTXOEntryPairsToOutpointAndUTXOEntryPairs

func DomainOutpointAndUTXOEntryPairsToOutpointAndUTXOEntryPairs(
	outpointAndUTXOEntryPairs []*externalapi.OutpointAndUTXOEntryPair) []*OutpointAndUTXOEntryPair

DomainOutpointAndUTXOEntryPairsToOutpointAndUTXOEntryPairs converts domain OutpointAndUTXOEntryPairs to OutpointAndUTXOEntryPairs

type PruningPointUTXOSetOverrideNotificationMessage

type PruningPointUTXOSetOverrideNotificationMessage struct {
	// contains filtered or unexported fields
}

PruningPointUTXOSetOverrideNotificationMessage is an appmessage corresponding to its respective RPC message

func NewPruningPointUTXOSetOverrideNotificationMessage

func NewPruningPointUTXOSetOverrideNotificationMessage() *PruningPointUTXOSetOverrideNotificationMessage

NewPruningPointUTXOSetOverrideNotificationMessage returns a instance of the message

func (*PruningPointUTXOSetOverrideNotificationMessage) Command

Command returns the protocol command string for the message

func (*PruningPointUTXOSetOverrideNotificationMessage) MessageNumber

func (b *PruningPointUTXOSetOverrideNotificationMessage) MessageNumber() uint64

func (*PruningPointUTXOSetOverrideNotificationMessage) ReceivedAt

func (b *PruningPointUTXOSetOverrideNotificationMessage) ReceivedAt() time.Time

func (*PruningPointUTXOSetOverrideNotificationMessage) SetMessageNumber

func (b *PruningPointUTXOSetOverrideNotificationMessage) SetMessageNumber(messageNumber uint64)

func (*PruningPointUTXOSetOverrideNotificationMessage) SetReceivedAt

func (b *PruningPointUTXOSetOverrideNotificationMessage) SetReceivedAt(receivedAt time.Time)

type RPCBlock

type RPCBlock struct {
	Header       *RPCBlockHeader
	Transactions []*RPCTransaction
	VerboseData  *RPCBlockVerboseData
}

RPCBlock is a kashd block representation meant to be used over RPC

func DomainBlockToRPCBlock

func DomainBlockToRPCBlock(block *externalapi.DomainBlock) *RPCBlock

DomainBlockToRPCBlock converts DomainBlocks to RPCBlocks

type RPCBlockHeader

type RPCBlockHeader struct {
	Version              uint32
	Parents              []*RPCBlockLevelParents
	HashMerkleRoot       string
	AcceptedIDMerkleRoot string
	UTXOCommitment       string
	Timestamp            int64
	Bits                 uint32
	Nonce                uint64
	DAAScore             uint64
	BlueScore            uint64
	BlueWork             string
	PruningPoint         string
}

RPCBlockHeader is a kashd block header representation meant to be used over RPC

type RPCBlockLevelParents

type RPCBlockLevelParents struct {
	ParentHashes []string
}

RPCBlockLevelParents holds parent hashes for one block level

type RPCBlockVerboseData

type RPCBlockVerboseData struct {
	Hash                string
	Difficulty          float64
	SelectedParentHash  string
	TransactionIDs      []string
	IsHeaderOnly        bool
	BlueScore           uint64
	ChildrenHashes      []string
	MergeSetBluesHashes []string
	MergeSetRedsHashes  []string
	IsChainBlock        bool
}

RPCBlockVerboseData holds verbose data about a block

type RPCError

type RPCError struct {
	Message string
}

RPCError represents an error arriving from the RPC

func RPCErrorf

func RPCErrorf(format string, args ...interface{}) *RPCError

RPCErrorf formats according to a format specifier and returns the string as an RPCError.

func (RPCError) Error

func (err RPCError) Error() string

type RPCOutpoint

type RPCOutpoint struct {
	TransactionID string
	Index         uint32
}

RPCOutpoint is a kashd outpoint representation meant to be used over RPC

type RPCScriptPublicKey

type RPCScriptPublicKey struct {
	Version uint16
	Script  string
}

RPCScriptPublicKey is a kashd ScriptPublicKey representation

type RPCTransaction

type RPCTransaction struct {
	Version      uint16
	Inputs       []*RPCTransactionInput
	Outputs      []*RPCTransactionOutput
	LockTime     uint64
	SubnetworkID string
	Gas          uint64
	Payload      string
	VerboseData  *RPCTransactionVerboseData
}

RPCTransaction is a kashd transaction representation meant to be used over RPC

func DomainTransactionToRPCTransaction

func DomainTransactionToRPCTransaction(transaction *externalapi.DomainTransaction) *RPCTransaction

DomainTransactionToRPCTransaction converts DomainTransactions to RPCTransactions

type RPCTransactionInput

type RPCTransactionInput struct {
	PreviousOutpoint *RPCOutpoint
	SignatureScript  string
	Sequence         uint64
	SigOpCount       byte
	VerboseData      *RPCTransactionInputVerboseData
}

RPCTransactionInput is a kashd transaction input representation meant to be used over RPC

type RPCTransactionInputVerboseData

type RPCTransactionInputVerboseData struct {
}

RPCTransactionInputVerboseData holds data about a transaction input

type RPCTransactionOutput

type RPCTransactionOutput struct {
	Amount          uint64
	ScriptPublicKey *RPCScriptPublicKey
	VerboseData     *RPCTransactionOutputVerboseData
}

RPCTransactionOutput is a kashd transaction output representation meant to be used over RPC

type RPCTransactionOutputVerboseData

type RPCTransactionOutputVerboseData struct {
	ScriptPublicKeyType    string
	ScriptPublicKeyAddress string
}

RPCTransactionOutputVerboseData holds data about a transaction output

type RPCTransactionVerboseData

type RPCTransactionVerboseData struct {
	TransactionID string
	Hash          string
	Mass          uint64
	BlockHash     string
	BlockTime     uint64
}

RPCTransactionVerboseData holds verbose data about a transaction

type RPCUTXOEntry

type RPCUTXOEntry struct {
	Amount          uint64
	AssetType       uint32
	ScriptPublicKey *RPCScriptPublicKey
	BlockDAAScore   uint64
	IsCoinbase      bool
}

RPCUTXOEntry is a kashd utxo entry representation meant to be used over RPC

type RejectReason

type RejectReason byte

RejectReason describes the reason why a block sent by SubmitBlock was rejected

const (
	RejectReasonNone         RejectReason = 0
	RejectReasonBlockInvalid RejectReason = 1
	RejectReasonIsInIBD      RejectReason = 2
)

RejectReason constants Not using iota, since in the .proto file those are hardcoded

func (RejectReason) String

func (rr RejectReason) String() string

type ResolveFinalityConflictRequestMessage

type ResolveFinalityConflictRequestMessage struct {
	FinalityBlockHash string
	// contains filtered or unexported fields
}

ResolveFinalityConflictRequestMessage is an appmessage corresponding to its respective RPC message

func NewResolveFinalityConflictRequestMessage

func NewResolveFinalityConflictRequestMessage(finalityBlockHash string) *ResolveFinalityConflictRequestMessage

NewResolveFinalityConflictRequestMessage returns a instance of the message

func (*ResolveFinalityConflictRequestMessage) Command

Command returns the protocol command string for the message

func (*ResolveFinalityConflictRequestMessage) MessageNumber

func (b *ResolveFinalityConflictRequestMessage) MessageNumber() uint64

func (*ResolveFinalityConflictRequestMessage) ReceivedAt

func (b *ResolveFinalityConflictRequestMessage) ReceivedAt() time.Time

func (*ResolveFinalityConflictRequestMessage) SetMessageNumber

func (b *ResolveFinalityConflictRequestMessage) SetMessageNumber(messageNumber uint64)

func (*ResolveFinalityConflictRequestMessage) SetReceivedAt

func (b *ResolveFinalityConflictRequestMessage) SetReceivedAt(receivedAt time.Time)

type ResolveFinalityConflictResponseMessage

type ResolveFinalityConflictResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

ResolveFinalityConflictResponseMessage is an appmessage corresponding to its respective RPC message

func NewResolveFinalityConflictResponseMessage

func NewResolveFinalityConflictResponseMessage() *ResolveFinalityConflictResponseMessage

NewResolveFinalityConflictResponseMessage returns a instance of the message

func (*ResolveFinalityConflictResponseMessage) Command

Command returns the protocol command string for the message

func (*ResolveFinalityConflictResponseMessage) MessageNumber

func (b *ResolveFinalityConflictResponseMessage) MessageNumber() uint64

func (*ResolveFinalityConflictResponseMessage) ReceivedAt

func (b *ResolveFinalityConflictResponseMessage) ReceivedAt() time.Time

func (*ResolveFinalityConflictResponseMessage) SetMessageNumber

func (b *ResolveFinalityConflictResponseMessage) SetMessageNumber(messageNumber uint64)

func (*ResolveFinalityConflictResponseMessage) SetReceivedAt

func (b *ResolveFinalityConflictResponseMessage) SetReceivedAt(receivedAt time.Time)

type ServiceFlag

type ServiceFlag uint64

ServiceFlag identifies services supported by a kaspa peer.

const (
	// SFNodeNetwork is a flag used to indicate a peer is a full node.
	SFNodeNetwork ServiceFlag = 1 << iota

	// SFNodeGetUTXO is a flag used to indicate a peer supports the
	// getutxos and utxos commands (BIP0064).
	SFNodeGetUTXO

	// SFNodeBloom is a flag used to indicate a peer supports bloom
	// filtering.
	SFNodeBloom

	// SFNodeXthin is a flag used to indicate a peer supports xthin blocks.
	SFNodeXthin

	// SFNodeBit5 is a flag used to indicate a peer supports a service
	// defined by bit 5.
	SFNodeBit5

	// SFNodeCF is a flag used to indicate a peer supports committed
	// filters (CFs).
	SFNodeCF
)

func (ServiceFlag) String

func (f ServiceFlag) String() string

String returns the ServiceFlag in human-readable form.

type ShutDownRequestMessage

type ShutDownRequestMessage struct {
	// contains filtered or unexported fields
}

ShutDownRequestMessage is an appmessage corresponding to its respective RPC message

func NewShutDownRequestMessage

func NewShutDownRequestMessage() *ShutDownRequestMessage

NewShutDownRequestMessage returns a instance of the message

func (*ShutDownRequestMessage) Command

func (msg *ShutDownRequestMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*ShutDownRequestMessage) MessageNumber

func (b *ShutDownRequestMessage) MessageNumber() uint64

func (*ShutDownRequestMessage) ReceivedAt

func (b *ShutDownRequestMessage) ReceivedAt() time.Time

func (*ShutDownRequestMessage) SetMessageNumber

func (b *ShutDownRequestMessage) SetMessageNumber(messageNumber uint64)

func (*ShutDownRequestMessage) SetReceivedAt

func (b *ShutDownRequestMessage) SetReceivedAt(receivedAt time.Time)

type ShutDownResponseMessage

type ShutDownResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

ShutDownResponseMessage is an appmessage corresponding to its respective RPC message

func NewShutDownResponseMessage

func NewShutDownResponseMessage() *ShutDownResponseMessage

NewShutDownResponseMessage returns a instance of the message

func (*ShutDownResponseMessage) Command

func (msg *ShutDownResponseMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*ShutDownResponseMessage) MessageNumber

func (b *ShutDownResponseMessage) MessageNumber() uint64

func (*ShutDownResponseMessage) ReceivedAt

func (b *ShutDownResponseMessage) ReceivedAt() time.Time

func (*ShutDownResponseMessage) SetMessageNumber

func (b *ShutDownResponseMessage) SetMessageNumber(messageNumber uint64)

func (*ShutDownResponseMessage) SetReceivedAt

func (b *ShutDownResponseMessage) SetReceivedAt(receivedAt time.Time)

type StopNotifyingPruningPointUTXOSetOverrideRequestMessage

type StopNotifyingPruningPointUTXOSetOverrideRequestMessage struct {
	// contains filtered or unexported fields
}

StopNotifyingPruningPointUTXOSetOverrideRequestMessage is an appmessage corresponding to its respective RPC message

func NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage

func NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage() *StopNotifyingPruningPointUTXOSetOverrideRequestMessage

NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage returns a instance of the message

func (*StopNotifyingPruningPointUTXOSetOverrideRequestMessage) Command

Command returns the protocol command string for the message

func (*StopNotifyingPruningPointUTXOSetOverrideRequestMessage) MessageNumber

func (b *StopNotifyingPruningPointUTXOSetOverrideRequestMessage) MessageNumber() uint64

func (*StopNotifyingPruningPointUTXOSetOverrideRequestMessage) ReceivedAt

func (b *StopNotifyingPruningPointUTXOSetOverrideRequestMessage) ReceivedAt() time.Time

func (*StopNotifyingPruningPointUTXOSetOverrideRequestMessage) SetMessageNumber

func (b *StopNotifyingPruningPointUTXOSetOverrideRequestMessage) SetMessageNumber(messageNumber uint64)

func (*StopNotifyingPruningPointUTXOSetOverrideRequestMessage) SetReceivedAt

func (b *StopNotifyingPruningPointUTXOSetOverrideRequestMessage) SetReceivedAt(receivedAt time.Time)

type StopNotifyingPruningPointUTXOSetOverrideResponseMessage

type StopNotifyingPruningPointUTXOSetOverrideResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

StopNotifyingPruningPointUTXOSetOverrideResponseMessage is an appmessage corresponding to its respective RPC message

func NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage

func NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage() *StopNotifyingPruningPointUTXOSetOverrideResponseMessage

NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage returns a instance of the message

func (*StopNotifyingPruningPointUTXOSetOverrideResponseMessage) Command

Command returns the protocol command string for the message

func (*StopNotifyingPruningPointUTXOSetOverrideResponseMessage) MessageNumber

func (b *StopNotifyingPruningPointUTXOSetOverrideResponseMessage) MessageNumber() uint64

func (*StopNotifyingPruningPointUTXOSetOverrideResponseMessage) ReceivedAt

func (b *StopNotifyingPruningPointUTXOSetOverrideResponseMessage) ReceivedAt() time.Time

func (*StopNotifyingPruningPointUTXOSetOverrideResponseMessage) SetMessageNumber

func (b *StopNotifyingPruningPointUTXOSetOverrideResponseMessage) SetMessageNumber(messageNumber uint64)

func (*StopNotifyingPruningPointUTXOSetOverrideResponseMessage) SetReceivedAt

func (b *StopNotifyingPruningPointUTXOSetOverrideResponseMessage) SetReceivedAt(receivedAt time.Time)

type StopNotifyingUTXOsChangedRequestMessage

type StopNotifyingUTXOsChangedRequestMessage struct {
	Addresses []string
	// contains filtered or unexported fields
}

StopNotifyingUTXOsChangedRequestMessage is an appmessage corresponding to its respective RPC message

func NewStopNotifyingUTXOsChangedRequestMessage

func NewStopNotifyingUTXOsChangedRequestMessage(addresses []string) *StopNotifyingUTXOsChangedRequestMessage

NewStopNotifyingUTXOsChangedRequestMessage returns a instance of the message

func (*StopNotifyingUTXOsChangedRequestMessage) Command

Command returns the protocol command string for the message

func (*StopNotifyingUTXOsChangedRequestMessage) MessageNumber

func (b *StopNotifyingUTXOsChangedRequestMessage) MessageNumber() uint64

func (*StopNotifyingUTXOsChangedRequestMessage) ReceivedAt

func (b *StopNotifyingUTXOsChangedRequestMessage) ReceivedAt() time.Time

func (*StopNotifyingUTXOsChangedRequestMessage) SetMessageNumber

func (b *StopNotifyingUTXOsChangedRequestMessage) SetMessageNumber(messageNumber uint64)

func (*StopNotifyingUTXOsChangedRequestMessage) SetReceivedAt

func (b *StopNotifyingUTXOsChangedRequestMessage) SetReceivedAt(receivedAt time.Time)

type StopNotifyingUTXOsChangedResponseMessage

type StopNotifyingUTXOsChangedResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

StopNotifyingUTXOsChangedResponseMessage is an appmessage corresponding to its respective RPC message

func NewStopNotifyingUTXOsChangedResponseMessage

func NewStopNotifyingUTXOsChangedResponseMessage() *StopNotifyingUTXOsChangedResponseMessage

NewStopNotifyingUTXOsChangedResponseMessage returns a instance of the message

func (*StopNotifyingUTXOsChangedResponseMessage) Command

Command returns the protocol command string for the message

func (*StopNotifyingUTXOsChangedResponseMessage) MessageNumber

func (b *StopNotifyingUTXOsChangedResponseMessage) MessageNumber() uint64

func (*StopNotifyingUTXOsChangedResponseMessage) ReceivedAt

func (b *StopNotifyingUTXOsChangedResponseMessage) ReceivedAt() time.Time

func (*StopNotifyingUTXOsChangedResponseMessage) SetMessageNumber

func (b *StopNotifyingUTXOsChangedResponseMessage) SetMessageNumber(messageNumber uint64)

func (*StopNotifyingUTXOsChangedResponseMessage) SetReceivedAt

func (b *StopNotifyingUTXOsChangedResponseMessage) SetReceivedAt(receivedAt time.Time)

type SubmitBlockRequestMessage

type SubmitBlockRequestMessage struct {
	Block             *RPCBlock
	AllowNonDAABlocks bool
	// contains filtered or unexported fields
}

SubmitBlockRequestMessage is an appmessage corresponding to its respective RPC message

func NewSubmitBlockRequestMessage

func NewSubmitBlockRequestMessage(block *RPCBlock, allowNonDAABlocks bool) *SubmitBlockRequestMessage

NewSubmitBlockRequestMessage returns a instance of the message

func (*SubmitBlockRequestMessage) Command

Command returns the protocol command string for the message

func (*SubmitBlockRequestMessage) MessageNumber

func (b *SubmitBlockRequestMessage) MessageNumber() uint64

func (*SubmitBlockRequestMessage) ReceivedAt

func (b *SubmitBlockRequestMessage) ReceivedAt() time.Time

func (*SubmitBlockRequestMessage) SetMessageNumber

func (b *SubmitBlockRequestMessage) SetMessageNumber(messageNumber uint64)

func (*SubmitBlockRequestMessage) SetReceivedAt

func (b *SubmitBlockRequestMessage) SetReceivedAt(receivedAt time.Time)

type SubmitBlockResponseMessage

type SubmitBlockResponseMessage struct {
	RejectReason RejectReason
	Error        *RPCError
	// contains filtered or unexported fields
}

SubmitBlockResponseMessage is an appmessage corresponding to its respective RPC message

func NewSubmitBlockResponseMessage

func NewSubmitBlockResponseMessage() *SubmitBlockResponseMessage

NewSubmitBlockResponseMessage returns an instance of the message

func (*SubmitBlockResponseMessage) Command

Command returns the protocol command string for the message

func (*SubmitBlockResponseMessage) MessageNumber

func (b *SubmitBlockResponseMessage) MessageNumber() uint64

func (*SubmitBlockResponseMessage) ReceivedAt

func (b *SubmitBlockResponseMessage) ReceivedAt() time.Time

func (*SubmitBlockResponseMessage) SetMessageNumber

func (b *SubmitBlockResponseMessage) SetMessageNumber(messageNumber uint64)

func (*SubmitBlockResponseMessage) SetReceivedAt

func (b *SubmitBlockResponseMessage) SetReceivedAt(receivedAt time.Time)

type SubmitTransactionRequestMessage

type SubmitTransactionRequestMessage struct {
	Transaction *RPCTransaction
	AllowOrphan bool
	// contains filtered or unexported fields
}

SubmitTransactionRequestMessage is an appmessage corresponding to its respective RPC message

func NewSubmitTransactionRequestMessage

func NewSubmitTransactionRequestMessage(transaction *RPCTransaction, allowOrphan bool) *SubmitTransactionRequestMessage

NewSubmitTransactionRequestMessage returns a instance of the message

func (*SubmitTransactionRequestMessage) Command

Command returns the protocol command string for the message

func (*SubmitTransactionRequestMessage) MessageNumber

func (b *SubmitTransactionRequestMessage) MessageNumber() uint64

func (*SubmitTransactionRequestMessage) ReceivedAt

func (b *SubmitTransactionRequestMessage) ReceivedAt() time.Time

func (*SubmitTransactionRequestMessage) SetMessageNumber

func (b *SubmitTransactionRequestMessage) SetMessageNumber(messageNumber uint64)

func (*SubmitTransactionRequestMessage) SetReceivedAt

func (b *SubmitTransactionRequestMessage) SetReceivedAt(receivedAt time.Time)

type SubmitTransactionResponseMessage

type SubmitTransactionResponseMessage struct {
	TransactionID string

	Error *RPCError
	// contains filtered or unexported fields
}

SubmitTransactionResponseMessage is an appmessage corresponding to its respective RPC message

func NewSubmitTransactionResponseMessage

func NewSubmitTransactionResponseMessage(transactionID string) *SubmitTransactionResponseMessage

NewSubmitTransactionResponseMessage returns a instance of the message

func (*SubmitTransactionResponseMessage) Command

Command returns the protocol command string for the message

func (*SubmitTransactionResponseMessage) MessageNumber

func (b *SubmitTransactionResponseMessage) MessageNumber() uint64

func (*SubmitTransactionResponseMessage) ReceivedAt

func (b *SubmitTransactionResponseMessage) ReceivedAt() time.Time

func (*SubmitTransactionResponseMessage) SetMessageNumber

func (b *SubmitTransactionResponseMessage) SetMessageNumber(messageNumber uint64)

func (*SubmitTransactionResponseMessage) SetReceivedAt

func (b *SubmitTransactionResponseMessage) SetReceivedAt(receivedAt time.Time)

type TrustedDataDAAHeader

type TrustedDataDAAHeader struct {
	Header       *MsgBlockHeader
	GHOSTDAGData *BlockGHOSTDAGData
}

TrustedDataDAAHeader is an appmessage representation of externalapi.TrustedDataDataDAAHeader

type TrustedDataDataDAABlock

type TrustedDataDataDAABlock struct {
	Block        *MsgBlock
	GHOSTDAGData *BlockGHOSTDAGData
}

TrustedDataDataDAABlock is an appmessage representation of externalapi.TrustedDataDataDAABlock

type TxIn

type TxIn struct {
	PreviousOutpoint Outpoint
	SignatureScript  []byte
	Sequence         uint64
	SigOpCount       byte
}

TxIn defines a kaspa transaction input.

func NewTxIn

func NewTxIn(prevOut *Outpoint, signatureScript []byte, sequence uint64, sigOpCount byte) *TxIn

NewTxIn returns a new kaspa transaction input with the provided previous outpoint point and signature script with a default sequence of MaxTxInSequenceNum.

type TxLoc

type TxLoc struct {
	TxStart int
	TxLen   int
}

TxLoc holds locator data for the offset and length of where a transaction is located within a MsgBlock data buffer.

type TxOut

type TxOut struct {
	Value        uint64
	AssetType    externalapi.AssetType
	ScriptPubKey *externalapi.ScriptPublicKey
}

TxOut defines a kaspa transaction output.

func NewTxOut

func NewTxOut(value uint64, scriptPubKey *externalapi.ScriptPublicKey) *TxOut

NewTxOut returns a new kaspa transaction output with the provided transaction value and public key script.

type UTXOEntry

type UTXOEntry struct {
	Amount          uint64
	AssetType       externalapi.AssetType
	ScriptPublicKey *externalapi.ScriptPublicKey
	BlockDAAScore   uint64
	IsCoinbase      bool
}

UTXOEntry houses details about an individual transaction output in a UTXO

type UTXOsByAddressesEntry

type UTXOsByAddressesEntry struct {
	Address   string
	Outpoint  *RPCOutpoint
	UTXOEntry *RPCUTXOEntry
}

UTXOsByAddressesEntry represents a UTXO of some address

type UTXOsChangedNotificationMessage

type UTXOsChangedNotificationMessage struct {
	Added   []*UTXOsByAddressesEntry
	Removed []*UTXOsByAddressesEntry
	// contains filtered or unexported fields
}

UTXOsChangedNotificationMessage is an appmessage corresponding to its respective RPC message

func NewUTXOsChangedNotificationMessage

func NewUTXOsChangedNotificationMessage() *UTXOsChangedNotificationMessage

NewUTXOsChangedNotificationMessage returns a instance of the message

func (*UTXOsChangedNotificationMessage) Command

Command returns the protocol command string for the message

func (*UTXOsChangedNotificationMessage) MessageNumber

func (b *UTXOsChangedNotificationMessage) MessageNumber() uint64

func (*UTXOsChangedNotificationMessage) ReceivedAt

func (b *UTXOsChangedNotificationMessage) ReceivedAt() time.Time

func (*UTXOsChangedNotificationMessage) SetMessageNumber

func (b *UTXOsChangedNotificationMessage) SetMessageNumber(messageNumber uint64)

func (*UTXOsChangedNotificationMessage) SetReceivedAt

func (b *UTXOsChangedNotificationMessage) SetReceivedAt(receivedAt time.Time)

type UnbanRequestMessage

type UnbanRequestMessage struct {
	IP string
	// contains filtered or unexported fields
}

UnbanRequestMessage is an appmessage corresponding to its respective RPC message

func NewUnbanRequestMessage

func NewUnbanRequestMessage(ip string) *UnbanRequestMessage

NewUnbanRequestMessage returns an instance of the message

func (*UnbanRequestMessage) Command

func (msg *UnbanRequestMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*UnbanRequestMessage) MessageNumber

func (b *UnbanRequestMessage) MessageNumber() uint64

func (*UnbanRequestMessage) ReceivedAt

func (b *UnbanRequestMessage) ReceivedAt() time.Time

func (*UnbanRequestMessage) SetMessageNumber

func (b *UnbanRequestMessage) SetMessageNumber(messageNumber uint64)

func (*UnbanRequestMessage) SetReceivedAt

func (b *UnbanRequestMessage) SetReceivedAt(receivedAt time.Time)

type UnbanResponseMessage

type UnbanResponseMessage struct {
	Error *RPCError
	// contains filtered or unexported fields
}

UnbanResponseMessage is an appmessage corresponding to its respective RPC message

func NewUnbanResponseMessage

func NewUnbanResponseMessage() *UnbanResponseMessage

NewUnbanResponseMessage returns a instance of the message

func (*UnbanResponseMessage) Command

func (msg *UnbanResponseMessage) Command() MessageCommand

Command returns the protocol command string for the message

func (*UnbanResponseMessage) MessageNumber

func (b *UnbanResponseMessage) MessageNumber() uint64

func (*UnbanResponseMessage) ReceivedAt

func (b *UnbanResponseMessage) ReceivedAt() time.Time

func (*UnbanResponseMessage) SetMessageNumber

func (b *UnbanResponseMessage) SetMessageNumber(messageNumber uint64)

func (*UnbanResponseMessage) SetReceivedAt

func (b *UnbanResponseMessage) SetReceivedAt(receivedAt time.Time)

type VirtualDaaScoreChangedNotificationMessage

type VirtualDaaScoreChangedNotificationMessage struct {
	VirtualDaaScore uint64
	// contains filtered or unexported fields
}

VirtualDaaScoreChangedNotificationMessage is an appmessage corresponding to its respective RPC message

func NewVirtualDaaScoreChangedNotificationMessage

func NewVirtualDaaScoreChangedNotificationMessage(
	virtualDaaScore uint64) *VirtualDaaScoreChangedNotificationMessage

NewVirtualDaaScoreChangedNotificationMessage returns a instance of the message

func (*VirtualDaaScoreChangedNotificationMessage) Command

Command returns the protocol command string for the message

func (*VirtualDaaScoreChangedNotificationMessage) MessageNumber

func (b *VirtualDaaScoreChangedNotificationMessage) MessageNumber() uint64

func (*VirtualDaaScoreChangedNotificationMessage) ReceivedAt

func (b *VirtualDaaScoreChangedNotificationMessage) ReceivedAt() time.Time

func (*VirtualDaaScoreChangedNotificationMessage) SetMessageNumber

func (b *VirtualDaaScoreChangedNotificationMessage) SetMessageNumber(messageNumber uint64)

func (*VirtualDaaScoreChangedNotificationMessage) SetReceivedAt

func (b *VirtualDaaScoreChangedNotificationMessage) SetReceivedAt(receivedAt time.Time)

type VirtualSelectedParentBlueScoreChangedNotificationMessage

type VirtualSelectedParentBlueScoreChangedNotificationMessage struct {
	VirtualSelectedParentBlueScore uint64
	// contains filtered or unexported fields
}

VirtualSelectedParentBlueScoreChangedNotificationMessage is an appmessage corresponding to its respective RPC message

func NewVirtualSelectedParentBlueScoreChangedNotificationMessage

func NewVirtualSelectedParentBlueScoreChangedNotificationMessage(
	virtualSelectedParentBlueScore uint64) *VirtualSelectedParentBlueScoreChangedNotificationMessage

NewVirtualSelectedParentBlueScoreChangedNotificationMessage returns a instance of the message

func (*VirtualSelectedParentBlueScoreChangedNotificationMessage) Command

Command returns the protocol command string for the message

func (*VirtualSelectedParentBlueScoreChangedNotificationMessage) MessageNumber

func (b *VirtualSelectedParentBlueScoreChangedNotificationMessage) MessageNumber() uint64

func (*VirtualSelectedParentBlueScoreChangedNotificationMessage) ReceivedAt

func (b *VirtualSelectedParentBlueScoreChangedNotificationMessage) ReceivedAt() time.Time

func (*VirtualSelectedParentBlueScoreChangedNotificationMessage) SetMessageNumber

func (b *VirtualSelectedParentBlueScoreChangedNotificationMessage) SetMessageNumber(messageNumber uint64)

func (*VirtualSelectedParentBlueScoreChangedNotificationMessage) SetReceivedAt

func (b *VirtualSelectedParentBlueScoreChangedNotificationMessage) SetReceivedAt(receivedAt time.Time)

type VirtualSelectedParentChainChangedNotificationMessage

type VirtualSelectedParentChainChangedNotificationMessage struct {
	RemovedChainBlockHashes []string
	AddedChainBlockHashes   []string
	AcceptedTransactionIDs  []*AcceptedTransactionIDs
	// contains filtered or unexported fields
}

VirtualSelectedParentChainChangedNotificationMessage is an appmessage corresponding to its respective RPC message

func NewVirtualSelectedParentChainChangedNotificationMessage

func NewVirtualSelectedParentChainChangedNotificationMessage(removedChainBlockHashes,
	addedChainBlocks []string, acceptedTransactionIDs []*AcceptedTransactionIDs) *VirtualSelectedParentChainChangedNotificationMessage

NewVirtualSelectedParentChainChangedNotificationMessage returns a instance of the message

func (*VirtualSelectedParentChainChangedNotificationMessage) Command

Command returns the protocol command string for the message

func (*VirtualSelectedParentChainChangedNotificationMessage) MessageNumber

func (b *VirtualSelectedParentChainChangedNotificationMessage) MessageNumber() uint64

func (*VirtualSelectedParentChainChangedNotificationMessage) ReceivedAt

func (b *VirtualSelectedParentChainChangedNotificationMessage) ReceivedAt() time.Time

func (*VirtualSelectedParentChainChangedNotificationMessage) SetMessageNumber

func (b *VirtualSelectedParentChainChangedNotificationMessage) SetMessageNumber(messageNumber uint64)

func (*VirtualSelectedParentChainChangedNotificationMessage) SetReceivedAt

func (b *VirtualSelectedParentChainChangedNotificationMessage) SetReceivedAt(receivedAt time.Time)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL