Net API

class web3.net.Net

The web3.net object exposes methods to interact with the RPC APIs under the net_ namespace.

Properties

The following properties are available on the web3.net namespace.

Net.chainId(self)

This method is trivially implemented. It will always return None, which is a valid chainId to specify in the transaction.

If you want the real chainId of your node, you must manually determine it for now.

Note that your transactions (may be) replayable on forks of the network you intend, if Working with Local Private Keys and using a chainId of None.

>>> web3.net.chainId
None
Net.version(self)
  • Delegates to net_version RPC Method

Returns the current network chainId/version.

>>> web3.net.version
1