Skip to content

Commit

Permalink
feat: add INDEXING_BATCH_SIZE configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
janezicmatej committed Jan 9, 2025
1 parent 6e108d5 commit d6c4c48
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
14 changes: 12 additions & 2 deletions .env.example.dev
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,20 @@ CONFIG_MODULE=flare
RPC_URL=RPC_URL

# optionally uncomment below line to override default processing start height
# INDEXING_DEFAULT_HEIGHT=number
# indexer will start from specified when database will be empty otherwise
# it will continue from where it stopped, this defaults to block where
# latest version of Relay contract was deployed per chain
# INDEXING_DEFAULT_HEIGHT=block

# optionally uncomment below line to override default processing sleep cycle
# INDEXING_SLEEP_CYCLE=number
# indexer will sleep for this many seconds when up to date with blockchain tip
# this defaults to 20
# INDEXING_SLEEP_CYCLE=20

# optionally uncomment below line to override default processing batch size
# indexer will try to index up to this many blocks at the same time
# this defaults to 30
# INDEXING_BATCH_SIZE=30

# if you only want to use data availability for one protocol, comment out the other
# ftso providers: all three values are comma separated strings
Expand Down
13 changes: 11 additions & 2 deletions .env.example.prod
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,20 @@ CONFIG_MODULE=flare
RPC_URL=RPC_URL

# optionally uncomment below line to override default processing start height
# INDEXING_DEFAULT_HEIGHT=number
# indexer will start from specified when database will be empty otherwise
# it will continue from where it stopped, this defaults to block where
# latest version of Relay contract was deployed per chain
# INDEXING_DEFAULT_HEIGHT=block

# optionally uncomment below line to override default processing sleep cycle
# INDEXING_SLEEP_CYCLE=number
# indexer will sleep for this many seconds when up to date with blockchain tip
# this defaults to 20
# INDEXING_SLEEP_CYCLE=20

# optionally uncomment below line to override default processing batch size
# indexer will try to index up to this many blocks at the same time
# this defaults to 30
# INDEXING_BATCH_SIZE=30

# if you only want to use data availability for one protocol, comment out the other
# ftso providers: all three values are comma separated strings
Expand Down
6 changes: 2 additions & 4 deletions configuration/configs/coston.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ def get_config() -> Configuration:
)

starting_config = SyncingConfig(
start_height=int(
e.get("INDEXING_DEFAULT_HEIGHT", "24237186")
), # old one: 24862497
max_processing_block_batch=50,
start_height=int(e.get("INDEXING_DEFAULT_HEIGHT", "24237186")),
max_processing_block_batch=int(e.get("INDEXING_BATCH_SIZE", "30")),
processing_sleep_cycle=int(e.get("INDEXING_SLEEP_CYCLE", "20")),
)

Expand Down
2 changes: 1 addition & 1 deletion configuration/configs/coston2.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_config() -> Configuration:

starting_config = SyncingConfig(
start_height=int(e.get("INDEXING_DEFAULT_HEIGHT", "14155435")),
max_processing_block_batch=50,
max_processing_block_batch=int(e.get("INDEXING_BATCH_SIZE", "30")),
processing_sleep_cycle=int(e.get("INDEXING_SLEEP_CYCLE", "20")),
)

Expand Down
2 changes: 1 addition & 1 deletion configuration/configs/flare.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_config() -> Configuration:

starting_config = SyncingConfig(
start_height=int(e.get("INDEXING_DEFAULT_HEIGHT", "29549028")),
max_processing_block_batch=50,
max_processing_block_batch=int(e.get("INDEXING_BATCH_SIZE", "30")),
processing_sleep_cycle=int(e.get("INDEXING_SLEEP_CYCLE", "20")),
)

Expand Down
2 changes: 1 addition & 1 deletion configuration/configs/songbird.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_config() -> Configuration:

starting_config = SyncingConfig(
start_height=int(e.get("INDEXING_DEFAULT_HEIGHT", "73422149")),
max_processing_block_batch=50,
max_processing_block_batch=int(e.get("INDEXING_BATCH_SIZE", "30")),
processing_sleep_cycle=int(e.get("INDEXING_SLEEP_CYCLE", "20")),
)

Expand Down

0 comments on commit d6c4c48

Please sign in to comment.