commit
d43ec82b7d
@ -0,0 +1,47 @@ |
||||
defmodule EthereumJSONRPC.Arbitrum do |
||||
@moduledoc """ |
||||
Ethereum JSONRPC methods that are only supported by [Arbitrum L2]https://github.com/OffchainLabs/arbitrum). |
||||
""" |
||||
|
||||
@behaviour EthereumJSONRPC.Variant |
||||
|
||||
@doc """ |
||||
Block reward contract beneficiary fetching is not supported currently for Arbitrum L2. |
||||
|
||||
To signal to the caller that fetching is not supported, `:ignore` is returned. |
||||
""" |
||||
@impl EthereumJSONRPC.Variant |
||||
def fetch_beneficiaries(_block_range, _json_rpc_named_arguments), do: :ignore |
||||
|
||||
@doc """ |
||||
Internal transaction fetching is not currently supported for Arbitrum L2. |
||||
|
||||
To signal to the caller that fetching is not supported, `:ignore` is returned. |
||||
""" |
||||
@impl EthereumJSONRPC.Variant |
||||
def fetch_internal_transactions(_transactions_params, _json_rpc_named_arguments), do: :ignore |
||||
|
||||
@doc """ |
||||
Internal transaction fetching is not currently supported for Arbitrum L2. |
||||
|
||||
To signal to the caller that fetching is not supported, `:ignore` is returned. |
||||
""" |
||||
@impl EthereumJSONRPC.Variant |
||||
def fetch_block_internal_transactions(_block_range, _json_rpc_named_arguments), do: :ignore |
||||
|
||||
@doc """ |
||||
Pending transaction fetching is not supported currently for Arbitrum L2. |
||||
|
||||
To signal to the caller that fetching is not supported, `:ignore` is returned. |
||||
""" |
||||
@impl EthereumJSONRPC.Variant |
||||
def fetch_pending_transactions(_json_rpc_named_arguments), do: :ignore |
||||
|
||||
@doc """ |
||||
Traces are not supported currently for Arbitrum L2. |
||||
|
||||
To signal to the caller that fetching is not supported, `:ignore` is returned. |
||||
""" |
||||
@impl EthereumJSONRPC.Variant |
||||
def fetch_first_trace(_transactions_params, _json_rpc_named_arguments), do: :ignore |
||||
end |
@ -0,0 +1,20 @@ |
||||
use Mix.Config |
||||
|
||||
config :explorer, |
||||
json_rpc_named_arguments: [ |
||||
transport: EthereumJSONRPC.HTTP, |
||||
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: [pool: :ethereum_jsonrpc]] |
||||
], |
||||
variant: EthereumJSONRPC.Arbitrum |
||||
], |
||||
subscribe_named_arguments: [ |
||||
transport: EthereumJSONRPC.WebSocket, |
||||
transport_options: [ |
||||
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient, |
||||
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") |
||||
], |
||||
variant: EthereumJSONRPC.Arbitrum |
||||
] |
@ -0,0 +1,20 @@ |
||||
use Mix.Config |
||||
|
||||
config :explorer, |
||||
json_rpc_named_arguments: [ |
||||
transport: EthereumJSONRPC.HTTP, |
||||
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: [pool: :ethereum_jsonrpc]] |
||||
], |
||||
variant: EthereumJSONRPC.Arbitrum |
||||
], |
||||
subscribe_named_arguments: [ |
||||
transport: EthereumJSONRPC.WebSocket, |
||||
transport_options: [ |
||||
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient, |
||||
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") |
||||
], |
||||
variant: EthereumJSONRPC.Arbitrum |
||||
] |
@ -0,0 +1,13 @@ |
||||
use Mix.Config |
||||
|
||||
config :explorer, |
||||
json_rpc_named_arguments: [ |
||||
transport: EthereumJSONRPC.Mox, |
||||
transport_options: [], |
||||
variant: EthereumJSONRPC.Arbitrum |
||||
], |
||||
subscribe_named_arguments: [ |
||||
transport: EthereumJSONRPC.Mox, |
||||
transport_options: [], |
||||
variant: EthereumJSONRPC.Arbitrum |
||||
] |
@ -0,0 +1,26 @@ |
||||
use Mix.Config |
||||
|
||||
config :indexer, |
||||
block_interval: :timer.seconds(5), |
||||
json_rpc_named_arguments: [ |
||||
transport: |
||||
if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", |
||||
do: EthereumJSONRPC.HTTP, |
||||
else: EthereumJSONRPC.IPC |
||||
), |
||||
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: [pool: :ethereum_jsonrpc]] |
||||
], |
||||
variant: EthereumJSONRPC.Arbitrum |
||||
], |
||||
subscribe_named_arguments: [ |
||||
transport: |
||||
System.get_env("ETHEREUM_JSONRPC_WS_URL") && System.get_env("ETHEREUM_JSONRPC_WS_URL") !== "" && |
||||
EthereumJSONRPC.WebSocket, |
||||
transport_options: [ |
||||
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient, |
||||
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") |
||||
] |
||||
] |
@ -0,0 +1,26 @@ |
||||
use Mix.Config |
||||
|
||||
config :indexer, |
||||
block_interval: :timer.seconds(5), |
||||
json_rpc_named_arguments: [ |
||||
transport: |
||||
if(System.get_env("ETHEREUM_JSONRPC_TRANSPORT", "http") == "http", |
||||
do: EthereumJSONRPC.HTTP, |
||||
else: EthereumJSONRPC.IPC |
||||
), |
||||
transport_options: [ |
||||
http: EthereumJSONRPC.HTTP.HTTPoison, |
||||
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:7545", |
||||
http_options: [recv_timeout: :timer.minutes(5), timeout: :timer.minutes(5), hackney: [pool: :ethereum_jsonrpc]] |
||||
], |
||||
variant: EthereumJSONRPC.Arbitrum |
||||
], |
||||
subscribe_named_arguments: [ |
||||
transport: |
||||
System.get_env("ETHEREUM_JSONRPC_WS_URL") && System.get_env("ETHEREUM_JSONRPC_WS_URL") !== "" && |
||||
EthereumJSONRPC.WebSocket, |
||||
transport_options: [ |
||||
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient, |
||||
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") |
||||
] |
||||
] |
@ -0,0 +1,8 @@ |
||||
use Mix.Config |
||||
|
||||
config :indexer, |
||||
json_rpc_named_arguments: [ |
||||
transport: EthereumJSONRPC.Mox, |
||||
transport_options: [], |
||||
variant: EthereumJSONRPC.Arbitrum |
||||
] |
Loading…
Reference in new issue