For the complete documentation index, see llms.txt. This page is also available as Markdown.

web3_clientVersion - Scroll

Example code for the web3_clientVersion JSON-RPC method. Complete guide on how to use web3_clientVersion JSON-RPC in GetBlock Web3 documentation.

This method returns the version string of the execution client serving the GIWA Sepolia endpoint. It is used to identify the node software and version behind a GetBlock endpoint for compatibility checks and debugging.

Parameters

This method does not require any parameters. Send the request with an empty params array.

Request

curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "web3_clientVersion",
    "params": [],
    "id": "getblock.io"
}'
example.js
const axios = require('axios');

const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'web3_clientVersion',
    params: [],
    id: 'getblock.io'
}, {
    headers: { 'Content-Type': 'application/json' }
});

console.log(response.data.result);
example.py
import requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'web3_clientVersion',
        'params': [],
        'id': 'getblock.io'
    }
)

print(response.json())

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "op-geth/v1.101511.0-stable"
}

Response Parameters

Parameter
Type
Description

jsonrpc

string

JSON-RPC protocol version ("2.0")

id

string

Request identifier matching the request

result

string

Client name and version string (e.g. op-geth build tag)

Use Cases

  • Client Detection: Identify whether an endpoint runs op-geth, op-reth, or another OP Stack client

  • Compatibility Checks: Confirm the client version supports a method before calling it

  • Support Diagnostics: Report the exact build when filing an infrastructure issue

  • Monitoring: Track client version rollouts across endpoints

Error Handling

Error Code
Message
Description

-32603

Internal error

The node failed to return its version string

-32601

Method not found

The client build has web3 methods disabled

Web3 Integration

Last updated

Was this helpful?