eventsqldb

package
v2.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 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`
)

nolint

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractEventSqlDB

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

ContractEventSqlDB BlockMysqlDB provider a implementation of `contracteventdb.ContractEventDB`

@Description:

This implementation provides a mysql based data model

func NewContractEventDB

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

NewContractEventDB 创建一个 ContractDB

@Description:
@param dbName
@param db
@param logger
@return *ContractEventSqlDB
@return error

func (*ContractEventSqlDB) Close

func (c *ContractEventSqlDB) Close()

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

@Description:
@receiver c

func (*ContractEventSqlDB) CommitBlock

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

CommitBlock commits the event in an atomic operation

@Description:
@receiver c
@param blockInfo
@param IsCache
@return error

func (*ContractEventSqlDB) GetLastSavepoint

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

GetLastSavepoint returns the last block height

@Description:
@receiver c
@return uint64
@return error

func (*ContractEventSqlDB) InitGenesis

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

InitGenesis 完成创世区块的写入

@Description:
@receiver c
@param genesisBlock
@return error

Jump to

Keyboard shortcuts

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