🚀 We’re excited to announce our $35m Series A led by Tiger Global: Press Release, Coindesk, Bloomberg, Business Insider & RefreshMiami!

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:

from web3 import Web3, HTTPProvider
w3 = Web3(HTTPProvider('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/'))
print(w3.net.version)
Ready to try QuickNode? Start your 7-day free trial