Documentation
¶
Index ¶
- Constants
- type ContractEventSqlDB
- func (c *ContractEventSqlDB) Close()
- func (c *ContractEventSqlDB) CommitBlock(blockInfo *serialization.BlockWithSerializedInfo, IsCache bool) error
- func (c *ContractEventSqlDB) GetLastSavepoint() (uint64, error)
- func (c *ContractEventSqlDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error
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
Click to show internal directories.
Click to hide internal directories.