githubEdit

rpc_modules - Arbitrum

Example code for the rpc_modules JSON RPC method. Сomplete guide on how to use rpc_modules JSON RPC in GetBlock Web3 documentation.

This method returns the current network ID of the connected Ethereum-compatible chain. Each network has a unique numeric identifier, and this method helps applications determine which chain they are interacting with.

Parameters

  • None

Request

curl --location 'https://go.getblock.us/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
   "jsonrpc": "2.0",
    "method": "rpc_modules",
    "params": []
    "id": "getblock.io"
}'

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "arb": "1.0",
        "eth": "1.0",
        "net": "1.0",
        "rpc": "1.0",
        "txpool": "1.0",
        "web3": "1.0"
    }
}

Reponse Parameter Definition

Field
Type
Description

jsonrpc

string

JSON-RPC version.

id

integer

Request identifier.

result

object

Key-value list of supported modules and versions.

Use case

The rpc_modules method helps developers to:

  • Helps tooling determine what RPC namespaces the node supports.

  • Blockchain tools use this to enable or disable features dynamically.

  • Confirms that an RPC node exposes required modules.

  • Ensures apps run only if the required modules are available.

Error handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS_TOKEN.

Integration with Web3

Using rpc_modules allows developers to:

  • Tools adapt automatically based on enabled modules.

  • Ensures required RPC namespaces exist before dApp initialization.

  • Helps compare feature sets across RPC providers.

Last updated

Was this helpful?