Documentation ¶
Index ¶
Constants ¶
View Source
const ( MetricReceiveMessages = "receive_messages" MetricParseDataError = "parse_data_error" MetricVaildationSuccess = "validation_success" MetricVaildationError = "validation_error" MetricDatabaseRollback = "database_rollback" MetricDatabaseCommit = "database_commit" MetricCronWorkerJob = "cron_worker_job" MetricCronWorkerJobGetBatchBlock = "cron_worker_job_get_batch_block" MetricCronWorkerJobUpdateMetaData = "cron_worker_job_update_meta_data" MetricRPCCall = "rpc_call" MetricRevertBlock = "revert_block" )
Variables ¶
This section is empty.
Functions ¶
func GetBlockMiner ¶
func GetBlockMiner(data *BSVBlockData, tx *service.Transaction) error
更新标记block所属矿池
func UpdateBlock ¶
func UpdateBlock(data *BSVBlockData, tx *service.Transaction) error
Types ¶
type BSVBlockData ¶
type BSVBlockData struct { Block *model.Block Transactions []*model.Transaction VIns []*model.VIn VOuts []*model.VOut }
func ParseBlock ¶
func ParseBlock(data string) (*BSVBlockData, error)
type BSVSplitter ¶
type BSVSplitter struct {
// contains filtered or unexported fields
}
func NewSplitter ¶
func NewSplitter(cfg *SplitterConfig) (*BSVSplitter, error)
func (*BSVSplitter) CheckBlock ¶
func (s *BSVSplitter) CheckBlock(curBlock *BSVBlockData) (bool, int64)
func (*BSVSplitter) RevertBlock ¶
func (s *BSVSplitter) RevertBlock(height int64, tx *service.Transaction) error
revert block by height
func (*BSVSplitter) SaveBlock ¶
func (s *BSVSplitter) SaveBlock(data *BSVBlockData) error
func (*BSVSplitter) Start ¶
func (s *BSVSplitter) Start()
func (*BSVSplitter) Stop ¶
func (s *BSVSplitter) Stop()
type CronWorker ¶
type CronWorker struct {
// contains filtered or unexported fields
}
func NewCronWorker ¶
func NewCronWorker(splitter *BSVSplitter) *CronWorker
func (*CronWorker) Prepare ¶
func (w *CronWorker) Prepare() error
func (*CronWorker) Start ¶
func (w *CronWorker) Start() error
func (*CronWorker) Stop ¶
func (w *CronWorker) Stop()
type SplitterConfig ¶
Click to show internal directories.
Click to hide internal directories.