Documentation ¶
Index ¶
- Constants
- func AddRootHashToIdentifier(identifier string, hash string) string
- func CreateAccountKey(accType Type, shId uint32, address []byte) string
- func CreateMiniBlockKey(key string) string
- func CreateRootHashKey(trieIdentifier string) string
- func CreateTransactionKey(key string, tx data.TransactionHandler) string
- func CreateTrieIdentifier(shID uint32, accountType Type) string
- func CreateVersionKey(meta *block.MetaBlock, hash []byte) string
- func NewEmptyAccount(accType Type, address []byte) (vmcommon.AccountHandler, error)
- func NewObject(objType Type) (interface{}, error)
- func NewStateExporter(args ArgsNewStateExporter) (*stateExport, error)
- func NewStateImport(args ArgsNewStateImport) (*stateImport, error)
- type ArgsNewStateExporter
- type ArgsNewStateImport
- type Type
Constants ¶
const EpochStartMetaBlockIdentifier = "epochStartMetaBlock"
EpochStartMetaBlockIdentifier is the constant which defines the export/import identifier for epoch start metaBlock
const MiniBlocksIdentifier = "miniBlocks"
MiniBlocksIdentifier is the constant which defines the export/import identifier for miniBlocks
const TransactionsIdentifier = "transactions"
TransactionsIdentifier is the constant which defines the export/import identifier for transactions
const TrieIdentifier = "trie"
TrieIdentifier is the constant which defines the export/import identifier for tries
const UnFinishedMetaBlocksIdentifier = "unFinishedMetaBlocks"
UnFinishedMetaBlocksIdentifier is the constant which defines the export/import identifier for unFinished metaBlocks
Variables ¶
This section is empty.
Functions ¶
func AddRootHashToIdentifier ¶
AddRootHashToIdentifier adds the roothash to the current identifier
func CreateAccountKey ¶
CreateAccountKey creates a key for an account according to its type, shard ID and address
func CreateMiniBlockKey ¶
CreateMiniBlockKey returns a miniblock key
func CreateRootHashKey ¶
CreateRootHashKey creates a key of type roothash for a given trie identifier
func CreateTransactionKey ¶
func CreateTransactionKey(key string, tx data.TransactionHandler) string
CreateTransactionKey create a transaction key according to its type
func CreateTrieIdentifier ¶
CreateTrieIdentifier creates a trie identifier according to trie type and shard id
func CreateVersionKey ¶
CreateVersionKey creates a version key from the given metaBlock
func NewEmptyAccount ¶
func NewEmptyAccount(accType Type, address []byte) (vmcommon.AccountHandler, error)
NewEmptyAccount returns a new account according to the given type
func NewStateExporter ¶
func NewStateExporter(args ArgsNewStateExporter) (*stateExport, error)
NewStateExporter exports all the data at a specific moment to a hardfork storer
func NewStateImport ¶
func NewStateImport(args ArgsNewStateImport) (*stateImport, error)
NewStateImport creates an importer which reads all the files for a new start
Types ¶
type ArgsNewStateExporter ¶
type ArgsNewStateExporter struct { ShardCoordinator sharding.Coordinator StateSyncer update.StateSyncer Marshalizer marshal.Marshalizer Hasher hashing.Hasher HardforkStorer update.HardforkStorer ExportFolder string AddressPubKeyConverter core.PubkeyConverter ValidatorPubKeyConverter core.PubkeyConverter GenesisNodesSetupHandler update.GenesisNodesSetupHandler }
ArgsNewStateExporter defines the arguments needed to create new state exporter
type ArgsNewStateImport ¶
type ArgsNewStateImport struct { Hasher hashing.Hasher Marshalizer marshal.Marshalizer ShardID uint32 StorageConfig config.StorageConfig TrieStorageManagers map[string]temporary.StorageManager HardforkStorer update.HardforkStorer }
ArgsNewStateImport is the arguments structure to create a new state importer
type Type ¶
type Type uint8
Type identifies the type of the export / import
const ( // Unknown is an export/import type which is not known by the system Unknown Type = iota // Transaction is the export/import type for pending transactions Transaction // SmartContractResult is the export/import type for pending smart contract results SmartContractResult // RewardTransaction is the export/import type for pending reward transaction RewardTransaction // MiniBlock is the export/import type for pending miniBlock MiniBlock // Header is the export/import type for pending headers Header // MetaHeader is the export/import type for pending meta headers MetaHeader // RootHash is the export/import type for byte array which has to be treated as rootHash RootHash // UserAccount is the export/import type for an account of type user account UserAccount // ValidatorAccount is the export/import type for peer account ValidatorAccount // DataTrie identifies the data trie kept under a specific account DataTrie )
func GetKeyTypeAndHash ¶
GetKeyTypeAndHash returns the type of the key by splitting it up and deciphering it