Local Light Node
To avoid high API fees, running a local node is an obvious solution. We are currently running on an Ethereum light node hosted on an Azure Virtual Machine.
To run a light node and be able to connect to your localhost RPC, install Geth, open a terminal and simply run the following :
geth --syncmode light --http --http.addr 0.0.0.0
Add the following line to your *.env file :
LOCALHOST = "http://127.0.0.1:8545" # alternatively http://localhost:8545
You are now able connect to the main net from your Python environment by running :
import os
from dotenv import load_dotenv
from web3 import Web3
load_dotenv()
web3 = Web3(Web3.HTTPProvider(os.getenv('LOCALHOST')))
We are currently considering running our own server and archive node to improve the node stability and reduce hardware provider costs.
Last modified 1yr ago