github.com/amazechain/amc@v0.1.3/docs/jsonrpc/net.md (about) 1 # `net` Namespace 2 3 The `net` API provides information about the networking component of the node. 4 5 ## `net_listening` 6 7 Returns a `bool` indicating whether or not the node is listening for network connections. 8 9 | Client | Method invocation | 10 |--------|---------------------------------------------| 11 | RPC | `{"method": "net_listening", "params": []}` | 12 13 ### Example 14 15 ```js 16 // > {"jsonrpc":"2.0","id":1,"method":"net_listening","params":[]} 17 {"jsonrpc":"2.0","id":1,"result":true} 18 ``` 19 20 ## `net_peerCount` 21 22 Returns the number of peers connected to the node. 23 24 | Client | Method invocation | 25 |--------|---------------------------------------------| 26 | RPC | `{"method": "net_peerCount", "params": []}` | 27 28 ### Example 29 30 ```js 31 // > {"jsonrpc":"2.0","id":1,"method":"net_peerCount","params":[]} 32 {"jsonrpc":"2.0","id":1,"result":10} 33 ``` 34 35 ## `net_version` 36 37 Returns the network ID (e.g. 1 for mainnet) 38 39 | Client | Method invocation | 40 |--------|-------------------------------------------| 41 | RPC | `{"method": "net_version", "params": []}` | 42 43 ### Example 44 45 ```js 46 // > {"jsonrpc":"2.0","id":1,"method":"net_version","params":[]} 47 {"jsonrpc":"2.0","id":1,"result":1} 48 ```