Documentation ¶
Index ¶
Constants ¶
View Source
const ( // AccountKVNamespace is the bucket name for account AccountKVNamespace = "Account" // ArchiveNamespacePrefix is the prefix of the buckets storing history data ArchiveNamespacePrefix = "Archive" // CurrentHeightKey indicates the key of current factory height in underlying DB CurrentHeightKey = "currentHeight" // ArchiveTrieNamespace is the bucket for the latest state view ArchiveTrieNamespace = "AccountTrie" // ArchiveTrieRootKey indicates the key of accountTrie root hash in underlying DB ArchiveTrieRootKey = "archiveTrieRoot" )
Variables ¶
View Source
var ( // ErrNotSupported is the error that the statedb is not for archive mode ErrNotSupported = errors.New("not supported") // ErrNoArchiveData is the error that the node have no archive data ErrNoArchiveData = errors.New("no archive data") )
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory interface { lifecycle.StartStopper protocol.StateReader Validate(context.Context, *block.Block) error // NewBlockBuilder creates block builder NewBlockBuilder(context.Context, map[string][]action.SealedEnvelope, []action.SealedEnvelope) (*block.Builder, error) SimulateExecution(context.Context, address.Address, *action.Execution, evm.GetBlockHash) ([]byte, *action.Receipt, error) Commit(context.Context, *block.Block) error }
Factory defines an interface for managing states
func NewFactory ¶
NewFactory creates a new state factory
func NewStateDB ¶
func NewStateDB(cfg config.Config, opts ...StateDBOption) (Factory, error)
NewStateDB creates a new state db
type Option ¶
Option sets Factory construction parameter
func DefaultTrieOption ¶
func DefaultTrieOption() Option
DefaultTrieOption creates trie from config for state factory
func InMemTrieOption ¶
func InMemTrieOption() Option
InMemTrieOption creates in memory trie for state factory
func PrecreatedTrieDBOption ¶
PrecreatedTrieDBOption uses pre-created trie DB for state factory
type StateDBOption ¶
StateDBOption sets stateDB construction parameter
func DefaultStateDBOption ¶
func DefaultStateDBOption() StateDBOption
DefaultStateDBOption creates default state db from config
func InMemStateDBOption ¶
func InMemStateDBOption() StateDBOption
InMemStateDBOption creates in memory state db
func PrecreatedStateDBOption ¶ added in v0.8.1
func PrecreatedStateDBOption(kv db.KVStore) StateDBOption
PrecreatedStateDBOption uses pre-created state db
Click to show internal directories.
Click to hide internal directories.