package
0.0.0-20240305095038-e87e1d8a3d70
Repository: https://github.com/ngchain/ngcore.git
Documentation: pkg.go.dev

# Functions

GetBlockReward returns the block reward in a specific height reward = 2 + 8*(0.9)^Era.
GetEmptyHash return an empty hash.
GetGenesisBlock will return a complete sealed GenesisBlock.
No description provided by the author
GetGenesisGenerateTx provides the genesis generate tx under current network.
No description provided by the author
GetGenesisSheet returns a genesis sheet.
GetGenesisStyleAccount will return the genesis style account.
GetGenesisTimestamp returns the genesis timestamp must be the time chain started, or the difficulty algo wont work FIXME: should be the time network starts.
GetMatureHeight will return the next mature height for now it is 100 * X.
GetNetwork converts the network name to the Network type.
GetNextDiff is a helper to get next pow block Diff field.
NewAccount receive parameters and return a new Account(class constructor.
NewAccountContext craetes a new empty AccountContext.
NewAddress will return a publickey address.
NewAddressFromBS58 converts a base58 string into the Address.
NewAddressFromMultiKeys will return a publickey address.
NewBareBlock will return an unsealing block and then you need to add txs and seal with the correct N.
NewBlock creates a new Block.
NewBlockFromHeader creates a new Block.
NewBlockFromPoWRaw will apply the raw pow of header and txs to the block.
NewHeaderTrie creates new HeaderTrie.
NewNumFromBytes recovers the AccountNum from the bytes in LE.
NewSheet gets the rows from db and return the sheet for transport/saving.
NewTx is the default constructor for ngtypes.Tx.
NewTxTrie receives ordered ops.
NewUnsignedTx will return an unsigned tx, must using Signature().

# Constants

AddressSize some for tx.
add content to the tail of contract.
do converge if fall behind one round.
No description provided by the author
renamed from logout.
DiffSize is the length of a difficulty.
Unit const.
No description provided by the author
GenesisAddressBase58 is the genesis address in base58 str.
HashSize is the length of a hash bytes.
No description provided by the author
TODO: cannot assign nor append, but can run vm.
MAINNET is the public network for production.
just for calculating the immature balance.
not mandatory required, can be modified by different daemons.
nonce uses 8 bytes.
PrivSize is the length of one private key in bytes.
No description provided by the author
SignatureSize is the size used by signature and is 64 bytes(R 32 + S 32).
PoW const.
TESTNET is the public internet testnet.
TimestampSize is The length of a timestamp bytes.
No description provided by the author
TxMaxExtraSize 1 << 20 = 1024K = 1M, if more than 1m, extra should be separated and using more than one append.
TODO: disable vm, but enable assign and append.
ZERONET is the local regression testnet.

# Variables

decoded genesis variables.
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
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
ErrInvalidDiff means the diff cannot load from the string.
No description provided by the author
ErrInvalidPoWRawLen means the length of the PoW raw is not 153 bytes.
Errors for Tx.
ErrNotBlockHeader means the var is not a block header.
No description provided by the author
Errors for Tx.
Errors for Tx.
Errors for Tx.
Errors for Tx.
Errors for Tx.
Errors for Tx.
Errors for Tx.
ErrTxSignInvalid occurs when the signature of the Tx doesnt match the Tx 's caller/account.
Errors for Tx.
Errors for Tx.
Errors for Tx.
decoded genesis variables.
MaxTarget is the Max value of mining target.
Units variables: https://en.wikipedia.org/wiki/Unit_prefix https://en.wikipedia.org/wiki/Metric_prefix.
Units variables: https://en.wikipedia.org/wiki/Unit_prefix https://en.wikipedia.org/wiki/Metric_prefix.
RegisterFee is the fee for registering a new account.

# Structs

Account is the shell of the address to process the txs and contracts.
AccountContext is the Context field of the Account, which is a in-mem (on-chain) k-v storage.
AppendExtra is the pre-defined data strcut for the Extra field in Append Tx.
Balance is a unit in Sheet.Balances, which represents the remaining coin amount of the address.
BlockHeader is the fix-sized header of the block, which is able to describe itself.
DeleteExtra is the pre-defined data struct for the Extra field in Delete Tx.
FullBlock is an implement of Block the base unit of the blockchain and the container of the txs, which provides the safety assurance by the hashes in the header.
FullTx is the basic implement of Tx (transaction, or operation).
LightWeightBlock is a light weight block strcut for db storage.
No description provided by the author

# Interfaces

Block is an abstract block interface.
No description provided by the author
Consensus is an abstract consensus interface.
Tx is an abstract transaction interface.

# Type aliases

AccountNum is a uint64 number which used as the identifier of the Account.
Address is the anonymous publickey for receiving coin.
HeaderTrie is a fixed ordered block header container of the subBlocks.
Network is the type of the ngchain network.
TxTrie is a fixed ordered tx container to get the trie root hash.
No description provided by the author