package_name
├── handler_rpc.go # RPC request wrapper
├── job.go # Worker job implement
├── meta.go # Global structure define
├── method.go # Block data parse implement
├── schema.json # Kafka data JSON schema
├── splitter.go # Package entry
└── worker.go # Background worker implement
package_name: symbol name of blockchain
example: bitcoin
type BTCBlockData struct {}
- prioritization
- relationship group
type SplitterConfig struct {}
type BTCSplitter struct {}
func NewSplitter(cfg *Config) (*BTCSplitter, error)
func (p *BTCSplitter) Start()
func (p *BTCSplitter) Stop()
func (p *BTCSplitter) CheckBlock(data *BTCBlockData)
func (p *BTCSplitter) CheckMissedBlock()
func (p *BTCSplitter) Save(data *BTCBlockData)
func (p *BTCSPlitter) RevertBlock(height int64, tx *service.Transaction) error
func ParseBlock(data string) (*BTCBlockData, error)
func NewCronWorker(splitter *BTCSplitter) *CronWorker
func (w *CronWorker) Prepare() error
func (w *CronWorker) Start() error
func (w *CronWorker) Stop()
func newUpdateMetaDataJob(splitter *BTCSplitter) *updateMetaDataJob
func (j *updateMetaDataJob) Run()
func (j *updateMetaDataJob) Name() string
func newRPCHandler(c *jsonrpc.Client) (*rpcHandler, error)
func (h *rpcHandler) SendBlock(height int64) error
func (h *rpcHandler) SendBatchBlock(startHeight, endHeight int64) error