blockinfo

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Mapping = `` /* 406-byte string literal not displayed */

Mapping block mapping

View Source
const (
	TableName = "block_info"
)

Variables

This section is empty.

Functions

func InitDB

func InitDB(cli db.DBCreator) error

InitDB init db

func SaveBlock

func SaveBlock(block *types.Block, hash string, op int) (db.Record, error)

Types

type BlockInfo

type BlockInfo struct {
	Height    int64  `json:"height"`
	TxCount   int    `json:"tx_count"`
	Hash      string `json:"hash"`
	BlockTime int64  `json:"block_time"`
	From      string `json:"from"`
}

type BlockRecord

type BlockRecord struct {
	*db.IKey
	*db.Op
	Block *BlockInfo
}

BlockRecord 用于db记录区块基本信息

func NewBlockRecord

func NewBlockRecord(block *BlockInfo, op int) *BlockRecord

NewBlockRecord create BlockRecord

func (*BlockRecord) Value

func (r *BlockRecord) Value() []byte

Value impl

Jump to

Keyboard shortcuts

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