Fallback trace url

pull/7246/head
Qwerty5Uiop 2 years ago
parent 916a3fe4db
commit 5591b2e290
  1. 2
      CHANGELOG.md
  2. 2
      apps/block_scout_web/test/block_scout_web/controllers/api/rpc/transaction_controller_test.exs
  3. 24
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc.ex
  4. 19
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/http.ex
  5. 4
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/utility/endpoint_availability_checker.ex
  6. 7
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/utility/endpoint_availability_observer.ex
  7. 2
      apps/explorer/config/dev/arbitrum.exs
  8. 3
      apps/explorer/config/dev/besu.exs
  9. 3
      apps/explorer/config/dev/erigon.exs
  10. 2
      apps/explorer/config/dev/ganache.exs
  11. 2
      apps/explorer/config/dev/geth.exs
  12. 3
      apps/explorer/config/dev/nethermind.exs
  13. 3
      apps/explorer/config/dev/rsk.exs
  14. 1
      apps/explorer/config/prod/besu.exs
  15. 1
      apps/explorer/config/prod/erigon.exs
  16. 1
      apps/explorer/config/prod/nethermind.exs
  17. 1
      apps/explorer/config/prod/rsk.exs
  18. 2
      apps/indexer/config/dev/arbitrum.exs
  19. 3
      apps/indexer/config/dev/besu.exs
  20. 3
      apps/indexer/config/dev/erigon.exs
  21. 2
      apps/indexer/config/dev/ganache.exs
  22. 2
      apps/indexer/config/dev/geth.exs
  23. 3
      apps/indexer/config/dev/nethermind.exs
  24. 3
      apps/indexer/config/dev/rsk.exs
  25. 2
      apps/indexer/config/prod/arbitrum.exs
  26. 1
      apps/indexer/config/prod/besu.exs
  27. 1
      apps/indexer/config/prod/erigon.exs
  28. 2
      apps/indexer/config/prod/ganache.exs
  29. 1
      apps/indexer/config/prod/nethermind.exs
  30. 1
      apps/indexer/config/prod/rsk.exs
  31. 2
      docker-compose/envs/common-blockscout.env
  32. 6
      docker/Makefile

@ -4,6 +4,8 @@
### Features
- [#7246](https://github.com/blockscout/blockscout/pull/7246) - Fallback JSON RPC option
### Fixes
### Chore

@ -739,7 +739,7 @@ defmodule BlockScoutWeb.API.RPC.TransactionControllerTest do
EthereumJSONRPC.Mox,
:json_rpc,
fn _json, [] ->
{:ok}
{:ok, :ok}
end
)

@ -380,34 +380,34 @@ defmodule EthereumJSONRPC do
* Handled response
* `{:error, reason}` if POST fails
"""
@spec json_rpc(Transport.request(), json_rpc_named_arguments, bool) ::
@spec json_rpc(Transport.request(), json_rpc_named_arguments) ::
{:ok, Transport.result()} | {:error, reason :: term()}
@spec json_rpc(Transport.batch_request(), json_rpc_named_arguments, bool) ::
@spec json_rpc(Transport.batch_request(), json_rpc_named_arguments) ::
{:ok, Transport.batch_response()} | {:error, reason :: term()}
def json_rpc(request, named_arguments, use_fallback? \\ true)
when (is_map(request) or is_list(request)) and is_list(named_arguments) do
def json_rpc(request, named_arguments) when (is_map(request) or is_list(request)) and is_list(named_arguments) do
transport = Keyword.fetch!(named_arguments, :transport)
transport_options = Keyword.fetch!(named_arguments, :transport_options)
throttle_timeout = Keyword.get(named_arguments, :throttle_timeout, @default_throttle_timeout)
url =
case EndpointAvailabilityObserver.check_endpoint(transport_options[:url]) do
:ok -> transport_options[:url]
:unavailable -> transport_options[:fallback_url] || transport_options[:url]
end
corrected_transport_options = if use_fallback?, do: Keyword.put(transport_options, :url, url), else: transport_options
url = maybe_replace_url(transport_options[:url], transport_options[:fallback_url], transport)
corrected_transport_options = Keyword.replace(transport_options, :url, url)
case RequestCoordinator.perform(request, transport, corrected_transport_options, throttle_timeout) do
{:ok, result} ->
{:ok, result}
{:error, reason} ->
EndpointAvailabilityObserver.inc_error_count(corrected_transport_options[:url], named_arguments)
maybe_inc_error_count(corrected_transport_options[:url], named_arguments, transport)
{:error, reason}
end
end
defp maybe_replace_url(url, _replace_url, EthereumJSONRPC.HTTP), do: url
defp maybe_replace_url(url, replace_url, _), do: EndpointAvailabilityObserver.maybe_replace_url(url, replace_url)
defp maybe_inc_error_count(_url, _arguments, EthereumJSONRPC.HTTP), do: :ok
defp maybe_inc_error_count(url, arguments, _), do: EndpointAvailabilityObserver.inc_error_count(url, arguments)
@doc """
Converts `t:quantity/0` to `t:non_neg_integer/0`.
"""

@ -3,7 +3,7 @@ defmodule EthereumJSONRPC.HTTP do
JSONRPC over HTTP
"""
alias EthereumJSONRPC.{DecodeError, Transport}
alias EthereumJSONRPC.{DecodeError, Transport, Utility.EndpointAvailabilityObserver}
require Logger
@ -27,8 +27,14 @@ defmodule EthereumJSONRPC.HTTP do
http_options = Keyword.fetch!(options, :http_options)
with {:ok, %{body: body, status_code: code}} <- http.json_rpc(url, json, http_options),
{:ok, json} <- decode_json(request: [url: url, body: json], response: [status_code: code, body: body]) do
handle_response(json, code)
{:ok, json} <- decode_json(request: [url: url, body: json], response: [status_code: code, body: body]),
{:ok, response} <- handle_response(json, code) do
{:ok, response}
else
error ->
named_arguments = [transport: __MODULE__, transport_options: Keyword.delete(options, :method_to_url)]
EndpointAvailabilityObserver.inc_error_count(url, named_arguments)
error
end
end
@ -177,9 +183,12 @@ defmodule EthereumJSONRPC.HTTP do
with {:ok, method_to_url} <- Keyword.fetch(options, :method_to_url),
{:ok, method_atom} <- to_existing_atom(method),
{:ok, url} <- Keyword.fetch(method_to_url, method_atom) do
url
EndpointAvailabilityObserver.maybe_replace_url(url, options[:fallback_trace_url])
else
_ -> Keyword.fetch!(options, :url)
_ ->
options
|> Keyword.fetch!(:url)
|> EndpointAvailabilityObserver.maybe_replace_url(options[:fallback_url])
end
end

@ -46,9 +46,11 @@ defmodule EthereumJSONRPC.Utility.EndpointAvailabilityChecker do
end
defp fetch_latest_block_number(json_rpc_named_arguments) do
{_, arguments_without_fallback} = pop_in(json_rpc_named_arguments, [:transport_options, :fallback_url])
%{id: 0, method: "eth_blockNumber", params: []}
|> EthereumJSONRPC.request()
|> EthereumJSONRPC.json_rpc(json_rpc_named_arguments, false)
|> EthereumJSONRPC.json_rpc(arguments_without_fallback)
end
defp schedule_next_check do

@ -29,6 +29,13 @@ defmodule EthereumJSONRPC.Utility.EndpointAvailabilityObserver do
GenServer.call(__MODULE__, {:check_endpoint, url})
end
def maybe_replace_url(url, replace_url) do
case check_endpoint(url) do
:ok -> url
:unavailable -> replace_url || url
end
end
def enable_endpoint(url) do
GenServer.cast(__MODULE__, {:enable_endpoint, url})
end

@ -13,7 +13,7 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Arbitrum

@ -13,7 +13,8 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_call: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",

@ -13,7 +13,8 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_call: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",

@ -13,7 +13,7 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:7545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:7545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Ganache

@ -13,7 +13,7 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Geth

@ -13,7 +13,8 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_call: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",

@ -13,7 +13,8 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_call: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",

@ -14,6 +14,7 @@ config :explorer,
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_call: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),

@ -14,6 +14,7 @@ config :explorer,
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_call: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),

@ -14,6 +14,7 @@ config :explorer,
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_call: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),

@ -14,6 +14,7 @@ config :explorer,
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_call: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),

@ -18,7 +18,7 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Arbitrum

@ -19,7 +19,8 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",

@ -19,7 +19,8 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",

@ -18,7 +18,7 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:7545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:7545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Ganache

@ -18,7 +18,7 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Geth

@ -19,7 +19,8 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",

@ -20,7 +20,8 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",

@ -18,7 +18,7 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:8545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Arbitrum

@ -19,6 +19,7 @@ config :indexer,
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),

@ -19,6 +19,7 @@ config :indexer,
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),

@ -18,7 +18,7 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:7545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL") || "http://localhost:7545",
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Ganache

@ -19,6 +19,7 @@ config :indexer,
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),

@ -21,6 +21,7 @@ config :indexer,
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
fallback_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_HTTP_URL"),
fallback_trace_url: System.get_env("ETHEREUM_JSONRPC_FALLBACK_TRACE_URL"),
method_to_url: [
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),

@ -1,8 +1,10 @@
# DOCKER_TAG=
ETHEREUM_JSONRPC_VARIANT=geth
ETHEREUM_JSONRPC_HTTP_URL=http://host.docker.internal:8545/
# ETHEREUM_JSONRPC_FALLBACK_HTTP_URL=
DATABASE_URL=postgresql://postgres:@host.docker.internal:7432/blockscout?ssl=false
ETHEREUM_JSONRPC_TRACE_URL=http://host.docker.internal:8545/
# ETHEREUM_JSONRPC_FALLBACK_TRACE_URL=
# ETHEREUM_JSONRPC_HTTP_TIMEOUT=
NETWORK=
SUBNETWORK=Awesome chain

@ -42,9 +42,15 @@ endif
ifdef ETHEREUM_JSONRPC_HTTP_URL
BLOCKSCOUT_CONTAINER_PARAMS += -e 'ETHEREUM_JSONRPC_HTTP_URL=$(ETHEREUM_JSONRPC_HTTP_URL)'
endif
ifdef ETHEREUM_JSONRPC_FALLBACK_HTTP_URL
BLOCKSCOUT_CONTAINER_PARAMS += -e 'ETHEREUM_JSONRPC_FALLBACK_HTTP_URL=$(ETHEREUM_JSONRPC_FALLBACK_HTTP_URL)'
endif
ifdef ETHEREUM_JSONRPC_TRACE_URL
BLOCKSCOUT_CONTAINER_PARAMS += -e 'ETHEREUM_JSONRPC_TRACE_URL=$(ETHEREUM_JSONRPC_TRACE_URL)'
endif
ifdef ETHEREUM_JSONRPC_FALLBACK_TRACE_URL
BLOCKSCOUT_CONTAINER_PARAMS += -e 'ETHEREUM_JSONRPC_FALLBACK_TRACE_URL=$(ETHEREUM_JSONRPC_FALLBACK_TRACE_URL)'
endif
ifdef ETHEREUM_JSONRPC_WS_URL
BLOCKSCOUT_CONTAINER_PARAMS += -e 'ETHEREUM_JSONRPC_WS_URL=$(ETHEREUM_JSONRPC_WS_URL)'
endif

Loading…
Cancel
Save