package
1.3.1
Repository: https://github.com/threefoldtech/rivine.git
Documentation: pkg.go.dev

# Functions

New returns a new ConsensusSet, containing at least the genesis block.
NewPluginStorage creates a new plugin storage for a given plugin bucket.
StandardTransactionValidators returns the standard transaction validators that are used if no custom set of transaction validators (effecitively rules that apply to every transaction) are defined, or if `nil` rules are set, in which case these default validators will be used as well.
StandardTransactionVersionMappedValidators returns the standard version-mapped transaction validators that are used if no custom set of transaction validators (effecitively rules that apply to every transaction) are defined, or if `nil` rules are set, in which case these default validators will be used as well.
ValidateBlockStakeInputsAreFulfilled validates that all block stake inputs are fulfilled.
ValidateBlockStakeInputsAreValid is a validator function that checks if all block stake inputs are standard, meaning their fulfillment is considered standard (== known) and their parent ID is defined.
ValidateBlockStakeOutputsAreBalanced is a validator function that checks if the sum of all block stakes outputs equals the sum of all block stake inputs.
ValidateBlockStakeOutputsAreValid is a validator function that checks if all block stake output is standard, meaning their condition is considered standard (== known) and their (block stake) value is individually greater than zero.
ValidateCoinInputsAreFulfilled validates that all coin outputs are validated.
ValidateCoinInputsAreValid is a validator function that checks if all coin inputs are standard, meaning their fulfillment is considered standard (== known) and their parent ID is defined.
ValidateCoinOutputsAreBalanced is a validator function that checks if the sum of all types of coin outputs equals the sum of coin inputs.
ValidateCoinOutputsAreValid is a validator function that checks if all coin outputs are standard, meaning their condition is considered standard (== known) and their (coin) value is individually greater than zero.
ValidateDoubleBlockStakeSpends validates that no block stake output is spent twice.
ValidateDoubleCoinSpends validates that no coin output is spent twice.
ValidateInvalidByDefault returns always an error and can be used to not allow transactions to be validated.
ValidateMinerFeeIsPresent is a validator function that checks that at least one miner fee is present.
ValidateMinerFeesAreValid is a validator function that checks if all miner fees are valid, meaning their (coin) value is individually greater than zero.
ValidateTransactionArbitraryData is a validator function that checks if a transaction's arbitrary data is valid.
ValidateTransactionFitsInABlock is a validator function that checks if a transaction fits in a block.

# Constants

DatabaseFilename contains the filename of the database that will be used when managing consensus.

# Variables

BlockHeight is a bucket that stores the current block height.
BlockMap is a database bucket containing all of the processed blocks, keyed by their id.
BlockPath is a database bucket containing a mapping from the height of a block to the id of the block at that height.
BlockStakeOutputs is a database bucket that contains all of the unspent blockstake outputs.
BucketPlugins is a database buckets that contains all plugins and their metadata.
ChangeLog contains a list of atomic changes that have happened to the consensus set so that subscribers can subscribe from the most recent change they have seen.
ChangeLogTailID is a key that points to the id of the current changelog tail.
CoinOutputs is a database bucket that contains all of the unspent coin outputs.
Consistency is a database bucket with a flag indicating whether inconsistencies within the database have been detected.
ErrMissingMetadataBucket is returned in case root plugins metadata folder is missing.
ErrMissingPluginMetadata is returned in case a plugin is missing metadata.
ErrPluginExists is returned in case a plugin with the same name is registered.
ErrPluginGhostMetadata is returned in case a plugin which wasn't registered yet, does have metadata.
ErrPluginNameEmpty is returned in case a plugin with that name is empty.
ErrPluginNameReserved is returned in case a plugin with that name is not allowed because it is a reserved bucket name.
MaxCatchUpBlocks is the maxiumum number of blocks that can be given to the consensus set in a single iteration during the initial blockchain download.
SurpassThreshold is a percentage that dictates how much heavier a competing chain has to be before the node will switch to mining on that chain.
TransactionIDMap is a database bucket that containsall of the present transaction IDs linked to their short ID.

# Structs

The ConsensusSet is the object responsible for tracking the current status of the blockchain.
A PluginViewStorage struct is a definition for the storage tool for a plugin bucket.