Contents

net_version RPC method

Parameters:

  1. None

Returns:

  1. Result - String value of current network id. Typical values are as follows:
    1 - Ethereum Mainnet 2 - Morden Testnet (deprecated) 3 - Ropsten Testnet 4 - Rinkeby Testnet 5 - Goerli Testnet 10 - Optimism Mainnet 69 - Optimism Kovan Testnet 42 - Kovan Testnet 137 - Matic/Polygon Mainnet 80001 - Matic/Polygon Mumbai Testnet 250 - Fantom Mainnet 100 - xDAI Mainnet 56 - BSC Mainnet

Code Examples:

require 'ethereum.rb'
client = Ethereum::HttpClient.new('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/')
networkVersion = client.get_chain
puts networkVersion
Ready to try QuickNode? Start your 7-day free trial