Move old root down to apps/explorer.  Make root umbrella.

Co-authored-by: Alex Garibay <alex.garibay@dockyard.com>
pull/86/head
Luke Imhoff 7 years ago
parent 595a21857b
commit 526eb526ac
  1. 4
      .credo.exs
  2. 2
      .gitignore
  3. 0
      apps/explorer/assets/.eslintrc
  4. 0
      apps/explorer/assets/brunch-config.js
  5. 0
      apps/explorer/assets/css/app.scss
  6. 0
      apps/explorer/assets/css/components/_address.scss
  7. 0
      apps/explorer/assets/css/components/_all.scss
  8. 0
      apps/explorer/assets/css/components/_block.scss
  9. 0
      apps/explorer/assets/css/components/_blocks.scss
  10. 0
      apps/explorer/assets/css/components/_chain.scss
  11. 0
      apps/explorer/assets/css/components/_container.scss
  12. 0
      apps/explorer/assets/css/components/_dot.scss
  13. 0
      apps/explorer/assets/css/components/_footer.scss
  14. 0
      apps/explorer/assets/css/components/_header.scss
  15. 0
      apps/explorer/assets/css/components/_internal_transaction.scss
  16. 0
      apps/explorer/assets/css/components/_pagination.scss
  17. 0
      apps/explorer/assets/css/components/_section.scss
  18. 0
      apps/explorer/assets/css/components/_transaction.scss
  19. 0
      apps/explorer/assets/css/components/_transaction_log.scss
  20. 0
      apps/explorer/assets/css/components/_transactions.scss
  21. 0
      apps/explorer/assets/css/explorer/_all.scss
  22. 0
      apps/explorer/assets/css/explorer/_breakpoints.scss
  23. 0
      apps/explorer/assets/css/explorer/_color.scss
  24. 0
      apps/explorer/assets/css/explorer/_header.scss
  25. 0
      apps/explorer/assets/css/explorer/_open_sans.scss
  26. 0
      apps/explorer/assets/css/explorer/_paper.scss
  27. 0
      apps/explorer/assets/css/explorer/_size.scss
  28. 0
      apps/explorer/assets/css/explorer/_table.scss
  29. 0
      apps/explorer/assets/css/explorer/_typography.scss
  30. 0
      apps/explorer/assets/js/app.js
  31. 0
      apps/explorer/assets/js/lib/block_subscription.js
  32. 0
      apps/explorer/assets/js/lib/react_phoenix.js
  33. 0
      apps/explorer/assets/js/socket.js
  34. 0
      apps/explorer/assets/package-lock.json
  35. 0
      apps/explorer/assets/package.json
  36. 0
      apps/explorer/assets/spec/lib/block_subscription_spec.js
  37. 0
      apps/explorer/assets/spec/spec_helper.js
  38. 0
      apps/explorer/assets/spec/support/jasmine.scss
  39. 0
      apps/explorer/assets/static/favicon.ico
  40. 0
      apps/explorer/assets/static/images/average_time.svg
  41. 0
      apps/explorer/assets/static/images/block.svg
  42. 0
      apps/explorer/assets/static/images/blocks.svg
  43. 0
      apps/explorer/assets/static/images/last_block.svg
  44. 0
      apps/explorer/assets/static/images/logo.svg
  45. 0
      apps/explorer/assets/static/images/mgi.svg
  46. 0
      apps/explorer/assets/static/images/transaction.svg
  47. 0
      apps/explorer/assets/static/images/transactions.svg
  48. 0
      apps/explorer/assets/static/robots.txt
  49. 0
      apps/explorer/assets/yarn.lock
  50. 59
      apps/explorer/config/config.exs
  51. 85
      apps/explorer/config/dev.exs
  52. 0
      apps/explorer/config/dev.secret.exs.example
  53. 89
      apps/explorer/config/prod.exs
  54. 29
      apps/explorer/config/test.exs
  55. 0
      apps/explorer/lib/backfill_transaction_receipt_ids.ex
  56. 0
      apps/explorer/lib/explorer.ex
  57. 0
      apps/explorer/lib/explorer/application.ex
  58. 0
      apps/explorer/lib/explorer/ethereum/ethereum.ex
  59. 0
      apps/explorer/lib/explorer/ethereum/live.ex
  60. 0
      apps/explorer/lib/explorer/ethereum/test.ex
  61. 0
      apps/explorer/lib/explorer/ethereumex_extensions.ex
  62. 0
      apps/explorer/lib/explorer/exq_node_identifier.ex
  63. 0
      apps/explorer/lib/explorer/forms/block_form.ex
  64. 0
      apps/explorer/lib/explorer/forms/pending_transaction_form.ex
  65. 0
      apps/explorer/lib/explorer/forms/transaction_form.ex
  66. 0
      apps/explorer/lib/explorer/importers/balance_importer.ex
  67. 0
      apps/explorer/lib/explorer/importers/block_importer.ex
  68. 0
      apps/explorer/lib/explorer/importers/internal_transaction_importer.ex
  69. 0
      apps/explorer/lib/explorer/importers/receipt_importer.ex
  70. 0
      apps/explorer/lib/explorer/importers/transaction_importer.ex
  71. 0
      apps/explorer/lib/explorer/repo.ex
  72. 0
      apps/explorer/lib/explorer/resource.ex
  73. 0
      apps/explorer/lib/explorer/scheduler.ex
  74. 0
      apps/explorer/lib/explorer/schemas/address.ex
  75. 0
      apps/explorer/lib/explorer/schemas/block.ex
  76. 0
      apps/explorer/lib/explorer/schemas/block_transaction.ex
  77. 0
      apps/explorer/lib/explorer/schemas/chain.ex
  78. 0
      apps/explorer/lib/explorer/schemas/credit.ex
  79. 0
      apps/explorer/lib/explorer/schemas/debit.ex
  80. 0
      apps/explorer/lib/explorer/schemas/from_address.ex
  81. 0
      apps/explorer/lib/explorer/schemas/internal_transaction.ex
  82. 0
      apps/explorer/lib/explorer/schemas/log.ex
  83. 0
      apps/explorer/lib/explorer/schemas/receipt.ex
  84. 0
      apps/explorer/lib/explorer/schemas/schema.ex
  85. 0
      apps/explorer/lib/explorer/schemas/to_address.ex
  86. 0
      apps/explorer/lib/explorer/schemas/transaction.ex
  87. 0
      apps/explorer/lib/explorer/servers/chain_statistics.ex
  88. 0
      apps/explorer/lib/explorer/services/address.ex
  89. 0
      apps/explorer/lib/explorer/services/transaction.ex
  90. 0
      apps/explorer/lib/explorer/skipped_balances.ex
  91. 0
      apps/explorer/lib/explorer/skipped_blocks.ex
  92. 0
      apps/explorer/lib/explorer/skipped_internal_transactions.ex
  93. 0
      apps/explorer/lib/explorer/skipped_receipts.ex
  94. 0
      apps/explorer/lib/explorer/workers/import_balance.ex
  95. 0
      apps/explorer/lib/explorer/workers/import_block.ex
  96. 0
      apps/explorer/lib/explorer/workers/import_internal_transaction.ex
  97. 0
      apps/explorer/lib/explorer/workers/import_receipt.ex
  98. 0
      apps/explorer/lib/explorer/workers/import_skipped_blocks.ex
  99. 0
      apps/explorer/lib/explorer/workers/import_transaction.ex
  100. 0
      apps/explorer/lib/explorer/workers/refresh_balance.ex
  101. Some files were not shown because too many files have changed in this diff Show More

@ -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

2
.gitignore vendored

@ -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/

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Before

Width:  |  Height:  |  Size: 1014 B

After

Width:  |  Height:  |  Size: 1014 B

Before

Width:  |  Height:  |  Size: 935 B

After

Width:  |  Height:  |  Size: 935 B

Before

Width:  |  Height:  |  Size: 256 B

After

Width:  |  Height:  |  Size: 256 B

Before

Width:  |  Height:  |  Size: 494 B

After

Width:  |  Height:  |  Size: 494 B

Before

Width:  |  Height:  |  Size: 983 B

After

Width:  |  Height:  |  Size: 983 B

@ -0,0 +1,59 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
use Mix.Config
# General application configuration
config :explorer, ecto_repos: [Explorer.Repo]
# Configures gettext
config :explorer, ExplorerWeb.Gettext, locales: ~w(en), default_locale: "en"
# Configures the endpoint
config :explorer, ExplorerWeb.Endpoint,
url: [host: "localhost"],
render_errors: [view: ExplorerWeb.ErrorView, accepts: ~w(html json)],
pubsub: [name: Explorer.PubSub, adapter: Phoenix.PubSub.PG2]
config :explorer, Explorer.Integrations.EctoLogger, query_time_ms_threshold: 2_000
# Configures Elixir's Logger
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
config :ethereumex, url: "http://localhost:8545"
config :new_relixir, active: false
config :ex_cldr,
default_locale: "en",
locales: ["en"],
gettext: ExplorerWeb.Gettext
config :exq,
host: "localhost",
port: 6379,
namespace: "exq",
start_on_application: false,
scheduler_enable: true,
shutdown_timeout: 5000,
max_retries: 10,
queues: [
{"default", 1},
{"balances", 1},
{"blocks", 1},
{"internal_transactions", 1},
{"transactions", 1},
{"receipts", 1}
]
config :explorer, :ethereum, backend: Explorer.Ethereum.Live
config :exq_ui, server: false
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"

@ -0,0 +1,85 @@
use Mix.Config
# For development, we disable any cache and enable
# debugging and code reloading.
#
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
# with brunch.io to recompile .js and .css sources.
config :explorer, ExplorerWeb.Endpoint,
http: [port: 4000],
debug_errors: true,
code_reloader: true,
check_origin: false,
watchers: [
node: [
"node_modules/brunch/bin/brunch",
"watch",
"--stdin",
cd: Path.expand("../assets", __DIR__)
]
]
# ## SSL Support
#
# In order to use HTTPS in development, a self-signed
# certificate can be generated by running the following
# command from your terminal:
#
# openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout priv/server.key -out priv/server.pem
#
# The `http:` config above can be replaced with:
#
# https: [port: 4000, keyfile: "priv/server.key", certfile: "priv/server.pem"],
#
# If desired, both `http:` and `https:` keys can be
# configured to run both http and https servers on
# different ports.
# Watch static and templates for browser reloading.
config :explorer, ExplorerWeb.Endpoint,
live_reload: [
patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},
~r{priv/gettext/.*(po)$},
~r{lib/explorer_web/views/.*(ex)$},
~r{lib/explorer_web/templates/.*(eex)$}
]
]
# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n"
# Set a higher stacktrace during development. Avoid configuring such
# in production as building large stacktraces may be expensive.
config :phoenix, :stacktrace_depth, 20
# Configure your database
config :explorer, Explorer.Repo,
adapter: Ecto.Adapters.Postgres,
database: "explorer_dev",
hostname: "localhost",
pool_size: 10
# Configure Quantum
config :explorer, Explorer.Scheduler,
jobs: [
[
schedule: {:extended, "*/15 * * * * *"},
task: {Explorer.Workers.RefreshBalance, :perform_later, []}
],
[
schedule: {:extended, "*/5 * * * * *"},
task: {Explorer.Workers.ImportBlock, :perform_later, ["latest"]}
],
[
schedule: {:extended, "*/5 * * * * *"},
task: {Explorer.Workers.ImportBlock, :perform_later, ["pending"]}
],
[
schedule: {:extended, "*/15 * * * * *"},
task: {Explorer.Workers.ImportSkippedBlocks, :perform_later, [1]}
]
]
import_config "dev.secret.exs"

@ -0,0 +1,89 @@
use Mix.Config
# For production, we often load configuration from external
# sources, such as your system environment. For this reason,
# you won't find the :http configuration below, but set inside
# ExplorerWeb.Endpoint.init/2 when load_from_system_env is
# true. Any dynamic configuration should be done there.
#
# Don't forget to configure the url host to something meaningful,
# Phoenix uses this information when generating URLs.
#
# Finally, we also include the path to a cache manifest
# containing the digested version of static files. This
# manifest is generated by the mix phx.digest task
# which you typically run after static files are built.
config :explorer, ExplorerWeb.Endpoint,
cache_static_manifest: "priv/static/cache_manifest.json",
force_ssl: [rewrite_on: [:x_forwarded_proto]],
instrumenters: [NewRelixir.Instrumenters.Phoenix],
load_from_system_env: true,
pubsub: [
adapter: Phoenix.PubSub.Redis,
url: System.get_env("REDIS_URL"),
node_name: System.get_env("DYNO")
],
secret_key_base: System.get_env("SECRET_KEY_BASE"),
url: [
scheme: "https",
host: Map.fetch!(System.get_env(), "HEROKU_APP_NAME") <> ".herokuapp.com",
port: 443
]
# Do not print debug messages in production
config :logger, level: :info
# Configures the database
config :explorer, Explorer.Repo,
adapter: Ecto.Adapters.Postgres,
url: System.get_env("DATABASE_URL"),
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
ssl: String.equivalent?(System.get_env("ECTO_USE_SSL") || "true", "true"),
prepare: :unnamed,
timeout: 60_000,
pool_timeout: 60_000
# Configure New Relic
config :new_relixir,
application_name: System.get_env("NEW_RELIC_APP_NAME"),
license_key: System.get_env("NEW_RELIC_LICENSE_KEY"),
active: true
# Configure Web3
config :ethereumex, url: System.get_env("ETHEREUM_URL")
# Configure Quantum
config :explorer, Explorer.Scheduler,
jobs: [
[
schedule: {:extended, System.get_env("EXQ_BALANCE_SCHEDULE") || "0 * * * * *"},
task: {Explorer.Workers.RefreshBalance, :perform_later, []}
],
[
schedule: {:extended, System.get_env("EXQ_LATEST_BLOCK_SCHEDULE") || "* * * * * *"},
task: {Explorer.Workers.ImportBlock, :perform_later, ["latest"]}
],
[
schedule: {:extended, System.get_env("EXQ_PENDING_BLOCK_SCHEDULE") || "* * * * * *"},
task: {Explorer.Workers.ImportBlock, :perform_later, ["pending"]}
],
[
schedule: {:extended, System.get_env("EXQ_BACKFILL_SCHEDULE") || "* * * * * *"},
task:
{Explorer.Workers.ImportSkippedBlocks, :perform_later,
[String.to_integer(System.get_env("EXQ_BACKFILL_BATCH_SIZE") || "1")]}
]
]
# Configure Exq
config :exq,
node_identifier: Explorer.ExqNodeIdentifier,
url: System.get_env("REDIS_URL"),
queues: [
{"blocks", String.to_integer(System.get_env("EXQ_BLOCKS_CONCURRENCY") || "1")},
{"default", String.to_integer(System.get_env("EXQ_CONCURRENCY") || "1")},
{"internal_transactions",
String.to_integer(System.get_env("EXQ_INTERNAL_TRANSACTIONS_CONCURRENCY") || "1")},
{"receipts", String.to_integer(System.get_env("EXQ_RECEIPTS_CONCURRENCY") || "1")},
{"transactions", String.to_integer(System.get_env("EXQ_TRANSACTIONS_CONCURRENCY") || "1")}
]

@ -0,0 +1,29 @@
use Mix.Config
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :explorer, ExplorerWeb.Endpoint,
http: [port: 4001],
secret_key_base: "27Swe6KtEtmN37WyEYRjKWyxYULNtrxlkCEKur4qoV+Lwtk8lafsR16ifz1XBBYj",
server: true
config :explorer, :sql_sandbox, true
# Print only warnings and errors during test
config :logger, level: :warn
# Configure your database
config :explorer, Explorer.Repo,
adapter: Ecto.Adapters.Postgres,
database: "explorer_test",
hostname: "localhost",
pool: Ecto.Adapters.SQL.Sandbox,
ownership_timeout: 60_000
# Configure wallaby
config :wallaby, screenshot_on_failure: true
# Configure ethereumex
config :ethereumex, url: "https://sokol-trace.poa.network"
config :explorer, :ethereum, backend: Explorer.Ethereum.Test

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save