Skip to main content
← All agent examples

Connect Ethereum, Base, and Arbitrum.

Set up one SolidRPC integration across Ethereum, Base, and Arbitrum One, verify chain IDs and current blocks, and preserve credentials for later sessions. This recipe reads blockchain data. It does not create an account, sign a transaction, or fund credit.

Pay per request with USDC is available for supported RPC calls and batches without an account where billing requirements allow. For a few reads, check its supported methods and limits before choosing account access. The downloadable scripts below use an RPC key and do not make payments.

Try SolidRPC without an account.

Copy and run these requests to check the connection. No account, API key, or payment is needed. Each command makes one read-only request and stops after 15 seconds.

Ethereum · check chain ID
curl --silent --show-error --fail-with-body --max-time 15 \
  'https://rpc.solidrpc.io/public/evm/1' \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'

Expected result: 0x1 (Ethereum, chain ID 1).

Base · check chain ID
curl --silent --show-error --fail-with-body --max-time 15 \
  'https://rpc.solidrpc.io/public/evm/8453' \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'

Expected result: 0x2105 (Base, chain ID 8453).

Arbitrum One · check chain ID
curl --silent --show-error --fail-with-body --max-time 15 \
  'https://rpc.solidrpc.io/public/evm/42161' \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'

Expected result: 0xa4b1 (Arbitrum One, chain ID 42161).

Use public RPC for small checks and light traffic. Public limits apply, including single-call requests, rate limits, and a 2 MiB response cap. Stop on errors or throttling. Indexing and production backfills need an authenticated endpoint.

Need your agent to manage keys, usage, and billing? Set up agent access with an approved budget. Free accounts do not support agent control.

Give your agent the task.

Task prompt
Configure SolidRPC for Ethereum, Base, and Arbitrum One. Reuse my saved credentials if available. Otherwise check onboarding and obtain my approval before creating an account or spending. Verify eth_chainId and eth_blockNumber for each network, then save the connection settings privately.

For the downloadable script below, use an ak_ RPC key. Follow agent account setup when you need delegated account access. A management token beginning with sa_ cannot be used for RPC calls.

Check coverage and limits.

Required methods: eth_chainId, eth_blockNumber. Read the network catalog and rate limits before a large run. One billable method call uses one response unit. Retries and range splits add requests.

Verify the catalog entries for Ethereum (1), Base (8453), and Arbitrum One (42161). Use the RPC origin returned for your environment. A key can serve multiple networks when its policy allows them. The network used to pay for credit does not determine which blockchain you query.

Run the example.

Download multichain-check.mjs and its shared rpc-client.mjs into the same folder. Review them before running. The helper refuses management tokens and redirects, sends the RPC key in a header, and makes read-only calls with bounded retries.

Configuration
# Node.js 22 or newer. Save both linked scripts in one folder.
export RPC_ORIGIN='https://rpc.solidrpc.io'
export RPC_KEY_FILE='/absolute/path/to/private/rpc-key'
Run
node multichain-check.mjs

Keep the key file outside your repository. The scripts print results without credentials. They do not automatically purchase more credit when the account runs out.

Know what success looks like.

The output has one line for each of the three networks, with the expected chain ID and latest block. This uses six calls before retries. It proves connectivity, not archive coverage, throughput, or a latency guarantee. Test the actual application methods next.

For errors, inspect HTTP status and the JSON-RPC error separately. Use the error reference. Report any partial result instead of claiming the entire task completed.

Need account access? Read the setup guide or open the management API contract.