Documentation ¶
Index ¶
- type DB
- func CreateDBFromConfig(cfg *config.HostConfig, regMetrics gethmetrics.Registry, logger gethlog.Logger) (*DB, error)
- func NewInMemoryDB(regMetrics gethmetrics.Registry, logger gethlog.Logger) *DB
- func NewLevelDBBackedDB(dbPath string, regMetrics gethmetrics.Registry, logger gethlog.Logger) (*DB, error)
- func (db *DB) AddBatch(batch *common.ExtBatch) error
- func (db *DB) AddBlock(header *types.Header) error
- func (db *DB) AddRollupHeader(rollup *common.ExtRollup, block *common.L1Block) error
- func (db *DB) GetBatch(batchHash gethcommon.Hash) (*common.ExtBatch, error)
- func (db *DB) GetBatchBySequenceNumber(sequenceNumber *big.Int) (*common.ExtBatch, error)
- func (db *DB) GetBatchHash(number *big.Int) (*gethcommon.Hash, error)
- func (db *DB) GetBatchHeader(hash gethcommon.Hash) (*common.BatchHeader, error)
- func (db *DB) GetBatchListing(pagination *common.QueryPagination) (*common.BatchListingResponse, error)
- func (db *DB) GetBatchNumber(txHash gethcommon.Hash) (*big.Int, error)
- func (db *DB) GetBatchTxs(batchHash gethcommon.Hash) ([]gethcommon.Hash, error)
- func (db *DB) GetBlockAtTip() (*types.Header, error)
- func (db *DB) GetBlockByHash(hash gethcommon.Hash) (*types.Header, error)
- func (db *DB) GetBlockByHeight(height *big.Int) (*types.Header, error)
- func (db *DB) GetBlockListing(pagination *common.QueryPagination) (*common.BlockListingResponse, error)
- func (db *DB) GetHeadBatchHeader() (*common.BatchHeader, error)
- func (db *DB) GetRollupHeader(hash gethcommon.Hash) (*common.RollupHeader, error)
- func (db *DB) GetRollupHeaderByBlock(blockHash gethcommon.Hash) (*common.RollupHeader, error)
- func (db *DB) GetTipRollupHeader() (*common.RollupHeader, error)
- func (db *DB) GetTotalTransactions() (*big.Int, error)
- func (db *DB) Stop() error
- type ObscuroLevelDB
- func (o *ObscuroLevelDB) Close() error
- func (o *ObscuroLevelDB) Compact(start []byte, limit []byte) error
- func (o *ObscuroLevelDB) Delete(key []byte) error
- func (o *ObscuroLevelDB) Get(key []byte) ([]byte, error)
- func (o *ObscuroLevelDB) Has(key []byte) (bool, error)
- func (o *ObscuroLevelDB) NewBatch() ethdb.Batch
- func (o *ObscuroLevelDB) NewBatchWithSize(int) ethdb.Batch
- func (o *ObscuroLevelDB) NewIterator(prefix []byte, start []byte) ethdb.Iterator
- func (o *ObscuroLevelDB) NewSnapshot() (ethdb.Snapshot, error)
- func (o *ObscuroLevelDB) Put(key []byte, value []byte) error
- func (o *ObscuroLevelDB) Stat(property string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB allows to access the nodes public nodeDB
func CreateDBFromConfig ¶ added in v0.10.0
func CreateDBFromConfig(cfg *config.HostConfig, regMetrics gethmetrics.Registry, logger gethlog.Logger) (*DB, error)
func NewInMemoryDB ¶
func NewInMemoryDB(regMetrics gethmetrics.Registry, logger gethlog.Logger) *DB
NewInMemoryDB returns a new instance of the Node DB
func NewLevelDBBackedDB ¶
func NewLevelDBBackedDB(dbPath string, regMetrics gethmetrics.Registry, logger gethlog.Logger) (*DB, error)
NewLevelDBBackedDB creates a persistent DB for the host, if dbPath == "" it will generate a temp file
func (*DB) AddRollupHeader ¶
AddRollupHeader adds a rollup to the DB
func (*DB) GetBatchBySequenceNumber ¶ added in v0.14.0
GetBatchBySequenceNumber returns the batch with the given sequence number.
func (*DB) GetBatchHash ¶ added in v0.7.0
GetBatchHash returns the hash of a batch given its number.
func (*DB) GetBatchHeader ¶ added in v0.7.0
func (db *DB) GetBatchHeader(hash gethcommon.Hash) (*common.BatchHeader, error)
GetBatchHeader returns the batch header given the hash.
func (*DB) GetBatchListing ¶ added in v0.15.0
func (db *DB) GetBatchListing(pagination *common.QueryPagination) (*common.BatchListingResponse, error)
GetBatchListing returns BatchListingResponse given a pagination todo change this when the db changes - this is not super performant
func (*DB) GetBatchNumber ¶ added in v0.7.1
GetBatchNumber returns the number of the batch containing the given transaction hash.
func (*DB) GetBatchTxs ¶ added in v0.7.1
func (db *DB) GetBatchTxs(batchHash gethcommon.Hash) ([]gethcommon.Hash, error)
GetBatchTxs returns the transaction hashes of the batch with the given hash.
func (*DB) GetBlockAtTip ¶ added in v0.15.0
GetBlockAtTip returns the block at current Head or Tip
func (*DB) GetBlockByHash ¶ added in v0.15.0
GetBlockByHash returns the block header given the hash.
func (*DB) GetBlockByHeight ¶ added in v0.15.0
GetBlockByHeight returns the block header given the height
func (*DB) GetBlockListing ¶ added in v0.15.0
func (db *DB) GetBlockListing(pagination *common.QueryPagination) (*common.BlockListingResponse, error)
GetBlockListing returns a list of blocks given the pagination
func (*DB) GetHeadBatchHeader ¶ added in v0.7.0
func (db *DB) GetHeadBatchHeader() (*common.BatchHeader, error)
GetHeadBatchHeader returns the header of the node's current head batch.
func (*DB) GetRollupHeader ¶
func (db *DB) GetRollupHeader(hash gethcommon.Hash) (*common.RollupHeader, error)
GetRollupHeader returns the rollup with the given hash.
func (*DB) GetRollupHeaderByBlock ¶ added in v0.15.0
func (db *DB) GetRollupHeaderByBlock(blockHash gethcommon.Hash) (*common.RollupHeader, error)
GetRollupHeaderByBlock returns the rollup for the given block
func (*DB) GetTipRollupHeader ¶ added in v0.14.0
func (db *DB) GetTipRollupHeader() (*common.RollupHeader, error)
GetTipRollupHeader returns the header of the node's current tip rollup.
func (*DB) GetTotalTransactions ¶
GetTotalTransactions returns the total number of batched transactions.
type ObscuroLevelDB ¶ added in v0.10.0
type ObscuroLevelDB struct {
// contains filtered or unexported fields
}
ObscuroLevelDB is a very thin wrapper around a level DB database for compatibility with our internal interfaces In particular, it overrides the Get method to return the obscuro ErrNotFound
func (*ObscuroLevelDB) Close ¶ added in v0.10.0
func (o *ObscuroLevelDB) Close() error
func (*ObscuroLevelDB) Compact ¶ added in v0.10.0
func (o *ObscuroLevelDB) Compact(start []byte, limit []byte) error
func (*ObscuroLevelDB) Delete ¶ added in v0.10.0
func (o *ObscuroLevelDB) Delete(key []byte) error
func (*ObscuroLevelDB) Get ¶ added in v0.10.0
func (o *ObscuroLevelDB) Get(key []byte) ([]byte, error)
Get is overridden here to return our internal NotFound error
func (*ObscuroLevelDB) Has ¶ added in v0.10.0
func (o *ObscuroLevelDB) Has(key []byte) (bool, error)
func (*ObscuroLevelDB) NewBatch ¶ added in v0.10.0
func (o *ObscuroLevelDB) NewBatch() ethdb.Batch
func (*ObscuroLevelDB) NewBatchWithSize ¶ added in v0.17.0
func (o *ObscuroLevelDB) NewBatchWithSize(int) ethdb.Batch
func (*ObscuroLevelDB) NewIterator ¶ added in v0.10.0
func (o *ObscuroLevelDB) NewIterator(prefix []byte, start []byte) ethdb.Iterator
func (*ObscuroLevelDB) NewSnapshot ¶ added in v0.17.0
func (o *ObscuroLevelDB) NewSnapshot() (ethdb.Snapshot, error)