Skip to content

Commit eaf8368

Browse files
authored
Merge pull request #61 from blinklabs-io/feat/indexer-bulk-mode
feat: use bulk mode for chainsync
2 parents 77aca54 + 4b914b9 commit eaf8368

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

internal/indexer/indexer.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ type Domain struct {
2323
}
2424

2525
type Indexer struct {
26-
pipeline *pipeline.Pipeline
27-
domains map[string]Domain
26+
pipeline *pipeline.Pipeline
27+
domains map[string]Domain
28+
tipReached bool
2829
}
2930

3031
// Singleton indexer instance
@@ -43,7 +44,12 @@ func (i *Indexer) Start() error {
4344
if err := state.GetState().UpdateCursor(status.SlotNumber, status.BlockHash); err != nil {
4445
logger.Errorf("failed to update cursor: %s", err)
4546
}
47+
if !i.tipReached && status.TipReached {
48+
i.tipReached = true
49+
logger.Infof("caught up to chain tip")
50+
}
4651
}),
52+
input_chainsync.WithBulkMode(true),
4753
}
4854
if cfg.Indexer.NetworkMagic > 0 {
4955
inputOpts = append(

0 commit comments

Comments
 (0)