diff --git a/.credo.exs b/.credo.exs index f0f24e8c35..29efa3dc50 100644 --- a/.credo.exs +++ b/.credo.exs @@ -21,8 +21,8 @@ # You can give explicit globs or simply directories. # In the latter case `**/*.{ex,exs}` will be used. # - included: ["lib/", "src/", "web/", "apps/"], - excluded: [~r"/_build/", ~r"/deps/"] + included: ["lib/", "src/", "web/", "apps/*/lib/**/*.{ex,exs}"], + excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] }, # # If you create your own checks, you must specify the source files for diff --git a/.gitignore b/.gitignore index 9f03dd3c94..98f30b70bc 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ npm-debug.log # Alternatively, you may comment the line below and commit the # secrets files as long as you replace their contents by environment # variables. -/config/*.secret.exs +/apps/explorer/config/*.secret.exs # Wallaby screenshots screenshots/ diff --git a/assets/.eslintrc b/apps/explorer/assets/.eslintrc similarity index 100% rename from assets/.eslintrc rename to apps/explorer/assets/.eslintrc diff --git a/assets/brunch-config.js b/apps/explorer/assets/brunch-config.js similarity index 100% rename from assets/brunch-config.js rename to apps/explorer/assets/brunch-config.js diff --git a/assets/css/app.scss b/apps/explorer/assets/css/app.scss similarity index 100% rename from assets/css/app.scss rename to apps/explorer/assets/css/app.scss diff --git a/assets/css/components/_address.scss b/apps/explorer/assets/css/components/_address.scss similarity index 100% rename from assets/css/components/_address.scss rename to apps/explorer/assets/css/components/_address.scss diff --git a/assets/css/components/_all.scss b/apps/explorer/assets/css/components/_all.scss similarity index 100% rename from assets/css/components/_all.scss rename to apps/explorer/assets/css/components/_all.scss diff --git a/assets/css/components/_block.scss b/apps/explorer/assets/css/components/_block.scss similarity index 100% rename from assets/css/components/_block.scss rename to apps/explorer/assets/css/components/_block.scss diff --git a/assets/css/components/_blocks.scss b/apps/explorer/assets/css/components/_blocks.scss similarity index 100% rename from assets/css/components/_blocks.scss rename to apps/explorer/assets/css/components/_blocks.scss diff --git a/assets/css/components/_chain.scss b/apps/explorer/assets/css/components/_chain.scss similarity index 100% rename from assets/css/components/_chain.scss rename to apps/explorer/assets/css/components/_chain.scss diff --git a/assets/css/components/_container.scss b/apps/explorer/assets/css/components/_container.scss similarity index 100% rename from assets/css/components/_container.scss rename to apps/explorer/assets/css/components/_container.scss diff --git a/assets/css/components/_dot.scss b/apps/explorer/assets/css/components/_dot.scss similarity index 100% rename from assets/css/components/_dot.scss rename to apps/explorer/assets/css/components/_dot.scss diff --git a/assets/css/components/_footer.scss b/apps/explorer/assets/css/components/_footer.scss similarity index 100% rename from assets/css/components/_footer.scss rename to apps/explorer/assets/css/components/_footer.scss diff --git a/assets/css/components/_header.scss b/apps/explorer/assets/css/components/_header.scss similarity index 100% rename from assets/css/components/_header.scss rename to apps/explorer/assets/css/components/_header.scss diff --git a/assets/css/components/_internal_transaction.scss b/apps/explorer/assets/css/components/_internal_transaction.scss similarity index 100% rename from assets/css/components/_internal_transaction.scss rename to apps/explorer/assets/css/components/_internal_transaction.scss diff --git a/assets/css/components/_pagination.scss b/apps/explorer/assets/css/components/_pagination.scss similarity index 100% rename from assets/css/components/_pagination.scss rename to apps/explorer/assets/css/components/_pagination.scss diff --git a/assets/css/components/_section.scss b/apps/explorer/assets/css/components/_section.scss similarity index 100% rename from assets/css/components/_section.scss rename to apps/explorer/assets/css/components/_section.scss diff --git a/assets/css/components/_transaction.scss b/apps/explorer/assets/css/components/_transaction.scss similarity index 100% rename from assets/css/components/_transaction.scss rename to apps/explorer/assets/css/components/_transaction.scss diff --git a/assets/css/components/_transaction_log.scss b/apps/explorer/assets/css/components/_transaction_log.scss similarity index 100% rename from assets/css/components/_transaction_log.scss rename to apps/explorer/assets/css/components/_transaction_log.scss diff --git a/assets/css/components/_transactions.scss b/apps/explorer/assets/css/components/_transactions.scss similarity index 100% rename from assets/css/components/_transactions.scss rename to apps/explorer/assets/css/components/_transactions.scss diff --git a/assets/css/explorer/_all.scss b/apps/explorer/assets/css/explorer/_all.scss similarity index 100% rename from assets/css/explorer/_all.scss rename to apps/explorer/assets/css/explorer/_all.scss diff --git a/assets/css/explorer/_breakpoints.scss b/apps/explorer/assets/css/explorer/_breakpoints.scss similarity index 100% rename from assets/css/explorer/_breakpoints.scss rename to apps/explorer/assets/css/explorer/_breakpoints.scss diff --git a/assets/css/explorer/_color.scss b/apps/explorer/assets/css/explorer/_color.scss similarity index 100% rename from assets/css/explorer/_color.scss rename to apps/explorer/assets/css/explorer/_color.scss diff --git a/assets/css/explorer/_header.scss b/apps/explorer/assets/css/explorer/_header.scss similarity index 100% rename from assets/css/explorer/_header.scss rename to apps/explorer/assets/css/explorer/_header.scss diff --git a/assets/css/explorer/_open_sans.scss b/apps/explorer/assets/css/explorer/_open_sans.scss similarity index 100% rename from assets/css/explorer/_open_sans.scss rename to apps/explorer/assets/css/explorer/_open_sans.scss diff --git a/assets/css/explorer/_paper.scss b/apps/explorer/assets/css/explorer/_paper.scss similarity index 100% rename from assets/css/explorer/_paper.scss rename to apps/explorer/assets/css/explorer/_paper.scss diff --git a/assets/css/explorer/_size.scss b/apps/explorer/assets/css/explorer/_size.scss similarity index 100% rename from assets/css/explorer/_size.scss rename to apps/explorer/assets/css/explorer/_size.scss diff --git a/assets/css/explorer/_table.scss b/apps/explorer/assets/css/explorer/_table.scss similarity index 100% rename from assets/css/explorer/_table.scss rename to apps/explorer/assets/css/explorer/_table.scss diff --git a/assets/css/explorer/_typography.scss b/apps/explorer/assets/css/explorer/_typography.scss similarity index 100% rename from assets/css/explorer/_typography.scss rename to apps/explorer/assets/css/explorer/_typography.scss diff --git a/assets/js/app.js b/apps/explorer/assets/js/app.js similarity index 100% rename from assets/js/app.js rename to apps/explorer/assets/js/app.js diff --git a/assets/js/lib/block_subscription.js b/apps/explorer/assets/js/lib/block_subscription.js similarity index 100% rename from assets/js/lib/block_subscription.js rename to apps/explorer/assets/js/lib/block_subscription.js diff --git a/assets/js/lib/react_phoenix.js b/apps/explorer/assets/js/lib/react_phoenix.js similarity index 100% rename from assets/js/lib/react_phoenix.js rename to apps/explorer/assets/js/lib/react_phoenix.js diff --git a/assets/js/socket.js b/apps/explorer/assets/js/socket.js similarity index 100% rename from assets/js/socket.js rename to apps/explorer/assets/js/socket.js diff --git a/assets/package-lock.json b/apps/explorer/assets/package-lock.json similarity index 100% rename from assets/package-lock.json rename to apps/explorer/assets/package-lock.json diff --git a/assets/package.json b/apps/explorer/assets/package.json similarity index 100% rename from assets/package.json rename to apps/explorer/assets/package.json diff --git a/assets/spec/lib/block_subscription_spec.js b/apps/explorer/assets/spec/lib/block_subscription_spec.js similarity index 100% rename from assets/spec/lib/block_subscription_spec.js rename to apps/explorer/assets/spec/lib/block_subscription_spec.js diff --git a/assets/spec/spec_helper.js b/apps/explorer/assets/spec/spec_helper.js similarity index 100% rename from assets/spec/spec_helper.js rename to apps/explorer/assets/spec/spec_helper.js diff --git a/assets/spec/support/jasmine.scss b/apps/explorer/assets/spec/support/jasmine.scss similarity index 100% rename from assets/spec/support/jasmine.scss rename to apps/explorer/assets/spec/support/jasmine.scss diff --git a/assets/static/favicon.ico b/apps/explorer/assets/static/favicon.ico similarity index 100% rename from assets/static/favicon.ico rename to apps/explorer/assets/static/favicon.ico diff --git a/assets/static/images/average_time.svg b/apps/explorer/assets/static/images/average_time.svg similarity index 100% rename from assets/static/images/average_time.svg rename to apps/explorer/assets/static/images/average_time.svg diff --git a/assets/static/images/block.svg b/apps/explorer/assets/static/images/block.svg similarity index 100% rename from assets/static/images/block.svg rename to apps/explorer/assets/static/images/block.svg diff --git a/assets/static/images/blocks.svg b/apps/explorer/assets/static/images/blocks.svg similarity index 100% rename from assets/static/images/blocks.svg rename to apps/explorer/assets/static/images/blocks.svg diff --git a/assets/static/images/last_block.svg b/apps/explorer/assets/static/images/last_block.svg similarity index 100% rename from assets/static/images/last_block.svg rename to apps/explorer/assets/static/images/last_block.svg diff --git a/assets/static/images/logo.svg b/apps/explorer/assets/static/images/logo.svg similarity index 100% rename from assets/static/images/logo.svg rename to apps/explorer/assets/static/images/logo.svg diff --git a/assets/static/images/mgi.svg b/apps/explorer/assets/static/images/mgi.svg similarity index 100% rename from assets/static/images/mgi.svg rename to apps/explorer/assets/static/images/mgi.svg diff --git a/assets/static/images/transaction.svg b/apps/explorer/assets/static/images/transaction.svg similarity index 100% rename from assets/static/images/transaction.svg rename to apps/explorer/assets/static/images/transaction.svg diff --git a/assets/static/images/transactions.svg b/apps/explorer/assets/static/images/transactions.svg similarity index 100% rename from assets/static/images/transactions.svg rename to apps/explorer/assets/static/images/transactions.svg diff --git a/assets/static/robots.txt b/apps/explorer/assets/static/robots.txt similarity index 100% rename from assets/static/robots.txt rename to apps/explorer/assets/static/robots.txt diff --git a/assets/yarn.lock b/apps/explorer/assets/yarn.lock similarity index 100% rename from assets/yarn.lock rename to apps/explorer/assets/yarn.lock diff --git a/apps/explorer/config/config.exs b/apps/explorer/config/config.exs new file mode 100644 index 0000000000..3b20eda7c4 --- /dev/null +++ b/apps/explorer/config/config.exs @@ -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" diff --git a/apps/explorer/config/dev.exs b/apps/explorer/config/dev.exs new file mode 100644 index 0000000000..082de0d9a8 --- /dev/null +++ b/apps/explorer/config/dev.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" diff --git a/config/dev.secret.exs.example b/apps/explorer/config/dev.secret.exs.example similarity index 100% rename from config/dev.secret.exs.example rename to apps/explorer/config/dev.secret.exs.example diff --git a/apps/explorer/config/prod.exs b/apps/explorer/config/prod.exs new file mode 100644 index 0000000000..d66a3f5bb3 --- /dev/null +++ b/apps/explorer/config/prod.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")} + ] diff --git a/apps/explorer/config/test.exs b/apps/explorer/config/test.exs new file mode 100644 index 0000000000..442717e8d5 --- /dev/null +++ b/apps/explorer/config/test.exs @@ -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 diff --git a/lib/backfill_transaction_receipt_ids.ex b/apps/explorer/lib/backfill_transaction_receipt_ids.ex similarity index 100% rename from lib/backfill_transaction_receipt_ids.ex rename to apps/explorer/lib/backfill_transaction_receipt_ids.ex diff --git a/lib/explorer.ex b/apps/explorer/lib/explorer.ex similarity index 100% rename from lib/explorer.ex rename to apps/explorer/lib/explorer.ex diff --git a/lib/explorer/application.ex b/apps/explorer/lib/explorer/application.ex similarity index 100% rename from lib/explorer/application.ex rename to apps/explorer/lib/explorer/application.ex diff --git a/lib/explorer/ethereum/ethereum.ex b/apps/explorer/lib/explorer/ethereum/ethereum.ex similarity index 100% rename from lib/explorer/ethereum/ethereum.ex rename to apps/explorer/lib/explorer/ethereum/ethereum.ex diff --git a/lib/explorer/ethereum/live.ex b/apps/explorer/lib/explorer/ethereum/live.ex similarity index 100% rename from lib/explorer/ethereum/live.ex rename to apps/explorer/lib/explorer/ethereum/live.ex diff --git a/lib/explorer/ethereum/test.ex b/apps/explorer/lib/explorer/ethereum/test.ex similarity index 100% rename from lib/explorer/ethereum/test.ex rename to apps/explorer/lib/explorer/ethereum/test.ex diff --git a/lib/explorer/ethereumex_extensions.ex b/apps/explorer/lib/explorer/ethereumex_extensions.ex similarity index 100% rename from lib/explorer/ethereumex_extensions.ex rename to apps/explorer/lib/explorer/ethereumex_extensions.ex diff --git a/lib/explorer/exq_node_identifier.ex b/apps/explorer/lib/explorer/exq_node_identifier.ex similarity index 100% rename from lib/explorer/exq_node_identifier.ex rename to apps/explorer/lib/explorer/exq_node_identifier.ex diff --git a/lib/explorer/forms/block_form.ex b/apps/explorer/lib/explorer/forms/block_form.ex similarity index 100% rename from lib/explorer/forms/block_form.ex rename to apps/explorer/lib/explorer/forms/block_form.ex diff --git a/lib/explorer/forms/pending_transaction_form.ex b/apps/explorer/lib/explorer/forms/pending_transaction_form.ex similarity index 100% rename from lib/explorer/forms/pending_transaction_form.ex rename to apps/explorer/lib/explorer/forms/pending_transaction_form.ex diff --git a/lib/explorer/forms/transaction_form.ex b/apps/explorer/lib/explorer/forms/transaction_form.ex similarity index 100% rename from lib/explorer/forms/transaction_form.ex rename to apps/explorer/lib/explorer/forms/transaction_form.ex diff --git a/lib/explorer/importers/balance_importer.ex b/apps/explorer/lib/explorer/importers/balance_importer.ex similarity index 100% rename from lib/explorer/importers/balance_importer.ex rename to apps/explorer/lib/explorer/importers/balance_importer.ex diff --git a/lib/explorer/importers/block_importer.ex b/apps/explorer/lib/explorer/importers/block_importer.ex similarity index 100% rename from lib/explorer/importers/block_importer.ex rename to apps/explorer/lib/explorer/importers/block_importer.ex diff --git a/lib/explorer/importers/internal_transaction_importer.ex b/apps/explorer/lib/explorer/importers/internal_transaction_importer.ex similarity index 100% rename from lib/explorer/importers/internal_transaction_importer.ex rename to apps/explorer/lib/explorer/importers/internal_transaction_importer.ex diff --git a/lib/explorer/importers/receipt_importer.ex b/apps/explorer/lib/explorer/importers/receipt_importer.ex similarity index 100% rename from lib/explorer/importers/receipt_importer.ex rename to apps/explorer/lib/explorer/importers/receipt_importer.ex diff --git a/lib/explorer/importers/transaction_importer.ex b/apps/explorer/lib/explorer/importers/transaction_importer.ex similarity index 100% rename from lib/explorer/importers/transaction_importer.ex rename to apps/explorer/lib/explorer/importers/transaction_importer.ex diff --git a/lib/explorer/repo.ex b/apps/explorer/lib/explorer/repo.ex similarity index 100% rename from lib/explorer/repo.ex rename to apps/explorer/lib/explorer/repo.ex diff --git a/lib/explorer/resource.ex b/apps/explorer/lib/explorer/resource.ex similarity index 100% rename from lib/explorer/resource.ex rename to apps/explorer/lib/explorer/resource.ex diff --git a/lib/explorer/scheduler.ex b/apps/explorer/lib/explorer/scheduler.ex similarity index 100% rename from lib/explorer/scheduler.ex rename to apps/explorer/lib/explorer/scheduler.ex diff --git a/lib/explorer/schemas/address.ex b/apps/explorer/lib/explorer/schemas/address.ex similarity index 100% rename from lib/explorer/schemas/address.ex rename to apps/explorer/lib/explorer/schemas/address.ex diff --git a/lib/explorer/schemas/block.ex b/apps/explorer/lib/explorer/schemas/block.ex similarity index 100% rename from lib/explorer/schemas/block.ex rename to apps/explorer/lib/explorer/schemas/block.ex diff --git a/lib/explorer/schemas/block_transaction.ex b/apps/explorer/lib/explorer/schemas/block_transaction.ex similarity index 100% rename from lib/explorer/schemas/block_transaction.ex rename to apps/explorer/lib/explorer/schemas/block_transaction.ex diff --git a/lib/explorer/schemas/chain.ex b/apps/explorer/lib/explorer/schemas/chain.ex similarity index 100% rename from lib/explorer/schemas/chain.ex rename to apps/explorer/lib/explorer/schemas/chain.ex diff --git a/lib/explorer/schemas/credit.ex b/apps/explorer/lib/explorer/schemas/credit.ex similarity index 100% rename from lib/explorer/schemas/credit.ex rename to apps/explorer/lib/explorer/schemas/credit.ex diff --git a/lib/explorer/schemas/debit.ex b/apps/explorer/lib/explorer/schemas/debit.ex similarity index 100% rename from lib/explorer/schemas/debit.ex rename to apps/explorer/lib/explorer/schemas/debit.ex diff --git a/lib/explorer/schemas/from_address.ex b/apps/explorer/lib/explorer/schemas/from_address.ex similarity index 100% rename from lib/explorer/schemas/from_address.ex rename to apps/explorer/lib/explorer/schemas/from_address.ex diff --git a/lib/explorer/schemas/internal_transaction.ex b/apps/explorer/lib/explorer/schemas/internal_transaction.ex similarity index 100% rename from lib/explorer/schemas/internal_transaction.ex rename to apps/explorer/lib/explorer/schemas/internal_transaction.ex diff --git a/lib/explorer/schemas/log.ex b/apps/explorer/lib/explorer/schemas/log.ex similarity index 100% rename from lib/explorer/schemas/log.ex rename to apps/explorer/lib/explorer/schemas/log.ex diff --git a/lib/explorer/schemas/receipt.ex b/apps/explorer/lib/explorer/schemas/receipt.ex similarity index 100% rename from lib/explorer/schemas/receipt.ex rename to apps/explorer/lib/explorer/schemas/receipt.ex diff --git a/lib/explorer/schemas/schema.ex b/apps/explorer/lib/explorer/schemas/schema.ex similarity index 100% rename from lib/explorer/schemas/schema.ex rename to apps/explorer/lib/explorer/schemas/schema.ex diff --git a/lib/explorer/schemas/to_address.ex b/apps/explorer/lib/explorer/schemas/to_address.ex similarity index 100% rename from lib/explorer/schemas/to_address.ex rename to apps/explorer/lib/explorer/schemas/to_address.ex diff --git a/lib/explorer/schemas/transaction.ex b/apps/explorer/lib/explorer/schemas/transaction.ex similarity index 100% rename from lib/explorer/schemas/transaction.ex rename to apps/explorer/lib/explorer/schemas/transaction.ex diff --git a/lib/explorer/servers/chain_statistics.ex b/apps/explorer/lib/explorer/servers/chain_statistics.ex similarity index 100% rename from lib/explorer/servers/chain_statistics.ex rename to apps/explorer/lib/explorer/servers/chain_statistics.ex diff --git a/lib/explorer/services/address.ex b/apps/explorer/lib/explorer/services/address.ex similarity index 100% rename from lib/explorer/services/address.ex rename to apps/explorer/lib/explorer/services/address.ex diff --git a/lib/explorer/services/transaction.ex b/apps/explorer/lib/explorer/services/transaction.ex similarity index 100% rename from lib/explorer/services/transaction.ex rename to apps/explorer/lib/explorer/services/transaction.ex diff --git a/lib/explorer/skipped_balances.ex b/apps/explorer/lib/explorer/skipped_balances.ex similarity index 100% rename from lib/explorer/skipped_balances.ex rename to apps/explorer/lib/explorer/skipped_balances.ex diff --git a/lib/explorer/skipped_blocks.ex b/apps/explorer/lib/explorer/skipped_blocks.ex similarity index 100% rename from lib/explorer/skipped_blocks.ex rename to apps/explorer/lib/explorer/skipped_blocks.ex diff --git a/lib/explorer/skipped_internal_transactions.ex b/apps/explorer/lib/explorer/skipped_internal_transactions.ex similarity index 100% rename from lib/explorer/skipped_internal_transactions.ex rename to apps/explorer/lib/explorer/skipped_internal_transactions.ex diff --git a/lib/explorer/skipped_receipts.ex b/apps/explorer/lib/explorer/skipped_receipts.ex similarity index 100% rename from lib/explorer/skipped_receipts.ex rename to apps/explorer/lib/explorer/skipped_receipts.ex diff --git a/lib/explorer/workers/import_balance.ex b/apps/explorer/lib/explorer/workers/import_balance.ex similarity index 100% rename from lib/explorer/workers/import_balance.ex rename to apps/explorer/lib/explorer/workers/import_balance.ex diff --git a/lib/explorer/workers/import_block.ex b/apps/explorer/lib/explorer/workers/import_block.ex similarity index 100% rename from lib/explorer/workers/import_block.ex rename to apps/explorer/lib/explorer/workers/import_block.ex diff --git a/lib/explorer/workers/import_internal_transaction.ex b/apps/explorer/lib/explorer/workers/import_internal_transaction.ex similarity index 100% rename from lib/explorer/workers/import_internal_transaction.ex rename to apps/explorer/lib/explorer/workers/import_internal_transaction.ex diff --git a/lib/explorer/workers/import_receipt.ex b/apps/explorer/lib/explorer/workers/import_receipt.ex similarity index 100% rename from lib/explorer/workers/import_receipt.ex rename to apps/explorer/lib/explorer/workers/import_receipt.ex diff --git a/lib/explorer/workers/import_skipped_blocks.ex b/apps/explorer/lib/explorer/workers/import_skipped_blocks.ex similarity index 100% rename from lib/explorer/workers/import_skipped_blocks.ex rename to apps/explorer/lib/explorer/workers/import_skipped_blocks.ex diff --git a/lib/explorer/workers/import_transaction.ex b/apps/explorer/lib/explorer/workers/import_transaction.ex similarity index 100% rename from lib/explorer/workers/import_transaction.ex rename to apps/explorer/lib/explorer/workers/import_transaction.ex diff --git a/lib/explorer/workers/refresh_balance.ex b/apps/explorer/lib/explorer/workers/refresh_balance.ex similarity index 100% rename from lib/explorer/workers/refresh_balance.ex rename to apps/explorer/lib/explorer/workers/refresh_balance.ex diff --git a/lib/explorer_web.ex b/apps/explorer/lib/explorer_web.ex similarity index 100% rename from lib/explorer_web.ex rename to apps/explorer/lib/explorer_web.ex diff --git a/lib/explorer_web/channels/user_socket.ex b/apps/explorer/lib/explorer_web/channels/user_socket.ex similarity index 100% rename from lib/explorer_web/channels/user_socket.ex rename to apps/explorer/lib/explorer_web/channels/user_socket.ex diff --git a/lib/explorer_web/controllers/address_controller.ex b/apps/explorer/lib/explorer_web/controllers/address_controller.ex similarity index 100% rename from lib/explorer_web/controllers/address_controller.ex rename to apps/explorer/lib/explorer_web/controllers/address_controller.ex diff --git a/lib/explorer_web/controllers/address_transaction_from_controller.ex b/apps/explorer/lib/explorer_web/controllers/address_transaction_from_controller.ex similarity index 100% rename from lib/explorer_web/controllers/address_transaction_from_controller.ex rename to apps/explorer/lib/explorer_web/controllers/address_transaction_from_controller.ex diff --git a/lib/explorer_web/controllers/address_transaction_to_controller.ex b/apps/explorer/lib/explorer_web/controllers/address_transaction_to_controller.ex similarity index 100% rename from lib/explorer_web/controllers/address_transaction_to_controller.ex rename to apps/explorer/lib/explorer_web/controllers/address_transaction_to_controller.ex diff --git a/lib/explorer_web/controllers/block_controller.ex b/apps/explorer/lib/explorer_web/controllers/block_controller.ex similarity index 100% rename from lib/explorer_web/controllers/block_controller.ex rename to apps/explorer/lib/explorer_web/controllers/block_controller.ex diff --git a/lib/explorer_web/controllers/block_transaction_controller.ex b/apps/explorer/lib/explorer_web/controllers/block_transaction_controller.ex similarity index 100% rename from lib/explorer_web/controllers/block_transaction_controller.ex rename to apps/explorer/lib/explorer_web/controllers/block_transaction_controller.ex diff --git a/lib/explorer_web/controllers/chain_controller.ex b/apps/explorer/lib/explorer_web/controllers/chain_controller.ex similarity index 100% rename from lib/explorer_web/controllers/chain_controller.ex rename to apps/explorer/lib/explorer_web/controllers/chain_controller.ex diff --git a/lib/explorer_web/controllers/internal_transaction_controller.ex b/apps/explorer/lib/explorer_web/controllers/internal_transaction_controller.ex similarity index 100% rename from lib/explorer_web/controllers/internal_transaction_controller.ex rename to apps/explorer/lib/explorer_web/controllers/internal_transaction_controller.ex diff --git a/lib/explorer_web/controllers/pending_transaction_controller.ex b/apps/explorer/lib/explorer_web/controllers/pending_transaction_controller.ex similarity index 100% rename from lib/explorer_web/controllers/pending_transaction_controller.ex rename to apps/explorer/lib/explorer_web/controllers/pending_transaction_controller.ex diff --git a/lib/explorer_web/controllers/transaction_controller.ex b/apps/explorer/lib/explorer_web/controllers/transaction_controller.ex similarity index 100% rename from lib/explorer_web/controllers/transaction_controller.ex rename to apps/explorer/lib/explorer_web/controllers/transaction_controller.ex diff --git a/lib/explorer_web/controllers/transaction_log_controller.ex b/apps/explorer/lib/explorer_web/controllers/transaction_log_controller.ex similarity index 100% rename from lib/explorer_web/controllers/transaction_log_controller.ex rename to apps/explorer/lib/explorer_web/controllers/transaction_log_controller.ex diff --git a/lib/explorer_web/endpoint.ex b/apps/explorer/lib/explorer_web/endpoint.ex similarity index 100% rename from lib/explorer_web/endpoint.ex rename to apps/explorer/lib/explorer_web/endpoint.ex diff --git a/lib/explorer_web/gettext.ex b/apps/explorer/lib/explorer_web/gettext.ex similarity index 100% rename from lib/explorer_web/gettext.ex rename to apps/explorer/lib/explorer_web/gettext.ex diff --git a/lib/explorer_web/router.ex b/apps/explorer/lib/explorer_web/router.ex similarity index 100% rename from lib/explorer_web/router.ex rename to apps/explorer/lib/explorer_web/router.ex diff --git a/lib/explorer_web/templates/address/show.html.eex b/apps/explorer/lib/explorer_web/templates/address/show.html.eex similarity index 100% rename from lib/explorer_web/templates/address/show.html.eex rename to apps/explorer/lib/explorer_web/templates/address/show.html.eex diff --git a/lib/explorer_web/templates/address_transaction_from/index.html.eex b/apps/explorer/lib/explorer_web/templates/address_transaction_from/index.html.eex similarity index 100% rename from lib/explorer_web/templates/address_transaction_from/index.html.eex rename to apps/explorer/lib/explorer_web/templates/address_transaction_from/index.html.eex diff --git a/lib/explorer_web/templates/address_transaction_to/index.html.eex b/apps/explorer/lib/explorer_web/templates/address_transaction_to/index.html.eex similarity index 100% rename from lib/explorer_web/templates/address_transaction_to/index.html.eex rename to apps/explorer/lib/explorer_web/templates/address_transaction_to/index.html.eex diff --git a/lib/explorer_web/templates/block/index.html.eex b/apps/explorer/lib/explorer_web/templates/block/index.html.eex similarity index 100% rename from lib/explorer_web/templates/block/index.html.eex rename to apps/explorer/lib/explorer_web/templates/block/index.html.eex diff --git a/lib/explorer_web/templates/block/show.html.eex b/apps/explorer/lib/explorer_web/templates/block/show.html.eex similarity index 100% rename from lib/explorer_web/templates/block/show.html.eex rename to apps/explorer/lib/explorer_web/templates/block/show.html.eex diff --git a/lib/explorer_web/templates/block_transaction/index.html.eex b/apps/explorer/lib/explorer_web/templates/block_transaction/index.html.eex similarity index 100% rename from lib/explorer_web/templates/block_transaction/index.html.eex rename to apps/explorer/lib/explorer_web/templates/block_transaction/index.html.eex diff --git a/lib/explorer_web/templates/chain/show.html.eex b/apps/explorer/lib/explorer_web/templates/chain/show.html.eex similarity index 100% rename from lib/explorer_web/templates/chain/show.html.eex rename to apps/explorer/lib/explorer_web/templates/chain/show.html.eex diff --git a/lib/explorer_web/templates/internal_transaction/index.html.eex b/apps/explorer/lib/explorer_web/templates/internal_transaction/index.html.eex similarity index 100% rename from lib/explorer_web/templates/internal_transaction/index.html.eex rename to apps/explorer/lib/explorer_web/templates/internal_transaction/index.html.eex diff --git a/lib/explorer_web/templates/layout/_footer.html.eex b/apps/explorer/lib/explorer_web/templates/layout/_footer.html.eex similarity index 100% rename from lib/explorer_web/templates/layout/_footer.html.eex rename to apps/explorer/lib/explorer_web/templates/layout/_footer.html.eex diff --git a/lib/explorer_web/templates/layout/_header.html.eex b/apps/explorer/lib/explorer_web/templates/layout/_header.html.eex similarity index 100% rename from lib/explorer_web/templates/layout/_header.html.eex rename to apps/explorer/lib/explorer_web/templates/layout/_header.html.eex diff --git a/lib/explorer_web/templates/layout/app.html.eex b/apps/explorer/lib/explorer_web/templates/layout/app.html.eex similarity index 100% rename from lib/explorer_web/templates/layout/app.html.eex rename to apps/explorer/lib/explorer_web/templates/layout/app.html.eex diff --git a/lib/explorer_web/templates/pending_transaction/index.html.eex b/apps/explorer/lib/explorer_web/templates/pending_transaction/index.html.eex similarity index 100% rename from lib/explorer_web/templates/pending_transaction/index.html.eex rename to apps/explorer/lib/explorer_web/templates/pending_transaction/index.html.eex diff --git a/lib/explorer_web/templates/transaction/index.html.eex b/apps/explorer/lib/explorer_web/templates/transaction/index.html.eex similarity index 100% rename from lib/explorer_web/templates/transaction/index.html.eex rename to apps/explorer/lib/explorer_web/templates/transaction/index.html.eex diff --git a/lib/explorer_web/templates/transaction/show.html.eex b/apps/explorer/lib/explorer_web/templates/transaction/show.html.eex similarity index 100% rename from lib/explorer_web/templates/transaction/show.html.eex rename to apps/explorer/lib/explorer_web/templates/transaction/show.html.eex diff --git a/lib/explorer_web/templates/transaction_log/index.html.eex b/apps/explorer/lib/explorer_web/templates/transaction_log/index.html.eex similarity index 100% rename from lib/explorer_web/templates/transaction_log/index.html.eex rename to apps/explorer/lib/explorer_web/templates/transaction_log/index.html.eex diff --git a/lib/explorer_web/views/address_transaction_from_view.ex b/apps/explorer/lib/explorer_web/views/address_transaction_from_view.ex similarity index 100% rename from lib/explorer_web/views/address_transaction_from_view.ex rename to apps/explorer/lib/explorer_web/views/address_transaction_from_view.ex diff --git a/lib/explorer_web/views/address_transaction_to_view.ex b/apps/explorer/lib/explorer_web/views/address_transaction_to_view.ex similarity index 100% rename from lib/explorer_web/views/address_transaction_to_view.ex rename to apps/explorer/lib/explorer_web/views/address_transaction_to_view.ex diff --git a/lib/explorer_web/views/address_view.ex b/apps/explorer/lib/explorer_web/views/address_view.ex similarity index 100% rename from lib/explorer_web/views/address_view.ex rename to apps/explorer/lib/explorer_web/views/address_view.ex diff --git a/lib/explorer_web/views/block_transaction_view.ex b/apps/explorer/lib/explorer_web/views/block_transaction_view.ex similarity index 100% rename from lib/explorer_web/views/block_transaction_view.ex rename to apps/explorer/lib/explorer_web/views/block_transaction_view.ex diff --git a/lib/explorer_web/views/block_view.ex b/apps/explorer/lib/explorer_web/views/block_view.ex similarity index 100% rename from lib/explorer_web/views/block_view.ex rename to apps/explorer/lib/explorer_web/views/block_view.ex diff --git a/lib/explorer_web/views/chain_view.ex b/apps/explorer/lib/explorer_web/views/chain_view.ex similarity index 100% rename from lib/explorer_web/views/chain_view.ex rename to apps/explorer/lib/explorer_web/views/chain_view.ex diff --git a/lib/explorer_web/views/error_helpers.ex b/apps/explorer/lib/explorer_web/views/error_helpers.ex similarity index 100% rename from lib/explorer_web/views/error_helpers.ex rename to apps/explorer/lib/explorer_web/views/error_helpers.ex diff --git a/lib/explorer_web/views/error_view.ex b/apps/explorer/lib/explorer_web/views/error_view.ex similarity index 100% rename from lib/explorer_web/views/error_view.ex rename to apps/explorer/lib/explorer_web/views/error_view.ex diff --git a/lib/explorer_web/views/internal_transaction_view.ex b/apps/explorer/lib/explorer_web/views/internal_transaction_view.ex similarity index 100% rename from lib/explorer_web/views/internal_transaction_view.ex rename to apps/explorer/lib/explorer_web/views/internal_transaction_view.ex diff --git a/lib/explorer_web/views/layout_view.ex b/apps/explorer/lib/explorer_web/views/layout_view.ex similarity index 100% rename from lib/explorer_web/views/layout_view.ex rename to apps/explorer/lib/explorer_web/views/layout_view.ex diff --git a/lib/explorer_web/views/pending_transaction_view.ex b/apps/explorer/lib/explorer_web/views/pending_transaction_view.ex similarity index 100% rename from lib/explorer_web/views/pending_transaction_view.ex rename to apps/explorer/lib/explorer_web/views/pending_transaction_view.ex diff --git a/lib/explorer_web/views/transaction_log_view.ex b/apps/explorer/lib/explorer_web/views/transaction_log_view.ex similarity index 100% rename from lib/explorer_web/views/transaction_log_view.ex rename to apps/explorer/lib/explorer_web/views/transaction_log_view.ex diff --git a/lib/explorer_web/views/transaction_view.ex b/apps/explorer/lib/explorer_web/views/transaction_view.ex similarity index 100% rename from lib/explorer_web/views/transaction_view.ex rename to apps/explorer/lib/explorer_web/views/transaction_view.ex diff --git a/lib/giant_address_migrator.ex b/apps/explorer/lib/giant_address_migrator.ex similarity index 100% rename from lib/giant_address_migrator.ex rename to apps/explorer/lib/giant_address_migrator.ex diff --git a/lib/mix/tasks/exq.start.ex b/apps/explorer/lib/mix/tasks/exq.start.ex similarity index 100% rename from lib/mix/tasks/exq.start.ex rename to apps/explorer/lib/mix/tasks/exq.start.ex diff --git a/lib/mix/tasks/scrape.balances.ex b/apps/explorer/lib/mix/tasks/scrape.balances.ex similarity index 100% rename from lib/mix/tasks/scrape.balances.ex rename to apps/explorer/lib/mix/tasks/scrape.balances.ex diff --git a/lib/mix/tasks/scrape.blocks.ex b/apps/explorer/lib/mix/tasks/scrape.blocks.ex similarity index 100% rename from lib/mix/tasks/scrape.blocks.ex rename to apps/explorer/lib/mix/tasks/scrape.blocks.ex diff --git a/lib/mix/tasks/scrape.internal_transactions.ex b/apps/explorer/lib/mix/tasks/scrape.internal_transactions.ex similarity index 100% rename from lib/mix/tasks/scrape.internal_transactions.ex rename to apps/explorer/lib/mix/tasks/scrape.internal_transactions.ex diff --git a/lib/mix/tasks/scrape.receipts.ex b/apps/explorer/lib/mix/tasks/scrape.receipts.ex similarity index 100% rename from lib/mix/tasks/scrape.receipts.ex rename to apps/explorer/lib/mix/tasks/scrape.receipts.ex diff --git a/apps/explorer/mix.exs b/apps/explorer/mix.exs new file mode 100644 index 0000000000..7f572fb660 --- /dev/null +++ b/apps/explorer/mix.exs @@ -0,0 +1,130 @@ +defmodule Explorer.Mixfile do + use Mix.Project + + def project do + [ + aliases: aliases(), + app: :explorer, + build_path: "../../_build", + config_path: "../../config/config.exs", + compilers: [:phoenix, :gettext | Mix.compilers()], + deps: deps(), + deps_path: "../../deps", + dialyzer: [ + plt_add_deps: :transitive, + plt_add_apps: [:mix], + ignore_warnings: "../../.dialyzer-ignore" + ], + elixir: "~> 1.4", + elixirc_paths: elixirc_paths(Mix.env()), + lock_file: "../../mix.lock", + package: package(), + start_permanent: Mix.env() == :prod, + version: "0.0.1" + ] + end + + # Configuration for the OTP application. + # + # Type `mix help compile.app` for more information. + def application do + [ + mod: {Explorer.Application, []}, + extra_applications: extra_applications(Mix.env()) + ] + end + + # Specifies which paths to compile per environment. + defp elixirc_paths(:test), do: ["test/support" | elixirc_paths()] + defp elixirc_paths(_), do: elixirc_paths() + defp elixirc_paths, do: ["lib"] + + # Specifies extra applications to start per environment + defp extra_applications(:prod), + do: [:phoenix_pubsub_redis, :exq, :exq_ui | extra_applications()] + + defp extra_applications(:dev), do: [:exq, :exq_ui | extra_applications()] + defp extra_applications(_), do: extra_applications() + + defp extra_applications, + do: [ + :scrivener_ecto, + :scrivener_html, + :ex_cldr, + :ex_jasmine, + :ethereumex, + :timex, + :timex_ecto, + :crontab, + :set_locale, + :logger, + :runtime_tools, + :new_relixir + ] + + # Specifies your project dependencies. + # + # Type `mix help deps` for examples and options. + defp deps do + [ + {:cowboy, "~> 1.0"}, + {:credo, "~> 0.8", only: [:dev, :test], runtime: false}, + {:crontab, "~> 1.1"}, + {:dialyxir, "~> 0.5", only: [:dev, :test], runtime: false}, + {:ethereumex, "~> 0.3"}, + {:ex_cldr_numbers, "~> 1.0"}, + {:ex_cldr_units, "~> 1.0"}, + {:ex_jasmine, github: "minifast/ex_jasmine", branch: "master"}, + {:ex_machina, "~> 2.1", only: [:test]}, + {:exq, "~> 0.9.1"}, + {:exq_ui, "~> 0.9.0"}, + {:exvcr, "~> 0.10", only: :test}, + {:flow, "~> 0.12"}, + {:gettext, "~> 0.11"}, + {:httpoison, "~> 1.0", override: true}, + {:junit_formatter, ">= 0.0.0", only: [:test], runtime: false}, + {:math, "~> 0.3.0"}, + {:mock, "~> 0.3.0", only: [:test], runtime: false}, + {:new_relixir, "~> 0.4"}, + {:phoenix, "~> 1.3.0"}, + {:phoenix_ecto, "~> 3.2"}, + {:phoenix_html, "~> 2.10"}, + {:phoenix_live_reload, "~> 1.0", only: [:dev]}, + {:phoenix_pubsub, "~> 1.0"}, + {:phoenix_pubsub_redis, "~> 2.1.0", only: [:prod]}, + {:postgrex, ">= 0.0.0"}, + {:quantum, "~> 2.2.1"}, + {:react_phoenix, "~> 0.5"}, + {:scrivener_ecto, "~> 1.0"}, + {:scrivener_html, "~> 1.7"}, + # Waiting on https://github.com/smeevil/set_locale/pull/9 + {:set_locale, github: "minifast/set_locale", branch: "master"}, + {:sobelow, ">= 0.0.0", only: [:dev, :test], runtime: false}, + {:timex, "~> 3.1.24"}, + {:timex_ecto, "~> 3.2.1"}, + {:wallaby, "~> 0.19.2", only: [:test], runtime: false} + ] + end + + # Aliases are shortcuts or tasks specific to the current project. + # For example, to create, migrate and run the seeds file at once: + # + # $ mix ecto.setup + # + # See the documentation for `Mix` for more info on aliases. + defp aliases do + [ + "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], + "ecto.reset": ["ecto.drop", "ecto.setup"], + test: ["ecto.create --quiet", "ecto.migrate", "test"] + ] + end + + defp package do + [ + maintainers: ["POA Networks Ltd."], + licenses: ["GPL 3.0"], + links: %{"GitHub" => "https://github.com/poanetwork/poa-explorer"} + ] + end +end diff --git a/priv/gettext/default.pot b/apps/explorer/priv/gettext/default.pot similarity index 100% rename from priv/gettext/default.pot rename to apps/explorer/priv/gettext/default.pot diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/apps/explorer/priv/gettext/en/LC_MESSAGES/default.po similarity index 100% rename from priv/gettext/en/LC_MESSAGES/default.po rename to apps/explorer/priv/gettext/en/LC_MESSAGES/default.po diff --git a/priv/gettext/en/LC_MESSAGES/errors.po b/apps/explorer/priv/gettext/en/LC_MESSAGES/errors.po similarity index 100% rename from priv/gettext/en/LC_MESSAGES/errors.po rename to apps/explorer/priv/gettext/en/LC_MESSAGES/errors.po diff --git a/priv/gettext/errors.pot b/apps/explorer/priv/gettext/errors.pot similarity index 100% rename from priv/gettext/errors.pot rename to apps/explorer/priv/gettext/errors.pot diff --git a/priv/repo/migrations/.gitkeep b/apps/explorer/priv/repo/migrations/.gitkeep similarity index 100% rename from priv/repo/migrations/.gitkeep rename to apps/explorer/priv/repo/migrations/.gitkeep diff --git a/priv/repo/migrations/20180117221921_create_blocks.exs b/apps/explorer/priv/repo/migrations/20180117221921_create_blocks.exs similarity index 100% rename from priv/repo/migrations/20180117221921_create_blocks.exs rename to apps/explorer/priv/repo/migrations/20180117221921_create_blocks.exs diff --git a/priv/repo/migrations/20180117221922_create_transactions.exs b/apps/explorer/priv/repo/migrations/20180117221922_create_transactions.exs similarity index 100% rename from priv/repo/migrations/20180117221922_create_transactions.exs rename to apps/explorer/priv/repo/migrations/20180117221922_create_transactions.exs diff --git a/priv/repo/migrations/20180124003303_add_value_to_transactions.exs b/apps/explorer/priv/repo/migrations/20180124003303_add_value_to_transactions.exs similarity index 100% rename from priv/repo/migrations/20180124003303_add_value_to_transactions.exs rename to apps/explorer/priv/repo/migrations/20180124003303_add_value_to_transactions.exs diff --git a/priv/repo/migrations/20180129201141_add_fields_to_transactions.exs b/apps/explorer/priv/repo/migrations/20180129201141_add_fields_to_transactions.exs similarity index 100% rename from priv/repo/migrations/20180129201141_add_fields_to_transactions.exs rename to apps/explorer/priv/repo/migrations/20180129201141_add_fields_to_transactions.exs diff --git a/priv/repo/migrations/20180130001125_create_address.exs b/apps/explorer/priv/repo/migrations/20180130001125_create_address.exs similarity index 100% rename from priv/repo/migrations/20180130001125_create_address.exs rename to apps/explorer/priv/repo/migrations/20180130001125_create_address.exs diff --git a/priv/repo/migrations/20180130004126_create_from_addresses.exs b/apps/explorer/priv/repo/migrations/20180130004126_create_from_addresses.exs similarity index 100% rename from priv/repo/migrations/20180130004126_create_from_addresses.exs rename to apps/explorer/priv/repo/migrations/20180130004126_create_from_addresses.exs diff --git a/priv/repo/migrations/20180130004544_create_to_addresses.exs b/apps/explorer/priv/repo/migrations/20180130004544_create_to_addresses.exs similarity index 100% rename from priv/repo/migrations/20180130004544_create_to_addresses.exs rename to apps/explorer/priv/repo/migrations/20180130004544_create_to_addresses.exs diff --git a/priv/repo/migrations/20180202195342_create_block_transactions.exs b/apps/explorer/priv/repo/migrations/20180202195342_create_block_transactions.exs similarity index 100% rename from priv/repo/migrations/20180202195342_create_block_transactions.exs rename to apps/explorer/priv/repo/migrations/20180202195342_create_block_transactions.exs diff --git a/priv/repo/migrations/20180202215933_remove_block_id_from_transactions.exs b/apps/explorer/priv/repo/migrations/20180202215933_remove_block_id_from_transactions.exs similarity index 100% rename from priv/repo/migrations/20180202215933_remove_block_id_from_transactions.exs rename to apps/explorer/priv/repo/migrations/20180202215933_remove_block_id_from_transactions.exs diff --git a/priv/repo/migrations/20180208010839_add_indices_to_block_and_block_transaction.exs b/apps/explorer/priv/repo/migrations/20180208010839_add_indices_to_block_and_block_transaction.exs similarity index 100% rename from priv/repo/migrations/20180208010839_add_indices_to_block_and_block_transaction.exs rename to apps/explorer/priv/repo/migrations/20180208010839_add_indices_to_block_and_block_transaction.exs diff --git a/priv/repo/migrations/20180208054620_add_transactions_index_to_timestamps.exs b/apps/explorer/priv/repo/migrations/20180208054620_add_transactions_index_to_timestamps.exs similarity index 100% rename from priv/repo/migrations/20180208054620_add_transactions_index_to_timestamps.exs rename to apps/explorer/priv/repo/migrations/20180208054620_add_transactions_index_to_timestamps.exs diff --git a/priv/repo/migrations/20180212214442_create_receipts.exs b/apps/explorer/priv/repo/migrations/20180212214442_create_receipts.exs similarity index 100% rename from priv/repo/migrations/20180212214442_create_receipts.exs rename to apps/explorer/priv/repo/migrations/20180212214442_create_receipts.exs diff --git a/priv/repo/migrations/20180212222309_create_logs.exs b/apps/explorer/priv/repo/migrations/20180212222309_create_logs.exs similarity index 100% rename from priv/repo/migrations/20180212222309_create_logs.exs rename to apps/explorer/priv/repo/migrations/20180212222309_create_logs.exs diff --git a/priv/repo/migrations/20180216011950_create_balances_views.exs b/apps/explorer/priv/repo/migrations/20180216011950_create_balances_views.exs similarity index 100% rename from priv/repo/migrations/20180216011950_create_balances_views.exs rename to apps/explorer/priv/repo/migrations/20180216011950_create_balances_views.exs diff --git a/priv/repo/migrations/20180221001948_create_internal_transactions.exs b/apps/explorer/priv/repo/migrations/20180221001948_create_internal_transactions.exs similarity index 100% rename from priv/repo/migrations/20180221001948_create_internal_transactions.exs rename to apps/explorer/priv/repo/migrations/20180221001948_create_internal_transactions.exs diff --git a/priv/repo/migrations/20180223220816_move_address_keys_to_transactions.exs b/apps/explorer/priv/repo/migrations/20180223220816_move_address_keys_to_transactions.exs similarity index 100% rename from priv/repo/migrations/20180223220816_move_address_keys_to_transactions.exs rename to apps/explorer/priv/repo/migrations/20180223220816_move_address_keys_to_transactions.exs diff --git a/priv/repo/migrations/20180223223257_index_transaction_address_ids.exs b/apps/explorer/priv/repo/migrations/20180223223257_index_transaction_address_ids.exs similarity index 100% rename from priv/repo/migrations/20180223223257_index_transaction_address_ids.exs rename to apps/explorer/priv/repo/migrations/20180223223257_index_transaction_address_ids.exs diff --git a/priv/repo/migrations/20180224004300_update_credit_debit_materialized_view.exs b/apps/explorer/priv/repo/migrations/20180224004300_update_credit_debit_materialized_view.exs similarity index 100% rename from priv/repo/migrations/20180224004300_update_credit_debit_materialized_view.exs rename to apps/explorer/priv/repo/migrations/20180224004300_update_credit_debit_materialized_view.exs diff --git a/priv/repo/migrations/20180227004146_dedup_internal_transactions_and_add_unique_index.exs b/apps/explorer/priv/repo/migrations/20180227004146_dedup_internal_transactions_and_add_unique_index.exs similarity index 100% rename from priv/repo/migrations/20180227004146_dedup_internal_transactions_and_add_unique_index.exs rename to apps/explorer/priv/repo/migrations/20180227004146_dedup_internal_transactions_and_add_unique_index.exs diff --git a/priv/repo/migrations/20180227225553_add_balance_and_balance_updated_at_to_address.exs b/apps/explorer/priv/repo/migrations/20180227225553_add_balance_and_balance_updated_at_to_address.exs similarity index 100% rename from priv/repo/migrations/20180227225553_add_balance_and_balance_updated_at_to_address.exs rename to apps/explorer/priv/repo/migrations/20180227225553_add_balance_and_balance_updated_at_to_address.exs diff --git a/priv/repo/migrations/20180301013446_add_receipt_id_to_transactions.exs b/apps/explorer/priv/repo/migrations/20180301013446_add_receipt_id_to_transactions.exs similarity index 100% rename from priv/repo/migrations/20180301013446_add_receipt_id_to_transactions.exs rename to apps/explorer/priv/repo/migrations/20180301013446_add_receipt_id_to_transactions.exs diff --git a/priv/repo/seeds.exs b/apps/explorer/priv/repo/seeds.exs similarity index 100% rename from priv/repo/seeds.exs rename to apps/explorer/priv/repo/seeds.exs diff --git a/test/explorer/address_test.exs b/apps/explorer/test/explorer/address_test.exs similarity index 100% rename from test/explorer/address_test.exs rename to apps/explorer/test/explorer/address_test.exs diff --git a/test/explorer/block_test.exs b/apps/explorer/test/explorer/block_test.exs similarity index 100% rename from test/explorer/block_test.exs rename to apps/explorer/test/explorer/block_test.exs diff --git a/test/explorer/block_transaction_test.exs b/apps/explorer/test/explorer/block_transaction_test.exs similarity index 100% rename from test/explorer/block_transaction_test.exs rename to apps/explorer/test/explorer/block_transaction_test.exs diff --git a/test/explorer/chain_test.exs b/apps/explorer/test/explorer/chain_test.exs similarity index 100% rename from test/explorer/chain_test.exs rename to apps/explorer/test/explorer/chain_test.exs diff --git a/test/explorer/credit_test.exs b/apps/explorer/test/explorer/credit_test.exs similarity index 100% rename from test/explorer/credit_test.exs rename to apps/explorer/test/explorer/credit_test.exs diff --git a/test/explorer/debit_test.exs b/apps/explorer/test/explorer/debit_test.exs similarity index 100% rename from test/explorer/debit_test.exs rename to apps/explorer/test/explorer/debit_test.exs diff --git a/test/explorer/ethereum/ethereum_test.exs b/apps/explorer/test/explorer/ethereum/ethereum_test.exs similarity index 100% rename from test/explorer/ethereum/ethereum_test.exs rename to apps/explorer/test/explorer/ethereum/ethereum_test.exs diff --git a/test/explorer/ethereumex_extensions_test.exs b/apps/explorer/test/explorer/ethereumex_extensions_test.exs similarity index 100% rename from test/explorer/ethereumex_extensions_test.exs rename to apps/explorer/test/explorer/ethereumex_extensions_test.exs diff --git a/test/explorer/forms/block_form_test.exs b/apps/explorer/test/explorer/forms/block_form_test.exs similarity index 100% rename from test/explorer/forms/block_form_test.exs rename to apps/explorer/test/explorer/forms/block_form_test.exs diff --git a/test/explorer/forms/pending_transaction_form_test.exs b/apps/explorer/test/explorer/forms/pending_transaction_form_test.exs similarity index 100% rename from test/explorer/forms/pending_transaction_form_test.exs rename to apps/explorer/test/explorer/forms/pending_transaction_form_test.exs diff --git a/test/explorer/forms/transaction_form_test.exs b/apps/explorer/test/explorer/forms/transaction_form_test.exs similarity index 100% rename from test/explorer/forms/transaction_form_test.exs rename to apps/explorer/test/explorer/forms/transaction_form_test.exs diff --git a/test/explorer/from_address_test.exs b/apps/explorer/test/explorer/from_address_test.exs similarity index 100% rename from test/explorer/from_address_test.exs rename to apps/explorer/test/explorer/from_address_test.exs diff --git a/test/explorer/importers/balance_importer_test.exs b/apps/explorer/test/explorer/importers/balance_importer_test.exs similarity index 100% rename from test/explorer/importers/balance_importer_test.exs rename to apps/explorer/test/explorer/importers/balance_importer_test.exs diff --git a/test/explorer/importers/block_importer_test.exs b/apps/explorer/test/explorer/importers/block_importer_test.exs similarity index 100% rename from test/explorer/importers/block_importer_test.exs rename to apps/explorer/test/explorer/importers/block_importer_test.exs diff --git a/test/explorer/importers/internal_transaction_importer_test.exs b/apps/explorer/test/explorer/importers/internal_transaction_importer_test.exs similarity index 100% rename from test/explorer/importers/internal_transaction_importer_test.exs rename to apps/explorer/test/explorer/importers/internal_transaction_importer_test.exs diff --git a/test/explorer/importers/receipt_importer_test.exs b/apps/explorer/test/explorer/importers/receipt_importer_test.exs similarity index 100% rename from test/explorer/importers/receipt_importer_test.exs rename to apps/explorer/test/explorer/importers/receipt_importer_test.exs diff --git a/test/explorer/importers/transaction_importer_test.exs b/apps/explorer/test/explorer/importers/transaction_importer_test.exs similarity index 100% rename from test/explorer/importers/transaction_importer_test.exs rename to apps/explorer/test/explorer/importers/transaction_importer_test.exs diff --git a/test/explorer/internal_transaction_test.exs b/apps/explorer/test/explorer/internal_transaction_test.exs similarity index 100% rename from test/explorer/internal_transaction_test.exs rename to apps/explorer/test/explorer/internal_transaction_test.exs diff --git a/test/explorer/log_test.exs b/apps/explorer/test/explorer/log_test.exs similarity index 100% rename from test/explorer/log_test.exs rename to apps/explorer/test/explorer/log_test.exs diff --git a/test/explorer/receipt_test.exs b/apps/explorer/test/explorer/receipt_test.exs similarity index 100% rename from test/explorer/receipt_test.exs rename to apps/explorer/test/explorer/receipt_test.exs diff --git a/test/explorer/resource_test.exs b/apps/explorer/test/explorer/resource_test.exs similarity index 100% rename from test/explorer/resource_test.exs rename to apps/explorer/test/explorer/resource_test.exs diff --git a/test/explorer/servers/chain_statistics_test.exs b/apps/explorer/test/explorer/servers/chain_statistics_test.exs similarity index 100% rename from test/explorer/servers/chain_statistics_test.exs rename to apps/explorer/test/explorer/servers/chain_statistics_test.exs diff --git a/test/explorer/services/address_test.exs b/apps/explorer/test/explorer/services/address_test.exs similarity index 100% rename from test/explorer/services/address_test.exs rename to apps/explorer/test/explorer/services/address_test.exs diff --git a/test/explorer/services/transaction_test.exs b/apps/explorer/test/explorer/services/transaction_test.exs similarity index 100% rename from test/explorer/services/transaction_test.exs rename to apps/explorer/test/explorer/services/transaction_test.exs diff --git a/test/explorer/skipped_balances_test.exs b/apps/explorer/test/explorer/skipped_balances_test.exs similarity index 100% rename from test/explorer/skipped_balances_test.exs rename to apps/explorer/test/explorer/skipped_balances_test.exs diff --git a/test/explorer/skipped_blocks_test.exs b/apps/explorer/test/explorer/skipped_blocks_test.exs similarity index 100% rename from test/explorer/skipped_blocks_test.exs rename to apps/explorer/test/explorer/skipped_blocks_test.exs diff --git a/test/explorer/skipped_internal_transactions_test.exs b/apps/explorer/test/explorer/skipped_internal_transactions_test.exs similarity index 100% rename from test/explorer/skipped_internal_transactions_test.exs rename to apps/explorer/test/explorer/skipped_internal_transactions_test.exs diff --git a/test/explorer/skipped_transactions_test.exs b/apps/explorer/test/explorer/skipped_transactions_test.exs similarity index 100% rename from test/explorer/skipped_transactions_test.exs rename to apps/explorer/test/explorer/skipped_transactions_test.exs diff --git a/test/explorer/to_address_test.exs b/apps/explorer/test/explorer/to_address_test.exs similarity index 100% rename from test/explorer/to_address_test.exs rename to apps/explorer/test/explorer/to_address_test.exs diff --git a/test/explorer/transaction_test.exs b/apps/explorer/test/explorer/transaction_test.exs similarity index 100% rename from test/explorer/transaction_test.exs rename to apps/explorer/test/explorer/transaction_test.exs diff --git a/test/explorer/workers/import_balance_test.exs b/apps/explorer/test/explorer/workers/import_balance_test.exs similarity index 100% rename from test/explorer/workers/import_balance_test.exs rename to apps/explorer/test/explorer/workers/import_balance_test.exs diff --git a/test/explorer/workers/import_block_test.exs b/apps/explorer/test/explorer/workers/import_block_test.exs similarity index 100% rename from test/explorer/workers/import_block_test.exs rename to apps/explorer/test/explorer/workers/import_block_test.exs diff --git a/test/explorer/workers/import_internal_transaction_test.exs b/apps/explorer/test/explorer/workers/import_internal_transaction_test.exs similarity index 100% rename from test/explorer/workers/import_internal_transaction_test.exs rename to apps/explorer/test/explorer/workers/import_internal_transaction_test.exs diff --git a/test/explorer/workers/import_receipt_test.exs b/apps/explorer/test/explorer/workers/import_receipt_test.exs similarity index 100% rename from test/explorer/workers/import_receipt_test.exs rename to apps/explorer/test/explorer/workers/import_receipt_test.exs diff --git a/test/explorer/workers/import_skipped_blocks_test.exs b/apps/explorer/test/explorer/workers/import_skipped_blocks_test.exs similarity index 100% rename from test/explorer/workers/import_skipped_blocks_test.exs rename to apps/explorer/test/explorer/workers/import_skipped_blocks_test.exs diff --git a/test/explorer/workers/import_transaction_test.exs b/apps/explorer/test/explorer/workers/import_transaction_test.exs similarity index 100% rename from test/explorer/workers/import_transaction_test.exs rename to apps/explorer/test/explorer/workers/import_transaction_test.exs diff --git a/test/explorer/workers/refresh_balance_test.exs b/apps/explorer/test/explorer/workers/refresh_balance_test.exs similarity index 100% rename from test/explorer/workers/refresh_balance_test.exs rename to apps/explorer/test/explorer/workers/refresh_balance_test.exs diff --git a/test/explorer_web/controllers/address_controller_test.exs b/apps/explorer/test/explorer_web/controllers/address_controller_test.exs similarity index 100% rename from test/explorer_web/controllers/address_controller_test.exs rename to apps/explorer/test/explorer_web/controllers/address_controller_test.exs diff --git a/test/explorer_web/controllers/address_transaction_from_controller_test.exs b/apps/explorer/test/explorer_web/controllers/address_transaction_from_controller_test.exs similarity index 100% rename from test/explorer_web/controllers/address_transaction_from_controller_test.exs rename to apps/explorer/test/explorer_web/controllers/address_transaction_from_controller_test.exs diff --git a/test/explorer_web/controllers/address_transaction_to_controller_test.exs b/apps/explorer/test/explorer_web/controllers/address_transaction_to_controller_test.exs similarity index 100% rename from test/explorer_web/controllers/address_transaction_to_controller_test.exs rename to apps/explorer/test/explorer_web/controllers/address_transaction_to_controller_test.exs diff --git a/test/explorer_web/controllers/block_controller_test.exs b/apps/explorer/test/explorer_web/controllers/block_controller_test.exs similarity index 100% rename from test/explorer_web/controllers/block_controller_test.exs rename to apps/explorer/test/explorer_web/controllers/block_controller_test.exs diff --git a/test/explorer_web/controllers/block_transaction_controller_test.exs b/apps/explorer/test/explorer_web/controllers/block_transaction_controller_test.exs similarity index 100% rename from test/explorer_web/controllers/block_transaction_controller_test.exs rename to apps/explorer/test/explorer_web/controllers/block_transaction_controller_test.exs diff --git a/test/explorer_web/controllers/chain_controller_test.exs b/apps/explorer/test/explorer_web/controllers/chain_controller_test.exs similarity index 100% rename from test/explorer_web/controllers/chain_controller_test.exs rename to apps/explorer/test/explorer_web/controllers/chain_controller_test.exs diff --git a/test/explorer_web/controllers/internal_transaction_controller_test.exs b/apps/explorer/test/explorer_web/controllers/internal_transaction_controller_test.exs similarity index 100% rename from test/explorer_web/controllers/internal_transaction_controller_test.exs rename to apps/explorer/test/explorer_web/controllers/internal_transaction_controller_test.exs diff --git a/test/explorer_web/controllers/pending_transaction_controller_test.exs b/apps/explorer/test/explorer_web/controllers/pending_transaction_controller_test.exs similarity index 100% rename from test/explorer_web/controllers/pending_transaction_controller_test.exs rename to apps/explorer/test/explorer_web/controllers/pending_transaction_controller_test.exs diff --git a/test/explorer_web/controllers/transaction_controller_test.exs b/apps/explorer/test/explorer_web/controllers/transaction_controller_test.exs similarity index 100% rename from test/explorer_web/controllers/transaction_controller_test.exs rename to apps/explorer/test/explorer_web/controllers/transaction_controller_test.exs diff --git a/test/explorer_web/controllers/transaction_log_controller_test.exs b/apps/explorer/test/explorer_web/controllers/transaction_log_controller_test.exs similarity index 100% rename from test/explorer_web/controllers/transaction_log_controller_test.exs rename to apps/explorer/test/explorer_web/controllers/transaction_log_controller_test.exs diff --git a/test/explorer_web/features/contributor_browsing_test.exs b/apps/explorer/test/explorer_web/features/contributor_browsing_test.exs similarity index 100% rename from test/explorer_web/features/contributor_browsing_test.exs rename to apps/explorer/test/explorer_web/features/contributor_browsing_test.exs diff --git a/test/explorer_web/features/exq_test.exs b/apps/explorer/test/explorer_web/features/exq_test.exs similarity index 100% rename from test/explorer_web/features/exq_test.exs rename to apps/explorer/test/explorer_web/features/exq_test.exs diff --git a/test/explorer_web/features/javascript_test.exs b/apps/explorer/test/explorer_web/features/javascript_test.exs similarity index 100% rename from test/explorer_web/features/javascript_test.exs rename to apps/explorer/test/explorer_web/features/javascript_test.exs diff --git a/test/explorer_web/views/chain_view_test.exs b/apps/explorer/test/explorer_web/views/chain_view_test.exs similarity index 100% rename from test/explorer_web/views/chain_view_test.exs rename to apps/explorer/test/explorer_web/views/chain_view_test.exs diff --git a/test/explorer_web/views/error_view_test.exs b/apps/explorer/test/explorer_web/views/error_view_test.exs similarity index 100% rename from test/explorer_web/views/error_view_test.exs rename to apps/explorer/test/explorer_web/views/error_view_test.exs diff --git a/test/explorer_web/views/layout_view_test.exs b/apps/explorer/test/explorer_web/views/layout_view_test.exs similarity index 100% rename from test/explorer_web/views/layout_view_test.exs rename to apps/explorer/test/explorer_web/views/layout_view_test.exs diff --git a/test/support/channel_case.ex b/apps/explorer/test/support/channel_case.ex similarity index 100% rename from test/support/channel_case.ex rename to apps/explorer/test/support/channel_case.ex diff --git a/test/support/conn_case.ex b/apps/explorer/test/support/conn_case.ex similarity index 100% rename from test/support/conn_case.ex rename to apps/explorer/test/support/conn_case.ex diff --git a/test/support/data_case.ex b/apps/explorer/test/support/data_case.ex similarity index 100% rename from test/support/data_case.ex rename to apps/explorer/test/support/data_case.ex diff --git a/test/support/factories/address_factory.ex b/apps/explorer/test/support/factories/address_factory.ex similarity index 100% rename from test/support/factories/address_factory.ex rename to apps/explorer/test/support/factories/address_factory.ex diff --git a/test/support/factories/block_factory.ex b/apps/explorer/test/support/factories/block_factory.ex similarity index 100% rename from test/support/factories/block_factory.ex rename to apps/explorer/test/support/factories/block_factory.ex diff --git a/test/support/factories/block_transaction_factory.ex b/apps/explorer/test/support/factories/block_transaction_factory.ex similarity index 100% rename from test/support/factories/block_transaction_factory.ex rename to apps/explorer/test/support/factories/block_transaction_factory.ex diff --git a/test/support/factories/from_address_factory.ex b/apps/explorer/test/support/factories/from_address_factory.ex similarity index 100% rename from test/support/factories/from_address_factory.ex rename to apps/explorer/test/support/factories/from_address_factory.ex diff --git a/test/support/factories/internal_transaction_factory.ex b/apps/explorer/test/support/factories/internal_transaction_factory.ex similarity index 100% rename from test/support/factories/internal_transaction_factory.ex rename to apps/explorer/test/support/factories/internal_transaction_factory.ex diff --git a/test/support/factories/log_factory.ex b/apps/explorer/test/support/factories/log_factory.ex similarity index 100% rename from test/support/factories/log_factory.ex rename to apps/explorer/test/support/factories/log_factory.ex diff --git a/test/support/factories/receipt_factory.ex b/apps/explorer/test/support/factories/receipt_factory.ex similarity index 100% rename from test/support/factories/receipt_factory.ex rename to apps/explorer/test/support/factories/receipt_factory.ex diff --git a/test/support/factories/to_address_factory.ex b/apps/explorer/test/support/factories/to_address_factory.ex similarity index 100% rename from test/support/factories/to_address_factory.ex rename to apps/explorer/test/support/factories/to_address_factory.ex diff --git a/test/support/factories/transaction_factory.ex b/apps/explorer/test/support/factories/transaction_factory.ex similarity index 100% rename from test/support/factories/transaction_factory.ex rename to apps/explorer/test/support/factories/transaction_factory.ex diff --git a/test/support/factory.ex b/apps/explorer/test/support/factory.ex similarity index 100% rename from test/support/factory.ex rename to apps/explorer/test/support/factory.ex diff --git a/test/support/feature_case.ex b/apps/explorer/test/support/feature_case.ex similarity index 100% rename from test/support/feature_case.ex rename to apps/explorer/test/support/feature_case.ex diff --git a/test/support/fixture/vcr_cassettes/.gitkeep b/apps/explorer/test/support/fixture/vcr_cassettes/.gitkeep similarity index 100% rename from test/support/fixture/vcr_cassettes/.gitkeep rename to apps/explorer/test/support/fixture/vcr_cassettes/.gitkeep diff --git a/test/support/fixture/vcr_cassettes/block_importer_download_block_1_downloads_the_block.json b/apps/explorer/test/support/fixture/vcr_cassettes/block_importer_download_block_1_downloads_the_block.json similarity index 100% rename from test/support/fixture/vcr_cassettes/block_importer_download_block_1_downloads_the_block.json rename to apps/explorer/test/support/fixture/vcr_cassettes/block_importer_download_block_1_downloads_the_block.json diff --git a/test/support/fixture/vcr_cassettes/block_importer_import_1_duplicate_block.json b/apps/explorer/test/support/fixture/vcr_cassettes/block_importer_import_1_duplicate_block.json similarity index 100% rename from test/support/fixture/vcr_cassettes/block_importer_import_1_duplicate_block.json rename to apps/explorer/test/support/fixture/vcr_cassettes/block_importer_import_1_duplicate_block.json diff --git a/test/support/fixture/vcr_cassettes/block_importer_import_1_pending.json b/apps/explorer/test/support/fixture/vcr_cassettes/block_importer_import_1_pending.json similarity index 100% rename from test/support/fixture/vcr_cassettes/block_importer_import_1_pending.json rename to apps/explorer/test/support/fixture/vcr_cassettes/block_importer_import_1_pending.json diff --git a/test/support/fixture/vcr_cassettes/block_importer_import_1_saves_the_block.json b/apps/explorer/test/support/fixture/vcr_cassettes/block_importer_import_1_saves_the_block.json similarity index 100% rename from test/support/fixture/vcr_cassettes/block_importer_import_1_saves_the_block.json rename to apps/explorer/test/support/fixture/vcr_cassettes/block_importer_import_1_saves_the_block.json diff --git a/test/support/fixture/vcr_cassettes/ethereumex_extensions_trace_transaction_1.json b/apps/explorer/test/support/fixture/vcr_cassettes/ethereumex_extensions_trace_transaction_1.json similarity index 100% rename from test/support/fixture/vcr_cassettes/ethereumex_extensions_trace_transaction_1.json rename to apps/explorer/test/support/fixture/vcr_cassettes/ethereumex_extensions_trace_transaction_1.json diff --git a/test/support/fixture/vcr_cassettes/import_block_perform_1_duplicate.json b/apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_1_duplicate.json similarity index 100% rename from test/support/fixture/vcr_cassettes/import_block_perform_1_duplicate.json rename to apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_1_duplicate.json diff --git a/test/support/fixture/vcr_cassettes/import_block_perform_1_earliest.json b/apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_1_earliest.json similarity index 100% rename from test/support/fixture/vcr_cassettes/import_block_perform_1_earliest.json rename to apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_1_earliest.json diff --git a/test/support/fixture/vcr_cassettes/import_block_perform_1_integer.json b/apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_1_integer.json similarity index 100% rename from test/support/fixture/vcr_cassettes/import_block_perform_1_integer.json rename to apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_1_integer.json diff --git a/test/support/fixture/vcr_cassettes/import_block_perform_1_latest.json b/apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_1_latest.json similarity index 100% rename from test/support/fixture/vcr_cassettes/import_block_perform_1_latest.json rename to apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_1_latest.json diff --git a/test/support/fixture/vcr_cassettes/import_block_perform_1_string.json b/apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_1_string.json similarity index 100% rename from test/support/fixture/vcr_cassettes/import_block_perform_1_string.json rename to apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_1_string.json diff --git a/test/support/fixture/vcr_cassettes/import_block_perform_later_1_latest.json b/apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_later_1_latest.json similarity index 100% rename from test/support/fixture/vcr_cassettes/import_block_perform_later_1_latest.json rename to apps/explorer/test/support/fixture/vcr_cassettes/import_block_perform_later_1_latest.json diff --git a/test/support/fixture/vcr_cassettes/import_internal_transaction_perform_1.json b/apps/explorer/test/support/fixture/vcr_cassettes/import_internal_transaction_perform_1.json similarity index 100% rename from test/support/fixture/vcr_cassettes/import_internal_transaction_perform_1.json rename to apps/explorer/test/support/fixture/vcr_cassettes/import_internal_transaction_perform_1.json diff --git a/test/support/fixture/vcr_cassettes/import_receipt_perform_1.json b/apps/explorer/test/support/fixture/vcr_cassettes/import_receipt_perform_1.json similarity index 100% rename from test/support/fixture/vcr_cassettes/import_receipt_perform_1.json rename to apps/explorer/test/support/fixture/vcr_cassettes/import_receipt_perform_1.json diff --git a/test/support/fixture/vcr_cassettes/import_skipped_blocks_perform_1.json b/apps/explorer/test/support/fixture/vcr_cassettes/import_skipped_blocks_perform_1.json similarity index 100% rename from test/support/fixture/vcr_cassettes/import_skipped_blocks_perform_1.json rename to apps/explorer/test/support/fixture/vcr_cassettes/import_skipped_blocks_perform_1.json diff --git a/test/support/fixture/vcr_cassettes/import_transaction_perform_1.json b/apps/explorer/test/support/fixture/vcr_cassettes/import_transaction_perform_1.json similarity index 100% rename from test/support/fixture/vcr_cassettes/import_transaction_perform_1.json rename to apps/explorer/test/support/fixture/vcr_cassettes/import_transaction_perform_1.json diff --git a/test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1.json b/apps/explorer/test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1.json similarity index 100% rename from test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1.json rename to apps/explorer/test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1.json diff --git a/test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1_from_core-trace.json b/apps/explorer/test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1_from_core-trace.json similarity index 100% rename from test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1_from_core-trace.json rename to apps/explorer/test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1_from_core-trace.json diff --git a/test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1_with_contract_creation.json b/apps/explorer/test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1_with_contract_creation.json similarity index 100% rename from test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1_with_contract_creation.json rename to apps/explorer/test/support/fixture/vcr_cassettes/internal_transaction_importer_import_1_with_contract_creation.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_binds_internal_transactions.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_binds_internal_transactions.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_binds_internal_transactions.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_binds_internal_transactions.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_creates_a_from_address.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_creates_a_from_address.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_creates_a_from_address.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_creates_a_from_address.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_creates_a_to_address.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_creates_a_to_address.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_creates_a_to_address.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_creates_a_to_address.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_creates_a_to_address_from_creates.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_creates_a_to_address_from_creates.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_creates_a_to_address_from_creates.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_creates_a_to_address_from_creates.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_download_transaction.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_download_transaction.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_download_transaction.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_download_transaction.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_download_transaction_with_a_bad_hash.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_download_transaction_with_a_bad_hash.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_download_transaction_with_a_bad_hash.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_download_transaction_with_a_bad_hash.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_import_1_failed.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_import_1_failed.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_import_1_failed.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_import_1_failed.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_import_1_out_of_gas.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_import_1_out_of_gas.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_import_1_out_of_gas.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_import_1_out_of_gas.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_import_1_pending.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_import_1_pending.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_import_1_pending.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_import_1_pending.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_import_1_receipt.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_import_1_receipt.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_import_1_receipt.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_import_1_receipt.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_import_saves_the_transaction.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_import_saves_the_transaction.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_import_saves_the_transaction.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_import_saves_the_transaction.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_saves_the_association.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_saves_the_association.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_saves_the_association.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_saves_the_association.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_txn_without_block.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_txn_without_block.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_txn_without_block.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_txn_without_block.json diff --git a/test/support/fixture/vcr_cassettes/transaction_importer_updates_the_association.json b/apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_updates_the_association.json similarity index 100% rename from test/support/fixture/vcr_cassettes/transaction_importer_updates_the_association.json rename to apps/explorer/test/support/fixture/vcr_cassettes/transaction_importer_updates_the_association.json diff --git a/test/test_helper.exs b/apps/explorer/test/test_helper.exs similarity index 100% rename from test/test_helper.exs rename to apps/explorer/test/test_helper.exs diff --git a/config/config.exs b/config/config.exs index 3b20eda7c4..883acdfde1 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,59 +1,19 @@ # 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 +# By default, the umbrella project as well as each child +# application will require this configuration file, ensuring +# they all use the same configuration. While one could +# configure all applications here, we prefer to delegate +# back to each application for organization purposes. +import_config "../apps/*/config/config.exs" # 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" diff --git a/config/dev.exs b/config/dev.exs index 082de0d9a8..e472324ced 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1,85 +1,4 @@ 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" diff --git a/config/prod.exs b/config/prod.exs index d66a3f5bb3..6ca4472984 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -1,89 +1,4 @@ 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")} - ] diff --git a/config/test.exs b/config/test.exs index 442717e8d5..af29307cc1 100644 --- a/config/test.exs +++ b/config/test.exs @@ -1,29 +1,4 @@ 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 diff --git a/doc/dependency_decisions.yml b/doc/dependency_decisions.yml index 8e9b8cb4ca..225f7c43c2 100644 --- a/doc/dependency_decisions.yml +++ b/doc/dependency_decisions.yml @@ -351,3 +351,16 @@ :why: :versions: [] :when: 2018-02-09 05:08:02.294651000 Z +- - :license + - explorer + - GPLv3 + - :who: Luke Imhoff + :why: Inherits license from umbrella project + :versions: [] + :when: 2018-04-02 19:27:00.704774000 Z +- - :approve + - explorer + - :who: Luke Imhoff + :why: In-umbrella project dependency + :versions: [] + :when: 2018-04-02 19:30:09.643200000 Z diff --git a/mix.exs b/mix.exs index 2e98f60883..77ea6e0c3a 100644 --- a/mix.exs +++ b/mix.exs @@ -1,126 +1,32 @@ -defmodule Explorer.Mixfile do +defmodule Explorer.Umbrella.Mixfile do use Mix.Project def project do [ - app: :explorer, - version: "0.0.1", - elixir: "~> 1.4", - elixirc_paths: elixirc_paths(Mix.env()), - compilers: [:phoenix, :gettext | Mix.compilers()], - start_permanent: Mix.env() == :prod, - package: package(), - aliases: aliases(), + apps_path: "apps", deps: deps(), dialyzer: [ plt_add_deps: :transitive, plt_add_apps: [:mix], ignore_warnings: ".dialyzer-ignore" - ] + ], + start_permanent: Mix.env() == :prod ] end - # Configuration for the OTP application. + # Dependencies can be Hex packages: # - # Type `mix help compile.app` for more information. - def application do - [ - mod: {Explorer.Application, []}, - extra_applications: extra_applications(Mix.env()) - ] - end - - # Specifies which paths to compile per environment. - defp elixirc_paths(:test), do: ["test/support" | elixirc_paths()] - defp elixirc_paths(_), do: elixirc_paths() - defp elixirc_paths, do: ["lib"] - - # Specifies extra applications to start per environment - defp extra_applications(:prod), - do: [:phoenix_pubsub_redis, :exq, :exq_ui | extra_applications()] - - defp extra_applications(:dev), do: [:exq, :exq_ui | extra_applications()] - defp extra_applications(_), do: extra_applications() - - defp extra_applications, - do: [ - :scrivener_ecto, - :scrivener_html, - :ex_cldr, - :ex_jasmine, - :ethereumex, - :timex, - :timex_ecto, - :crontab, - :set_locale, - :logger, - :runtime_tools, - :new_relixir - ] - - # Specifies your project dependencies. + # {:mydep, "~> 0.3.0"} # - # Type `mix help deps` for examples and options. - defp deps do - [ - {:cowboy, "~> 1.0"}, - {:credo, "~> 0.8", only: [:dev, :test], runtime: false}, - {:crontab, "~> 1.1"}, - {:dialyxir, "~> 0.5", only: [:dev, :test], runtime: false}, - {:ethereumex, "~> 0.3"}, - {:ex_cldr_numbers, "~> 1.0"}, - {:ex_cldr_units, "~> 1.0"}, - {:ex_jasmine, github: "minifast/ex_jasmine", branch: "master"}, - {:ex_machina, "~> 2.1", only: [:test]}, - {:exq, "~> 0.9.1"}, - {:exq_ui, "~> 0.9.0"}, - {:exvcr, "~> 0.10", only: :test}, - {:flow, "~> 0.12"}, - {:gettext, "~> 0.11"}, - {:httpoison, "~> 1.0", override: true}, - {:junit_formatter, ">= 0.0.0", only: [:test], runtime: false}, - {:math, "~> 0.3.0"}, - {:mock, "~> 0.3.0", only: [:test], runtime: false}, - {:new_relixir, "~> 0.4"}, - {:phoenix, "~> 1.3.0"}, - {:phoenix_ecto, "~> 3.2"}, - {:phoenix_html, "~> 2.10"}, - {:phoenix_live_reload, "~> 1.0", only: [:dev]}, - {:phoenix_pubsub, "~> 1.0"}, - {:phoenix_pubsub_redis, "~> 2.1.0", only: [:prod]}, - {:postgrex, ">= 0.0.0"}, - {:quantum, "~> 2.2.1"}, - {:react_phoenix, "~> 0.5"}, - {:scrivener_ecto, "~> 1.0"}, - {:scrivener_html, "~> 1.7"}, - # Waiting on https://github.com/smeevil/set_locale/pull/9 - {:set_locale, github: "minifast/set_locale", branch: "master"}, - {:sobelow, ">= 0.0.0", only: [:dev, :test], runtime: false}, - {:timex, "~> 3.1.24"}, - {:timex_ecto, "~> 3.2.1"}, - {:wallaby, "~> 0.19.2", only: [:test], runtime: false} - ] - end - - # Aliases are shortcuts or tasks specific to the current project. - # For example, to create, migrate and run the seeds file at once: + # Or git/path repositories: # - # $ mix ecto.setup + # {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"} # - # See the documentation for `Mix` for more info on aliases. - defp aliases do - [ - "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], - "ecto.reset": ["ecto.drop", "ecto.setup"], - test: ["ecto.create --quiet", "ecto.migrate", "test"] - ] - end - - defp package do - [ - maintainers: ["POA Networks Ltd."], - licenses: ["GPL 3.0"], - links: %{"GitHub" => "https://github.com/poanetwork/poa-explorer"} - ] + # Type "mix help deps" for more examples and options. + # + # Dependencies listed here are available only for this project + # and cannot be accessed from applications inside the apps folder + defp deps do + [] end end