ETHEREUM_JSONRPC_HTTP_TIMEOUT env variable

pull/7089/head
Qwerty5Uiop 2 years ago
parent 3aae7464b2
commit 622c2abffe
  1. 1
      CHANGELOG.md
  2. 14
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth.ex
  3. 23
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/utility/common_helper.ex
  4. 3
      apps/explorer/config/dev/arbitrum.exs
  5. 3
      apps/explorer/config/dev/besu.exs
  6. 3
      apps/explorer/config/dev/erigon.exs
  7. 3
      apps/explorer/config/dev/ganache.exs
  8. 3
      apps/explorer/config/dev/geth.exs
  9. 3
      apps/explorer/config/dev/nethermind.exs
  10. 3
      apps/explorer/config/dev/rsk.exs
  11. 3
      apps/explorer/config/prod/arbitrum.exs
  12. 3
      apps/explorer/config/prod/besu.exs
  13. 3
      apps/explorer/config/prod/erigon.exs
  14. 3
      apps/explorer/config/prod/ganache.exs
  15. 3
      apps/explorer/config/prod/geth.exs
  16. 3
      apps/explorer/config/prod/nethermind.exs
  17. 3
      apps/explorer/config/prod/rsk.exs
  18. 3
      apps/indexer/config/dev/arbitrum.exs
  19. 3
      apps/indexer/config/dev/besu.exs
  20. 3
      apps/indexer/config/dev/erigon.exs
  21. 3
      apps/indexer/config/dev/ganache.exs
  22. 3
      apps/indexer/config/dev/geth.exs
  23. 3
      apps/indexer/config/dev/nethermind.exs
  24. 3
      apps/indexer/config/dev/rsk.exs
  25. 3
      apps/indexer/config/prod/arbitrum.exs
  26. 3
      apps/indexer/config/prod/besu.exs
  27. 3
      apps/indexer/config/prod/erigon.exs
  28. 3
      apps/indexer/config/prod/ganache.exs
  29. 3
      apps/indexer/config/prod/geth.exs
  30. 3
      apps/indexer/config/prod/nethermind.exs
  31. 3
      apps/indexer/config/prod/rsk.exs
  32. 8
      config/config_helper.exs
  33. 2
      deploy/testing/eth-goerli/values.yaml
  34. 1
      docker-compose/envs/common-blockscout.env
  35. 3
      docker/Makefile

@ -6,6 +6,7 @@
- [#7068](https://github.com/blockscout/blockscout/pull/7068) - Add authenticate endpoint
- [#6990](https://github.com/blockscout/blockscout/pull/6990) - Improved http requests logging, batch transfers pagination; New API v2 endpoint `/smart-contracts/counters`; And some refactoring
- [#7089](https://github.com/blockscout/blockscout/pull/7089) - ETHEREUM_JSONRPC_HTTP_TIMEOUT env variable
### Fixes

@ -7,7 +7,7 @@ defmodule EthereumJSONRPC.Geth do
import EthereumJSONRPC, only: [id_to_params: 1, integer_to_quantity: 1, json_rpc: 2, request: 1]
alias EthereumJSONRPC.{FetchedBalance, FetchedCode, PendingTransaction}
alias EthereumJSONRPC.{FetchedBalance, FetchedCode, PendingTransaction, Utility.CommonHelper}
alias EthereumJSONRPC.Geth.{Calls, Tracer}
@behaviour EthereumJSONRPC.Variant
@ -27,10 +27,20 @@ defmodule EthereumJSONRPC.Geth do
def fetch_internal_transactions(transactions_params, json_rpc_named_arguments) when is_list(transactions_params) do
id_to_params = id_to_params(transactions_params)
debug_trace_transaction_timeout =
Application.get_env(:ethereum_jsonrpc, __MODULE__)[:debug_trace_transaction_timeout]
parsed_timeout = CommonHelper.parse_duration(debug_trace_transaction_timeout)
json_rpc_named_arguments_corrected_timeout =
json_rpc_named_arguments
|> put_in([:transport_options, :http_options, :timeout], parsed_timeout)
|> put_in([:transport_options, :http_options, :recv_timeout], parsed_timeout)
with {:ok, responses} <-
id_to_params
|> debug_trace_transaction_requests()
|> json_rpc(json_rpc_named_arguments) do
|> json_rpc(json_rpc_named_arguments_corrected_timeout) do
debug_trace_transaction_responses_to_internal_transactions_params(
responses,
id_to_params,

@ -0,0 +1,23 @@
defmodule EthereumJSONRPC.Utility.CommonHelper do
@moduledoc """
Common helper functions
"""
# converts duration like "5s", "2m" to milliseconds
@duration_regex ~r/^(\d+)([smh]{1})$/
def parse_duration(duration) do
case Regex.run(@duration_regex, duration) do
[_, number, granularity] ->
number
|> String.to_integer()
|> convert_to_ms(granularity)
_ ->
{:error, :invalid_format}
end
end
defp convert_to_ms(number, "s"), do: :timer.seconds(number)
defp convert_to_ms(number, "m"), do: :timer.minutes(number)
defp convert_to_ms(number, "h"), do: :timer.hours(number)
end

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -12,7 +13,7 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Arbitrum
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -17,7 +18,7 @@ config :explorer,
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545"
],
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Besu
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -17,7 +18,7 @@ config :explorer,
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545"
],
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Erigon
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -12,7 +13,7 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:7545",
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Ganache
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -12,7 +13,7 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Geth
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -17,7 +18,7 @@ config :explorer,
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545"
],
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Nethermind
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -17,7 +18,7 @@ config :explorer,
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545"
],
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.RSK
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -12,7 +13,7 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Arbitrum
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -17,7 +18,7 @@ config :explorer,
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL")
],
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Besu
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -17,7 +18,7 @@ config :explorer,
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL")
],
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Erigon
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -12,7 +13,7 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Ganache
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -12,7 +13,7 @@ config :explorer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Geth
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -17,7 +18,7 @@ config :explorer,
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL")
],
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Nethermind
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :explorer,
json_rpc_named_arguments: [
@ -17,7 +18,7 @@ config :explorer,
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL")
],
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.RSK
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :indexer,
block_interval: :timer.seconds(5),
@ -17,7 +18,7 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Arbitrum
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(10)
config :indexer,
block_interval: :timer.seconds(5),
@ -23,7 +24,7 @@ config :indexer,
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_replayBlockTransactions: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545"
],
http_options: [recv_timeout: :timer.minutes(10), timeout: :timer.minutes(10), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Besu
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(10)
config :indexer,
block_interval: :timer.seconds(5),
@ -23,7 +24,7 @@ config :indexer,
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_replayBlockTransactions: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545"
],
http_options: [recv_timeout: :timer.minutes(10), timeout: :timer.minutes(10), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Erigon
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :indexer,
block_interval: :timer.seconds(5),
@ -17,7 +18,7 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:7545",
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Ganache
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :indexer,
block_interval: :timer.seconds(5),
@ -17,7 +18,7 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Geth
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(10)
config :indexer,
block_interval: :timer.seconds(5),
@ -23,7 +24,7 @@ config :indexer,
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_replayBlockTransactions: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545"
],
http_options: [recv_timeout: :timer.minutes(10), timeout: :timer.minutes(10), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Nethermind
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(10)
config :indexer,
block_interval: :timer.seconds(5),
@ -24,7 +25,7 @@ config :indexer,
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545",
trace_replayBlockTransactions: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "http://localhost:8545"
],
http_options: [recv_timeout: :timer.minutes(10), timeout: :timer.minutes(10), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.RSK
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(5)
config :indexer,
block_interval: :timer.seconds(5),
@ -17,7 +18,7 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:8545",
http_options: [recv_timeout: :timer.minutes(5), timeout: :timer.minutes(5), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Arbitrum
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(10)
config :indexer,
block_interval: :timer.seconds(5),
@ -22,7 +23,7 @@ config :indexer,
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL")
],
http_options: [recv_timeout: :timer.minutes(10), timeout: :timer.minutes(10), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Besu
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(10)
config :indexer,
block_interval: :timer.seconds(5),
@ -22,7 +23,7 @@ config :indexer,
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL")
],
http_options: [recv_timeout: :timer.minutes(10), timeout: :timer.minutes(10), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Erigon
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(1)
config :indexer,
block_interval: :timer.seconds(5),
@ -17,7 +18,7 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:7545",
http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Ganache
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(10)
config :indexer,
block_interval: :timer.seconds(5),
@ -17,7 +18,7 @@ config :indexer,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL"),
http_options: [recv_timeout: :timer.minutes(10), timeout: :timer.minutes(10), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Geth
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout()
config :indexer,
block_interval: :timer.seconds(5),
@ -22,7 +23,7 @@ config :indexer,
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL")
],
http_options: [recv_timeout: :timer.minutes(10), timeout: :timer.minutes(10), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.Nethermind
],

@ -5,6 +5,7 @@ import Config
|> Code.eval_file()
hackney_opts = ConfigHelper.hackney_options()
timeout = ConfigHelper.timeout(10)
config :indexer,
block_interval: :timer.seconds(5),
@ -24,7 +25,7 @@ config :indexer,
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL"),
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL")
],
http_options: [recv_timeout: :timer.minutes(10), timeout: :timer.minutes(10), hackney: hackney_opts]
http_options: [recv_timeout: timeout, timeout: timeout, hackney: hackney_opts]
],
variant: EthereumJSONRPC.RSK
],

@ -10,4 +10,12 @@ defmodule ConfigHelper do
else: &1
)).()
end
def timeout(default_minutes \\ 1) do
case Integer.parse(System.get_env("ETHEREUM_JSONRPC_HTTP_TIMEOUT", "#{default_minutes * 60}")) do
{seconds, ""} -> seconds
_ -> default_minutes * 60
end
|> :timer.seconds()
end
end

@ -97,6 +97,8 @@ blockscout:
_default: '[{"title": "Marketplace", "url": "/apps", "embedded?": true}]'
ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT:
_default: '20s'
ETHEREUM_JSONRPC_HTTP_TIMEOUT:
_default: 60
INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE:
_default: 15
INDEXER_DISABLE_EMPTY_BLOCK_SANITIZER:

@ -3,6 +3,7 @@ ETHEREUM_JSONRPC_VARIANT=geth
ETHEREUM_JSONRPC_HTTP_URL=http://host.docker.internal:8545/
DATABASE_URL=postgresql://postgres:@host.docker.internal:7432/blockscout?ssl=false
ETHEREUM_JSONRPC_TRACE_URL=http://host.docker.internal:8545/
# ETHEREUM_JSONRPC_HTTP_TIMEOUT=
NETWORK=
SUBNETWORK=Awesome chain
LOGO=/images/blockscout_logo.svg

@ -376,6 +376,9 @@ endif
ifdef ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT
BLOCKSCOUT_CONTAINER_PARAMS += -e 'ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT=$(ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT)'
endif
ifdef ETHEREUM_JSONRPC_HTTP_TIMEOUT
BLOCKSCOUT_CONTAINER_PARAMS += -e 'ETHEREUM_JSONRPC_HTTP_TIMEOUT=$(ETHEREUM_JSONRPC_HTTP_TIMEOUT)'
endif
ifdef FETCH_REWARDS_WAY
BLOCKSCOUT_CONTAINER_PARAMS += -e 'FETCH_REWARDS_WAY=$(FETCH_REWARDS_WAY)'
endif

Loading…
Cancel
Save