TriportRPC

net_listening

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

Returns whether the Ethereum node is actively listening for network connections.

Ethereumfree — 10 RPS · basic 20 RPS · pro 100 RPS · business 250 RPS

net_listening reports whether the underlying Ethereum node is currently listening for inbound peer-to-peer network connections. It returns a single boolean: true when the node is accepting connections, false otherwise.

Use it as a lightweight health/liveness probe before issuing heavier calls, or as part of a monitoring loop. It takes no parameters and is available on the free tier, so it is a cheap way to confirm the endpoint is reachable and your API key is valid.

This is a read-only method in the net namespace. It does not reflect peer count — use net_peerCount for that.

Parameters

This method takes no parameters. Pass an empty array for params.

optional
No parameters.

Response

Response fields

FieldTypeDescription
jsonrpcstringJSON-RPC version, always "2.0".
idnumberEchoes the request id.
resultbooleantrue if the node is listening for network connections, otherwise false.

Errors

CodeMeaningWhen it happens
-32001trial_expiredThe API key's trial period has ended; upgrade the plan to continue.
-32003rate_limitedRequests exceeded the per-tier RPS limit (10 RPS on free). Back off and retry.

Errors are returned in the standard JSON-RPC error envelope. See the shared Errors page for the full envelope and handling guidance.

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io/v1/ethereum", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "net_listening",
    params: [],
  }),
});


const { result } = await res.json();
console.log("listening:", result); // true

TypeScript SDK (@triport/sdk)

import { Triport } from "@triport/sdk";


const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });


const listening: boolean = await triport.ethereum.rpc("net_listening", []);
console.log("listening:", listening);

Python (triport-sdk)

import os
from triport import Triport


triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])


listening = triport.ethereum.rpc("net_listening", [])
print("listening:", listening)  # True

Notes

  • The result is almost always true for a healthy synced node; a false value indicates the node has disabled inbound networking.
  • For richer connectivity diagnostics, pair this with net_peerCount (number of connected peers) and net_version (network ID).
  • No parameters and no daily quota — rate limiting is purely RPS-per-tier with burst allowance.