Search code examples
pythonpython-3.xblockchainethereumweb3py

How to connect web3 to main ethereum network using python?


I am using web3.py on my private/test network though:

from web3 import Web3, HTTPProvider
w3 = Web3(HTTPProvider("https://private-ip:8545"))

For making connection to my private network i use this method and after performing all the oprations and testing i want to connect my API to main ethereum network.

So, my question is that how can i connect to main ethereum network ?


Solution

  • Just use the URL of a node in the main Ethereum network. That could be one you run or one someone else makes available publicly.

    Infura runs one such public node.