eosstore

package
v0.0.0-...-fc865ac Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const TxMapping = `` /* 1014-byte string literal not displayed */

更改ref_block_num 和block_num为类型为long

Variables

This section is empty.

Functions

This section is empty.

Types

type ESClient

type ESClient struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewESClient

func NewESClient() *ESClient

func (*ESClient) DeleteUnconfirmTx

func (es *ESClient) DeleteUnconfirmTx(TxId string) bool

func (*ESClient) UpdateTxInfo

func (es *ESClient) UpdateTxInfo(transferData *model.TransferData, status int8) bool

type EosStore

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

func NewEosStore

func NewEosStore(baseUrl string, scanHeight uint32, redisPool *redis.Pool, esClient *ESClient) *EosStore

func (*EosStore) GetApi

func (es *EosStore) GetApi() *eos.API

func (*EosStore) GetIrTxChan

func (es *EosStore) GetIrTxChan() <-chan *model.TransferData

func (*EosStore) ScanIrreversibleOfUnconfirmTx

func (es *EosStore) ScanIrreversibleOfUnconfirmTx()

从ElasticSearch中读出unconfirmTx, 判断所在块高度是否已经不可逆, 如果不可逆, 则删除改交易 目前EOS确认块(irreversible)大概是360个块(后面可能是两个块1s),也可以把当前块前推360个块来做确认。

func (*EosStore) Start

func (es *EosStore) Start()

获取到的区块信息,irreversible数据和unconfirm数据分别写入不同的ES index, irreversible向网关推送“交易确认”消息,unconfirm不推送消息 固定时间间隔pop出unconfirm表中已不可逆转的交易,并删除

Jump to

Keyboard shortcuts

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