Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to hit geth's JSON RPC over different transports.
#!/usr/bin/env bash
curl -X POST $(curl --data '{"jsonrpc":"2.0","method":"trace_transaction","params":["0x552280896083bfe801a1f70c84011d1b4195a2c08d2221f80245380775cd6270"],"id":1}' -H "Content-Type: application/json
http --json POST http://localhost:8545 id:=$(date +%s) method='rpc_discover' params:='[]'
# Websocket
echo | websocat -B 650000 -n1 --jsonrpc ws://localhost:8546
echo '{"jsonrpc":"2.0","method":"","params":[],"id":71}' | nc -U -W1 -I653366 /tmp/geth-test.ipc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment