Documentation ¶
Index ¶
Constants ¶
View Source
const ( // StreamTypeSequencer represents a Sequencer stream StreamTypeSequencer datastreamer.StreamType = 1 // EntryTypeL2BlockStart represents a L2 block start EntryTypeL2BlockStart datastreamer.EntryType = 1 // EntryTypeL2Tx represents a L2 transaction EntryTypeL2Tx datastreamer.EntryType = 2 // EntryTypeL2BlockEnd represents a L2 block end EntryTypeL2BlockEnd datastreamer.EntryType = 3 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Database name Name string `mapstructure:"Name"` // Database User name User string `mapstructure:"User"` // Database Password of the user Password string `mapstructure:"Password"` // Host address of database Host string `mapstructure:"Host"` // Port Number of database Port string `mapstructure:"Port"` // EnableLog EnableLog bool `mapstructure:"EnableLog"` // MaxConns is the maximum number of connections in the pool. MaxConns int `mapstructure:"MaxConns"` }
Config is the configuration for the database
type L2Block ¶
type L2Block struct { BatchNumber uint64 // 8 bytes L2BlockNumber uint64 // 8 bytes Timestamp int64 // 8 bytes GlobalExitRoot common.Hash // 32 bytes Coinbase common.Address // 20 bytes ForkID uint16 // 2 bytes BlockHash common.Hash // 32 bytes StateRoot common.Hash // 32 bytes }
L2Block is a full l2 block
type L2BlockEnd ¶ added in v0.0.7
type L2BlockEnd struct { L2BlockNumber uint64 // 8 bytes BlockHash common.Hash // 32 bytes StateRoot common.Hash // 32 bytes }
L2BlockEnd represents a L2 block end
func (L2BlockEnd) Encode ¶ added in v0.0.7
func (b L2BlockEnd) Encode() []byte
Encode returns the encoded EndL2Block as a byte slice
type L2BlockStart ¶ added in v0.0.7
type L2BlockStart struct { BatchNumber uint64 // 8 bytes L2BlockNumber uint64 // 8 bytes Timestamp int64 // 8 bytes GlobalExitRoot common.Hash // 32 bytes Coinbase common.Address // 20 bytes ForkID uint16 // 2 bytes }
L2BlockStart represents a L2 block start
func (L2BlockStart) Encode ¶ added in v0.0.7
func (b L2BlockStart) Encode() []byte
Encode returns the encoded StartL2Block as a byte slice
type L2Transaction ¶
type L2Transaction struct { EffectiveGasPricePercentage uint8 // 1 byte IsValid uint8 // 1 byte EncodedLength uint32 // 4 bytes Encoded []byte }
L2Transaction represents a L2 transaction
func (L2Transaction) Encode ¶
func (l L2Transaction) Encode() []byte
Encode returns the encoded L2Transaction as a byte slice
type StateDB ¶
StateDB implements the StateDB interface
func (*StateDB) GetGenesisBlock ¶ added in v0.0.7
GetGenesisBlock returns the genesis block
func (*StateDB) GetL2Blocks ¶
GetL2Blocks returns the L2 blocks
func (*StateDB) GetL2Transactions ¶
func (db *StateDB) GetL2Transactions(ctx context.Context, minL2Block, maxL2Block uint64) ([]*L2Transaction, error)
GetL2Transactions returns the L2 transactions
Click to show internal directories.
Click to hide internal directories.