TriportRPC

eth_protocolVersion

POSThttps://api.triport.io/v1/eth

Returns the Ethereum wire protocol version the node speaks, as a hex-encoded integer.

Ethereumfree · 10 RPS (free) / 20 RPS (basic) / 100 RPS (pro) / 250 RPS (business)

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.

optional
No parameters.

Response

Response fields

FieldTypeDescription
jsonrpcstringJSON-RPC version, always "2.0".
idnumber | stringEchoes the id from the request.
resultstringThe 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.

CodeMeaningWhen it happens
-32001trial_expiredThe API key's trial period has ended; upgrade to a paid tier to continue.
-32003rate_limitedYou 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. 65

TypeScript 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 eth wire protocol version, not a human-facing client or network identifier. To distinguish chains, use eth_chainId or net_version.
  • The result is a hex string; convert with parseInt(result, 16) (JS) or int(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.