Move old root down to apps/explorer. Make root umbrella. Co-authored-by: Alex Garibay <alex.garibay@dockyard.com>pull/86/head
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1014 B After Width: | Height: | Size: 1014 B |
Before Width: | Height: | Size: 935 B After Width: | Height: | Size: 935 B |
Before Width: | Height: | Size: 256 B After Width: | Height: | Size: 256 B |
Before Width: | Height: | Size: 494 B After Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 983 B After Width: | Height: | Size: 983 B |
@ -0,0 +1,59 @@ |
|||||||
|
# This file is responsible for configuring your application |
||||||
|
# and its dependencies with the aid of the Mix.Config module. |
||||||
|
# |
||||||
|
# This configuration file is loaded before any dependency and |
||||||
|
# is restricted to this project. |
||||||
|
use Mix.Config |
||||||
|
|
||||||
|
# General application configuration |
||||||
|
config :explorer, ecto_repos: [Explorer.Repo] |
||||||
|
|
||||||
|
# Configures gettext |
||||||
|
config :explorer, ExplorerWeb.Gettext, locales: ~w(en), default_locale: "en" |
||||||
|
|
||||||
|
# Configures the endpoint |
||||||
|
config :explorer, ExplorerWeb.Endpoint, |
||||||
|
url: [host: "localhost"], |
||||||
|
render_errors: [view: ExplorerWeb.ErrorView, accepts: ~w(html json)], |
||||||
|
pubsub: [name: Explorer.PubSub, adapter: Phoenix.PubSub.PG2] |
||||||
|
|
||||||
|
config :explorer, Explorer.Integrations.EctoLogger, query_time_ms_threshold: 2_000 |
||||||
|
|
||||||
|
# Configures Elixir's Logger |
||||||
|
config :logger, :console, |
||||||
|
format: "$time $metadata[$level] $message\n", |
||||||
|
metadata: [:request_id] |
||||||
|
|
||||||
|
config :ethereumex, url: "http://localhost:8545" |
||||||
|
|
||||||
|
config :new_relixir, active: false |
||||||
|
|
||||||
|
config :ex_cldr, |
||||||
|
default_locale: "en", |
||||||
|
locales: ["en"], |
||||||
|
gettext: ExplorerWeb.Gettext |
||||||
|
|
||||||
|
config :exq, |
||||||
|
host: "localhost", |
||||||
|
port: 6379, |
||||||
|
namespace: "exq", |
||||||
|
start_on_application: false, |
||||||
|
scheduler_enable: true, |
||||||
|
shutdown_timeout: 5000, |
||||||
|
max_retries: 10, |
||||||
|
queues: [ |
||||||
|
{"default", 1}, |
||||||
|
{"balances", 1}, |
||||||
|
{"blocks", 1}, |
||||||
|
{"internal_transactions", 1}, |
||||||
|
{"transactions", 1}, |
||||||
|
{"receipts", 1} |
||||||
|
] |
||||||
|
|
||||||
|
config :explorer, :ethereum, backend: Explorer.Ethereum.Live |
||||||
|
|
||||||
|
config :exq_ui, server: false |
||||||
|
|
||||||
|
# Import environment specific config. This must remain at the bottom |
||||||
|
# of this file so it overrides the configuration defined above. |
||||||
|
import_config "#{Mix.env()}.exs" |
@ -0,0 +1,85 @@ |
|||||||
|
use Mix.Config |
||||||
|
|
||||||
|
# For development, we disable any cache and enable |
||||||
|
# debugging and code reloading. |
||||||
|
# |
||||||
|
# The watchers configuration can be used to run external |
||||||
|
# watchers to your application. For example, we use it |
||||||
|
# with brunch.io to recompile .js and .css sources. |
||||||
|
config :explorer, ExplorerWeb.Endpoint, |
||||||
|
http: [port: 4000], |
||||||
|
debug_errors: true, |
||||||
|
code_reloader: true, |
||||||
|
check_origin: false, |
||||||
|
watchers: [ |
||||||
|
node: [ |
||||||
|
"node_modules/brunch/bin/brunch", |
||||||
|
"watch", |
||||||
|
"--stdin", |
||||||
|
cd: Path.expand("../assets", __DIR__) |
||||||
|
] |
||||||
|
] |
||||||
|
|
||||||
|
# ## SSL Support |
||||||
|
# |
||||||
|
# In order to use HTTPS in development, a self-signed |
||||||
|
# certificate can be generated by running the following |
||||||
|
# command from your terminal: |
||||||
|
# |
||||||
|
# openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout priv/server.key -out priv/server.pem |
||||||
|
# |
||||||
|
# The `http:` config above can be replaced with: |
||||||
|
# |
||||||
|
# https: [port: 4000, keyfile: "priv/server.key", certfile: "priv/server.pem"], |
||||||
|
# |
||||||
|
# If desired, both `http:` and `https:` keys can be |
||||||
|
# configured to run both http and https servers on |
||||||
|
# different ports. |
||||||
|
|
||||||
|
# Watch static and templates for browser reloading. |
||||||
|
config :explorer, ExplorerWeb.Endpoint, |
||||||
|
live_reload: [ |
||||||
|
patterns: [ |
||||||
|
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$}, |
||||||
|
~r{priv/gettext/.*(po)$}, |
||||||
|
~r{lib/explorer_web/views/.*(ex)$}, |
||||||
|
~r{lib/explorer_web/templates/.*(eex)$} |
||||||
|
] |
||||||
|
] |
||||||
|
|
||||||
|
# Do not include metadata nor timestamps in development logs |
||||||
|
config :logger, :console, format: "[$level] $message\n" |
||||||
|
|
||||||
|
# Set a higher stacktrace during development. Avoid configuring such |
||||||
|
# in production as building large stacktraces may be expensive. |
||||||
|
config :phoenix, :stacktrace_depth, 20 |
||||||
|
|
||||||
|
# Configure your database |
||||||
|
config :explorer, Explorer.Repo, |
||||||
|
adapter: Ecto.Adapters.Postgres, |
||||||
|
database: "explorer_dev", |
||||||
|
hostname: "localhost", |
||||||
|
pool_size: 10 |
||||||
|
|
||||||
|
# Configure Quantum |
||||||
|
config :explorer, Explorer.Scheduler, |
||||||
|
jobs: [ |
||||||
|
[ |
||||||
|
schedule: {:extended, "*/15 * * * * *"}, |
||||||
|
task: {Explorer.Workers.RefreshBalance, :perform_later, []} |
||||||
|
], |
||||||
|
[ |
||||||
|
schedule: {:extended, "*/5 * * * * *"}, |
||||||
|
task: {Explorer.Workers.ImportBlock, :perform_later, ["latest"]} |
||||||
|
], |
||||||
|
[ |
||||||
|
schedule: {:extended, "*/5 * * * * *"}, |
||||||
|
task: {Explorer.Workers.ImportBlock, :perform_later, ["pending"]} |
||||||
|
], |
||||||
|
[ |
||||||
|
schedule: {:extended, "*/15 * * * * *"}, |
||||||
|
task: {Explorer.Workers.ImportSkippedBlocks, :perform_later, [1]} |
||||||
|
] |
||||||
|
] |
||||||
|
|
||||||
|
import_config "dev.secret.exs" |
@ -0,0 +1,89 @@ |
|||||||
|
use Mix.Config |
||||||
|
|
||||||
|
# For production, we often load configuration from external |
||||||
|
# sources, such as your system environment. For this reason, |
||||||
|
# you won't find the :http configuration below, but set inside |
||||||
|
# ExplorerWeb.Endpoint.init/2 when load_from_system_env is |
||||||
|
# true. Any dynamic configuration should be done there. |
||||||
|
# |
||||||
|
# Don't forget to configure the url host to something meaningful, |
||||||
|
# Phoenix uses this information when generating URLs. |
||||||
|
# |
||||||
|
# Finally, we also include the path to a cache manifest |
||||||
|
# containing the digested version of static files. This |
||||||
|
# manifest is generated by the mix phx.digest task |
||||||
|
# which you typically run after static files are built. |
||||||
|
config :explorer, ExplorerWeb.Endpoint, |
||||||
|
cache_static_manifest: "priv/static/cache_manifest.json", |
||||||
|
force_ssl: [rewrite_on: [:x_forwarded_proto]], |
||||||
|
instrumenters: [NewRelixir.Instrumenters.Phoenix], |
||||||
|
load_from_system_env: true, |
||||||
|
pubsub: [ |
||||||
|
adapter: Phoenix.PubSub.Redis, |
||||||
|
url: System.get_env("REDIS_URL"), |
||||||
|
node_name: System.get_env("DYNO") |
||||||
|
], |
||||||
|
secret_key_base: System.get_env("SECRET_KEY_BASE"), |
||||||
|
url: [ |
||||||
|
scheme: "https", |
||||||
|
host: Map.fetch!(System.get_env(), "HEROKU_APP_NAME") <> ".herokuapp.com", |
||||||
|
port: 443 |
||||||
|
] |
||||||
|
|
||||||
|
# Do not print debug messages in production |
||||||
|
config :logger, level: :info |
||||||
|
|
||||||
|
# Configures the database |
||||||
|
config :explorer, Explorer.Repo, |
||||||
|
adapter: Ecto.Adapters.Postgres, |
||||||
|
url: System.get_env("DATABASE_URL"), |
||||||
|
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), |
||||||
|
ssl: String.equivalent?(System.get_env("ECTO_USE_SSL") || "true", "true"), |
||||||
|
prepare: :unnamed, |
||||||
|
timeout: 60_000, |
||||||
|
pool_timeout: 60_000 |
||||||
|
|
||||||
|
# Configure New Relic |
||||||
|
config :new_relixir, |
||||||
|
application_name: System.get_env("NEW_RELIC_APP_NAME"), |
||||||
|
license_key: System.get_env("NEW_RELIC_LICENSE_KEY"), |
||||||
|
active: true |
||||||
|
|
||||||
|
# Configure Web3 |
||||||
|
config :ethereumex, url: System.get_env("ETHEREUM_URL") |
||||||
|
|
||||||
|
# Configure Quantum |
||||||
|
config :explorer, Explorer.Scheduler, |
||||||
|
jobs: [ |
||||||
|
[ |
||||||
|
schedule: {:extended, System.get_env("EXQ_BALANCE_SCHEDULE") || "0 * * * * *"}, |
||||||
|
task: {Explorer.Workers.RefreshBalance, :perform_later, []} |
||||||
|
], |
||||||
|
[ |
||||||
|
schedule: {:extended, System.get_env("EXQ_LATEST_BLOCK_SCHEDULE") || "* * * * * *"}, |
||||||
|
task: {Explorer.Workers.ImportBlock, :perform_later, ["latest"]} |
||||||
|
], |
||||||
|
[ |
||||||
|
schedule: {:extended, System.get_env("EXQ_PENDING_BLOCK_SCHEDULE") || "* * * * * *"}, |
||||||
|
task: {Explorer.Workers.ImportBlock, :perform_later, ["pending"]} |
||||||
|
], |
||||||
|
[ |
||||||
|
schedule: {:extended, System.get_env("EXQ_BACKFILL_SCHEDULE") || "* * * * * *"}, |
||||||
|
task: |
||||||
|
{Explorer.Workers.ImportSkippedBlocks, :perform_later, |
||||||
|
[String.to_integer(System.get_env("EXQ_BACKFILL_BATCH_SIZE") || "1")]} |
||||||
|
] |
||||||
|
] |
||||||
|
|
||||||
|
# Configure Exq |
||||||
|
config :exq, |
||||||
|
node_identifier: Explorer.ExqNodeIdentifier, |
||||||
|
url: System.get_env("REDIS_URL"), |
||||||
|
queues: [ |
||||||
|
{"blocks", String.to_integer(System.get_env("EXQ_BLOCKS_CONCURRENCY") || "1")}, |
||||||
|
{"default", String.to_integer(System.get_env("EXQ_CONCURRENCY") || "1")}, |
||||||
|
{"internal_transactions", |
||||||
|
String.to_integer(System.get_env("EXQ_INTERNAL_TRANSACTIONS_CONCURRENCY") || "1")}, |
||||||
|
{"receipts", String.to_integer(System.get_env("EXQ_RECEIPTS_CONCURRENCY") || "1")}, |
||||||
|
{"transactions", String.to_integer(System.get_env("EXQ_TRANSACTIONS_CONCURRENCY") || "1")} |
||||||
|
] |
@ -0,0 +1,29 @@ |
|||||||
|
use Mix.Config |
||||||
|
|
||||||
|
# We don't run a server during test. If one is required, |
||||||
|
# you can enable the server option below. |
||||||
|
config :explorer, ExplorerWeb.Endpoint, |
||||||
|
http: [port: 4001], |
||||||
|
secret_key_base: "27Swe6KtEtmN37WyEYRjKWyxYULNtrxlkCEKur4qoV+Lwtk8lafsR16ifz1XBBYj", |
||||||
|
server: true |
||||||
|
|
||||||
|
config :explorer, :sql_sandbox, true |
||||||
|
|
||||||
|
# Print only warnings and errors during test |
||||||
|
config :logger, level: :warn |
||||||
|
|
||||||
|
# Configure your database |
||||||
|
config :explorer, Explorer.Repo, |
||||||
|
adapter: Ecto.Adapters.Postgres, |
||||||
|
database: "explorer_test", |
||||||
|
hostname: "localhost", |
||||||
|
pool: Ecto.Adapters.SQL.Sandbox, |
||||||
|
ownership_timeout: 60_000 |
||||||
|
|
||||||
|
# Configure wallaby |
||||||
|
config :wallaby, screenshot_on_failure: true |
||||||
|
|
||||||
|
# Configure ethereumex |
||||||
|
config :ethereumex, url: "https://sokol-trace.poa.network" |
||||||
|
|
||||||
|
config :explorer, :ethereum, backend: Explorer.Ethereum.Test |