How to restart a local hardhat node to initial state?

Viewed 401

I am not really sure how to restart the state of the node to the initial state. Each time I try to redeploy a contract - I'm getting the same contract, the constructor params don't change.

How to clean my local hardhat node?

1 Answers

Took me a lot longer than I'm proud to admit to figure it out, but here's the answer:

The node doesn't store the state. Every time you stop and start the node again - it is in the initial state. That's why it's important to have some scripts to set your initial node state, that is, get it in the wanted state before you do any further testing.

Related