Skip to content

Instantly share code, notes, and snippets.

@onqtam
Last active October 8, 2020 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onqtam/aaf883d46f4dab1311ca9c160df12fe4 to your computer and use it in GitHub Desktop.
Save onqtam/aaf883d46f4dab1311ca9c160df12fe4 to your computer and use it in GitHub Desktop.
running a local geth instance for nimbus

In order to use a local instance of geth you'd have to follow these steps:

  1. Make sure to have installed geth and to have it accessible on the commandline (added to PATH, etc): https://geth.ethereum.org/docs/install-and-build/installing-geth
  2. Run it with the following parameters: geth --ws --gcmode archive
    • --ws: enable the websocket RPC API so Nimbus can query the Eth1 chain using Web3 API calls
    • --gcmode archive: without this Nimbus won't be able to sync because calls to eth_call will be failing due to missing trie nodes more than 128 blocks away from the current head of the Eth1 chain. This however requires more disk space - in the case of the Goerli testnet this increases the chaindata folder from <10GB to 60GB+.
    • if you'd like to connect to an Eth2 testnet (like Medalla) instead of Eth2 mainnet you'd have to also pass --goerli so that geth connects to the Goerli Eth1 testnet where the deposit contract for the specific Eth2 testnet lives (like Medalla).
    • You can also change the listening address and port of your geth instance by specifying --ws.addr value and --ws.port value but don't forget to reflect that in the Web3 URL when starting Nimbus.
  3. Let it sync - you'll be using the fast sync mode by default and 16 months of Goerli Eth1 chain data takes about a couple of hours, but you could also use --syncmode full if you so desire. It could take a lot longer if there are problems finding peers to sync.
  4. Launch Nimbus by specifying a different Web3 address from the default one (centralized - using Infura) like this: make GOERLI_WEB3_URL=ws://localhost:8546 medalla
    • TODO: change this to not be always GOERLI_... if this document should be readable for mainnet as well
@markspanbroek
Copy link

In order to run an archive node, you need to specify --syncmode full in addition to --gcmode archive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment