Hope this question is not too vague: Lets say I have a full node running locally. As I understand, in theory this node contains an up-to-date state of affairs of all transactions up to the very latest block. Lets suppose I wanted to create a hypothetical transaction X. Without sending it to the actual mainnet chain, is there a way I can "play" the transaction locally and track the changes to the state machine from before transaction X and after transaction X?

How would I be able to implement this in code in practice? Any ideas where to start? Thanks!


You can fork the mainnet using hardhat and then send transactions to this forks, this means that it will simulate having the same state as mainnet, but it will work as a local development network. You can start from hardhats documentation here

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