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

net_info - Cosmos

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

Returns information about the node's network — number of peers, listening status, and per-peer connection details.

Parameters

  • None

Request Example

# JSON-RPC over HTTP POST (canonical)
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "net_info",
    "params": [],
    "id": "getblock.io"
}'

# URI over HTTP GET (alternate, for simple methods)
curl --location --request GET 'https://go.getblock.io/<ACCESS-TOKEN>/net_info'

Response Example

Response Parameters

Field
Type
Description

result.listening

boolean

Whether the node is accepting P2P connections

result.n_peers

string

Total connected peer count (decimal string)

result.peers

array

Per-peer connection records

result.peers[].node_info.moniker

string

Peer's node name

result.peers[].is_outbound

boolean

Whether the connection is outbound from this node

result.peers[].remote_ip

string

Remote peer IP address

Use Cases

  • Network topology inspection and analytics

  • Detecting isolated or poorly-connected nodes

  • Validator peer-set monitoring

Error Handling

Status Code
Error Message
Cause

404

Not Found

Missing or invalid <ACCESS-TOKEN>

-32603

Internal error

Server-side error while processing the request

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?