diff --git a/CHANGELOG.md b/CHANGELOG.md index d37282fd18..1fcd748491 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### Features + - [1611](https://github.com/poanetwork/blockscout/pull/1611) - allow setting the first indexing block + ### Fixes - [#1621](https://github.com/poanetwork/blockscout/pull/1621) - Modify query to fetch failed contract creations diff --git a/apps/indexer/config/config.exs b/apps/indexer/config/config.exs index 10dfd691a0..9f9a34c18e 100644 --- a/apps/indexer/config/config.exs +++ b/apps/indexer/config/config.exs @@ -33,10 +33,11 @@ config :indexer, ecto_repos: [Explorer.Repo], metadata_updater_days_interval: 7, # bytes - memory_limit: 1 <<< 30 + memory_limit: 1 <<< 30, + first_block: System.get_env("FIRST_BLOCK") || 0 # config :indexer, Indexer.ReplacedTransaction.Supervisor, disabled?: true -# config :indexer, Indexer.Block.Reward.Supervisor, disabled?: true +# config :indexer, Indexer.Block.Reward.Supervisor, disabled?: true config :indexer, Indexer.Tracer, service: :indexer, diff --git a/apps/indexer/lib/indexer/block/catchup/fetcher.ex b/apps/indexer/lib/indexer/block/catchup/fetcher.ex index bf9327f126..23836d8cbe 100644 --- a/apps/indexer/lib/indexer/block/catchup/fetcher.ex +++ b/apps/indexer/lib/indexer/block/catchup/fetcher.ex @@ -80,7 +80,7 @@ defmodule Indexer.Block.Catchup.Fetcher do _ -> # realtime indexer gets the current latest block first = latest_block_number - 1 - last = 0 + last = Application.get_env(:indexer, :first_block) Logger.metadata(first_block_number: first, last_block_number: last)