From d9387ae495040b9cd7755aee66797a47e2652153 Mon Sep 17 00:00:00 2001 From: nervehammer Date: Fri, 15 Mar 2019 15:28:43 +0530 Subject: [PATCH 1/2] add option to disable block rewards --- apps/indexer/config/config.exs | 1 + apps/indexer/lib/indexer/block/reward/fetcher.ex | 7 ++++++- apps/indexer/lib/indexer/block/reward/supervisor.ex | 10 +++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/indexer/config/config.exs b/apps/indexer/config/config.exs index a0f9662ef7..10dfd691a0 100644 --- a/apps/indexer/config/config.exs +++ b/apps/indexer/config/config.exs @@ -36,6 +36,7 @@ config :indexer, memory_limit: 1 <<< 30 # config :indexer, Indexer.ReplacedTransaction.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/reward/fetcher.ex b/apps/indexer/lib/indexer/block/reward/fetcher.ex index f480021545..88a9f9391d 100644 --- a/apps/indexer/lib/indexer/block/reward/fetcher.ex +++ b/apps/indexer/lib/indexer/block/reward/fetcher.ex @@ -18,6 +18,7 @@ defmodule Indexer.Block.Reward.Fetcher do alias Explorer.Chain.{Block, Wei} alias Indexer.Address.CoinBalances alias Indexer.{AddressExtraction, BufferedTask, CoinBalance, Tracer} + alias Indexer.Block.Reward.Supervisor, as: BlockRewardSupervisor @behaviour BufferedTask @@ -34,7 +35,11 @@ defmodule Indexer.Block.Reward.Fetcher do """ @spec async_fetch([Block.block_number()]) :: :ok def async_fetch(block_numbers) when is_list(block_numbers) do - BufferedTask.buffer(__MODULE__, block_numbers) + if BlockRewardSupervisor.disabled?() do + :ok + else + BufferedTask.buffer(__MODULE__, block_numbers) + end end @doc false diff --git a/apps/indexer/lib/indexer/block/reward/supervisor.ex b/apps/indexer/lib/indexer/block/reward/supervisor.ex index de222dd328..9dab2269a2 100644 --- a/apps/indexer/lib/indexer/block/reward/supervisor.ex +++ b/apps/indexer/lib/indexer/block/reward/supervisor.ex @@ -22,7 +22,15 @@ defmodule Indexer.Block.Reward.Supervisor do end def start_link(arguments, gen_server_options \\ []) do - Supervisor.start_link(__MODULE__, arguments, Keyword.put_new(gen_server_options, :name, __MODULE__)) + if disabled?() do + :ignore + else + Supervisor.start_link(__MODULE__, arguments, Keyword.put_new(gen_server_options, :name, __MODULE__)) + end + end + + def disabled?() do + Application.get_env(:indexer, __MODULE__, [])[:disabled?] == true end @impl Supervisor From 5602b3c531bff177efe1871b75f120589c651ea7 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 15 Mar 2019 18:34:49 +0300 Subject: [PATCH 2/2] Add SpringChain to the list of Additional Chains Utilizing BlockScout in README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0aa5158753..152ec62d02 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ Currently available block explorers (i.e. Etherscan and Etherchain) are closed s * [Fuse Network](https://explorer.fuse.io/) * [ARTIS](https://explorer.sigma1.artis.network) * [SafeChain](https://explorer.safechain.io) +* [SpringChain](https://explorer.springrole.com/) ### Visual Interface