Documentation
¶
Index ¶
- Variables
- func NewIndexDB(chainID *big.Int, rootDB *storm.DB, cacheSize uint64) *indexDB
- func OpenEtherDB(ctx ServiceContext, name string) (ethdb.Database, error)
- func OpenStormDB(ctx ServiceContext, name string) (*storm.DB, error)
- type CrossTransactionIndexed
- type CtxDB
- type CtxSortedByBlockNum
- func (m *CtxSortedByBlockNum) Do(do func(*cc.CrossTransactionWithSignatures) bool)
- func (m *CtxSortedByBlockNum) Get(txId common.Hash) *cc.CrossTransactionWithSignatures
- func (m *CtxSortedByBlockNum) Len() int
- func (m *CtxSortedByBlockNum) Put(ctx *cc.CrossTransactionWithSignatures)
- func (m *CtxSortedByBlockNum) RemoveByID(id common.Hash)
- func (m *CtxSortedByBlockNum) RemoveUnderNum(num uint64) (removed cc.CtxIDs)
- type ErrCtxDbFailure
- type FieldName
- type IndexDbCache
- type QueueDB
- type ServiceContext
- type TransactionLog
- type TransactionLogs
Constants ¶
This section is empty.
Variables ¶
View Source
var (
FinishedRoot = []byte("_FINISHED_ROOT_")
)
Functions ¶
func NewIndexDB ¶
func OpenEtherDB ¶
func OpenEtherDB(ctx ServiceContext, name string) (ethdb.Database, error)
func OpenStormDB ¶
func OpenStormDB(ctx ServiceContext, name string) (*storm.DB, error)
Types ¶
type CrossTransactionIndexed ¶
type CrossTransactionIndexed struct { PK uint64 `storm:"id,increment"` CtxId common.Hash `storm:"unique"` From common.Address `storm:"index"` To common.Address `storm:"index"` TxHash common.Hash `storm:"index"` Price *big.Float `storm:"index"` BlockNum uint64 `storm:"index"` // normal field Status uint8 `storm:"index"` Value *big.Int BlockHash common.Hash DestinationId *big.Int DestinationValue *big.Int `storm:"index"` Input []byte V []*big.Int R []*big.Int S []*big.Int }
func NewCrossTransactionIndexed ¶
func NewCrossTransactionIndexed(ctx *cc.CrossTransactionWithSignatures) *CrossTransactionIndexed
func (CrossTransactionIndexed) ToCrossTransaction ¶
func (c CrossTransactionIndexed) ToCrossTransaction() *cc.CrossTransactionWithSignatures
type CtxDB ¶
type CtxDB interface { io.Closer ChainID() *big.Int Count(filter ...q.Matcher) int Height() uint64 Write(ctx *cc.CrossTransactionWithSignatures) error Writes([]*cc.CrossTransactionWithSignatures, bool) error Read(ctxId common.Hash) (*cc.CrossTransactionWithSignatures, error) Update(id common.Hash, updater func(ctx *CrossTransactionIndexed)) error Updates(idList []common.Hash, updaters []func(ctx *CrossTransactionIndexed)) error Deletes(idList []common.Hash) error Has(id common.Hash) bool One(field FieldName, key interface{}) *cc.CrossTransactionWithSignatures //Find(field FieldName, key interface{}) []*cc.CrossTransactionWithSignatures Query(pageSize int, startPage int, orderBy []FieldName, reverse bool, filter ...q.Matcher) []*cc.CrossTransactionWithSignatures RangeByNumber(begin, end uint64, limit int) []*cc.CrossTransactionWithSignatures Load() error Repair() error Clean() error }
type CtxSortedByBlockNum ¶
type CtxSortedByBlockNum struct {
// contains filtered or unexported fields
}
func NewCtxSortedMap ¶
func NewCtxSortedMap() *CtxSortedByBlockNum
func (*CtxSortedByBlockNum) Do ¶ added in v1.0.6
func (m *CtxSortedByBlockNum) Do(do func(*cc.CrossTransactionWithSignatures) bool)
Do calls function f on each element of the map, in forward order.
func (*CtxSortedByBlockNum) Get ¶
func (m *CtxSortedByBlockNum) Get(txId common.Hash) *cc.CrossTransactionWithSignatures
func (*CtxSortedByBlockNum) Len ¶
func (m *CtxSortedByBlockNum) Len() int
func (*CtxSortedByBlockNum) Put ¶
func (m *CtxSortedByBlockNum) Put(ctx *cc.CrossTransactionWithSignatures)
func (*CtxSortedByBlockNum) RemoveByID ¶ added in v1.0.6
func (m *CtxSortedByBlockNum) RemoveByID(id common.Hash)
func (*CtxSortedByBlockNum) RemoveUnderNum ¶
func (m *CtxSortedByBlockNum) RemoveUnderNum(num uint64) (removed cc.CtxIDs)
type ErrCtxDbFailure ¶
type ErrCtxDbFailure struct {
// contains filtered or unexported fields
}
func (ErrCtxDbFailure) Error ¶
func (e ErrCtxDbFailure) Error() string
type IndexDbCache ¶
func (*IndexDbCache) Get ¶
func (m *IndexDbCache) Get(index FieldName, key interface{}) *CrossTransactionIndexed
func (*IndexDbCache) Put ¶
func (m *IndexDbCache) Put(index FieldName, key interface{}, ctx *CrossTransactionIndexed)
func (*IndexDbCache) Remove ¶
func (m *IndexDbCache) Remove(index FieldName, key interface{})
type QueueDB ¶ added in v1.0.6
type QueueDB struct {
// contains filtered or unexported fields
}
func NewQueueDB ¶ added in v1.0.6
func NewQueueDB(db ethdb.KeyValueStore) (*QueueDB, error)
type ServiceContext ¶
type TransactionLog ¶ added in v1.0.6
type TransactionLog struct { *TransactionLogs // contains filtered or unexported fields }
func (*TransactionLog) AddFinish ¶ added in v1.0.6
func (l *TransactionLog) AddFinish(ctx *core.CrossTransactionWithSignatures) error
func (*TransactionLog) Commit ¶ added in v1.0.6
func (l *TransactionLog) Commit() (common.Hash, error)
func (*TransactionLog) GetFinish ¶ added in v1.0.6
func (l *TransactionLog) GetFinish(hash common.Hash) (*core.CrossTransactionWithSignatures, bool)
type TransactionLogs ¶ added in v1.0.6
type TransactionLogs struct {
// contains filtered or unexported fields
}
func NewTransactionLogs ¶ added in v1.0.6
func NewTransactionLogs(db ethdb.KeyValueStore) (*TransactionLogs, error)
func (*TransactionLogs) Close ¶ added in v1.0.6
func (l *TransactionLogs) Close()
func (*TransactionLogs) Get ¶ added in v1.0.6
func (l *TransactionLogs) Get(chainID *big.Int) *TransactionLog
Click to show internal directories.
Click to hide internal directories.