Documentation ¶
Index ¶
- Constants
- func CreateOnRoadInfoKey(addr *types.Address, tId *types.TokenTypeId) []byte
- func CreateOnRoadInfoPrefixKey(addr *types.Address) []byte
- type Chain
- type FilterToken
- func (ft *FilterToken) DeleteAccountBlocks(batch *leveldb.Batch, accountBlocks []*ledger.AccountBlock) error
- func (ft *FilterToken) DeleteSnapshotBlocks(batch *leveldb.Batch, chunks []*ledger.SnapshotChunk) error
- func (ft *FilterToken) GetBlocks(addr types.Address, tokenId types.TokenTypeId, blockHash *types.Hash, ...) ([]*ledger.AccountBlock, error)
- func (ft *FilterToken) GetStore() *chain_db.Store
- func (ft *FilterToken) InsertAccountBlock(batch *leveldb.Batch, accountBlock *ledger.AccountBlock) error
- func (ft *FilterToken) InsertSnapshotBlock(batch *leveldb.Batch, snapshotBlock *ledger.SnapshotBlock, ...) error
- func (ft *FilterToken) RebuildData(flusher *chain_flusher.Flusher) error
- func (ft *FilterToken) RemoveNewUnconfirmed(*leveldb.Batch, []*ledger.AccountBlock) error
- func (ft *FilterToken) SetStore(store *chain_db.Store)
- type OnRoadInfo
- func (or *OnRoadInfo) DeleteAccountBlocks(batch *leveldb.Batch, blocks []*ledger.AccountBlock) error
- func (or *OnRoadInfo) DeleteSnapshotBlocks(batch *leveldb.Batch, chunks []*ledger.SnapshotChunk) error
- func (or *OnRoadInfo) GetAccountInfo(addr *types.Address) (*ledger.AccountInfo, error)
- func (or *OnRoadInfo) GetOnRoadInfoUnconfirmedHashList(addr types.Address) ([]*types.Hash, error)
- func (or *OnRoadInfo) GetStore() *chain_db.Store
- func (or *OnRoadInfo) InsertAccountBlock(batch *leveldb.Batch, block *ledger.AccountBlock) error
- func (or *OnRoadInfo) InsertSnapshotBlock(batch *leveldb.Batch, snapshotBlock *ledger.SnapshotBlock, ...) error
- func (or *OnRoadInfo) RebuildData(flusher *chain_flusher.Flusher) error
- func (or *OnRoadInfo) RemoveFromUnconfirmedCache(addr types.Address, hashList []*types.Hash) error
- func (or *OnRoadInfo) RemoveNewUnconfirmed(rollbackBatch *leveldb.Batch, allUnconfirmedBlocks []*ledger.AccountBlock) error
- func (or *OnRoadInfo) SetStore(store *chain_db.Store)
- func (or *OnRoadInfo) UpdateOnRoadInfo(addr types.Address, tkId types.TokenTypeId, number uint64, amount big.Int) error
- type Plugin
- type Plugins
- func (p *Plugins) Close() error
- func (p *Plugins) DeleteAccountBlocks(blocks []*ledger.AccountBlock) error
- func (p *Plugins) DeleteSnapshotBlocks(chunks []*ledger.SnapshotChunk) error
- func (p *Plugins) GetPlugin(name string) Plugin
- func (p *Plugins) InsertAccountBlocks(blocks []*vm_db.VmAccountBlock) error
- func (p *Plugins) InsertSnapshotBlocks(chunks []*ledger.SnapshotChunk) error
- func (p *Plugins) PrepareDeleteAccountBlocks(blocks []*ledger.AccountBlock) error
- func (p *Plugins) PrepareDeleteSnapshotBlocks(chunks []*ledger.SnapshotChunk) error
- func (p *Plugins) PrepareInsertAccountBlocks(vmBlocks []*vm_db.VmAccountBlock) error
- func (p *Plugins) PrepareInsertSnapshotBlocks(chunks []*ledger.SnapshotChunk) error
- func (p *Plugins) RebuildData() error
- func (p *Plugins) RemovePlugin(name string)
- func (p *Plugins) StartWrite()
- func (p *Plugins) StopWrite()
- func (p *Plugins) Stores() []*chain_db.Store
Constants ¶
View Source
const ( PluginKeyFilterToken = "plugin_filter_token" PluginKeyOnRoadInfo = "plugin_onroad_info" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chain ¶
type Chain interface { Flusher() *chain_flusher.Flusher GetLatestSnapshotBlock() *ledger.SnapshotBlock GetSnapshotBlocksByHeight(height uint64, higher bool, count uint64) ([]*ledger.SnapshotBlock, error) GetSubLedgerAfterHeight(height uint64) ([]*ledger.SnapshotChunk, error) GetSubLedger(startHeight, endHeight uint64) ([]*ledger.SnapshotChunk, error) GetAccountBlockByHash(blockHash types.Hash) (*ledger.AccountBlock, error) IsAccountBlockExisted(hash types.Hash) (bool, error) IsGenesisAccountBlock(hash types.Hash) bool GetAllUnconfirmedBlocks() []*ledger.AccountBlock LoadAllOnRoad() (map[types.Address][]types.Hash, error) }
type FilterToken ¶
type FilterToken struct {
// contains filtered or unexported fields
}
func (*FilterToken) DeleteAccountBlocks ¶
func (ft *FilterToken) DeleteAccountBlocks(batch *leveldb.Batch, accountBlocks []*ledger.AccountBlock) error
func (*FilterToken) DeleteSnapshotBlocks ¶
func (ft *FilterToken) DeleteSnapshotBlocks(batch *leveldb.Batch, chunks []*ledger.SnapshotChunk) error
func (*FilterToken) GetBlocks ¶
func (ft *FilterToken) GetBlocks(addr types.Address, tokenId types.TokenTypeId, blockHash *types.Hash, count uint64) ([]*ledger.AccountBlock, error)
func (*FilterToken) GetStore ¶
func (ft *FilterToken) GetStore() *chain_db.Store
func (*FilterToken) InsertAccountBlock ¶
func (ft *FilterToken) InsertAccountBlock(batch *leveldb.Batch, accountBlock *ledger.AccountBlock) error
func (*FilterToken) InsertSnapshotBlock ¶
func (ft *FilterToken) InsertSnapshotBlock(batch *leveldb.Batch, snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock) error
func (*FilterToken) RebuildData ¶
func (ft *FilterToken) RebuildData(flusher *chain_flusher.Flusher) error
func (*FilterToken) RemoveNewUnconfirmed ¶
func (ft *FilterToken) RemoveNewUnconfirmed(*leveldb.Batch, []*ledger.AccountBlock) error
func (*FilterToken) SetStore ¶
func (ft *FilterToken) SetStore(store *chain_db.Store)
type OnRoadInfo ¶
type OnRoadInfo struct {
// contains filtered or unexported fields
}
func (*OnRoadInfo) DeleteAccountBlocks ¶
func (or *OnRoadInfo) DeleteAccountBlocks(batch *leveldb.Batch, blocks []*ledger.AccountBlock) error
func (*OnRoadInfo) DeleteSnapshotBlocks ¶
func (or *OnRoadInfo) DeleteSnapshotBlocks(batch *leveldb.Batch, chunks []*ledger.SnapshotChunk) error
func (*OnRoadInfo) GetAccountInfo ¶
func (or *OnRoadInfo) GetAccountInfo(addr *types.Address) (*ledger.AccountInfo, error)
func (*OnRoadInfo) GetOnRoadInfoUnconfirmedHashList ¶
func (*OnRoadInfo) GetStore ¶
func (or *OnRoadInfo) GetStore() *chain_db.Store
func (*OnRoadInfo) InsertAccountBlock ¶
func (or *OnRoadInfo) InsertAccountBlock(batch *leveldb.Batch, block *ledger.AccountBlock) error
func (*OnRoadInfo) InsertSnapshotBlock ¶
func (or *OnRoadInfo) InsertSnapshotBlock(batch *leveldb.Batch, snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock) error
func (*OnRoadInfo) RebuildData ¶
func (or *OnRoadInfo) RebuildData(flusher *chain_flusher.Flusher) error
func (*OnRoadInfo) RemoveFromUnconfirmedCache ¶
func (*OnRoadInfo) RemoveNewUnconfirmed ¶
func (or *OnRoadInfo) RemoveNewUnconfirmed(rollbackBatch *leveldb.Batch, allUnconfirmedBlocks []*ledger.AccountBlock) error
func (*OnRoadInfo) SetStore ¶
func (or *OnRoadInfo) SetStore(store *chain_db.Store)
func (*OnRoadInfo) UpdateOnRoadInfo ¶
func (or *OnRoadInfo) UpdateOnRoadInfo(addr types.Address, tkId types.TokenTypeId, number uint64, amount big.Int) error
type Plugin ¶
type Plugin interface { SetStore(store *chain_db.Store) GetStore() *chain_db.Store InsertAccountBlock(*leveldb.Batch, *ledger.AccountBlock) error InsertSnapshotBlock(*leveldb.Batch, *ledger.SnapshotBlock, []*ledger.AccountBlock) error DeleteAccountBlocks(*leveldb.Batch, []*ledger.AccountBlock) error DeleteSnapshotBlocks(*leveldb.Batch, []*ledger.SnapshotChunk) error RemoveNewUnconfirmed(*leveldb.Batch, []*ledger.AccountBlock) error RebuildData(flusher *chain_flusher.Flusher) error }
type Plugins ¶
type Plugins struct {
// contains filtered or unexported fields
}
func (*Plugins) DeleteAccountBlocks ¶
func (p *Plugins) DeleteAccountBlocks(blocks []*ledger.AccountBlock) error
func (*Plugins) DeleteSnapshotBlocks ¶
func (p *Plugins) DeleteSnapshotBlocks(chunks []*ledger.SnapshotChunk) error
func (*Plugins) InsertAccountBlocks ¶
func (p *Plugins) InsertAccountBlocks(blocks []*vm_db.VmAccountBlock) error
func (*Plugins) InsertSnapshotBlocks ¶
func (p *Plugins) InsertSnapshotBlocks(chunks []*ledger.SnapshotChunk) error
func (*Plugins) PrepareDeleteAccountBlocks ¶
func (p *Plugins) PrepareDeleteAccountBlocks(blocks []*ledger.AccountBlock) error
func (*Plugins) PrepareDeleteSnapshotBlocks ¶
func (p *Plugins) PrepareDeleteSnapshotBlocks(chunks []*ledger.SnapshotChunk) error
func (*Plugins) PrepareInsertAccountBlocks ¶
func (p *Plugins) PrepareInsertAccountBlocks(vmBlocks []*vm_db.VmAccountBlock) error
func (*Plugins) PrepareInsertSnapshotBlocks ¶
func (p *Plugins) PrepareInsertSnapshotBlocks(chunks []*ledger.SnapshotChunk) error
Click to show internal directories.
Click to hide internal directories.