curl --request POST \
--url https://bsc-mainnet.core.chainstack.com/35848e183f3e3303c8cfeacbea831cab \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "web3_clientVersion",
"params": []
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}
curl --request POST \
--url https://bsc-mainnet.core.chainstack.com/35848e183f3e3303c8cfeacbea831cab \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "web3_clientVersion",
"params": []
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}
none
string
— a string identifying the type of client, version, operating system, and language version running on the nodeweb3_clientVersion
code examplesconst { Web3 } = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);
async function getClient() {
const client = await web3.eth.getNodeInfo();
console.log(client);
}
getClient();
web3_clientVersion
method can be to verify which client is running to then decide which method to run.
Let’s say you have a DApp that needs to retrieve all of the transaction receipts in a block; the Erigon client has a method for this, eth_getBlockReceipts
, but with Geth, this method is only available starting from V1.13.0. You can use the web3_clientVersion
method in your logic to identify which client you are using to see if you have the method available.
eth_getBlockReceipts
on any EVM-compatible chain.The client running on this node.
The response is of type object
.
Was this page helpful?