eventsqldb

package
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateBlockHeightWithTopicTableDdl string = `` /* 289-byte string literal not displayed */
	BlockHeightWithTopicTableName      string = `block_height_topic_table_index`
	CreateBlockHeightIndexTableDdl     string = `` /* 165-byte string literal not displayed */
	InitBlockHeightIndexTableDdl       string = `INSERT IGNORE INTO block_height_index (id,block_height) VALUES('1','0')`
	BlockHeightIndexTableName          string = `block_height_index`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractEventSqlDB

type ContractEventSqlDB struct {
	Logger protocol.Logger
	// contains filtered or unexported fields
}

BlockMysqlDB provider a implementation of `contracteventdb.ContractEventDB` This implementation provides a mysql based data model

func NewContractEventDB

func NewContractEventDB(dbName string, db protocol.SqlDBHandle, logger protocol.Logger) (*ContractEventSqlDB, error)

func (*ContractEventSqlDB) Close

func (c *ContractEventSqlDB) Close()

Close is used to close database, there is no need for gorm to close db

func (*ContractEventSqlDB) CommitBlock

func (c *ContractEventSqlDB) CommitBlock(blockInfo *serialization.BlockWithSerializedInfo, IsCache bool) error

CommitBlock commits the event in an atomic operation

func (*ContractEventSqlDB) GetLastSavepoint

func (c *ContractEventSqlDB) GetLastSavepoint() (uint64, error)

GetLastSavepoint returns the last block height

func (*ContractEventSqlDB) InitGenesis

func (c *ContractEventSqlDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL