|
|
@ -46,10 +46,6 @@ defmodule Explorer.Application do |
|
|
|
# Children to start in all environments |
|
|
|
# Children to start in all environments |
|
|
|
base_children = [ |
|
|
|
base_children = [ |
|
|
|
Explorer.Repo, |
|
|
|
Explorer.Repo, |
|
|
|
Explorer.Repo.Replica1, |
|
|
|
|
|
|
|
Explorer.Repo.Account, |
|
|
|
|
|
|
|
Explorer.Repo.PolygonEdge, |
|
|
|
|
|
|
|
Explorer.Repo.RSK, |
|
|
|
|
|
|
|
Explorer.Vault, |
|
|
|
Explorer.Vault, |
|
|
|
Supervisor.child_spec({SpandexDatadog.ApiServer, datadog_opts()}, id: SpandexDatadog.ApiServer), |
|
|
|
Supervisor.child_spec({SpandexDatadog.ApiServer, datadog_opts()}, id: SpandexDatadog.ApiServer), |
|
|
|
Supervisor.child_spec({Task.Supervisor, name: Explorer.HistoryTaskSupervisor}, id: Explorer.HistoryTaskSupervisor), |
|
|
|
Supervisor.child_spec({Task.Supervisor, name: Explorer.HistoryTaskSupervisor}, id: Explorer.HistoryTaskSupervisor), |
|
|
@ -93,43 +89,70 @@ defmodule Explorer.Application do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp configurable_children do |
|
|
|
defp configurable_children do |
|
|
|
[ |
|
|
|
configurable_children_set = |
|
|
|
configure(Explorer.ExchangeRates), |
|
|
|
[ |
|
|
|
configure(Explorer.ExchangeRates.TokenExchangeRates), |
|
|
|
configure(Explorer.ExchangeRates), |
|
|
|
configure(Explorer.ChainSpec.GenesisData), |
|
|
|
configure(Explorer.ExchangeRates.TokenExchangeRates), |
|
|
|
configure(Explorer.Market.History.Cataloger), |
|
|
|
configure(Explorer.ChainSpec.GenesisData), |
|
|
|
configure(Explorer.Chain.Cache.ContractsCounter), |
|
|
|
configure(Explorer.Market.History.Cataloger), |
|
|
|
configure(Explorer.Chain.Cache.NewContractsCounter), |
|
|
|
configure(Explorer.Chain.Cache.ContractsCounter), |
|
|
|
configure(Explorer.Chain.Cache.VerifiedContractsCounter), |
|
|
|
configure(Explorer.Chain.Cache.NewContractsCounter), |
|
|
|
configure(Explorer.Chain.Cache.NewVerifiedContractsCounter), |
|
|
|
configure(Explorer.Chain.Cache.VerifiedContractsCounter), |
|
|
|
configure(Explorer.Chain.Cache.TransactionActionTokensData), |
|
|
|
configure(Explorer.Chain.Cache.NewVerifiedContractsCounter), |
|
|
|
configure(Explorer.Chain.Cache.TransactionActionUniswapPools), |
|
|
|
configure(Explorer.Chain.Cache.TransactionActionTokensData), |
|
|
|
configure(Explorer.Chain.Cache.WithdrawalsSum), |
|
|
|
configure(Explorer.Chain.Cache.TransactionActionUniswapPools), |
|
|
|
configure(Explorer.Chain.Transaction.History.Historian), |
|
|
|
configure(Explorer.Chain.Cache.WithdrawalsSum), |
|
|
|
configure(Explorer.Chain.Events.Listener), |
|
|
|
configure(Explorer.Chain.Transaction.History.Historian), |
|
|
|
configure(Explorer.Counters.AddressesWithBalanceCounter), |
|
|
|
configure(Explorer.Chain.Events.Listener), |
|
|
|
configure(Explorer.Counters.AddressesCounter), |
|
|
|
configure(Explorer.Counters.AddressesWithBalanceCounter), |
|
|
|
configure(Explorer.Counters.AddressTransactionsCounter), |
|
|
|
configure(Explorer.Counters.AddressesCounter), |
|
|
|
configure(Explorer.Counters.AddressTokenTransfersCounter), |
|
|
|
configure(Explorer.Counters.AddressTransactionsCounter), |
|
|
|
configure(Explorer.Counters.AddressTransactionsGasUsageCounter), |
|
|
|
configure(Explorer.Counters.AddressTokenTransfersCounter), |
|
|
|
configure(Explorer.Counters.AddressTokenUsdSum), |
|
|
|
configure(Explorer.Counters.AddressTransactionsGasUsageCounter), |
|
|
|
configure(Explorer.Counters.TokenHoldersCounter), |
|
|
|
configure(Explorer.Counters.AddressTokenUsdSum), |
|
|
|
configure(Explorer.Counters.TokenTransfersCounter), |
|
|
|
configure(Explorer.Counters.TokenHoldersCounter), |
|
|
|
configure(Explorer.Counters.BlockBurnedFeeCounter), |
|
|
|
configure(Explorer.Counters.TokenTransfersCounter), |
|
|
|
configure(Explorer.Counters.BlockPriorityFeeCounter), |
|
|
|
configure(Explorer.Counters.BlockBurnedFeeCounter), |
|
|
|
configure(Explorer.Counters.AverageBlockTime), |
|
|
|
configure(Explorer.Counters.BlockPriorityFeeCounter), |
|
|
|
configure(Explorer.Counters.Bridge), |
|
|
|
configure(Explorer.Counters.AverageBlockTime), |
|
|
|
configure(Explorer.Validator.MetadataProcessor), |
|
|
|
configure(Explorer.Counters.Bridge), |
|
|
|
configure(Explorer.Tags.AddressTag.Cataloger), |
|
|
|
configure(Explorer.Validator.MetadataProcessor), |
|
|
|
configure(MinMissingBlockNumber), |
|
|
|
configure(Explorer.Tags.AddressTag.Cataloger), |
|
|
|
configure(TokenTransferTokenIdMigration.Supervisor), |
|
|
|
configure(MinMissingBlockNumber), |
|
|
|
configure(Explorer.Chain.Fetcher.CheckBytecodeMatchingOnDemand), |
|
|
|
configure(TokenTransferTokenIdMigration.Supervisor), |
|
|
|
configure(Explorer.Chain.Fetcher.FetchValidatorInfoOnDemand), |
|
|
|
configure(Explorer.Chain.Fetcher.CheckBytecodeMatchingOnDemand), |
|
|
|
configure(Explorer.TokenInstanceOwnerAddressMigration.Supervisor), |
|
|
|
configure(Explorer.Chain.Fetcher.FetchValidatorInfoOnDemand), |
|
|
|
sc_microservice_configure(Explorer.Chain.Fetcher.LookUpSmartContractSourcesOnDemand), |
|
|
|
configure(Explorer.TokenInstanceOwnerAddressMigration.Supervisor), |
|
|
|
configure(Explorer.Chain.Cache.RootstockLockedBTC) |
|
|
|
sc_microservice_configure(Explorer.Chain.Fetcher.LookUpSmartContractSourcesOnDemand), |
|
|
|
] |
|
|
|
configure(Explorer.Chain.Cache.RootstockLockedBTC) |
|
|
|
|> List.flatten() |
|
|
|
] |
|
|
|
|
|
|
|
|> List.flatten() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
repos_by_chain_type() ++ account_repo() ++ replica_repo() ++ configurable_children_set |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp repos_by_chain_type do |
|
|
|
|
|
|
|
if Mix.env() == :test do |
|
|
|
|
|
|
|
[Explorer.Repo.PolygonEdge, Explorer.Repo.RSK] |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
[] |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp account_repo do |
|
|
|
|
|
|
|
if System.get_env("ACCOUNT_DATABASE_URL") || Mix.env() == :test do |
|
|
|
|
|
|
|
[Explorer.Repo.Account] |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
[] |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp replica_repo do |
|
|
|
|
|
|
|
if System.get_env("DATABASE_READ_ONLY_API_URL") do |
|
|
|
|
|
|
|
[Explorer.Repo.Replica1] |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
[] |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp should_start?(process) do |
|
|
|
defp should_start?(process) do |
|
|
|