Documentation ¶
Index ¶
- Constants
- func GetBlockMiner(data *BTCBlockData, tx *service.Transaction) error
- func UpdateBlock(data *BTCBlockData, tx *service.Transaction) error
- type BTCBlockData
- type BTCSplitter
- func (s *BTCSplitter) CheckBlock(curBlock *BTCBlockData) (bool, int64)
- func (s *BTCSplitter) MakeUpOmni() error
- func (s *BTCSplitter) RevertBlock(height int64, tx *service.Transaction) error
- func (s *BTCSplitter) RevertTetherAddress(height int64, tx *service.Transaction) error
- func (s *BTCSplitter) SaveBlock(data *BTCBlockData) error
- func (s *BTCSplitter) Start()
- func (s *BTCSplitter) Stop()
- func (s *BTCSplitter) UpdateTetherAddress(data *BTCBlockData, tx *service.Transaction) error
- type CronWorker
- type SplitterConfig
- type WorkerJob
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" MinOmniBlockHeight = 252316 )
Variables ¶
This section is empty.
Functions ¶
func GetBlockMiner ¶
func GetBlockMiner(data *BTCBlockData, tx *service.Transaction) error
Fill in the name of the miner
func UpdateBlock ¶
func UpdateBlock(data *BTCBlockData, tx *service.Transaction) error
update address value, vout is_used, miner coinbase_times after each block
Types ¶
type BTCBlockData ¶
type BTCBlockData struct { Block *model.Block Transactions []*model.Transaction VIns []*model.VIn VOuts []*model.VOut OmniTransactions []*model.OmniTansaction }
func ParseBlock ¶
func ParseBlock(data string) (*BTCBlockData, error)
type BTCSplitter ¶
type BTCSplitter struct {
// contains filtered or unexported fields
}
func NewSplitter ¶
func NewSplitter(cfg *SplitterConfig) (*BTCSplitter, error)
func (*BTCSplitter) CheckBlock ¶
func (s *BTCSplitter) CheckBlock(curBlock *BTCBlockData) (bool, int64)
func (*BTCSplitter) MakeUpOmni ¶
func (s *BTCSplitter) MakeUpOmni() error
func (*BTCSplitter) RevertBlock ¶
func (s *BTCSplitter) RevertBlock(height int64, tx *service.Transaction) error
revert block by height
func (*BTCSplitter) RevertTetherAddress ¶
func (s *BTCSplitter) RevertTetherAddress(height int64, tx *service.Transaction) error
revert tether address table
func (*BTCSplitter) SaveBlock ¶
func (s *BTCSplitter) SaveBlock(data *BTCBlockData) error
func (*BTCSplitter) Start ¶
func (s *BTCSplitter) Start()
func (*BTCSplitter) Stop ¶
func (s *BTCSplitter) Stop()
func (*BTCSplitter) UpdateTetherAddress ¶
func (s *BTCSplitter) UpdateTetherAddress(data *BTCBlockData, tx *service.Transaction) error
type CronWorker ¶
type CronWorker struct {
// contains filtered or unexported fields
}
func NewCronWorker ¶
func NewCronWorker(splitter *BTCSplitter) *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 ¶
type SplitterConfig struct { Engine *xorm.Engine Consumer *kafka.ConsumerGroup Topic string DatabaseEnable bool MaxBatchBlock int Endpoint string User string Password string OmniEndpoint string OmniUser string OmniPassword string JSONSchemaFile string JSONSchemaValidationEnable bool OmniEnable bool }
Click to show internal directories.
Click to hide internal directories.