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/ethereum_jsonrpc
Victor Baranov cb54b6da81
Merge pull request #9168 from blockscout/kf-eip4844-blobs
9 months ago
..
config Add ETHEREUM_JSONRPC_WAIT_PER_TIMEOUT env var 1 year ago
lib Merge pull request #9168 from blockscout/kf-eip4844-blobs 9 months ago
priv/js/ethereum_jsonrpc/geth/debug_traceTransaction Fix Elixir tracer to work with polygon edge 2 years ago
test fix: tests 10 months ago
.gitignore cd apps; mix new ethereum_jsonrpc 7 years ago
README.md Rename obsolete "parity" EthereumJSONRPC.Variant to "nethermind" 2 years ago
mix.exs 6.1.0 9 months ago

README.md

EthereumJSONRPC

Ethereum JSONRPC client.

Configuration

Configuration for parity URLs can be provided with the following mix config:

config :ethereum_jsonrpc,
  url: "http://localhost:8545",
  trace_url: "http://localhost:8545",
  http: [recv_timeout: 60_000, timeout: 60_000, hackney: [pool: :ethereum_jsonrpc]]

Note: the tracing node URL is provided separately from :url, via :trace_url. The trace URL and is used for fetch_internal_transactions, which is only a supported method on tracing nodes. The :http option is passed directly to the HTTP library (HTTPoison), which forwards the options down to :hackney.

Testing

Nethermind

Mox

This is the default setup. mix test will work on its own, but to be explicit, use the following setup:

export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Nethermind.Mox
export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Mox
mix test --exclude no_nethermind

HTTP / WebSocket

export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Nethermind.HTTPWebSocket
export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Nethermind
mix test --exclude no_nethermind
Protocol URL
HTTP http://localhost:8545
WebSocket ws://localhost:8546

Geth

Mox

export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Geth.Mox
export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Mox
mix test --exclude no_geth

HTTP / WebSocket

export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Geth.HTTPWebSocket
export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Geth
mix test --exclude no_geth
Protocol URL
HTTP https://mainnet.infura.io/8lTvJTKmHPCHazkneJsY
WebSocket wss://mainnet.infura.io/ws/8lTvJTKmHPCHazkneJsY

Installation

The OTP application :ethereum_jsonrpc can be used in other umbrella OTP applications by adding ethereum_jsonrpc to your list of dependencies in mix.exs:

def deps do
  [
    {:ethereum_jsonrpc, in_umbrella: true}
  ]
end