Overview
Thenet namespace provides methods for querying network connectivity and peer information.
Methods
net_version
Returns the current network ID.Network ID as a string
- “88” for Viction mainnet
- “89” for Viction testnet
The network ID is returned as a decimal string, not hexadecimal. This differs from
eth_chainId which returns hexadecimal.net_listening
Returns true if the client is actively listening for network connections.true if listening, false otherwise
net_peerCount
Returns the number of peers currently connected to the client.Number of connected peers as a hexadecimal string
0x19 (25 in decimal) peers are connected.
Network Identifiers
Viction Mainnet
- Network ID: 88
- Chain ID: 0x58 (88 in hex)
- RPC Endpoint: https://rpc.viction.xyz
Viction Testnet
- Network ID: 89
- Chain ID: 0x59 (89 in hex)
- RPC Endpoint: https://rpc-testnet.viction.xyz
Usage Examples
JavaScript (Web3.js)
JavaScript (Ethers.js)
Python (Web3.py)
Network Diagnostics
These methods are useful for:Network Detection
Identify which Viction network (mainnet/testnet) you’re connected to
Connection Health
Verify your node is actively listening for connections
Peer Monitoring
Monitor the number of connected peers for network health
Sync Verification
Ensure your node is properly connected to the network
Troubleshooting
Low Peer Count
Ifnet_peerCount returns a very low number (less than 5):
- Check firewall settings - ensure P2P port (default 30303) is open
- Verify network connectivity
- Check if bootnodes are configured correctly
- Ensure sufficient disk space and system resources
Not Listening
Ifnet_listening returns false:
- Check if the node is fully started
- Verify the P2P port configuration
- Check for port conflicts
- Review node logs for errors
Network Mismatch
Ifnet_version returns unexpected value:
- Verify you’re connecting to the correct RPC endpoint
- Check if the node is syncing the intended network
- Review genesis configuration for custom networks