Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
blockscout/apps/block_scout_web/mix.exs

169 lines
5.8 KiB

defmodule BlockScoutWeb.Mixfile do
use Mix.Project
def project do
[
aliases: aliases(),
app: :block_scout_web,
build_path: "../../_build",
config_path: "../../config/config.exs",
deps: deps(),
deps_path: "../../deps",
description: "Web interface for BlockScout.",
dialyzer: [
plt_add_deps: :transitive,
ignore_warnings: "../../.dialyzer-ignore"
],
elixir: "~> 1.13",
elixirc_paths: elixirc_paths(Mix.env()),
lockfile: "../../mix.lock",
package: package(),
preferred_cli_env: [
credo: :test,
dialyzer: :test
],
start_permanent: Mix.env() == :prod,
version: "5.3.3",
1 year ago
xref: [exclude: [Explorer.Chain.Zkevm.Reader]]
]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.
def application do
[
mod: {BlockScoutWeb.Application, []},
extra_applications: extra_applications()
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["test/support", "test/block_scout_web/features/pages"] ++ elixirc_paths()
defp elixirc_paths(_), do: elixirc_paths()
defp elixirc_paths, do: ["lib"]
defp extra_applications,
do: [
Account/Watchlist/Notifications (#13) * Auth for debug Fix for Auth callback calls endless cycle * Logout from auth0 and add profile picture Fix styles in signin/signout * Add profile * Update dockerfiles * Make auth paths dependent of API_PATH * Change api_path to network_path * Save identity from auth into DB * Hardcode urls to make it work again Style fixes * Change sign_in icon * Create Watchlist together with identity * Add watchlist show * Add watchlist addresses Fix creating account on first login Make address as it should look like * Associate watchlist with addresses * Create watchlist address UI Add balance in coin (need to use right coin) * Add tokens on watchlist Fix warnings Fix topnav styles * Add watch_ and notify_ fields in WatchlistAddress * Notifications draft Style fixes Removed divider Watchlist Address Form: ERC-721 & ERC-1155 -> NFT Form style -> modal Move Auth into Account module Add any valid address to watchlist Fix profile namespace in router Fixes in build Notification Fixed insert notifications * Send Emails via SendGrid * Add AUTH0 & SENDGRID API keys to Makefile * Finish email variables Fix warnings Add links to email * Update & Delete Watchlist Addresses Fix styles Fix warnings * Authorize create/update watchlist_address Fix credo warnings * Refactoring and fix UI * Introduce sender & template ENVs * Fix credo warns * Fix formatter & dialyzer * Make Notifier main entrypoint * Fix tests * Fix comments * Hardcode auth0 callbacks for prod env Export it in dev env and it should work: ``` export AUTH0_CALLBACK_URL='http://localhost:4000/auth/auth0/callback' export AUTH0_LOGOUT_RETURN_URL='http://localhost:4000/auth/logout' ``` * Style fixes * Private tags on address/transaction/token pages * Add account logger * fix email subject * Fix token_transfers notifications * Prepare for release * Fix transaction dropdown * Remoe unwanted changes * Reset CI cache * Fix Dialyzer, gettext * Add logout_return_to_url to :ueberauth config for test env * Invalidate GA cache * Redefine sign_in_link for test env * Fix adding address with disabled checkboxes Remove testnet hardcode from prod config CI fix attempt * Add AUTH0_LOGOUT_URL env * Fix logger warning * current_user/1, check that mapping contains :current_user object before executing get_session function * Fix current_user * Final fix of current_user/1 * Introduce COIN_NAME env * Lowercase hashes in email * Style fix * Add block_url to email * Fix creating notifications for NFT * Add notifier to token_transfers import runner * Add processing transfer into Notifier * Fix token transfer summary * WIP: Account refactoring (#19) * Move Ueberauth settings to config.exs * Make AuthController more clear * Fix error when build_watchlist_notification returns nil * Set WatchlistAddressForm defaults * Style fix * Fix double send email for tokens * Style fix WatchlistController * Style fix AddWatchlistAddress * Style fix UserFromAuth * Use Logger instead AccountLogger * Credo fix * Fix AddWatchlistAddress * Fix Notifier Co-authored-by: Oleg Sovetnik <sovetnik@oblaka.biz> Co-authored-by: nikitosing <nikitosing4@mail.ru>
3 years ago
:ueberauth_auth0,
:logger,
:runtime_tools
]
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps do
[
# GraphQL toolkit
{:absinthe, "~> 1.5"},
# Integrates Absinthe subscriptions with Phoenix
{:absinthe_phoenix, "~> 2.0.0"},
# Plug support for Absinthe
{:absinthe_plug, git: "https://github.com/blockscout/absinthe_plug.git", tag: "1.5.3", override: true},
GraphQL support to get transactions by address Why: * We'd like to add support for GraphQL queries to get transactions by address hash. RPC API users could use this instead of the `txlist` RPC API action. Example usage: 1. ``` query($hash: AddressHash!, $first: Int!) { address(hash: $hash) { transactions(first: $first) { edges { node { hash blockNumber } cursor } } } ``` 2. with pagination support via [Relay Cursor Connections](https://facebook.github.io/relay/graphql/connections.htm) ``` query($hash: AddressHash!, $first: Int!, $after: String!) { address(hash: $hash) { transactions(first: $first, after: $after) { pageInfo { hasNextPage hasPreviousPage } edges { node { hash blockNumber } cursor } } } } ``` * Issue link: n/a This change addresses the need by: * Renaming `BlockScoutWeb.Schema.Query.AddressTest` to `...AddressesTest` for the name to match the query field it is testing. * Adding `:absinthe_relay` dependency to `BlockScoutWeb` app for Absinthe support for the [Relay framework](https://facebook.github.io/relay/graphql/connections.htm). * Editing `BlockScoutWeb.Schema` to use `Absinthe.Relay.Schema`, define a node interface, and define a node field. This was necessary to support relay connections. * Adding an `address` field to `BlockScoutWeb.Schema`, to get a single address by hash. * Adding a `TransactionConnection` field to the `address` object type in `BlockScoutWeb.Schema.Types` * Configuring the `transaction` object type as a node, in `BlockScoutWeb.Schema.Types`. * Adding a resolver function in `BlockScoutWeb.Resolvers.Address`, to get a single address. * Adding a resolver function in `BlockScoutWeb.Resolvers.Transaction`, to get transactions for an address. * Creating `Explorer.GraphQL` for GraphQL API specific Ecto queries. The only function in this module now is `address_to_transactions_query/1`. This function is necessary for `Absinthe.Relay.Connection.from_query/4` to load transactions in the new transaction resolver mentioned above. * Editing RPC API docs to include reference to the GraphQL "transactions" field.
6 years ago
# Absinthe support for the Relay framework
{:absinthe_relay, "~> 1.5"},
{:bypass, "~> 2.1", only: :test},
# To add (CORS)(https://www.w3.org/TR/cors/)
{:cors_plug, "~> 3.0"},
{:credo, "~> 1.5", only: :test, runtime: false},
# For Absinthe to load data in batches
{:dataloader, "~> 1.0.0"},
{:dialyxir, "~> 1.1", only: [:dev, :test], runtime: false},
# Need until https://github.com/absinthe-graphql/absinthe_relay/pull/125 is released, then can be removed
# The current `absinthe_relay` is compatible though as shown from that PR
{:ecto, "~> 3.3", override: true},
{:ex_cldr, "~> 2.7"},
{:ex_cldr_numbers, "~> 2.6"},
{:ex_cldr_units, "~> 3.13"},
{:cldr_utils, "~> 2.3"},
{:ex_machina, "~> 2.1", only: [:test]},
{:explorer, in_umbrella: true},
{:exvcr, "~> 0.10", only: :test},
{:file_info, "~> 0.0.4"},
# HTML CSS selectors for Phoenix controller tests
{:floki, "~> 0.31"},
{:flow, "~> 1.2"},
{:gettext, "~> 0.24.0"},
3 years ago
{:hammer, "~> 6.0"},
{:httpoison, "~> 2.0"},
{:indexer, in_umbrella: true, runtime: false},
# JSON parser and generator
{:jason, "~> 1.3"},
{:junit_formatter, ">= 0.0.0", only: [:test], runtime: false},
# Log errors and application output to separate files
{:logger_file_backend, "~> 0.0.10"},
{:math, "~> 0.7.0"},
{:mock, "~> 0.3.0", only: [:test], runtime: false},
{:number, "~> 1.0.1"},
{:phoenix, "== 1.5.14"},
4 years ago
{:phoenix_ecto, "~> 4.1"},
{:phoenix_html, "== 3.0.4"},
{:phoenix_live_reload, "~> 1.2", only: [:dev]},
{:phoenix_pubsub, "~> 2.0"},
{:prometheus_ex, git: "https://github.com/lanodan/prometheus.ex", branch: "fix/elixir-1.14", override: true},
# use `:cowboy` for WebServer with `:plug`
{:plug_cowboy, "~> 2.2"},
6 years ago
# Waiting for the Pretty Print to be implemented at the Jason lib
# https://github.com/michalmuskala/jason/issues/15
{:poison, "~> 4.0.1"},
{:postgrex, ">= 0.0.0"},
# For compatibility with `prometheus_process_collector`, which hasn't been updated yet
{:prometheus, "~> 4.0", override: true},
# Gather methods for Phoenix requests
{:prometheus_phoenix, "~> 1.2"},
# Expose metrics from URL Prometheus server can scrape
{:prometheus_plugs, "~> 1.1"},
# OS process metrics for Prometheus
{:prometheus_process_collector, "~> 1.3"},
{:remote_ip, "~> 1.0"},
6 years ago
{:qrcode, "~> 0.1.0"},
{:sobelow, ">= 0.7.0", only: [:dev, :test], runtime: false},
# Tracing
4 years ago
{:spandex, "~> 3.0"},
# `:spandex` integration with Datadog
4 years ago
{:spandex_datadog, "~> 1.0"},
# `:spandex` tracing of `:phoenix`
4 years ago
{:spandex_phoenix, "~> 1.0"},
3 years ago
{:timex, "~> 3.7.1"},
{:wallaby, "~> 0.30", only: :test, runtime: false},
# `:cowboy` `~> 2.0` and Phoenix 1.4 compatibility
{:websocket_client, git: "https://github.com/blockscout/websocket_client.git", branch: "master", override: true},
{:ex_json_schema, "~> 0.10.1"},
Account/Watchlist/Notifications (#13) * Auth for debug Fix for Auth callback calls endless cycle * Logout from auth0 and add profile picture Fix styles in signin/signout * Add profile * Update dockerfiles * Make auth paths dependent of API_PATH * Change api_path to network_path * Save identity from auth into DB * Hardcode urls to make it work again Style fixes * Change sign_in icon * Create Watchlist together with identity * Add watchlist show * Add watchlist addresses Fix creating account on first login Make address as it should look like * Associate watchlist with addresses * Create watchlist address UI Add balance in coin (need to use right coin) * Add tokens on watchlist Fix warnings Fix topnav styles * Add watch_ and notify_ fields in WatchlistAddress * Notifications draft Style fixes Removed divider Watchlist Address Form: ERC-721 & ERC-1155 -> NFT Form style -> modal Move Auth into Account module Add any valid address to watchlist Fix profile namespace in router Fixes in build Notification Fixed insert notifications * Send Emails via SendGrid * Add AUTH0 & SENDGRID API keys to Makefile * Finish email variables Fix warnings Add links to email * Update & Delete Watchlist Addresses Fix styles Fix warnings * Authorize create/update watchlist_address Fix credo warnings * Refactoring and fix UI * Introduce sender & template ENVs * Fix credo warns * Fix formatter & dialyzer * Make Notifier main entrypoint * Fix tests * Fix comments * Hardcode auth0 callbacks for prod env Export it in dev env and it should work: ``` export AUTH0_CALLBACK_URL='http://localhost:4000/auth/auth0/callback' export AUTH0_LOGOUT_RETURN_URL='http://localhost:4000/auth/logout' ``` * Style fixes * Private tags on address/transaction/token pages * Add account logger * fix email subject * Fix token_transfers notifications * Prepare for release * Fix transaction dropdown * Remoe unwanted changes * Reset CI cache * Fix Dialyzer, gettext * Add logout_return_to_url to :ueberauth config for test env * Invalidate GA cache * Redefine sign_in_link for test env * Fix adding address with disabled checkboxes Remove testnet hardcode from prod config CI fix attempt * Add AUTH0_LOGOUT_URL env * Fix logger warning * current_user/1, check that mapping contains :current_user object before executing get_session function * Fix current_user * Final fix of current_user/1 * Introduce COIN_NAME env * Lowercase hashes in email * Style fix * Add block_url to email * Fix creating notifications for NFT * Add notifier to token_transfers import runner * Add processing transfer into Notifier * Fix token transfer summary * WIP: Account refactoring (#19) * Move Ueberauth settings to config.exs * Make AuthController more clear * Fix error when build_watchlist_notification returns nil * Set WatchlistAddressForm defaults * Style fix * Fix double send email for tokens * Style fix WatchlistController * Style fix AddWatchlistAddress * Style fix UserFromAuth * Use Logger instead AccountLogger * Credo fix * Fix AddWatchlistAddress * Fix Notifier Co-authored-by: Oleg Sovetnik <sovetnik@oblaka.biz> Co-authored-by: nikitosing <nikitosing4@mail.ru>
3 years ago
{:ueberauth, "~> 0.7"},
{:ueberauth_auth0, "~> 2.0"},
{:bureaucrat, "~> 0.2.9", only: :test},
{:logger_json, "~> 5.1"}
]
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
[
compile: "compile --warnings-as-errors",
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: [
"ecto.create --quiet",
"ecto.migrate",
# to match behavior of `mix test` from project root, which needs to not start applications for `indexer` to
# prevent its supervision tree from starting, which is undesirable in test
"test --no-start"
]
]
end
defp package do
[
maintainers: ["Blockscout"],
licenses: ["GPL 3.0"],
links: %{"GitHub" => "https://github.com/blockscout/blockscout"}
]
end
end