# Packages
Package rawdb contains a collection of low level database accessors.
# Functions
GenerateChain creates a chain of n blocks.
MakeChain return snailChain and fastchain by given fastBlockNumbers and snailBlockNumbers.
No description provided by the author
MakeSnailBlockFruit retrieves a snailblock or fruit by given parametercreate block,fruit chain: for snail chain fastchian: for fast chain makeStartFastNum,makeFruitSize :if you create a block the fruitset startnumber and size this is fastblock numberpubkey : for election coinbaseAddr: for coin.
MakeSnailBlockFruits return fruits or blocks by given params and insert these in the chain.
MakeSnailBlockFruit retrieves a snailblock or fruit by given parameter.
MakeSnailBlockFruits return fruits or blocks by given params and insert these in the chain.
MakeSnailBlockFruitsWithoutInsert return fruits or blocks by given params.
No description provided by the author
MakeSnailChain return snailChain and fastchain by given snailBlockNumbers and a default fastBlockNumbers(60).
No description provided by the author
No description provided by the author
NewBlockValidator returns a new block validator which is safe for re-use.
NewChainIndexer creates a new chain indexer to do background processing on chain segments of a given size after certain number of confirmations passed.
NewHeaderChain creates a new HeaderChain structure.
NewSnailBlockChain returns a fully initialised block chain using information available in the database.
NewSnailPool creates a new fruit pool to gather, sort and filter inbound fruits from the network.
# Constants
the three kind of status.
the three kind of status.
the three kind of status.
# Variables
BadHashes represent a set of manually tracked bad hashes (usually hard forks).
DefaultSnailPoolConfig contains the default configurations for the fruit pool.
ErrBlacklistedHash is returned if a block to import is on the blacklist.
ErrBlockTime is returned if the block's time less than the last fruit's time.
ErrFruitTime is returned if the fruit's time less than fastblock's time.
ErrGapFruits is returned if the fruits's fastblock time gap less than 360s.
ErrInvalidFast is returned if the fastchain not have the hash.
ErrInvalidFruits is returned if the fruits in block not continuity.
ErrInvalidSignHash is returned if the fruit contains an invalid signatures hash.
ErrKnownBlock is returned when a block to import is already known locally.
ErrNoFruits is returned if the block not contains the exact fruit count.
ErrNoGenesis is returned if the Genesis not found in chain.
ErrNotExist is returned if the fast block not exist in fastchain.
ErrRewardedBlock is returned if a block to import is already rewarded.
# Structs
BlockGen creates blocks for testing.
BlockValidator is responsible for validating block headers, uncles and processed state.
ChainIndexer does a post-processing job for equally sized sections of the canonical chain (like BlooomBits and CHT structures).
HeaderChain implements the basic block header chain logic that is shared by core.BlockChain and light.LightChain.
No description provided by the author
SnailBlockChain represents the canonical chain given a database with a genesis block.
SnailPool contains all currently known fruit.
SnailPoolConfig are the configuration parameters of the fruit pool.
# Interfaces
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.
# 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.
WriteStatus status of write.