Versions in this module Expand all Collapse all v1 v1.0.0 Jul 29, 2022 Changes in this version + var AccountPrefix = []byte + var IssueAssetPrefix = []byte + var NameCleanupPrefix = []byte + var NamePrefix = []byte + var NamePrefix_legacy = []byte + var NameRegistrantPrefix = []byte + var NanoPayCleanupPrefix = []byte + var NanoPayPrefix = []byte + var PubSubCleanupPrefix = []byte + var PubSubPrefix = []byte + func NewAccount(n uint64, b *balance, id []byte) *account + func NewTrieStore(db db.IStore) *cachingDB + type Asset struct + func (ia *Asset) Deserialize(r io.Reader) error + func (ia *Asset) Empty() bool + func (ia *Asset) Serialize(w io.Writer) error + type ChainStore struct + States *StateDB + func NewLedgerStore() (*ChainStore, error) + func (cs *ChainStore) AddHeader(header *block.Header) error + func (cs *ChainStore) CalcNextDonation_legacy(height uint32) (*Donation, error) + func (cs *ChainStore) Close() + func (cs *ChainStore) FastSyncDone(syncRootHash common.Uint256, fastSyncHeight uint32) error + func (cs *ChainStore) GenerateStateRoot(ctx context.Context, b *block.Block, ...) (common.Uint256, error) + func (cs *ChainStore) GetAsset(assetID common.Uint256) (name, symbol string, totalSupply common.Fixed64, precision uint32, err error) + func (cs *ChainStore) GetBalance(addr common.Uint160) common.Fixed64 + func (cs *ChainStore) GetBalanceByAssetID(addr common.Uint160, assetID common.Uint256) common.Fixed64 + func (cs *ChainStore) GetBlock(hash common.Uint256) (*block.Block, error) + func (cs *ChainStore) GetBlockByHeight(height uint32) (*block.Block, error) + func (cs *ChainStore) GetBlockHash(height uint32) (common.Uint256, error) + func (cs *ChainStore) GetCurrentBlockHash() common.Uint256 + func (cs *ChainStore) GetCurrentBlockHashFromDB() (common.Uint256, uint32, error) + func (cs *ChainStore) GetCurrentBlockStateRoot() (common.Uint256, error) + func (cs *ChainStore) GetCurrentHeaderHash() common.Uint256 + func (cs *ChainStore) GetDatabase() db.IStore + func (cs *ChainStore) GetDonation() (common.Fixed64, error) + func (cs *ChainStore) GetFastSyncStateRoot() (common.Uint256, error) + func (cs *ChainStore) GetHeader(hash common.Uint256) (*block.Header, error) + func (cs *ChainStore) GetHeaderByHeight(height uint32) (*block.Header, error) + func (cs *ChainStore) GetHeaderHashByHeight(height uint32) common.Uint256 + func (cs *ChainStore) GetHeaderHeight() uint32 + func (cs *ChainStore) GetHeaderWithCache(hash common.Uint256) (*block.Header, error) + func (cs *ChainStore) GetHeight() uint32 + func (cs *ChainStore) GetHeightByBlockHash(hash common.Uint256) (uint32, error) + func (cs *ChainStore) GetID(publicKey []byte, height uint32) ([]byte, error) + func (cs *ChainStore) GetIDVersion(publicKey []byte) ([]byte, byte, error) + func (cs *ChainStore) GetName_legacy(registrant []byte) (string, error) + func (cs *ChainStore) GetNanoPay(addr common.Uint160, recipient common.Uint160, nonce uint64) (common.Fixed64, uint32, error) + func (cs *ChainStore) GetNonce(addr common.Uint160) uint64 + func (cs *ChainStore) GetPruningStartHeight() (uint32, uint32) + func (cs *ChainStore) GetRDCBalance(addr common.Uint160) common.Fixed64 + func (cs *ChainStore) GetRegistrant(name string) ([]byte, uint32, error) + func (cs *ChainStore) GetRegistrant_legacy(name string) ([]byte, error) + func (cs *ChainStore) GetSigChainWithCache(hash common.Uint256) (*pb.SigChain, error) + func (cs *ChainStore) GetStateRoots(fromHeight, toHeight uint32) ([]common.Uint256, error) + func (cs *ChainStore) GetSubscribers(topic string, bucket, offset, limit uint32, subscriberHashPrefix []byte, ...) ([]string, error) + func (cs *ChainStore) GetSubscribersCount(topic string, bucket uint32, subscriberHashPrefix []byte, ctx context.Context) (int, error) + func (cs *ChainStore) GetSubscribersWithMeta(topic string, bucket, offset, limit uint32, subscriberHashPrefix []byte, ...) (map[string]string, error) + func (cs *ChainStore) GetSubscription(topic string, bucket uint32, subscriber []byte, identifier string) (string, uint32, error) + func (cs *ChainStore) GetSyncRootHeight() (uint32, error) + func (cs *ChainStore) GetTransaction(hash common.Uint256) (*transaction.Transaction, error) + func (cs *ChainStore) InitLedgerStoreWithGenesisBlock(genesisBlock *block.Block) (uint32, error) + func (cs *ChainStore) IsBlockInStore(hash common.Uint256) bool + func (cs *ChainStore) IsDoubleSpend(tx *transaction.Transaction) bool + func (cs *ChainStore) IsSubscribed(topic string, bucket uint32, subscriber []byte, identifier string) (bool, error) + func (cs *ChainStore) IsTxHashDuplicate(txhash common.Uint256) bool + func (cs *ChainStore) PrepareFastSync(fastSyncHeight uint32, fastSyncRootHash common.Uint256) error + func (cs *ChainStore) PruneStates() error + func (cs *ChainStore) PruneStatesLowMemory(full bool) error + func (cs *ChainStore) ResetDB() error + func (cs *ChainStore) Rollback(b *block.Block) error + func (cs *ChainStore) SaveBlock(b *block.Block, pruning, fastSync bool) error + func (cs *ChainStore) SequentialPrune() error + func (cs *ChainStore) ShouldFastSync(syncStopHeight uint32) bool + func (cs *ChainStore) TrieTraverse(needPrint bool) error + func (cs *ChainStore) VerifyState() error + type Donation struct + Amount common.Fixed64 + Height uint32 + func NewDonation(height uint32, amount common.Fixed64) *Donation + func (d *Donation) Deserialize(r io.Reader) error + func (d *Donation) Serialize(w io.Writer) error + type HeaderCache struct + func NewHeaderCache() *HeaderCache + func (hc *HeaderCache) AddHeaderToCache(header *block.Header) + func (hc *HeaderCache) Dump() + func (hc *HeaderCache) GetCachedHeader(hash common.Uint256) (*block.Header, error) + func (hc *HeaderCache) GetCachedHeaderHashByHeight(height uint32) common.Uint256 + func (hc *HeaderCache) GetCurrentCacheHeaderHash() common.Uint256 + func (hc *HeaderCache) GetCurrentCachedHeight() uint32 + func (hc *HeaderCache) RemoveCachedHeader(height uint32) + func (hc *HeaderCache) RollbackHeader(h *block.Header) + type ITrie interface + CommitTo func() (common.Uint256, error) + Hash func() common.Uint256 + NewRefCounts func(refCountTargetHeight, pruningTargetHeight uint32) (*trie.RefCounts, error) + NodeIterator func(start []byte) trie.NodeIterator + TryDelete func(key []byte) error + TryGet func(key []byte) ([]byte, error) + TryTraverse func(needPrint bool) error + TryUpdate func(key, value []byte) error + type Operation int + const Addition + const Subtraction + type SigChainCache struct + func NewSigChainCache() *SigChainCache + func (s *SigChainCache) AddSigChainToCache(hash common.Uint256, sc *pb.SigChain) + func (s *SigChainCache) GetCachedSigChain(hash common.Uint256) (*pb.SigChain, error) + func (s *SigChainCache) RemoveCachedSigChain(h []byte) + func (s *SigChainCache) RollbackSigChain(h *block.Header) + type StateDB struct + func NewStateDB(root common.Uint256, cs *ChainStore) (*StateDB, error) + func (sdb *StateDB) CleanupNames(height uint32) error + func (sdb *StateDB) CleanupNanoPay(height uint32) error + func (sdb *StateDB) CleanupPubSub(height uint32) error + func (sdb *StateDB) Finalize(commit bool) (common.Uint256, error) + func (sdb *StateDB) FinalizeAccounts(commit bool) error + func (sdb *StateDB) FinalizeIssueAsset(commit bool) error + func (sdb *StateDB) FinalizeNames(commit bool) error + func (sdb *StateDB) FinalizeNames_legacy(commit bool) error + func (sdb *StateDB) FinalizeNanoPay(commit bool) error + func (sdb *StateDB) FinalizePubSub(commit bool) error + func (sdb *StateDB) GetAsset(assetID common.Uint256) (*Asset, error) + func (sdb *StateDB) GetBalance(assetID common.Uint256, addr common.Uint160) common.Fixed64 + func (sdb *StateDB) GetID(addr common.Uint160, height uint32) []byte + func (sdb *StateDB) GetIDVersion(addr common.Uint160) ([]byte, byte) + func (sdb *StateDB) GetNanoPay(sender, recipient common.Uint160, nonce uint64) (common.Fixed64, uint32, error) + func (sdb *StateDB) GetNonce(addr common.Uint160) uint64 + func (sdb *StateDB) GetOrNewAccount(addr common.Uint160) *account + func (sdb *StateDB) GetState(hash common.Uint256) ([]byte, error) + func (sdb *StateDB) IncrNonce(addr common.Uint160) error + func (sdb *StateDB) IntermediateRoot() (common.Uint256, error) + func (sdb *StateDB) NewBatch() error + func (sdb *StateDB) PruneStates() error + func (sdb *StateDB) PruneStatesLowMemory(full bool) error + func (sdb *StateDB) RollbackPruning(b *block.Block) error + func (sdb *StateDB) SequentialPrune() error + func (sdb *StateDB) SetAccount(addr common.Uint160, acc *account) + func (sdb *StateDB) SetAsset(assetID common.Uint256, name string, symbol string, totalSupply common.Fixed64, ...) error + func (sdb *StateDB) SetBalance(addr common.Uint160, assetID common.Uint256, value common.Fixed64) error + func (sdb *StateDB) SetID(addr common.Uint160, id []byte, version byte) error + func (sdb *StateDB) SetNanoPay(sender, recipient common.Uint160, nonce uint64, balance common.Fixed64, ...) error + func (sdb *StateDB) SetNonce(addr common.Uint160, nonce uint64) error + func (sdb *StateDB) TrieTraverse(needPrint bool) error + func (sdb *StateDB) UpdateBalance(addr common.Uint160, assetID common.Uint256, value common.Fixed64, ...) error + func (sdb *StateDB) UpdateID(addr common.Uint160, id []byte, version byte) error + func (sdb *StateDB) VerifyState() error