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

166 lines
5.9 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",
compilers: [:phoenix, :gettext | Mix.compilers()],
deps: deps(),
deps_path: "../../deps",
description: "Web interface for BlockScout.",
dialyzer: [
plt_add_deps: :transitive,
ignore_warnings: "../../.dialyzer-ignore"
],
elixir: "~> 1.9",
elixirc_paths: elixirc_paths(Mix.env()),
lockfile: "../../mix.lock",
package: package(),
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test,
credo: :test,
dialyzer: :test
],
start_permanent: Mix.env() == :prod,
test_coverage: [tool: ExCoveralls],
version: "0.0.1"
]
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: [
:logger,
:runtime_tools
]
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps do
[
# GraphQL toolkit
{:absinthe, "~> 1.4"},
# Integrates Absinthe subscriptions with Phoenix
{:absinthe_phoenix, git: "https://github.com/ayrat555/absinthe_phoenix.git", branch: "master"},
# Plug support for Absinthe
{:absinthe_plug, git: "https://github.com/ayrat555/absinthe_plug.git", branch: "ab-allow-to-set-default-query"},
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.4"},
{:bypass, "~> 1.0", only: :test},
# To add (CORS)(https://www.w3.org/TR/cors/)
{:cors_plug, "~> 2.0"},
{:credo, "~> 1.1", only: :test, runtime: false},
# For Absinthe to load data in batches
{:dataloader, "~> 1.0.0"},
{:dialyxir, "~> 0.5", 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.0", override: true},
{:ex_cldr, "~> 2.7"},
{:ex_cldr_numbers, "~> 2.6"},
{:ex_cldr_units, "~> 2.5"},
{:cldr_utils, "~> 2.3"},
{:ex_machina, "~> 2.1", only: [:test]},
# Code coverage
{:excoveralls, "~> 0.10.0", only: [:test], github: "KronicDeth/excoveralls", branch: "circle-workflows"},
{:explorer, in_umbrella: true},
{:exvcr, "~> 0.10", only: :test},
# HTML CSS selectors for Phoenix controller tests
{:floki, "~> 0.20.1", only: :test},
{:flow, "~> 0.12"},
{:gettext, "~> 0.16.1"},
{:httpoison, "~> 1.0"},
{:indexer, in_umbrella: true, runtime: false},
# JSON parser and generator
{:jason, "~> 1.0"},
{: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.3.0"},
{:mock, "~> 0.3.0", only: [:test], runtime: false},
{:phoenix, "~> 1.4"},
{:phoenix_ecto, "~> 4.0"},
{:phoenix_html, "~> 2.10"},
{:phoenix_live_reload, "~> 1.0", only: [:dev]},
{:phoenix_pubsub, "~> 1.0"},
# use `:cowboy` for WebServer with `:plug`
{:plug_cowboy, "~> 2.0"},
6 years ago
# Waiting for the Pretty Print to be implemented at the Jason lib
# https://github.com/michalmuskala/jason/issues/15
{:poison, "~> 3.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"},
6 years ago
{:qrcode, "~> 0.1.0"},
{:sobelow, ">= 0.7.0", only: [:dev, :test], runtime: false},
# Tracing
{:spandex, github: "spandex-project/spandex", branch: "allow-setting-trace-key", override: true},
# `:spandex` integration with Datadog
{:spandex_datadog, "~> 0.4.0"},
# `:spandex` tracing of `:phoenix`
{:spandex_phoenix, "~> 0.3.1"},
5 years ago
{:timex, "~> 3.6"},
6 years ago
{:wallaby, "~> 0.22", only: [:test], runtime: false},
# `:cowboy` `~> 2.0` and Phoenix 1.4 compatibility
{:wobserver, "~> 0.2.0", github: "poanetwork/wobserver", branch: "support-https"},
{:phoenix_form_awesomplete, "~> 0.1.4"}
]
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: ["POA Networks Ltd."],
licenses: ["GPL 3.0"],
links: %{"GitHub" => "https://github.com/poanetwork/blockscout"}
]
end
end