Documentation ¶
Index ¶
- Constants
- Variables
- func NewLedgerStore() (ILedgerStore, error)
- func NewStore(file string) (IStore, error)
- type CacheCodeTable
- type ChainStore
- func (self *ChainStore) AddHeaders(headers []Header, ledger *Ledger) error
- func (bd *ChainStore) BlockInCache(hash Uint256) bool
- func (self *ChainStore) Close()
- func (bd *ChainStore) ContainsUnspent(txid Uint256, index uint16) (bool, error)
- func (bd *ChainStore) GetAccount(programHash Uint160) (*account.AccountState, error)
- func (bd *ChainStore) GetAsset(hash Uint256) (*Asset, error)
- func (bd *ChainStore) GetAssetState(assetId Uint256) (*states.AssetState, error)
- func (bd *ChainStore) GetAssets() map[Uint256]*Asset
- func (bd *ChainStore) GetAvailableAsset(programHash Uint160, assetID Uint256) (Fixed64, Fixed64, error)
- func (bd *ChainStore) GetBlock(hash Uint256) (*Block, error)
- func (bd *ChainStore) GetBlockHash(height uint32) (Uint256, error)
- func (self *ChainStore) GetBookKeeperList() ([]*crypto.PubKey, []*crypto.PubKey, error)
- func (bd *ChainStore) GetContract(codeHash Uint160) ([]byte, error)
- func (bd *ChainStore) GetCurrentBlockHash() Uint256
- func (bd *ChainStore) GetCurrentHeaderHash() Uint256
- func (bd *ChainStore) GetHeader(hash Uint256) (*Header, error)
- func (bd *ChainStore) GetHeaderHashByHeight(height uint32) Uint256
- func (bd *ChainStore) GetHeaderHeight() uint32
- func (bd *ChainStore) GetHeight() uint32
- func (bd *ChainStore) GetLockedFromProgramHash(programHash Uint160, assetID Uint256) ([]*LockAsset, error)
- func (bd *ChainStore) GetQuantityIssued(assetId Uint256) (Fixed64, error)
- func (bd *ChainStore) GetRecord(filehash string) (Uint256, error)
- func (bd *ChainStore) GetStorage(key []byte) ([]byte, error)
- func (bd *ChainStore) GetTransaction(hash Uint256) (*tx.Transaction, error)
- func (bd *ChainStore) GetUnspent(txid Uint256, index uint16) (*tx.TxOutput, error)
- func (bd *ChainStore) GetUnspentFromProgramHash(programHash Uint160, assetid Uint256) ([]*tx.UTXOUnspent, error)
- func (bd *ChainStore) GetUnspentsFromProgramHash(programHash Uint160) (map[Uint256][]*tx.UTXOUnspent, error)
- func (bd *ChainStore) InitLedgerStore(l *Ledger) error
- func (bd *ChainStore) InitLedgerStoreWithGenesisBlock(genesisBlock *Block, defaultBookKeeper []*crypto.PubKey) (uint32, error)
- func (bd *ChainStore) IsBlockInStore(hash Uint256) bool
- func (bd *ChainStore) IsDoubleSpend(tx *tx.Transaction) bool
- func (bd *ChainStore) IsTxHashDuplicate(txhash Uint256) bool
- func (bd *ChainStore) SaveAsset(assetId Uint256, asset *Asset) error
- func (self *ChainStore) SaveBlock(b *Block, ledger *Ledger) error
- func (bd *ChainStore) SaveLockedAsset(programHash Uint160, assetID Uint256, lockAsset []*LockAsset) error
- func (bd *ChainStore) SaveRecord(hash string, txhash Uint256) error
- func (bd *ChainStore) SaveTransaction(tx *tx.Transaction, height uint32) error
- type DBCache
- func (cache *DBCache) AddBalance(common.Uint160, *big.Int)
- func (cache *DBCache) Commit() (err error)
- func (cache *DBCache) GetBalance(common.Uint160) *big.Int
- func (cache *DBCache) GetCode(codeHash common.Uint160) ([]byte, error)
- func (cache *DBCache) GetCodeSize(common.Uint160) int
- func (cache *DBCache) GetOrAdd(prefix store.DataEntryPrefix, key string, value states.IStateValueInterface) (states.IStateValueInterface, error)
- func (cache *DBCache) GetState(codeHash common.Uint160, loc common.Hash) (common.Hash, error)
- func (cache *DBCache) GetWriteSet() *storage.RWSet
- func (cache *DBCache) SetCode(codeHash common.Uint160, code []byte)
- func (cache *DBCache) SetState(codeHash common.Uint160, loc, value common.Hash)
- func (cache *DBCache) Suicide(codeHash common.Uint160) bool
- func (cache *DBCache) TryGet(prefix store.DataEntryPrefix, key string) (states.IStateValueInterface, error)
- func (cache *DBCache) TryGetInternal(prefix store.DataEntryPrefix, key string) (states.IStateValueInterface, error)
Constants ¶
View Source
const ( HeaderHashListCount = 2000 CleanCacheThreshold = 2 TaskChanCap = 4 DEPLOY_TRANSACTION = "DeployTransaction" INVOKE_TRANSACTION = "InvokeTransaction" )
Variables ¶
View Source
var (
ErrDBNotFound = errors.New("leveldb: not found")
)
Functions ¶
func NewLedgerStore ¶
func NewLedgerStore() (ILedgerStore, error)
Types ¶
type CacheCodeTable ¶
type CacheCodeTable struct {
// contains filtered or unexported fields
}
func NewCacheCodeTable ¶
func NewCacheCodeTable(dbCache *DBCache) *CacheCodeTable
type ChainStore ¶
type ChainStore struct {
// contains filtered or unexported fields
}
func NewChainStore ¶
func NewChainStore(file string) (*ChainStore, error)
func (*ChainStore) AddHeaders ¶
func (self *ChainStore) AddHeaders(headers []Header, ledger *Ledger) error
func (*ChainStore) BlockInCache ¶
func (bd *ChainStore) BlockInCache(hash Uint256) bool
func (*ChainStore) Close ¶
func (self *ChainStore) Close()
func (*ChainStore) ContainsUnspent ¶
func (bd *ChainStore) ContainsUnspent(txid Uint256, index uint16) (bool, error)
func (*ChainStore) GetAccount ¶
func (bd *ChainStore) GetAccount(programHash Uint160) (*account.AccountState, error)
func (*ChainStore) GetAsset ¶
func (bd *ChainStore) GetAsset(hash Uint256) (*Asset, error)
func (*ChainStore) GetAssetState ¶
func (bd *ChainStore) GetAssetState(assetId Uint256) (*states.AssetState, error)
func (*ChainStore) GetAssets ¶
func (bd *ChainStore) GetAssets() map[Uint256]*Asset
func (*ChainStore) GetAvailableAsset ¶
func (bd *ChainStore) GetAvailableAsset(programHash Uint160, assetID Uint256) (Fixed64, Fixed64, error)
func (*ChainStore) GetBlock ¶
func (bd *ChainStore) GetBlock(hash Uint256) (*Block, error)
func (*ChainStore) GetBlockHash ¶
func (bd *ChainStore) GetBlockHash(height uint32) (Uint256, error)
func (*ChainStore) GetBookKeeperList ¶
func (*ChainStore) GetContract ¶
func (bd *ChainStore) GetContract(codeHash Uint160) ([]byte, error)
func (*ChainStore) GetCurrentBlockHash ¶
func (bd *ChainStore) GetCurrentBlockHash() Uint256
func (*ChainStore) GetCurrentHeaderHash ¶
func (bd *ChainStore) GetCurrentHeaderHash() Uint256
func (*ChainStore) GetHeader ¶
func (bd *ChainStore) GetHeader(hash Uint256) (*Header, error)
func (*ChainStore) GetHeaderHashByHeight ¶
func (bd *ChainStore) GetHeaderHashByHeight(height uint32) Uint256
func (*ChainStore) GetHeaderHeight ¶
func (bd *ChainStore) GetHeaderHeight() uint32
func (*ChainStore) GetHeight ¶
func (bd *ChainStore) GetHeight() uint32
func (*ChainStore) GetLockedFromProgramHash ¶
func (bd *ChainStore) GetLockedFromProgramHash(programHash Uint160, assetID Uint256) ([]*LockAsset, error)
func (*ChainStore) GetQuantityIssued ¶
func (bd *ChainStore) GetQuantityIssued(assetId Uint256) (Fixed64, error)
func (*ChainStore) GetRecord ¶
func (bd *ChainStore) GetRecord(filehash string) (Uint256, error)
func (*ChainStore) GetStorage ¶
func (bd *ChainStore) GetStorage(key []byte) ([]byte, error)
func (*ChainStore) GetTransaction ¶
func (bd *ChainStore) GetTransaction(hash Uint256) (*tx.Transaction, error)
func (*ChainStore) GetUnspent ¶
func (bd *ChainStore) GetUnspent(txid Uint256, index uint16) (*tx.TxOutput, error)
func (*ChainStore) GetUnspentFromProgramHash ¶
func (bd *ChainStore) GetUnspentFromProgramHash(programHash Uint160, assetid Uint256) ([]*tx.UTXOUnspent, error)
func (*ChainStore) GetUnspentsFromProgramHash ¶
func (bd *ChainStore) GetUnspentsFromProgramHash(programHash Uint160) (map[Uint256][]*tx.UTXOUnspent, error)
func (*ChainStore) InitLedgerStore ¶
func (bd *ChainStore) InitLedgerStore(l *Ledger) error
func (*ChainStore) InitLedgerStoreWithGenesisBlock ¶
func (bd *ChainStore) InitLedgerStoreWithGenesisBlock(genesisBlock *Block, defaultBookKeeper []*crypto.PubKey) (uint32, error)
func (*ChainStore) IsBlockInStore ¶
func (bd *ChainStore) IsBlockInStore(hash Uint256) bool
func (*ChainStore) IsDoubleSpend ¶
func (bd *ChainStore) IsDoubleSpend(tx *tx.Transaction) bool
func (*ChainStore) IsTxHashDuplicate ¶
func (bd *ChainStore) IsTxHashDuplicate(txhash Uint256) bool
func (*ChainStore) SaveAsset ¶
func (bd *ChainStore) SaveAsset(assetId Uint256, asset *Asset) error
func (*ChainStore) SaveBlock ¶
func (self *ChainStore) SaveBlock(b *Block, ledger *Ledger) error
func (*ChainStore) SaveLockedAsset ¶
func (bd *ChainStore) SaveLockedAsset(programHash Uint160, assetID Uint256, lockAsset []*LockAsset) error
func (*ChainStore) SaveRecord ¶
func (bd *ChainStore) SaveRecord(hash string, txhash Uint256) error
func (*ChainStore) SaveTransaction ¶
func (bd *ChainStore) SaveTransaction(tx *tx.Transaction, height uint32) error
type DBCache ¶
func NewDBCache ¶
func NewDBCache(db *ChainStore) *DBCache
func (*DBCache) GetOrAdd ¶
func (cache *DBCache) GetOrAdd(prefix store.DataEntryPrefix, key string, value states.IStateValueInterface) (states.IStateValueInterface, error)
func (*DBCache) GetWriteSet ¶
func (*DBCache) TryGet ¶
func (cache *DBCache) TryGet(prefix store.DataEntryPrefix, key string) (states.IStateValueInterface, error)
func (*DBCache) TryGetInternal ¶
func (cache *DBCache) TryGetInternal(prefix store.DataEntryPrefix, key string) (states.IStateValueInterface, error)
Click to show internal directories.
Click to hide internal directories.