Is it possible to create a `tx.json` file from `forc run` for use in `forc debug`?

Question in the title, I’d like to debug why my script is failing and it’s not clear from any of the documentation how I can actually do this without having to manually write the tx.json myself.

1 Like

Just figured out I can use --dry-run but still not exactly clear how to output it as json?

Hi @mixy1 this isn’t possible right now with the current tooling but does sound like it would be really useful. I’ll open an issue for this so we can look at implementing this feature. Thanks for the suggestion!

We have also released forc-call plugin, which can be used to call functions on contracts.
Docs here: forc call - The Sway Programming Language
^ formatting needs to be addressed

To print out the receipts - you can call your contract like so:

forc-call \
  --abi ./contract-abi.json \
  <CONTRACT_ADDRESS> \
  <function> "<function-params>" --show-receipts 

It would still be great to debug after the call - hence we do plan to output this tx.json object as part of this tools response.

Yeah, in the meantime I had figured out I can just use the rust/ts sdk to output it. Would be nice if it was mentioned in the docs.