Closed piwonskp closed 5 months ago
Custom RPC endpoint(s) could be implemented to allow calling functions such as tracer.lastTrace() remotely. Would you be willing to accept a PR implementing such a solution?
Sure, but how are you planning to implement this? Since to add an RPC method, I believe you need to modify the hardhat repository. Is it possible to add an RPC method to hardhat network via a plugin? Then this makes sense.
Some info that might be useful: this plugin hijacks the ethereumjs VM object which does all the low-level evm operations and collects the relevant trace data as tx keeps on executing on the VM and finally makes it available to consume through the lastTrace()
. However, this cannot work if you are using an rpc node (even if it is hardhat node over localhost, it is possible to hh node --trace
but it only works in the node terminal, not in your tests).
Use case
I would like to run a standalone node using
hardhat node
, deploy a contract from a script on it and access the trace from within the same script.Suggested solution
Custom RPC endpoint(s) could be implemented to allow calling functions such as
tracer.lastTrace()
remotely.Would you be willing to accept a PR implementing such a solution?