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?
Add a comment
|
1 Answer
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.
-
1Would I need full-node for this? Or I can achieve same behavior with fast/light node?– g_arcCommented Dec 3, 2019 at 13:47
-
-
@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.– CQMCommented 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