This page will show you how to configure your execution client to serve HTTP RPC requests.
This will allow you to interact directly with the Ethereum network using your own node. No need to use a 3rd party service like Infura anymore!
You will need to add the following flags to your execution client.
{% tabs %} {% tab title="Geth" %}
--http
--http.api eth,net,web3
--http.corsdomain '*'
Please note, configuring your --http-corsdomain as per the above example will allow anyone to use your node as an RPC endpoint. Please ensure this is also paired with the appropriate firewall rule(s) to prevent this from happening.
--http.addr 0.0.0.0
--http.port 8545
This will indicate your Geth node is ready for RPC connections
{% endtab %}{% tab title="Nethermind" %}
--JsonRpc.Enabled true
--JsonRpc.Port=8545
--JsonRpc.Host="127.0.0.1"
--JsonRpc.EnabledModules=[Eth,Web3,Net,Rpc]
This will indicate your Nethermind node is ready for RPC connections
{% endtab %}{% tab title="Besu" %}
--rpc-http-api=ETH,NET,WEB3
--rpc-http-cors-origins="*"
--rpc-http-enabled=true
Please note, configuring your --rpc-http-cors-origins as per the above example will allow anyone to use your node as an RPC endpoint. Please ensure this is also paired with the appropriate firewall rule(s) to prevent this from happening.
--rpc-http-host=0.0.0.0
This will indicate your Besu node is ready for RPC connections
{% endtab %}{% tab title="Erigon" %}
--http.api=eth,erigon,web3,net,debug,trace,txpool
--http.vhosts '*'
Please note, configuring your --http.vhosts as per the above example will allow anyone to use your node as an RPC endpoint. Please ensure this is also paired with the appropriate firewall rule(s) to prevent this from happening.
--http #HTTP-RPC server (enabled by default). Use --http=false to disable it (default: true)
--http.addr value #HTTP-RPC server listening interface (default: "localhost")
--http.port value #HTTP-RPC server listening port (default: 8545)
This will indicate your Erigon node is ready for RPC connections
{% endtab %} {% endtabs %}Now you will need a wallet that allows you to add custom RPC endpoints. You can find a list of wallets with this feature via this link.
The below example will show you how to use your RPC endpoint with Metamask as it is one of the most commonly used wallets.
The specific details will vary depending on your local setup. As I am running Geth on the same machine as my Metamask installation, so I am using 127.0.0.1 as the IP address.
If your RPC is unavailable or otherwise inaccessible, it may show an error when you enter the Chain ID and won't allow you to save the network.
Success! Now you can use Metamask as you normally would with the added benefit of accessing the Ethereum network through your own node 🥳