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?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
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.