Documentation
¶
Index ¶
- type ResultInfo
- func (b *ResultInfo) GetCountSql() (string, []interface{})
- func (b *ResultInfo) GetCreateTableSql(dbType string) string
- func (b *ResultInfo) GetInsertSql() (string, []interface{})
- func (b *ResultInfo) GetTableName() string
- func (b *ResultInfo) GetUpdateSql() (string, []interface{})
- func (b *ResultInfo) ScanObject(scan func(dest ...interface{}) error) error
- type ResultSqlDB
- func (h *ResultSqlDB) Close()
- func (h *ResultSqlDB) CommitBlock(blockInfo *serialization.BlockWithSerializedInfo, isCache bool) error
- func (s *ResultSqlDB) GetLastSavepoint() (uint64, error)
- func (h *ResultSqlDB) GetTxRWSet(txId string) (*commonPb.TxRWSet, error)
- func (h *ResultSqlDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error
- func (h *ResultSqlDB) RestoreBlocks(blockInfos []*serialization.BlockWithSerializedInfo) error
- func (h *ResultSqlDB) ShrinkBlocks(txIdsMap map[uint64][]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResultInfo ¶
type ResultInfo struct { TxId string `gorm:"size:128;primaryKey"` BlockHeight uint64 TxIndex uint32 Rwset []byte `gorm:"type:longblob"` Status int `gorm:"default:0"` Result []byte `gorm:"type:blob"` Message string `gorm:"type:longtext"` }
ResultInfo defines mysql orm model, used to create mysql table 'result_infos'
func NewResultInfo ¶
func NewResultInfo(txid string, blockHeight uint64, txIndex uint32, result *commonpb.ContractResult, rw *commonpb.TxRWSet) *ResultInfo
NewResultInfo construct a new HistoryInfo
func (*ResultInfo) GetCountSql ¶
func (b *ResultInfo) GetCountSql() (string, []interface{})
func (*ResultInfo) GetCreateTableSql ¶
func (b *ResultInfo) GetCreateTableSql(dbType string) string
func (*ResultInfo) GetInsertSql ¶
func (b *ResultInfo) GetInsertSql() (string, []interface{})
func (*ResultInfo) GetTableName ¶
func (b *ResultInfo) GetTableName() string
func (*ResultInfo) GetUpdateSql ¶
func (b *ResultInfo) GetUpdateSql() (string, []interface{})
func (*ResultInfo) ScanObject ¶
func (b *ResultInfo) ScanObject(scan func(dest ...interface{}) error) error
type ResultSqlDB ¶
type ResultSqlDB struct {
// contains filtered or unexported fields
}
ResultSqlDB provider a implementation of `history.HistoryDB` This implementation provides a mysql based data model
func NewResultSqlDB ¶
func NewResultSqlDB(dbName string, db protocol.SqlDBHandle, logger protocol.Logger) *ResultSqlDB
func getDbName(dbConfig *localconf.SqlDbConfig, chainId string) string { return dbConfig.DbPrefix + "resultdb_" + chainId }
func (*ResultSqlDB) Close ¶
func (h *ResultSqlDB) Close()
func (*ResultSqlDB) CommitBlock ¶
func (h *ResultSqlDB) CommitBlock(blockInfo *serialization.BlockWithSerializedInfo, isCache bool) error
func (*ResultSqlDB) GetLastSavepoint ¶
func (s *ResultSqlDB) GetLastSavepoint() (uint64, error)
func (*ResultSqlDB) GetTxRWSet ¶
func (h *ResultSqlDB) GetTxRWSet(txId string) (*commonPb.TxRWSet, error)
func (*ResultSqlDB) InitGenesis ¶
func (h *ResultSqlDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error
func (*ResultSqlDB) RestoreBlocks ¶
func (h *ResultSqlDB) RestoreBlocks(blockInfos []*serialization.BlockWithSerializedInfo) error
RestoreBlocks restore blocks from outside serialized block data
func (*ResultSqlDB) ShrinkBlocks ¶
func (h *ResultSqlDB) ShrinkBlocks(txIdsMap map[uint64][]string) error
ShrinkBlocks archive old blocks rwsets in an atomic operation
Click to show internal directories.
Click to hide internal directories.