indexer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInitBatches

func GetInitBatches(numBatch int, genesisBlock *big.Int, latestBlock *big.Int) []types.BatchStatus

GetInitBatches create batch initially

Types

type Indexer

type Indexer struct {
	IndexRepo repository.IndexRepo
	BatchRepo repository.BatchRepo
	// contains filtered or unexported fields
}

Indexer fetch data from blockchain and store in a repository

func NewIndexer

func NewIndexer(IndexRepo repository.IndexRepo, BatchRepo repository.BatchRepo, wa watcher.Watcher) Indexer

NewIndexer create an Indexer

func (*Indexer) CreateIndexData

func (indexer *Indexer) CreateIndexData(blockDetail *types.BLockDetail) ([]*types.AddressIndex, *types.BlockIndex)

CreateIndexData transforms blockchain data to our index data

func (*Indexer) FetchAndProcess

func (indexer *Indexer) FetchAndProcess(blockNumber *big.Int) error

FetchAndProcess fetch a block data from blockchain and process it

func (*Indexer) FirstIndex added in v1.0.0

func (indexer *Indexer) FirstIndex()

FirstIndex Entry point

func (*Indexer) IpcUpdated

func (indexer *Indexer) IpcUpdated(ipcPath string)

IpcUpdated implements IpcSubscriber interface

func (*Indexer) Name added in v1.0.0

func (indexer *Indexer) Name() string

Name implements IpcSubscriber interface

func (*Indexer) ProcessBlock

func (indexer *Indexer) ProcessBlock(blockDetail *types.BLockDetail, isBatch bool) error

ProcessBlock transform blockchain data to our index structure and save it to repo

Jump to

Keyboard shortcuts

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