Documentation
¶
Index ¶
- type Config
- type Indexer
- func (idx *Indexer) CreateTablesIfNotExist() error
- func (idx *Indexer) IndexInBatch(ctx context.Context, tipHeight uint64) error
- func (idx *Indexer) Initialize(genesis *indexprotocol.Genesis) error
- func (idx *Indexer) RegisterDefaultProtocols() error
- func (idx *Indexer) RegisterProtocol(protocolID string, protocol indexprotocol.Protocol) error
- func (idx *Indexer) Start(ctx context.Context) error
- func (idx *Indexer) Stop(ctx context.Context) error
- func (idx *Indexer) SubscribeNewBlock(client iotexapi.APIServiceClient, height chan uint64, report chan error, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
NumDelegates uint64 `yaml:"numDelegates"`
NumCandidateDelegates uint64 `yaml:"numCandidateDelegates"`
NumSubEpochs uint64 `yaml:"numSubEpochs"`
RangeQueryLimit uint64 `yaml:"rangeQueryLimit"`
Genesis indexprotocol.Genesis `yaml:"genesis"`
}
Config contains indexer configs
type Indexer ¶
type Indexer struct {
Store s.Store
Registry *indexprotocol.Registry
IndexProtocols []indexprotocol.Protocol
Config Config
// contains filtered or unexported fields
}
Indexer handles the index build for blocks
func NewIndexer ¶
NewIndexer creates a new indexer
func (*Indexer) CreateTablesIfNotExist ¶
CreateTablesIfNotExist creates tables in local database
func (*Indexer) IndexInBatch ¶
IndexInBatch indexes blocks in batch
func (*Indexer) Initialize ¶
func (idx *Indexer) Initialize(genesis *indexprotocol.Genesis) error
Initialize initialize the registered protocols
func (*Indexer) RegisterDefaultProtocols ¶
RegisterDefaultProtocols registers default protocols to hte indexer
func (*Indexer) RegisterProtocol ¶
func (idx *Indexer) RegisterProtocol(protocolID string, protocol indexprotocol.Protocol) error
RegisterProtocol registers a protocol to the indexer
func (*Indexer) SubscribeNewBlock ¶
func (idx *Indexer) SubscribeNewBlock( client iotexapi.APIServiceClient, height chan uint64, report chan error, unsubscribe chan bool, )
SubscribeNewBlock polls the new block height from the chain
Click to show internal directories.
Click to hide internal directories.