0

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?

0

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.