Skip to content

Commit 9fb242f

Browse files
committed
add notes to README about start index logic
1 parent 2b2b562 commit 9fb242f

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ database = "flare_ftso_indexer"
4848
username = "root"
4949
password = "root"
5050
log_queries = false
51-
drop_table_at_start = true
52-
history_drop = 604800 # Enable deleting the transactions and logs in DB that are older (timestamp of the block) than history_drop (in seconds); set 0 to turn off; defaults to 7 days for Flare/Songbird and 2 days for Coston*
51+
drop_table_at_start = false # set to true to drop existing tables at the start of the indexing - useful to force re-indexing
52+
history_drop = 604800 # Enable deleting the transactions and logs in DB that are older (timestamp of the block) than history_drop (in seconds); set 0 to turn off; defaults to 7 days for Flare/Songbird and 2 days for Coston*
5353

5454
[logger]
5555
level = "INFO"
@@ -66,6 +66,21 @@ backoff_max_elapsed_time_seconds = 300 # optional, defaults to 300s = 5 minutes.
6666
timeout_milis = 1000 # optional, defaults to 1000ms = 1s. Try increasing if you see timeout errors often.
6767
```
6868

69+
If the C chain indexer has been previously run and there is existing data in the database,
70+
subsequent runs will resume indexing from after the last indexed block. Only when starting with an
71+
empty database will the indexer have to decide where to start. Normally this will be based on the
72+
history drop configuration parameter - if the history drop is 14 days for example then the indexer
73+
will start indexing from the block that was mined 14 days ago. If the history drop is disabled (set
74+
to 0) then the indexer will start from the configured `start_index` block or from block 0 if not
75+
set.
76+
77+
In case the indexer has been previously run and you need more historical data, you can increase
78+
the history drop parameter or disable history drop and set the start_index to the desired
79+
starting block. You can manually delete all existing data from the database in order to trigger
80+
re-indexing from the new starting block. You can also set the `drop_table_at_start` parameter to
81+
true to have the indexer drop existing tables at startup and force re-indexing - though remember to
82+
set it back to false afterwards to avoid losing data on subsequent runs.
83+
6984
### Database
7085

7186
In `database/docker` we provide a simple database. Navigate to the folder and run

0 commit comments

Comments
 (0)