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?
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.