Documentation ¶
Index ¶
- func NewSQLDB(cfg Config) (*pgxpool.Pool, error)
- type Config
- type StateDB
- func (db *StateDB) GetGenesisBlock(ctx context.Context) (*state.DSL2Block, error)
- func (db *StateDB) GetL2Blocks(ctx context.Context, limit, offset uint64) ([]*state.DSL2Block, error)
- func (db *StateDB) GetL2Transactions(ctx context.Context, minL2Block, maxL2Block uint64) ([]*state.DSL2Transaction, error)
Constants ¶
This section is empty.
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 StateDB ¶
StateDB implements the StateDB interface
func (*StateDB) GetGenesisBlock ¶
GetGenesisBlock returns the genesis block
func (*StateDB) GetL2Blocks ¶
func (db *StateDB) GetL2Blocks(ctx context.Context, limit, offset uint64) ([]*state.DSL2Block, error)
GetL2Blocks returns the L2 blocks
func (*StateDB) GetL2Transactions ¶
func (db *StateDB) GetL2Transactions(ctx context.Context, minL2Block, maxL2Block uint64) ([]*state.DSL2Transaction, error)
GetL2Transactions returns the L2 transactions
Click to show internal directories.
Click to hide internal directories.