Code examples

Read the code. Own the configuration.

Copy request text or download a small, read-only helper for your own node or API provider.

Inspect an example without sending it

Switch networks to compare the request bodies. Copying JSON does not execute it. Replace example identifiers with the values required by your own read-only test and send requests only to an endpoint you are authorized to use.

your-next-build / request.json

READ-ONLY EXAMPLE / eth_getBalance

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBalance",
  "params": [
    "0x0000000000000000000000000000000000000000",
    "latest"
  ]
}
Example only · no live request

Run the downloadable helper locally

The helper has no package dependencies. It reads its configuration from environment variables, allows only three fixed read methods, sets a timeout, and exits with a sanitized error if the request fails. It never prompts for wallet access.

Download the Node.js read helper
export RPC_URL="YOUR_HTTPS_RPC_ENDPOINT"
export NETWORK="solana"
# Optional: set RPC_AUTHORIZATION for your provider.
node rpc-read.mjs

Configuration

VariableMeaning
RPC_URLYour HTTPS endpoint, or an HTTP localhost node.
NETWORKethereum, solana, or bitcoin.
RPC_AUTHORIZATIONOptional Authorization header value, supplied only in your local environment.
RPC_TIMEOUT_MSOptional timeout between 1,000 and 60,000 milliseconds; default 10,000.

What to add in a real application

Validate the specific result schema, compare the reported network to your expected configuration, and define precision handling for methods that return amounts. Add a reviewed retry policy only after you classify errors. The example intentionally avoids automatic retries.

See the security checklist and bounded recovery guide before turning the helper into shared application infrastructure.

Your next idea starts here. ✨

Pick a network. Understand the request. Build something good.

Open the quickstart