R5 Network
WebsiteR5 LabsGitHub
  • Getting Started
    • Hello & Welcome!
  • About R5
    • Overview
    • R5 Components
    • Consensus Mechanism
    • zkNet (Privacy)
  • R5 Coin
  • R5 Tokenomics
  • Tutorials & Guides
    • Connect & Use R5
      • R5 Desktop Wallet
      • MetaMask
      • Rabby Wallet
      • Coinbase Wallet
    • zkNet Web Wallet
    • R5 Desktop Wallet
      • Interface Overview
      • Send a Transaction
      • Receive a Transaction
      • Backup Your Wallet
      • Retrieve Your Private Key
    • How To: Deploy a Node
    • How To: Mine R5
    • How To: GPU Mine R5
    • How To: Build R5 From Source
    • How To: Connect Local Nodes
  • For Developers
    • R5 SDK
      • R5 Relayer
      • R5 Console
      • JS Console
      • CLI Wallet
      • SCdev
      • SSL Proxy
    • Hardware Requirements
    • R5 Testnet
    • R5 Devnet
    • Local Networks
    • JSON-RPC API
      • admin
      • debug
      • ethash
      • miner
      • net
      • r5 (eth)
      • rpc
      • txpool
      • web3
    • Indexer API
    • zkNet API
    • Node Configuration
    • Ethash-R5
    • Smart Contracts
    • Wrapped R5 (Native)
    • Tokens & NFTs
  • Bug Bounty Program
  • Resources
    • Website
    • R5 Labs
    • R5 Labs GitHub
Powered by GitBook
On this page
  • net_listening
  • net_peerCount
  • net_version
  1. For Developers
  2. JSON-RPC API

net

The net namespace offers RPC endpoints for retrieving network-related information about your node. These endpoints allow you to check whether the node is listening for connections, view the current peer count, and obtain the network ID. This information is useful for network diagnostics and monitoring the overall connectivity status of your R5 node.


net_listening

Description: Indicates whether the node is actively listening for network connections. This can help verify that your node is reachable and accepting incoming peer connections.

Sample Request:

{
  "jsonrpc": "2.0",
  "method": "net_listening",
  "params": [],
  "id": 1
}

Expected Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": true
}

Parameters: None.


net_peerCount

Description: Returns the number of peers currently connected to the node. The peer count is typically represented as a hexadecimal string.

Sample Request:

{
  "jsonrpc": "2.0",
  "method": "net_peerCount",
  "params": [],
  "id": 1
}

Expected Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x5"
}

Parameters: None.


net_version

Description: Provides the network ID as a string. This value represents the network on which the node is operating and is useful for ensuring that nodes are connected to the correct blockchain network.

Sample Request:

{
  "jsonrpc": "2.0",
  "method": "net_version",
  "params": [],
  "id": 1
}

Expected Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "1"
}

Parameters: None.

PreviousminerNextr5 (eth)

Last updated 2 months ago