|
|
|
@ -86,53 +86,58 @@ defmodule Indexer.Supervisor do |
|
|
|
|
|
|
|
|
|
realtime_subscribe_named_arguments = realtime_overrides[:subscribe_named_arguments] || subscribe_named_arguments |
|
|
|
|
|
|
|
|
|
basic_fetchers = [ |
|
|
|
|
# Root fetchers |
|
|
|
|
{PendingTransaction.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments]]}, |
|
|
|
|
{Realtime.Supervisor, |
|
|
|
|
[ |
|
|
|
|
%{block_fetcher: realtime_block_fetcher, subscribe_named_arguments: realtime_subscribe_named_arguments}, |
|
|
|
|
[name: Realtime.Supervisor] |
|
|
|
|
]}, |
|
|
|
|
{Catchup.Supervisor, |
|
|
|
|
[ |
|
|
|
|
%{block_fetcher: block_fetcher, block_interval: block_interval, memory_monitor: memory_monitor}, |
|
|
|
|
[name: Catchup.Supervisor] |
|
|
|
|
]}, |
|
|
|
|
|
|
|
|
|
# Async catchup fetchers |
|
|
|
|
{UncleBlock.Supervisor, [[block_fetcher: block_fetcher, memory_monitor: memory_monitor]]}, |
|
|
|
|
{BlockReward.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{InternalTransaction.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{CoinBalance.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{Token.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{TokenInstance.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{ContractCode.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{TokenBalance.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{TokenUpdater.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{ReplacedTransaction.Supervisor, [[memory_monitor: memory_monitor]]}, |
|
|
|
|
{StakingPools.Supervisor, [[memory_monitor: memory_monitor]]}, |
|
|
|
|
|
|
|
|
|
# Out-of-band fetchers |
|
|
|
|
{CoinBalanceOnDemand.Supervisor, [json_rpc_named_arguments]}, |
|
|
|
|
|
|
|
|
|
# Temporary workers |
|
|
|
|
{UncatalogedTokenTransfers.Supervisor, [[]]}, |
|
|
|
|
{UnclesWithoutIndex.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{BlocksTransactionsMismatch.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{PendingOpsCleaner, [[], []]} |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
multi_token_bridge_mediator = Application.get_env(:block_scout_web, :multi_token_bridge_mediator) |
|
|
|
|
|
|
|
|
|
all_fetchers = |
|
|
|
|
if multi_token_bridge_mediator && multi_token_bridge_mediator !== "" do |
|
|
|
|
[{SetBridgedStatusForTokens, [[], []]} | basic_fetchers] |
|
|
|
|
else |
|
|
|
|
basic_fetchers |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
Supervisor.init( |
|
|
|
|
[ |
|
|
|
|
# Root fetchers |
|
|
|
|
{PendingTransaction.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments]]}, |
|
|
|
|
{Realtime.Supervisor, |
|
|
|
|
[ |
|
|
|
|
%{block_fetcher: realtime_block_fetcher, subscribe_named_arguments: realtime_subscribe_named_arguments}, |
|
|
|
|
[name: Realtime.Supervisor] |
|
|
|
|
]}, |
|
|
|
|
{Catchup.Supervisor, |
|
|
|
|
[ |
|
|
|
|
%{block_fetcher: block_fetcher, block_interval: block_interval, memory_monitor: memory_monitor}, |
|
|
|
|
[name: Catchup.Supervisor] |
|
|
|
|
]}, |
|
|
|
|
|
|
|
|
|
# Async catchup fetchers |
|
|
|
|
{UncleBlock.Supervisor, [[block_fetcher: block_fetcher, memory_monitor: memory_monitor]]}, |
|
|
|
|
{BlockReward.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{InternalTransaction.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{CoinBalance.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{Token.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{TokenInstance.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{ContractCode.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{TokenBalance.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{TokenUpdater.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{ReplacedTransaction.Supervisor, [[memory_monitor: memory_monitor]]}, |
|
|
|
|
{StakingPools.Supervisor, [[memory_monitor: memory_monitor]]}, |
|
|
|
|
|
|
|
|
|
# Out-of-band fetchers |
|
|
|
|
{CoinBalanceOnDemand.Supervisor, [json_rpc_named_arguments]}, |
|
|
|
|
{SetBridgedStatusForTokens, [[], []]}, |
|
|
|
|
|
|
|
|
|
# Temporary workers |
|
|
|
|
{UncatalogedTokenTransfers.Supervisor, [[]]}, |
|
|
|
|
{UnclesWithoutIndex.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{BlocksTransactionsMismatch.Supervisor, |
|
|
|
|
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]}, |
|
|
|
|
{PendingOpsCleaner, [[], []]} |
|
|
|
|
], |
|
|
|
|
all_fetchers, |
|
|
|
|
strategy: :one_for_one |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|