Documentation ¶
Index ¶
- Constants
- Variables
- func AddressConvert(address string) string
- func CombineMap(mapping, typ string, version int32) (string, error)
- func CompressContent(s string) string
- func DumpEnv(env *db.TxEnv, check bool) (string, int64)
- func ESCheckAndRepair(cfg *proto.ConfigNew, EsWrite escli.ESClient) error
- func ErrLogger(name string) *log15.Handler
- func GenEnv(hexBlock string, index int64) (*db.TxEnv, error)
- func GetStack() string
- func InitChain33(title, symbol, configFile string)
- func InitConvertEsBulk(bulk bool)
- func InitIndex(cli db.DBCreator, index, typ, mapping string) error
- func InitLastSyncSeqCache(client escli.ESClient, id string, startSeq int64) error
- func InitMapSet(esVersion int32, esIndex *proto.ESIndex)
- func LastSyncSeq(client escli.ESClient, id string) (int64, error)
- func LogFmtFormat() log15.Format
- func NewLastRecord(id string, seq int64) *block.LastSyncSeqRecord
- func NormalLogger(name string, logLevel string) *log15.Handler
- func PositionID(exec string, height, index int64) string
- func SaveToES(client escli.ESClient, blockItems []db.Record) error
- func SaveToESSelectBulk(client escli.ESClient, blockItems []db.Record, bulk bool) error
- func SetupLog(name string, logLevel string)
- type AppConvert
- type ModuleConvert
Constants ¶
View Source
const (
OmitMessage = " (...... logger omit %d character ......) "
)
Variables ¶
View Source
var Chain33CoinSymbol = `CoinSymbol="%s"
`
Chain33CoinSymbol ...
View Source
var Chain33DefaultConfig = `` /* 9552-byte string literal not displayed */
Chain33DefaultConfig Chain33 Default Config
View Source
var Chain33TitleFmt = `Title="%s"
`
Chain33TitleFmt ...
View Source
var Chain33TitleM = `
Title="bityuan"
`
Chain33TitleM ...
View Source
var Chain33TitleP = `
Title="user.p.xx."
`
Chain33TitleP ...
View Source
var Chain33V165 = `` /* 2855-byte string literal not displayed */
Chain33V165 chain33 1.65的配置 支持不指定配置文件, 可以更方便的使用
View Source
var ConvertEsBulk bool
ConvertEsBulk 数据解析结果存储的ES 是否选择批量写入
View Source
var ConvertServerStatus = &convertServerStatus{}
View Source
var LastSyncSeqCache = &lastSyncSeqCache{number: -1}
Functions ¶
func AddressConvert ¶ added in v1.6.0
AddressConvert 对地址进行转化 eth 格式地址, 都转化成小写格式
func CompressContent ¶
CompressContent process max output length
func InitConvertEsBulk ¶
func InitConvertEsBulk(bulk bool)
func InitLastSyncSeqCache ¶
func InitMapSet ¶
func LastSyncSeq ¶
GetLastSyncSeq 获得最后同步的seq
func LogFmtFormat ¶
LogFmtFormat copy from log15.LogfmtFormat(), add max output length process: CompressContent
func NewLastRecord ¶
func NewLastRecord(id string, seq int64) *block.LastSyncSeqRecord
NewLastRecord create LastSyncSeqRecord
func NormalLogger ¶
NormalLogger all log
func SaveToESSelectBulk ¶
Types ¶
type AppConvert ¶
type AppConvert interface { ConvertBlock(blockSeq *block.Seq, detail *types.BlockDetail) ([]db.Record, error) RecoverStats(client escli.ESClient, lastSeq int64) error }
AppConvert for application 随着需求增加,需要各种各样的解析。由app 提供, 可以更灵活的实现
type ModuleConvert ¶
type ModuleConvert struct { Title string Name string StartSeq int64 // 强制或建议从StartSeq 开始同步, 强制为了测试, 建议是因为之前seq没有需要处理的交易 ForceSeq bool WriteDB escli.ESClient SeqStore store.SeqStore SeqNumStore store.SeqNumStore AppConvert }
ModuleConvert 具体模块填上这个结构提, 由 Proc 控制流程
func (*ModuleConvert) SingleDealBlock ¶
SingleDealBlock 处理区块时只处理当前区块,不添加lastRecord
Source Files ¶
Click to show internal directories.
Click to hide internal directories.