Define chain type

pull/9098/head
POA 1 year ago
parent 1eb0647597
commit b6859d3547
  1. 9
      apps/explorer/config/test.exs
  2. 16
      config/runtime.exs
  3. 32
      config/runtime/dev.exs
  4. 32
      config/runtime/prod.exs

@ -64,6 +64,15 @@ for repo <- [
pool_size: 1
end
config :explorer, Explorer.Repo.PolygonZkevm,
database: "explorer_test",
hostname: "localhost",
pool: Ecto.Adapters.SQL.Sandbox,
# Default of `5_000` was too low for `BlockFetcher` test
ownership_timeout: :timer.minutes(1),
timeout: :timer.seconds(60),
queue_target: 1000
config :logger, :explorer,
level: :warn,
path: Path.absname("logs/test/explorer.log")

@ -682,14 +682,6 @@ config :indexer, Indexer.Fetcher.PolygonEdge.WithdrawalExit,
start_block_l1: System.get_env("INDEXER_POLYGON_EDGE_L1_WITHDRAWALS_START_BLOCK"),
exit_helper: System.get_env("INDEXER_POLYGON_EDGE_L1_EXIT_HELPER_CONTRACT")
config :indexer, Indexer.Fetcher.Zkevm.TransactionBatch,
chunk_size: ConfigHelper.parse_integer_env_var("INDEXER_ZKEVM_BATCHES_CHUNK_SIZE", 20),
recheck_interval: ConfigHelper.parse_integer_env_var("INDEXER_ZKEVM_BATCHES_RECHECK_INTERVAL", 60)
config :indexer, Indexer.Fetcher.Zkevm.TransactionBatch.Supervisor,
enabled:
ConfigHelper.chain_type() == "polygon_zkevm" && ConfigHelper.parse_bool_env_var("INDEXER_ZKEVM_BATCHES_ENABLED")
config :indexer, Indexer.Fetcher.RootstockData.Supervisor,
disabled?:
ConfigHelper.chain_type() != "rsk" || ConfigHelper.parse_bool_env_var("INDEXER_DISABLE_ROOTSTOCK_DATA_FETCHER")
@ -735,6 +727,14 @@ config :indexer, Indexer.Fetcher.Shibarium.L1.Supervisor, enabled: ConfigHelper.
config :indexer, Indexer.Fetcher.Shibarium.L2.Supervisor, enabled: ConfigHelper.chain_type() == "shibarium"
config :indexer, Indexer.Fetcher.Zkevm.TransactionBatch,
chunk_size: ConfigHelper.parse_integer_env_var("INDEXER_ZKEVM_BATCHES_CHUNK_SIZE", 20),
recheck_interval: ConfigHelper.parse_integer_env_var("INDEXER_ZKEVM_BATCHES_RECHECK_INTERVAL", 60)
config :indexer, Indexer.Fetcher.Zkevm.TransactionBatch.Supervisor,
enabled:
ConfigHelper.chain_type() == "polygon_zkevm" && ConfigHelper.parse_bool_env_var("INDEXER_ZKEVM_BATCHES_ENABLED")
Code.require_file("#{config_env()}.exs", "config/runtime")
for config <- "../apps/*/config/runtime/#{config_env()}.exs" |> Path.expand(__DIR__) |> Path.wildcard() do

@ -74,8 +74,8 @@ config :explorer, Explorer.Repo.Account,
pool_size: ConfigHelper.parse_integer_env_var("ACCOUNT_POOL_SIZE", 10),
queue_target: queue_target
# Configure PolygonEdge database
config :explorer, Explorer.Repo.PolygonEdge,
# Configure Beacon Chain database
config :explorer, Explorer.Repo.Beacon,
database: database,
hostname: hostname,
url: System.get_env("DATABASE_URL"),
@ -83,8 +83,8 @@ config :explorer, Explorer.Repo.PolygonEdge,
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
pool_size: 1
# Configure PolygonZkevm database
config :explorer, Explorer.Repo.PolygonZkevm,
# Configures BridgedTokens database
config :explorer, Explorer.Repo.BridgedTokens,
database: database,
hostname: hostname,
url: System.get_env("DATABASE_URL"),
@ -92,8 +92,8 @@ config :explorer, Explorer.Repo.PolygonZkevm,
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
pool_size: 1
# Configure Rootstock database
config :explorer, Explorer.Repo.RSK,
# Configure PolygonEdge database
config :explorer, Explorer.Repo.PolygonEdge,
database: database,
hostname: hostname,
url: System.get_env("DATABASE_URL"),
@ -101,8 +101,8 @@ config :explorer, Explorer.Repo.RSK,
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
pool_size: 1
# Configure Beacon Chain database
config :explorer, Explorer.Repo.Beacon,
# Configure PolygonZkevm database
config :explorer, Explorer.Repo.PolygonZkevm,
database: database,
hostname: hostname,
url: System.get_env("DATABASE_URL"),
@ -110,11 +110,13 @@ config :explorer, Explorer.Repo.Beacon,
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
pool_size: 1
# Configure Suave database
config :explorer, Explorer.Repo.Suave,
# Configure Rootstock database
config :explorer, Explorer.Repo.RSK,
database: database,
hostname: hostname,
url: ExplorerConfigHelper.get_suave_db_url(),
url: System.get_env("DATABASE_URL"),
# actually this repo is not started, and its pool size remains unused.
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
pool_size: 1
# Configure Shibarium database
@ -124,13 +126,11 @@ config :explorer, Explorer.Repo.Shibarium,
url: System.get_env("DATABASE_URL"),
pool_size: 1
# Configures BridgedTokens database
config :explorer, Explorer.Repo.BridgedTokens,
# Configure Suave database
config :explorer, Explorer.Repo.Suave,
database: database,
hostname: hostname,
url: System.get_env("DATABASE_URL"),
# actually this repo is not started, and its pool size remains unused.
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
url: ExplorerConfigHelper.get_suave_db_url(),
pool_size: 1
variant = Variant.get()

@ -51,41 +51,43 @@ config :explorer, Explorer.Repo.Account,
ssl: ExplorerConfigHelper.ssl_enabled?(),
queue_target: queue_target
# Configures PolygonEdge database
config :explorer, Explorer.Repo.PolygonEdge,
# Configure Beacon Chain database
config :explorer, Explorer.Repo.Beacon,
url: System.get_env("DATABASE_URL"),
# actually this repo is not started, and its pool size remains unused.
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
pool_size: 1,
ssl: ExplorerConfigHelper.ssl_enabled?()
# Configures PolygonZkevm database
config :explorer, Explorer.Repo.PolygonZkevm,
# Configures BridgedTokens database
config :explorer, Explorer.Repo.BridgedTokens,
url: System.get_env("DATABASE_URL"),
# actually this repo is not started, and its pool size remains unused.
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
pool_size: 1,
ssl: ExplorerConfigHelper.ssl_enabled?()
# Configures Rootstock database
config :explorer, Explorer.Repo.RSK,
# Configures PolygonEdge database
config :explorer, Explorer.Repo.PolygonEdge,
url: System.get_env("DATABASE_URL"),
# actually this repo is not started, and its pool size remains unused.
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
pool_size: 1,
ssl: ExplorerConfigHelper.ssl_enabled?()
# Configure Beacon Chain database
config :explorer, Explorer.Repo.Beacon,
# Configures PolygonZkevm database
config :explorer, Explorer.Repo.PolygonZkevm,
url: System.get_env("DATABASE_URL"),
# actually this repo is not started, and its pool size remains unused.
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
pool_size: 1,
ssl: ExplorerConfigHelper.ssl_enabled?()
# Configures Suave database
config :explorer, Explorer.Repo.Suave,
url: ExplorerConfigHelper.get_suave_db_url(),
# Configures Rootstock database
config :explorer, Explorer.Repo.RSK,
url: System.get_env("DATABASE_URL"),
# actually this repo is not started, and its pool size remains unused.
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
pool_size: 1,
ssl: ExplorerConfigHelper.ssl_enabled?()
@ -95,11 +97,9 @@ config :explorer, Explorer.Repo.Shibarium,
pool_size: 1,
ssl: ExplorerConfigHelper.ssl_enabled?()
# Configures BridgedTokens database
config :explorer, Explorer.Repo.BridgedTokens,
url: System.get_env("DATABASE_URL"),
# actually this repo is not started, and its pool size remains unused.
# separating repos for different CHAIN_TYPE is implemented only for the sake of keeping DB schema update relevant to the current chain type
# Configures Suave database
config :explorer, Explorer.Repo.Suave,
url: ExplorerConfigHelper.get_suave_db_url(),
pool_size: 1,
ssl: ExplorerConfigHelper.ssl_enabled?()

Loading…
Cancel
Save