net_version
返回当前连接网络的ID。
参数
无
返回值
String
- 当前连接网络的ID
- "1": Ethereum Mainnet
- "2": Morden Testnet (deprecated)
- "3": Ropsten Testnet
- "4": Rinkeby Testnet
- "42": Kovan Testnet
示例代码
请求:
curl -X POST --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}'
响应:
{
"id":67,
"jsonrpc": "2.0",
"result": "3"
}