package
0.3.13-beta.0
Repository: https://github.com/spacemeshos/go-spacemesh.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# Functions
ATXIDsToHashes turns a list of ATXID into their Hash32 representation.
BallotIDsToHashes turns a list of BallotID into their Hash32 representation.
BlockIdsField returns a list of loggable fields for a given list of BlockID.
BlockIDsToHashes turns a list of BlockID into their Hash32 representation.
BytesToBeacon sets the first BeaconSize bytes of b to the Beacon's data.
BytesToHash sets b to hash.
BytesToNodeID is a helper to copy buffer into NodeID struct.
CalcBlockHash32Presorted returns the 32-byte blake3 sum of the IDs, in the order given.
CalcBlocksHash32 returns the 32-byte blake3 sum of the IDs, sorted in lexicographic order.
CalcHash12 returns the 12-byte prefix of the blake3 sum of the given byte slice.
CalcHash32 returns the 32-byte blake3 sum of the given data.
CalcMessageHash12 returns the 12-byte blake3 sum of the given msg suffixed with protocol.
CalcObjectHash32 returns the 32-byte blake3 sum of the scale serialization of the object.
CalcProposalHash32Presorted returns the 32-byte blake3 sum of the IDs, in the order given.
CalcProposalsHash32 returns the 32-byte blake3 sum of the IDs, sorted in lexicographic order.
FirstEffectiveGenesis returns the first effective genesis layer.
GenerateAddress generates an address from a public key.
GetEffectiveGenesis returns the last layer of genesis.
GetLayersPerEpoch returns number of layers per epoch.
HexToBeacon sets byte representation of s to a Beacon.
HexToHash32 sets byte representation of s to hash.
MaxLayer returs max layer.
MinLayer returs minimal nonzero layer.
No description provided by the author
NewActivationTx returns a new activation transaction.
NewExistingBallot creates ballot from stored data.
NewExistingBlock creates a block from existing data.
NewExistingLayer returns a new layer with the given list of blocks without validation.
NewLayer returns a layer with no proposals.
NewRawTx computes id from raw bytes and returns the object.
NodeIDsToHashes turns a list of NodeID into their Hash32 representation.
ProposalIDsToHashes turns a list of ProposalID into their Hash32 representation.
RandomActiveSet generates a random set of ATXIDs of the specified size.
RandomATXID generates a random ATXID for testing.
RandomBallot generates a Ballot with random content for testing.
RandomBallotID generates a random BallotID for testing.
RandomBeacon generates random beacon in bytes for testing.
RandomBlockID generates a random ProposalID for testing.
RandomBytes generates random data in bytes for testing.
RandomEdSignature generates a random (not necessarily valid) EdSignature for testing.
RandomHash generates random Hash32 for testing.
RandomNodeID generates a random NodeID for testing.
RandomProposalID generates a random ProposalID for testing.
RandomTransactionID generates a random TransactionID for testing.
RandomTXSet generates a random set of TransactionID of the specified size.
RandomVrfSignature generates a random VrfSignature for testing.
No description provided by the author
No description provided by the author
SetLayersPerEpoch sets global parameter of layers per epoch, all conversions from layer to epoch use this param.
No description provided by the author
Shorten shortens a string to a specified length.
SortBlockIDs sorts a list of BlockID in lexicographic order, in-place.
SortProposalIDs sorts a list of ProposalID in lexicographic order, in-place.
SortProposals sorts a list of Proposal in their ID's lexicographic order, in-place.
SortTransactionIDs sorts a list of TransactionID in their lexicographic order, in-place.
StringToAddress returns a new Address from a given string like `sm1abc...`.
ToATXIDs returns a slice of ATXID corresponding to the given activation tx.
ToBallotIDs turns a list of Ballot into a list of BallotID.
ToBlockIDs returns a slice of BlockID corresponding to the given list of Block.
ToProposalIDs returns a slice of ProposalID corresponding to the given proposals.
ToTransactionIDs returns a slice of TransactionID corresponding to the given transactions.
TransactionIDsToHashes turns a list of TransactionID into their Hash32 representation.
TxIdsField returns a list of loggable fields for a given list of IDs.
# Constants
AddressLength is the expected length of the address.
AddressReservedSpace define how much bytes from top is reserved in address for future.
APPLIED represents the state when a transaction is applied to the state.
ATXIDSize in bytes.
BallotIDSize in bytes.
BeaconSize in bytes.
BlockIDSize in bytes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FirstRound is convenient for initializing the index in a loop.
No description provided by the author
Hash32Length is 32, the expected length of the hash.
MEMPOOL represents the state when a transaction is in mempool.
No description provided by the author
No description provided by the author
NodeIDSize in bytes.
PENDING represents the state when a transaction is syntactically valid, but its nonce and the principal's ability to cover gas have not been verified yet.
ProposalIDSize in bytes.
TransactionFailure is a status for failed but consumed transaction.
TransactionIDSize in bytes.
TransactionSuccess is a status for successfully applied transaction.
No description provided by the author
# Variables
EmptyATXID is a canonical empty ATXID.
EmptyBallotID is a canonical empty BallotID.
EmptyBeacon is a canonical empty Beacon.
EmptyBlockID is a canonical empty BlockID.
EmptyEdSignature is a canonical empty EdSignature.
EmptyLayerHash is the layer hash for an empty layer.
EmptyNodeID is a canonical empty NodeID.
EmptyPoetProofRef is an empty PoET proof reference.
EmptyProposalID is a canonical empty ProposalID.
EmptyVrfSignature is a canonical empty VrfSignature.
ErrDecodeBech32 is returned when an error occurs during decoding bech32.
ErrMissingReservedSpace is returned if top bytes of address is not 0.
ErrUnsupportedNetwork is returned when a network is not supported.
ErrWrongAddressLength is returned when the length of the address is not correct.
# Structs
Account represents account state at a certain layer.
No description provided by the author
ActivationTx is a full, signed activation transaction.
ActivationTxHeader is the header of an activation transaction.
AddressNonce is an (address, nonce) named tuple.
AnyReward contains the reward information by ATXID.
ATXMetadata is the data of ActivationTx that is signed.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Ballot contains the smeshers signed vote on the mesh history.
BallotMetadata is the signed part of Ballot.
No description provided by the author
No description provided by the author
No description provided by the author
Block contains the content of a layer on the mesh history.
BlockContextualValidity represents the contextual validity of a block.
No description provided by the author
Certificate represents a certified block.
CertifyContent is actual content the node would sign to certify a hare output.
CertifyMessage is generated by a node that's eligible to certify the hare output and is gossiped to the network.
No description provided by the author
CoinbaseReward contains the reward information by coinbase, used as an interface to VM.
EpochData contains information that cannot be changed mid-epoch.
No description provided by the author
HareEligibility includes the required values that, along with the smesher's VRF public key, allow non-interactive eligibility validation for hare round participation.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
InnerActivationTx is a set of all of an ATX's fields, except the signature.
InnerBallot contains all info about a smeshers votes on the mesh history.
InnerBlock contains the transactions and rewards of a block.
No description provided by the author
InnerProposal contains a smesher's content proposal for layer and its votes on the mesh history.
Layer contains a list of proposals and their corresponding LayerID.
LayerLimits if defined restricts in what layers transaction may be applied.
No description provided by the author
No description provided by the author
Merkle proof proving that a given leaf is included in the root of merkle tree.
MeshTransaction is stored in the mesh and included in the block.
No description provided by the author
NIPost is Non-Interactive Proof of Space-Time.
NIPostBuilderState is a builder state.
NIPostChallenge is the set of fields that's serialized, hashed and submitted to the PoET service to be included in the PoET membership proof.
Opinion is a tuple from opinion hash and votes that decode to opinion hash.
No description provided by the author
PoetProof is the full PoET service proof of elapsed time.
PoetProofMessage is the envelope which includes the PoetProof, service ID, round ID and signature.
PoetRequest describes an in-flight challenge submission for a poet proof.
PoetRound includes the PoET's round ID.
No description provided by the author
PostMetadata is similar postShared.ProofMetadata, but without the fields which can be derived elsewhere in a given ATX (ID, NumUnits).
ProcessingError is a type of error (implements the error interface) that is used to differentiate processing errors from validation errors.
No description provided by the author
Proposal contains the smesher's signed content proposal for a given layer and vote on the mesh history.
RatNum represents a rational number with the numerator and denominator.
RawTx stores an identity and a pointer to raw bytes.
No description provided by the author
Reward is a virtual reward transaction, which the node keeps track of for the gRPC api.
Transaction is an alias to RawTx.
TransactionResult is created after consuming transaction.
TransactionWithResult is a transaction with attached result.
TxHeader is a transaction header, with some of the fields defined directly in the tx and the rest is computed by the template based on immutable state and method arguments.
No description provided by the author
Votes is for encoding local votes to send over the wire.
VotingEligibility includes the required values that, along with the smeshers VRF public key, allow non-interactive voting eligibility validation.
# Type aliases
Address represents the address of a spacemesh account with AddressLength length.
ATXID is a 32-bit hash used to identify an activation transaction.
ATXIDList defines ATX ID list.
BallotID is a 20-byte blake3 sum of the serialized ballot used to identify a Ballot.
Beacon defines the beacon value.
BlockID is a 20-byte blake3 sum of the serialized block used to identify a Block.
No description provided by the author
No description provided by the author
EpochID is the running epoch number.
Hash12 represents the first 12 bytes of blake3 hash, mostly used for internal caches.
Hash20 represents the 20-byte blake3 hash of arbitrary data.
Hash32 represents the 32-byte blake3 hash of arbitrary data.
LayerID is representing a layer number.
No description provided by the author
NodeID contains a miner's public key.
Nonce alias to uint64.
No description provided by the author
Post is an alias to postShared.Proof.
ProposalID is a 20-byte blake3 sum of the serialized ballot used to identify a Proposal.
RatVar is a wrapper for big.Rat to use it with the pflag package.
No description provided by the author
RoundID is the round ID used to run any protocol that requires multiple rounds.
TransactionID is a 32-byte blake3 sum of the transaction, used as an identifier.
TransactionStatus ...
TXState describes the state of a transaction.
Vote additionally carries layer id and height in order for the tortoise to count votes without downloading block body.
VRFPostIndex is the nonce generated using Pow during post initialization.
No description provided by the author