This question already has an answer here:

I want to artificially make the blockchain fork, so that some blocks are invalidated. This is for testing purpose.

Does anyone have clues on how to do this?

marked as duplicate by Richard Horrocks, Ismael, gisdev_p, eth Dec 7 '17 at 18:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You can have two nodes each mining, while nodes are connected they will stay synchronized. If you disconnect them with admin.removePeer they will start mining independently of each other and should fork eventually. If you later reconnect them both nodes should synchronice discarding the blocks mined by one of the nodes.

You have to configure each node such that they will not reconnect automatically for example usin --nodiscover in the geth commandline.

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