|
|
@ -5,6 +5,9 @@ |
|
|
|
# is restricted to this project. |
|
|
|
# is restricted to this project. |
|
|
|
import Config |
|
|
|
import Config |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
disable_indexer = System.get_env("DISABLE_INDEXER") |
|
|
|
|
|
|
|
disable_webapp = System.get_env("DISABLE_WEBAPP") |
|
|
|
|
|
|
|
|
|
|
|
# General application configuration |
|
|
|
# General application configuration |
|
|
|
config :explorer, |
|
|
|
config :explorer, |
|
|
|
ecto_repos: [Explorer.Repo], |
|
|
|
ecto_repos: [Explorer.Repo], |
|
|
@ -18,7 +21,7 @@ config :explorer, |
|
|
|
if(System.get_env("UNCLES_IN_AVERAGE_BLOCK_TIME") == "true", do: true, else: false), |
|
|
|
if(System.get_env("UNCLES_IN_AVERAGE_BLOCK_TIME") == "true", do: true, else: false), |
|
|
|
healthy_blocks_period: System.get_env("HEALTHY_BLOCKS_PERIOD") || :timer.minutes(5), |
|
|
|
healthy_blocks_period: System.get_env("HEALTHY_BLOCKS_PERIOD") || :timer.minutes(5), |
|
|
|
realtime_events_sender: |
|
|
|
realtime_events_sender: |
|
|
|
if(System.get_env("DISABLE_WEBAPP") != "true", |
|
|
|
if(disable_webapp != "true", |
|
|
|
do: Explorer.Chain.Events.SimpleSender, |
|
|
|
do: Explorer.Chain.Events.SimpleSender, |
|
|
|
else: Explorer.Chain.Events.DBSender |
|
|
|
else: Explorer.Chain.Events.DBSender |
|
|
|
) |
|
|
|
) |
|
|
@ -29,7 +32,7 @@ config :explorer, Explorer.Counters.AverageBlockTime, |
|
|
|
|
|
|
|
|
|
|
|
config :explorer, Explorer.Chain.Events.Listener, |
|
|
|
config :explorer, Explorer.Chain.Events.Listener, |
|
|
|
enabled: |
|
|
|
enabled: |
|
|
|
if(System.get_env("DISABLE_WEBAPP") == "true" && System.get_env("DISABLE_INDEXER") == "true", |
|
|
|
if(disable_webapp == "true" && disable_indexer == "true", |
|
|
|
do: false, |
|
|
|
do: false, |
|
|
|
else: true |
|
|
|
else: true |
|
|
|
) |
|
|
|
) |
|
|
@ -42,8 +45,8 @@ config :explorer, Explorer.ChainSpec.GenesisData, |
|
|
|
|
|
|
|
|
|
|
|
config :explorer, Explorer.Chain.Cache.BlockNumber, |
|
|
|
config :explorer, Explorer.Chain.Cache.BlockNumber, |
|
|
|
enabled: true, |
|
|
|
enabled: true, |
|
|
|
ttl_check_interval: if(System.get_env("DISABLE_INDEXER") == "true", do: :timer.seconds(1), else: false), |
|
|
|
ttl_check_interval: if(disable_indexer == "true", do: :timer.seconds(1), else: false), |
|
|
|
global_ttl: if(System.get_env("DISABLE_INDEXER") == "true", do: :timer.seconds(5)) |
|
|
|
global_ttl: if(disable_indexer == "true", do: :timer.seconds(5)) |
|
|
|
|
|
|
|
|
|
|
|
address_sum_global_ttl = |
|
|
|
address_sum_global_ttl = |
|
|
|
"CACHE_ADDRESS_SUM_PERIOD" |
|
|
|
"CACHE_ADDRESS_SUM_PERIOD" |
|
|
@ -64,9 +67,11 @@ config :explorer, Explorer.Chain.Cache.AddressSumMinusBurnt, |
|
|
|
ttl_check_interval: :timer.seconds(1), |
|
|
|
ttl_check_interval: :timer.seconds(1), |
|
|
|
global_ttl: address_sum_global_ttl |
|
|
|
global_ttl: address_sum_global_ttl |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cache_address_with_balances_update_interval = System.get_env("CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL") |
|
|
|
|
|
|
|
|
|
|
|
balances_update_interval = |
|
|
|
balances_update_interval = |
|
|
|
if System.get_env("CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL") do |
|
|
|
if cache_address_with_balances_update_interval do |
|
|
|
case Integer.parse(System.get_env("CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL")) do |
|
|
|
case Integer.parse(cache_address_with_balances_update_interval) do |
|
|
|
{integer, ""} -> integer |
|
|
|
{integer, ""} -> integer |
|
|
|
_ -> nil |
|
|
|
_ -> nil |
|
|
|
end |
|
|
|
end |
|
|
@ -121,9 +126,11 @@ config :explorer, Explorer.Counters.BlockPriorityFeeCounter, |
|
|
|
config :explorer, Explorer.Chain.Cache.GasUsage, |
|
|
|
config :explorer, Explorer.Chain.Cache.GasUsage, |
|
|
|
enabled: System.get_env("CACHE_ENABLE_TOTAL_GAS_USAGE_COUNTER") == "true" |
|
|
|
enabled: System.get_env("CACHE_ENABLE_TOTAL_GAS_USAGE_COUNTER") == "true" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cache_bridge_market_cap_update_interval = System.get_env("CACHE_BRIDGE_MARKET_CAP_UPDATE_INTERVAL") |
|
|
|
|
|
|
|
|
|
|
|
bridge_market_cap_update_interval = |
|
|
|
bridge_market_cap_update_interval = |
|
|
|
if System.get_env("CACHE_BRIDGE_MARKET_CAP_UPDATE_INTERVAL") do |
|
|
|
if cache_bridge_market_cap_update_interval do |
|
|
|
case Integer.parse(System.get_env("CACHE_BRIDGE_MARKET_CAP_UPDATE_INTERVAL")) do |
|
|
|
case Integer.parse(cache_bridge_market_cap_update_interval) do |
|
|
|
{integer, ""} -> integer |
|
|
|
{integer, ""} -> integer |
|
|
|
_ -> nil |
|
|
|
_ -> nil |
|
|
|
end |
|
|
|
end |
|
|
@ -141,7 +148,7 @@ config :explorer, Explorer.KnownTokens, enabled: System.get_env("DISABLE_KNOWN_T |
|
|
|
|
|
|
|
|
|
|
|
config :explorer, Explorer.Integrations.EctoLogger, query_time_ms_threshold: :timer.seconds(2) |
|
|
|
config :explorer, Explorer.Integrations.EctoLogger, query_time_ms_threshold: :timer.seconds(2) |
|
|
|
|
|
|
|
|
|
|
|
config :explorer, Explorer.Market.History.Cataloger, enabled: System.get_env("DISABLE_INDEXER") != "true" |
|
|
|
config :explorer, Explorer.Market.History.Cataloger, enabled: disable_indexer != "true" |
|
|
|
|
|
|
|
|
|
|
|
config :explorer, Explorer.Chain.Cache.MinMissingBlockNumber, enabled: System.get_env("DISABLE_WRITE_API") != "true" |
|
|
|
config :explorer, Explorer.Chain.Cache.MinMissingBlockNumber, enabled: System.get_env("DISABLE_WRITE_API") != "true" |
|
|
|
|
|
|
|
|
|
|
@ -182,7 +189,7 @@ if System.get_env("METADATA_CONTRACT") && System.get_env("VALIDATORS_CONTRACT") |
|
|
|
metadata_contract_address: System.get_env("METADATA_CONTRACT"), |
|
|
|
metadata_contract_address: System.get_env("METADATA_CONTRACT"), |
|
|
|
validators_contract_address: System.get_env("VALIDATORS_CONTRACT") |
|
|
|
validators_contract_address: System.get_env("VALIDATORS_CONTRACT") |
|
|
|
|
|
|
|
|
|
|
|
config :explorer, Explorer.Validator.MetadataProcessor, enabled: System.get_env("DISABLE_INDEXER") != "true" |
|
|
|
config :explorer, Explorer.Validator.MetadataProcessor, enabled: disable_indexer != "true" |
|
|
|
else |
|
|
|
else |
|
|
|
config :explorer, Explorer.Validator.MetadataProcessor, enabled: false |
|
|
|
config :explorer, Explorer.Validator.MetadataProcessor, enabled: false |
|
|
|
end |
|
|
|
end |
|
|
@ -191,10 +198,12 @@ config :explorer, Explorer.Chain.Block.Reward, |
|
|
|
validators_contract_address: System.get_env("VALIDATORS_CONTRACT"), |
|
|
|
validators_contract_address: System.get_env("VALIDATORS_CONTRACT"), |
|
|
|
keys_manager_contract_address: System.get_env("KEYS_MANAGER_CONTRACT") |
|
|
|
keys_manager_contract_address: System.get_env("KEYS_MANAGER_CONTRACT") |
|
|
|
|
|
|
|
|
|
|
|
if System.get_env("POS_STAKING_CONTRACT") do |
|
|
|
pos_staking_contract = System.get_env("POS_STAKING_CONTRACT") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if pos_staking_contract do |
|
|
|
config :explorer, Explorer.Staking.ContractState, |
|
|
|
config :explorer, Explorer.Staking.ContractState, |
|
|
|
enabled: true, |
|
|
|
enabled: true, |
|
|
|
staking_contract_address: System.get_env("POS_STAKING_CONTRACT"), |
|
|
|
staking_contract_address: pos_staking_contract, |
|
|
|
eth_subscribe_max_delay: System.get_env("POS_ETH_SUBSCRIBE_MAX_DELAY", "60"), |
|
|
|
eth_subscribe_max_delay: System.get_env("POS_ETH_SUBSCRIBE_MAX_DELAY", "60"), |
|
|
|
eth_blocknumber_pull_interval: System.get_env("POS_ETH_BLOCKNUMBER_PULL_INTERVAL", "500") |
|
|
|
eth_blocknumber_pull_interval: System.get_env("POS_ETH_BLOCKNUMBER_PULL_INTERVAL", "500") |
|
|
|
else |
|
|
|
else |
|
|
@ -234,20 +243,20 @@ config :spandex_ecto, SpandexEcto.EctoLogger, |
|
|
|
otp_app: :explorer |
|
|
|
otp_app: :explorer |
|
|
|
|
|
|
|
|
|
|
|
config :explorer, Explorer.Chain.Cache.Blocks, |
|
|
|
config :explorer, Explorer.Chain.Cache.Blocks, |
|
|
|
ttl_check_interval: if(System.get_env("DISABLE_INDEXER") == "true", do: :timer.seconds(1), else: false), |
|
|
|
ttl_check_interval: if(disable_indexer == "true", do: :timer.seconds(1), else: false), |
|
|
|
global_ttl: if(System.get_env("DISABLE_INDEXER") == "true", do: :timer.seconds(5)) |
|
|
|
global_ttl: if(disable_indexer == "true", do: :timer.seconds(5)) |
|
|
|
|
|
|
|
|
|
|
|
config :explorer, Explorer.Chain.Cache.Transactions, |
|
|
|
config :explorer, Explorer.Chain.Cache.Transactions, |
|
|
|
ttl_check_interval: if(System.get_env("DISABLE_INDEXER") == "true", do: :timer.seconds(1), else: false), |
|
|
|
ttl_check_interval: if(disable_indexer == "true", do: :timer.seconds(1), else: false), |
|
|
|
global_ttl: if(System.get_env("DISABLE_INDEXER") == "true", do: :timer.seconds(5)) |
|
|
|
global_ttl: if(disable_indexer == "true", do: :timer.seconds(5)) |
|
|
|
|
|
|
|
|
|
|
|
config :explorer, Explorer.Chain.Cache.Accounts, |
|
|
|
config :explorer, Explorer.Chain.Cache.Accounts, |
|
|
|
ttl_check_interval: if(System.get_env("DISABLE_INDEXER") == "true", do: :timer.seconds(1), else: false), |
|
|
|
ttl_check_interval: if(disable_indexer == "true", do: :timer.seconds(1), else: false), |
|
|
|
global_ttl: if(System.get_env("DISABLE_INDEXER") == "true", do: :timer.seconds(5)) |
|
|
|
global_ttl: if(disable_indexer == "true", do: :timer.seconds(5)) |
|
|
|
|
|
|
|
|
|
|
|
config :explorer, Explorer.Chain.Cache.Uncles, |
|
|
|
config :explorer, Explorer.Chain.Cache.Uncles, |
|
|
|
ttl_check_interval: if(System.get_env("DISABLE_INDEXER") == "true", do: :timer.seconds(1), else: false), |
|
|
|
ttl_check_interval: if(disable_indexer == "true", do: :timer.seconds(1), else: false), |
|
|
|
global_ttl: if(System.get_env("DISABLE_INDEXER") == "true", do: :timer.seconds(5)) |
|
|
|
global_ttl: if(disable_indexer == "true", do: :timer.seconds(5)) |
|
|
|
|
|
|
|
|
|
|
|
config :explorer, Explorer.ThirdPartyIntegrations.Sourcify, |
|
|
|
config :explorer, Explorer.ThirdPartyIntegrations.Sourcify, |
|
|
|
server_url: System.get_env("SOURCIFY_SERVER_URL") || "https://sourcify.dev/server", |
|
|
|
server_url: System.get_env("SOURCIFY_SERVER_URL") || "https://sourcify.dev/server", |
|
|
|