Are there any tricks for debugging on mainnet?

For some reason a process fails to execute but only on mainnet and although I’ve managed to peer through the black box somewhat via assert(), whose error messages on the browser tell you the line where things went wrong, the lack of print statements on mainnet makes it a bit of a dark room to debug, especially with medium-large codebases or processes that call several functions.

How have you dealt with it?

1 Like

I’ve done self-awaits that write to a ringbuffer in my canister that I can then query. Pretty hacky solution, but it got me far enough to solve my issues

7 Likes

I like it.

One thing I’ve found useful is having a debug button in the HTML that calls a debug function in the backend, and change the content of that function depending on what I’m looking at / doesn’t work.

3 Likes