Documentation ¶
Index ¶
- Constants
- Variables
- func CreateDB() (err error)
- func GetBlockData() (err error)
- func GetLastHeight() (height uint64, err error)
- func GetTypeString(itype int) string
- func InitBlock()
- func InsertData(tableName string, fields []Field) (sql.Result, error)
- func SelectRowsOffset(table string, where []Where, order *Order, offset, limit uint64, ...) error
- type Action
- type Block
- type Field
- type Order
- type Trans
- type Where
Constants ¶
View Source
const ( BLOCK_TABLE = "block_t" TRANSACTION_TABLE = "transaction_t" ACTION_TABLE = "action_t" )
View Source
const ONCENUMS = 10
Variables ¶
View Source
var ( Block_Attr = []string{"height", "hash", "chain_id", "time", "num_txs", "last_commit_hash", "data_hash", "validators_hash", "app_hash"} Transaction_Attr = []string{"hash", "blkhash", "basefee", "txtype", "actions", "createtime"} Action_Attr = []string{"actid", "txid", "txhash", "src", "dst", "amount", "body", "memo", "createtime"} )
Functions ¶
func GetBlockData ¶
func GetBlockData() (err error)
从chain获取从数据库height最大值起ONCENUMS的块数据,并分析tx,operation,数据插入数据库
func GetTypeString ¶
Types ¶
type Action ¶
type Block ¶
type Block struct { Height uint64 `db:"height"` Hash string `db:"hash"` ChainID string `db:"chain_id"` Time string `db:"time"` NumTx int `db:"num_txs"` LastComitHash string `db:"last_commit_hash"` DataHash string `db:"data_hash"` ValidHash string `db:"validators_hash"` AppHash string `db:"app_hash"` }
Click to show internal directories.
Click to hide internal directories.