This is a blueprint project showcasing how to setup TVM debugger. In order to do that, you need to follow a few simple steps. The first 3 steps are already done in this repo, but if you want to setup TVM debugger in your own projects, you need to do them all.
- Use the beta versions of blueprint and sandbox that include the debugger, like so:
"@ton/blueprint": "^0.23.0-debugger.2",
"@ton/sandbox": "^0.21.0-debugger.3",(put this in your package.json)
- In your test file, compile your contracts using the
doCompilefunction withdebugInfoparameter, registering the contracts' source maps, like so:
code = registerCompiledContract(await doCompile('Counter', {
debugInfo: true,
}));(put this in your .spec.ts file instead of code = await compile('Counter');)
-
In your test file, enable debugging using either the
blockchain.debugglobal property, or individually on each address(await blockchain.getContract(contract.address)).setDebug(true). -
Install the TVM Debugger VS Code extension and launch the test as usual (
yarn jest). -
Once you get the prompt
Please connect using the extension., launch Command Palette in your VS Code (usually it is bound toCtrl + Shift + P), and chooseDebug TON contract (TVM). -
Enjoy your debugging session!