# README
truechain-engineering-code
init
# Packages
Provides support for dealing with EVM assembly instructions (e.g., disassembling them).
Package bloombits implements bloom filtering on batches of data.
Package rawdb contains a collection of low level database accessors.
Package snailchain implements the truechain snailchain protocol.
Package state provides a caching layer atop the Ethereum state trie.
Package types contains data types related to truechain consensus.
Package vm implements the Ethereum Virtual Machine.
# Functions
ApplyMessage computes the new state by applying the given message against the old state within the environment.
ApplyTransaction attempts to apply a transaction to the given state database and uses the input parameters for its environment.
CanTransfer checks whether there are enough funds in the address' account to make a transfer.
DefaultDevGenesisBlock returns the Rinkeby network genesis block.
DefaultGenesisBlock returns the Truechain main net snail block.
No description provided by the author
DefaultTestnetGenesisBlock returns the Ropsten network genesis block.
FastCalcGasLimit computes the gas limit of the next block after parent.
GenerateChain creates a chain of n blocks.
No description provided by the author
GenesisFastBlockForTesting creates and writes a block in which addr has the given wei balance.
GenesisSnailBlockForTesting creates and writes a block in which addr has the given wei balance.
GetHashFn returns a GetHashFunc which retrieves header hashes by number.
IntrinsicGas computes the 'intrinsic gas' for a message with the given data.
NewBlockChain returns a fully initialised block chain using information available in the database.
NewBlockValidator returns a new block validator which is safe for re-use.
No description provided by the author
NewChainIndexer creates a new chain indexer to do background processing on chain segments of a given size after certain number of confirmations passed.
NewEVMBlockContext creates a new context for use in the EVM.
NewEVMTxContext creates a new transaction context for a single transaction.
NewHeaderChain creates a new HeaderChain structure.
NewStateProcessor initialises a new StateProcessor.
NewStateTransition initialises and returns a new state transition object.
NewTxPool creates a new transaction pool to gather, sort and filter inbound transactions from the network.
ReadTransaction attempts to apply a transaction to the given state database and uses the input parameters for its environment.
SetReceiptsData computes all the non-consensus fields of the receipts.
SetupGenesisBlock writes or updates the genesis block in db.
Transfer subtracts amount from sender and adds amount to recipient using the given Db.
# Constants
BlockChainVersion ensures that an incompatible database forces a resync from scratch.
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
all kind of status.
all kind of status.
all kind of status.
all kind of status.
# Variables
BadHashes represent a set of manually tracked bad hashes (usually hard forks).
DefaultTxPoolConfig contains the default configurations for the transaction pool.
ErrBlacklistedHash is returned if a block to import is on the blacklist.
fetch number of newBlock exceed specified number.
ErrGasLimit is returned if a transaction's requested gas limit exceeds the maximum allowance of the current block.
ErrGasLimitReached is returned by the gas pool if the amount of gas required by a transaction is higher than what's left in the block.
ErrGasUintOverflow is returned when calculating gas usage.
ErrInsufficientFunds is returned if the total cost of executing a transaction is higher than the balance of the user's account.
ErrInsufficientFundsForPayer is returned if the total gascost of executing a transactionis higher than the balance of the payer's account.
ErrInsufficientFundsForSender is returned if the amount of executing a transactionis higher than the balance of the user's account.
ErrInsufficientFundsForTransfer is returned if the transaction sender doesn't have enough funds for transfer(topmost call only).
ErrIntrinsicGas is returned if the transaction is specified to use less gas than required to start the invocation.
ErrInvalidPayer is returned if the transaction contains an invalid payer's signature.
ErrInvalidSender is returned if the transaction contains an invalid signature.
No description provided by the author
ErrKnownBlock is returned when a block to import is already known locally.
No description provided by the author
ErrNegativeValue is a sanity error to ensure noone is able to specify a transaction with a negative value.
No description provided by the author
ErrNonceTooHigh is returned if the nonce of a transaction is higher than the next one expected based on the local chain.
ErrNonceTooLow is returned if the nonce of a transaction is lower than the one present in the local chain.
ErrOversizedData is returned if the input data of a transaction is greater than some meaningful limit a user might use.
ErrReplaceUnderpriced is returned if a transaction is attempted to be replaced with a different one without the required price bump.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrUnderpriced is returned if a transaction's gas price is below the minimum configured for the transaction pool.
# Structs
BlockChain represents the canonical chain given a database with a genesis block.
BlockGen creates blocks for testing.
BlockValidator is responsible for validating block headers, uncles and processed state.
BloomIndexer implements a core.ChainIndexer, building up a rotated bloom bits index for the Ethereum header bloom filters, permitting blazing fast filtering.
CacheConfig contains the configuration values for the trie caching/pruning that's resident in a blockchain.
ChainIndexer does a post-processing job for equally sized sections of the canonical chain (like BlooomBits and CHT structures).
ExecutionResult includes all output after executing given evm message no matter the execution itself is successful or not.
Genesis specifies the header fields, state of a genesis block.
GenesisAccount is an account in the state of the genesis block.
GenesisMismatchError is raised when trying to overwrite an existing genesis block with an incompatible one.
HeaderChain implements the basic block header chain logic that is shared by core.BlockChain and light.LightChain.
StateProcessor is a basic Processor, which takes care of transitioning state from one point to another.
StateTransition :The State Transitioning Model
A state transition is a change made when a transaction is applied to the current world state
The state transitioning model does all all the necessary work to work out a valid new state root.
TxPool contains all currently known transactions.
TxPoolConfig are the configuration parameters of the transaction pool.
# Interfaces
ChainContext supports retrieving headers and consensus parameters from the current blockchain to be used during transaction processing.
ChainIndexerBackend defines the methods needed to process chain segments in the background and write the segment results into the database.
ChainIndexerChain interface is used for connecting the indexer to a blockchain.
Message represents a message sent to a contract.
Processor is an interface for processing blocks using a given initial state.
SnailChain is an interface which defines the standard for snail block.
SnailValidator is an interface which defines the standard for block validation.
Validator is an interface which defines the standard for block validation.
# Type aliases
DeleteCallback is a callback function that is called by SetHead before each header is deleted.
WhCallback is a callback function for inserting individual headers.
GasPool tracks the amount of gas available during execution of the transactions in a block.
TxStatus is the current status of a transaction as seen by the pool.
WriteStatus status of write.