I am running my own local Geth node and my main objective is to simulate some transactions and see how does the state of the blockchain change from the current one. For instance if I simulate a tx where A sends 3Eth to B, after the simulation I would like to see that in a new simulated block where only that tx was mined, addresses A and B would change. Then I could myself query from this new state the balances using web3.
My questions are:
- As I said I'm currently running my own local node. If I simulate a tx and thus create a new state of the blockchain, how would that interfere with my REAL node? Would it get de-sync? Would Geth save a parallel temporary (simulated) state so I can interact with it while the original one keeps getting sync? Would it only save as a new temporary state the addresses that changed?
- From what I've read around the way to go is to use geth's method
eth_call
. However I'm not sure if this is only for calls, or also for state changing transactions (what I'm actually interested in)? - Assuming
eth_call
is the correct method to call, how could I see what addresses' state changed (not necessarily only eth balances, could also be storage change, etc) inmediately after simulating the transaction? - I know that Truffle has an option to
--unlock
addresses with permission modifiers so you can simulate transactions calling those addresses anyway, does Geth provide something similar?
I know these are quite some questions, thanks!
Best Answer
eth_sendTransaction
. More on this here: https://eth.wiki/json-rpc/API