请求
curl https://eth.l0vdinfra.com/YOUR_KEY \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":1,"method":"net_version","params":[]}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "1"
}
参数与您的端点
参数
此方法没有参数。
返回值
string Network ID, e.g. "1" for Ethereum mainnet.
适用场景
Get the network ID as a decimal string.
如何解读结果
"1" on Ethereum mainnet. On most chains it equals the chain ID in decimal.
提示
- Prefer eth_chainId for signing; it is the value EIP-155 uses.
相关方法