Documentation ¶
Index ¶
- Constants
- Variables
- func NewAccount(n uint64, b *balance, id []byte) *account
- func NewTrieStore(db IStore) *cachingDB
- type Asset
- type ChainStore
- func (cs *ChainStore) AddHeader(header *block.Header) error
- func (cs *ChainStore) CalcNextDonation(height uint32) (*Donation, error)
- func (cs *ChainStore) Close()
- func (cs *ChainStore) GenerateStateRoot(b *block.Block, genesisBlockInitialized, needBeCommitted bool) (Uint256, error)
- func (cs *ChainStore) GetAsset(assetID common.Uint256) (name, symbol string, totalSupply common.Fixed64, precision uint32, err error)
- func (cs *ChainStore) GetBalance(addr Uint160) Fixed64
- func (cs *ChainStore) GetBalanceByAssetID(addr Uint160, assetID Uint256) Fixed64
- func (cs *ChainStore) GetBlock(hash Uint256) (*block.Block, error)
- func (cs *ChainStore) GetBlockByHeight(height uint32) (*block.Block, error)
- func (cs *ChainStore) GetBlockHash(height uint32) (Uint256, error)
- func (cs *ChainStore) GetCurrentBlockHash() Uint256
- func (cs *ChainStore) GetCurrentBlockStateRoot() (Uint256, error)
- func (cs *ChainStore) GetCurrentHeaderHash() Uint256
- func (cs *ChainStore) GetDatabase() IStore
- func (cs *ChainStore) GetDonation() (Fixed64, error)
- func (cs *ChainStore) GetFirstAvailableTopicBucket(topic string) int
- func (cs *ChainStore) GetHeader(hash Uint256) (*block.Header, error)
- func (cs *ChainStore) GetHeaderByHeight(height uint32) (*block.Header, error)
- func (cs *ChainStore) GetHeaderHashByHeight(height uint32) Uint256
- func (cs *ChainStore) GetHeaderHeight() uint32
- func (cs *ChainStore) GetHeaderWithCache(hash Uint256) (*block.Header, error)
- func (cs *ChainStore) GetHeight() uint32
- func (cs *ChainStore) GetHeightByBlockHash(hash Uint256) (uint32, error)
- func (cs *ChainStore) GetID(publicKey []byte) ([]byte, error)
- func (cs *ChainStore) GetName(registrant []byte) (string, error)
- func (cs *ChainStore) GetNanoPay(addr Uint160, recipient Uint160, nonce uint64) (Fixed64, uint32, error)
- func (cs *ChainStore) GetNonce(addr Uint160) uint64
- func (cs *ChainStore) GetRegistrant(name string) ([]byte, error)
- func (cs *ChainStore) GetSubscribers(topic string, bucket uint32) (map[string]string, error)
- func (cs *ChainStore) GetSubscribersCount(topic string, bucket uint32) int
- func (cs *ChainStore) GetTopicBucketsCount(topic string) (uint32, error)
- func (cs *ChainStore) GetTransaction(hash Uint256) (*transaction.Transaction, error)
- func (cs *ChainStore) InitLedgerStoreWithGenesisBlock(genesisBlock *block.Block) (uint32, error)
- func (cs *ChainStore) IsBlockInStore(hash 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 Uint256) bool
- func (cs *ChainStore) ResetDB() error
- func (cs *ChainStore) Rollback(b *block.Block) error
- func (cs *ChainStore) SaveBlock(b *block.Block, fastAdd bool) error
- type DataEntryPrefix
- type Donation
- type 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(stopHeight uint32)
- func (hc *HeaderCache) RollbackHeader(h *block.Header)
- type IIterator
- type IStore
- type ITrie
- type Iterator
- type LevelDBStore
- func (self *LevelDBStore) BatchCommit() error
- func (self *LevelDBStore) BatchDelete(key []byte) error
- func (self *LevelDBStore) BatchPut(key []byte, value []byte) error
- func (self *LevelDBStore) Close() error
- func (self *LevelDBStore) Delete(key []byte) error
- func (self *LevelDBStore) Get(key []byte) ([]byte, error)
- func (self *LevelDBStore) Has(key []byte) (bool, error)
- func (self *LevelDBStore) NewBatch() error
- func (self *LevelDBStore) NewIterator(prefix []byte) IIterator
- func (self *LevelDBStore) Put(key []byte, value []byte) error
- type Operation
- type StateDB
- func (sdb *StateDB) CleanupNanoPay(height uint32) error
- func (sdb *StateDB) CleanupPubSub(height uint32) error
- func (sdb *StateDB) Finalize(commit bool) (root common.Uint256, err error)
- func (sdb *StateDB) FinalizeAccounts(commit bool)
- func (sdb *StateDB) FinalizeIssueAsset(commit bool)
- func (sdb *StateDB) FinalizeNames(commit bool)
- func (sdb *StateDB) FinalizeNanoPay(commit bool)
- func (sdb *StateDB) FinalizePubSub(commit bool)
- 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) []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) IncrNonce(addr common.Uint160) error
- func (sdb *StateDB) IntermediateRoot() common.Uint256
- 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) 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) UpdateBalance(addr common.Uint160, assetID common.Uint256, value common.Fixed64, ...) error
- func (sdb *StateDB) UpdateID(addr common.Uint160, id []byte) error
Constants ¶
View Source
const BITSPERKEY = 10
used to compute the size of bloom filter bits array . too small will lead to high false positive rate.
Variables ¶
Functions ¶
func NewAccount ¶
func NewTrieStore ¶
func NewTrieStore(db IStore) *cachingDB
Types ¶
type ChainStore ¶
type ChainStore struct { States *StateDB // contains filtered or unexported fields }
func NewLedgerStore ¶
func NewLedgerStore() (*ChainStore, error)
func (*ChainStore) CalcNextDonation ¶
func (cs *ChainStore) CalcNextDonation(height uint32) (*Donation, error)
func (*ChainStore) Close ¶
func (cs *ChainStore) Close()
func (*ChainStore) GenerateStateRoot ¶
func (cs *ChainStore) GenerateStateRoot(b *block.Block, genesisBlockInitialized, needBeCommitted bool) (Uint256, error)
func (*ChainStore) GetBalance ¶
func (cs *ChainStore) GetBalance(addr Uint160) Fixed64
func (*ChainStore) GetBalanceByAssetID ¶
func (cs *ChainStore) GetBalanceByAssetID(addr Uint160, assetID Uint256) Fixed64
func (*ChainStore) GetBlockByHeight ¶
func (cs *ChainStore) GetBlockByHeight(height uint32) (*block.Block, error)
func (*ChainStore) GetBlockHash ¶
func (cs *ChainStore) GetBlockHash(height uint32) (Uint256, error)
func (*ChainStore) GetCurrentBlockHash ¶
func (cs *ChainStore) GetCurrentBlockHash() Uint256
func (*ChainStore) GetCurrentBlockStateRoot ¶
func (cs *ChainStore) GetCurrentBlockStateRoot() (Uint256, error)
func (*ChainStore) GetCurrentHeaderHash ¶
func (cs *ChainStore) GetCurrentHeaderHash() Uint256
func (*ChainStore) GetDatabase ¶
func (cs *ChainStore) GetDatabase() IStore
func (*ChainStore) GetDonation ¶
func (cs *ChainStore) GetDonation() (Fixed64, error)
func (*ChainStore) GetFirstAvailableTopicBucket ¶
func (cs *ChainStore) GetFirstAvailableTopicBucket(topic string) int
func (*ChainStore) GetHeaderByHeight ¶
func (cs *ChainStore) GetHeaderByHeight(height uint32) (*block.Header, error)
func (*ChainStore) GetHeaderHashByHeight ¶
func (cs *ChainStore) GetHeaderHashByHeight(height uint32) Uint256
func (*ChainStore) GetHeaderHeight ¶
func (cs *ChainStore) GetHeaderHeight() uint32
func (*ChainStore) GetHeaderWithCache ¶
func (cs *ChainStore) GetHeaderWithCache(hash Uint256) (*block.Header, error)
func (*ChainStore) GetHeight ¶
func (cs *ChainStore) GetHeight() uint32
func (*ChainStore) GetHeightByBlockHash ¶
func (cs *ChainStore) GetHeightByBlockHash(hash Uint256) (uint32, error)
func (*ChainStore) GetNanoPay ¶
func (cs *ChainStore) GetNanoPay(addr Uint160, recipient Uint160, nonce uint64) (Fixed64, uint32, error)
func (*ChainStore) GetNonce ¶
func (cs *ChainStore) GetNonce(addr Uint160) uint64
func (*ChainStore) GetRegistrant ¶
func (cs *ChainStore) GetRegistrant(name string) ([]byte, error)
func (*ChainStore) GetSubscribers ¶
func (*ChainStore) GetSubscribersCount ¶
func (cs *ChainStore) GetSubscribersCount(topic string, bucket uint32) int
func (*ChainStore) GetTopicBucketsCount ¶
func (cs *ChainStore) GetTopicBucketsCount(topic string) (uint32, error)
func (*ChainStore) GetTransaction ¶
func (cs *ChainStore) GetTransaction(hash Uint256) (*transaction.Transaction, error)
func (*ChainStore) InitLedgerStoreWithGenesisBlock ¶
func (cs *ChainStore) InitLedgerStoreWithGenesisBlock(genesisBlock *block.Block) (uint32, error)
func (*ChainStore) IsBlockInStore ¶
func (cs *ChainStore) IsBlockInStore(hash Uint256) bool
func (*ChainStore) IsDoubleSpend ¶
func (cs *ChainStore) IsDoubleSpend(tx *transaction.Transaction) bool
func (*ChainStore) IsSubscribed ¶
func (*ChainStore) IsTxHashDuplicate ¶
func (cs *ChainStore) IsTxHashDuplicate(txhash Uint256) bool
func (*ChainStore) ResetDB ¶
func (cs *ChainStore) ResetDB() error
type DataEntryPrefix ¶
type DataEntryPrefix byte
const ( // DATA DATA_BlockHash DataEntryPrefix = 0x00 DATA_Header DataEntryPrefix = 0x01 DATA_Transaction DataEntryPrefix = 0x02 ST_Prepaid DataEntryPrefix = 0xc7 ST_StateTrie DataEntryPrefix = 0xc8 //SYSTEM SYS_CurrentBlock DataEntryPrefix = 0x40 SYS_Donations DataEntryPrefix = 0x42 //CONFIG CFG_Version DataEntryPrefix = 0xf0 )
type HeaderCache ¶
type HeaderCache struct {
// contains filtered or unexported fields
}
func NewHeaderCache ¶
func NewHeaderCache() *HeaderCache
func (*HeaderCache) AddHeaderToCache ¶
func (hc *HeaderCache) AddHeaderToCache(header *block.Header)
func (*HeaderCache) Dump ¶
func (hc *HeaderCache) Dump()
func (*HeaderCache) GetCachedHeader ¶
func (*HeaderCache) GetCachedHeaderHashByHeight ¶
func (hc *HeaderCache) GetCachedHeaderHashByHeight(height uint32) common.Uint256
func (*HeaderCache) GetCurrentCacheHeaderHash ¶
func (hc *HeaderCache) GetCurrentCacheHeaderHash() common.Uint256
func (*HeaderCache) GetCurrentCachedHeight ¶
func (hc *HeaderCache) GetCurrentCachedHeight() uint32
func (*HeaderCache) RemoveCachedHeader ¶
func (hc *HeaderCache) RemoveCachedHeader(stopHeight uint32)
func (*HeaderCache) RollbackHeader ¶
func (hc *HeaderCache) RollbackHeader(h *block.Header)
type IStore ¶
type IStore interface { Put(key []byte, value []byte) error Get(key []byte) ([]byte, error) Has(key []byte) (bool, error) Delete(key []byte) error NewBatch() error BatchPut(key []byte, value []byte) error BatchDelete(key []byte) error BatchCommit() error Close() error NewIterator(prefix []byte) IIterator }
type LevelDBStore ¶
type LevelDBStore struct {
// contains filtered or unexported fields
}
func NewLevelDBStore ¶
func NewLevelDBStore(file string) (*LevelDBStore, error)
func (*LevelDBStore) BatchCommit ¶
func (self *LevelDBStore) BatchCommit() error
func (*LevelDBStore) BatchDelete ¶
func (self *LevelDBStore) BatchDelete(key []byte) error
func (*LevelDBStore) Close ¶
func (self *LevelDBStore) Close() error
func (*LevelDBStore) Delete ¶
func (self *LevelDBStore) Delete(key []byte) error
func (*LevelDBStore) NewBatch ¶
func (self *LevelDBStore) NewBatch() error
func (*LevelDBStore) NewIterator ¶
func (self *LevelDBStore) NewIterator(prefix []byte) IIterator
type StateDB ¶
type StateDB struct {
// contains filtered or unexported fields
}
func (*StateDB) CleanupNanoPay ¶
func (*StateDB) CleanupPubSub ¶
func (*StateDB) FinalizeAccounts ¶
func (*StateDB) FinalizeIssueAsset ¶
func (*StateDB) FinalizeNames ¶
func (*StateDB) FinalizeNanoPay ¶
func (*StateDB) FinalizePubSub ¶
func (*StateDB) GetBalance ¶
func (*StateDB) GetNanoPay ¶
func (*StateDB) GetOrNewAccount ¶
func (*StateDB) IntermediateRoot ¶
func (*StateDB) SetAccount ¶
func (*StateDB) SetBalance ¶
func (*StateDB) SetNanoPay ¶
func (*StateDB) UpdateBalance ¶
Click to show internal directories.
Click to hide internal directories.