eth_protocolVersion
https://api.triport.io/v1/ethReturns the Ethereum wire protocol version the node speaks, as a hex-encoded integer.
eth_protocolVersion reports the version of the Ethereum wire (devp2p eth)
protocol the underlying node implements. It is a connectivity- and
capability-probe method: use it to confirm your endpoint is reachable and
authenticated before issuing heavier calls, or to record which protocol
generation served a request.
The result is a string containing a hex-encoded integer (for example "0x41"
= 65, the eth/65 wire protocol). It is not the chain ID, the client
version, or the EVM/network version — for those see
net_version, eth_chainId, and
web3_clientVersion.
This method takes no parameters and is available on the free tier.
Parameters
This method takes no parameters. Pass an empty params array.
——optionalResponse
Response fields
| Field | Type | Description |
|---|---|---|
jsonrpc | string | JSON-RPC version, always "2.0". |
id | number | string | Echoes the id from the request. |
result | string | The wire protocol version as a hex-encoded integer (e.g. "0x41" for eth/65). |
Errors
Errors are returned in the standard JSON-RPC error envelope. See errors.md for the full envelope and shared codes.
| Code | Meaning | When it happens |
|---|---|---|
-32001 | trial_expired | The API key's trial period has ended; upgrade to a paid tier to continue. |
-32003 | rate_limited | You exceeded your tier's request-per-second limit (10/20/100/250 RPS). Back off and retry. |
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/eth", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "eth_protocolVersion",
params: [],
}),
});
const { result } = await res.json();
console.log("eth wire protocol:", parseInt(result, 16)); // e.g. 65TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const version = await triport.eth.protocolVersion();
console.log(version); // "0x41"Python (triport-sdk)
import os
from triport import Triport
triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])
version = triport.eth.protocol_version()
print(version) # "0x41"Notes
- The value is the devp2p
ethwire protocol version, not a human-facing client or network identifier. To distinguish chains, useeth_chainIdornet_version. - The result is a hex string; convert with
parseInt(result, 16)(JS) orint(result, 16)(Python) if you need a number. - Because it is cheap and parameterless, this method is a good lightweight health/auth check for your endpoint and key.