4

I want to run my own eth fork from mainnet (keeping history of transactions, balances & etc). How can I start my new geth instance that will start working after ###### block of mainnet chain? I found ganache-cli but it`s only for testing. Are there any solutions / manuals for forking eth mainnet in production?

1 Answer 1

2

To achieve this I would start off with one node (or a couple) and sync to the main net.

  • At block X, I would then server the connection with the mainnet
  • The connected nodes should continue to propagate their own blocks, which in essence is a fork
  • New nodes can join this network a continue to propagte this new fork.

A caveat is that you might have issues with the chain/network id and might have to chain this i.e. modify the genesis file and restart the nodes, otherwise the nodes might be convinced to reorg to the longest chain (i.e Mainnet) should they regain connection to the wild internet.

5
  • 1
    Would I need full-node for this? Or I can achieve same behavior with fast/light node?
    – g_arc
    Commented Dec 3, 2019 at 13:47
  • is there a better way to do this now? I have an archive node
    – CQM
    Commented Aug 18, 2021 at 3:03
  • @CQM What's the purpse? For debugging ganache has a fork option that allows passing a block number github.com/trufflesuite/ganache/tree/master#options. For production probably the best is 'forking' the geth repo.
    – Ismael
    Commented Aug 23, 2021 at 16:32
  • @Ismael to tinker with multi-part contracts that have been destroyed, before they got destroyed. feel like I need the whole chain and a reversion to that point in the chain.
    – CQM
    Commented Aug 24, 2021 at 4:57
  • 1
    @CQM Probably using ganache's fork option with a block number should be enough. If the blocks are old you might need an archive node.
    – Ismael
    Commented Aug 24, 2021 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.