ckb_rocksdb_parser

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CKBBlockChain

type CKBBlockChain struct {
	Ctx       context.Context
	ReqTryCfg *types.RetryConfig
	RpcClient rpc.Client
}

func NewCKBBlockChain

func NewCKBBlockChain(ctx context.Context, nodeUrl string, reqTryCfg *types.RetryConfig) *CKBBlockChain

func NewCKBBlockChainWithRpcClient

func NewCKBBlockChainWithRpcClient(ctx context.Context, rpcClient rpc.Client, reqTryCfg *types.RetryConfig) *CKBBlockChain

func (*CKBBlockChain) Close

func (ckb *CKBBlockChain) Close()

func (*CKBBlockChain) GetBlockInfoByNumber

func (ckb *CKBBlockChain) GetBlockInfoByNumber(blockNumber *big.Int) (*types.ScannerBlockInfo, error)

func (*CKBBlockChain) GetLatestBlockNumber

func (ckb *CKBBlockChain) GetLatestBlockNumber() (*big.Int, error)

func (*CKBBlockChain) GetParentHash

func (ckb *CKBBlockChain) GetParentHash(childHash string) (string, error)

type CKBRocksDb

type CKBRocksDb struct {
	// contains filtered or unexported fields
}

func NewCKBRocksDb

func NewCKBRocksDb(dataDir string, handler MsgHandler) *CKBRocksDb

func (*CKBRocksDb) Close

func (ckb *CKBRocksDb) Close() error

func (*CKBRocksDb) GetDbBlockByHash

func (ckb *CKBRocksDb) GetDbBlockByHash(blockHash string) (*types.Block, error)

func (*CKBRocksDb) GetDbLastBlock

func (ckb *CKBRocksDb) GetDbLastBlock() (*types.Block, error)

func (*CKBRocksDb) HandleForkEvent

func (ckb *CKBRocksDb) HandleForkEvent(info *types.BlockForkInfo) error

func (*CKBRocksDb) RecordBlock

func (ckb *CKBRocksDb) RecordBlock(block *types.Block, isUpdate, commitAfterOpt bool) error

func (*CKBRocksDb) TransactionHandler

func (ckb *CKBRocksDb) TransactionHandler(block *types.ScannerBlockInfo, dbTx interface{}, blockTxs interface{}) error

func (*CKBRocksDb) TxClose

func (ckb *CKBRocksDb) TxClose()

func (*CKBRocksDb) TxCommit

func (ckb *CKBRocksDb) TxCommit() error

func (*CKBRocksDb) TxOpen

func (ckb *CKBRocksDb) TxOpen() (interface{}, error)

func (*CKBRocksDb) TxRollBack

func (ckb *CKBRocksDb) TxRollBack() error

type MsgHandler

type MsgHandler struct {
	Receive func(info *TxMsgData) error
	Close   func()
}

type TxMsgData

type TxMsgData struct {
	BlockBaseInfo blockparserTypes.ScannerBlockInfo `json:"block_base_info"`
	Txs           []*types.Transaction              `json:"block_tx_list"`
}

Jump to

Keyboard shortcuts

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