Recently I encountered some unpleasant lags and outages with some of the publicly available RPCs for xDai. So I looked up how to run my own node on a local machine and connect Metamask directly to this node.
Now I interface smoothly with the xDai chain. With some help from now you too can become a noderunner!
⚡️ How to upgrade from 3.0.1
Upgrading from OpenEthereum 3.0.1 to 3.2.5 entails a database upgrade which itself requires a bit of terminal work. The upgrade tool is and instructions is found at openethereum/3.1-db-upgrade-tool.
I might cover the upgrade path in more detail in a later update if need be. If you’re not comfortable with the steps of the upgrade tool you may find and delete the chain data and download it once more.
Find your build of
Get it done.
It may look like this one:
Find the little guy.
./openethereum --chain xdai --jsonrpc-port=8545 --jsonrpc-cors=all --jsonrpc-interface=all --jsonrpc-hosts=all --jsonrpc-apis=web3,eth,net,parity --ws-interface=all --ws-apis=web3,eth,net,parity,pubsub --ws-origins=all --ws-hosts=all --ws-max-connections=10 --max-peers=100
If you’re on Windows your binary will be called
Now wait for the ~30 GB of blockchain data to be downloaded.
The program may throw some errors, especially in the beginning, but these are mainly related to running a real validator node which we’re not doing here.
Once it starts syncing, it’ll look like this:
Syncing #14889406 0x6a10…e8d8 42.97 blk/s 204.1 tx/s 34.6 Mgas/s 76+ 2566 Qed #14892053 4/25 peers 5 MiB chain 132 MiB db 41 MiB queue 8 MiB sync RPC: 0 conn, 3 req/s, 327 µs`
And once you’re completely sync, it’ll look like this:
Imported #14892107 0x7963…1c14 (7 txs, 2.59 Mgas, 48 ms, 3.73 KiB) 4/25 peers 6 MiB chain 131 MiB db 0 bytes queue 7 MiB sync RPC: 0 conn, 2 req/s, 278 µs```
Now you’re ready to switch over to your brand new RPC. Fire up Metamask, go to Settings Networks, then Add Network.
Your next transaction will pass through your node looking something like this:
Transaction mined (hash 0x0000000000000000000000000000000000000000000000000000000000000000)
- Exit the openethereum process by pressing Ctrl+C.
- Keep your node synced before using it. The main drawback of running it on your own machine is that the chain state needs resyncing after, for example, system hibernation. The RPC will still work, but it will only show the last synced state.