-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug doesn't print anything #13
Comments
The solution to the e.g.
So many fast moving parts in this stuff! It would still be good to understand why the node outputs nothing. |
@forgetso You're right that We observe that this typically happens because some third-party crate is included in the |
@forgetso Your contract is making heavy use of ink!'s Until then, in order to debug your contract, you could comment out the events ‒ we know that the event logic takes up a lot of space and my hunch is that this could bring your code size sufficiently down. |
Thanks for the info. I'll look into changing to |
Hi, I'm reopening this as I now have a contract built in debug mode and I still cannot get the contracts node to print anything out. Is it normal for nothing to be printed by the node when run with this command or should it print details of blocks being produced?
I have a debug print in my constructor but it still doesn't print anything. I'm able to deploy the contract so I'm assuming the constructor function must run ok. Thanks! |
@forgetso Sorry for the late reply. This is an unfortunate bug of the UI's:
So tl;dr: Alternatives for you would be that you either execute the RPC call manually or e.g. save the debug information from your constructor to your contract's storage and then create an ink! message |
Thanks @cmichi. Is it also true that debug only prints on |
@forgetso Sorry, only seeing this now, your question somehow drowned in a sea of notifications after being back from vacation. What do you mean with Currently this printing of debug messages only works for ink! messages, not for constructors. This is only a UI limitation though, which will be fixed as soon as constructors are dry-run as well (polkadot-js/apps#5338, use-ink/contracts-ui#132). Did you manage to get debug output on the terminal by now? |
No problem about the delay. Hope you had a nice holiday! By When debugging this I started using substrate full node and changed the code so that the
This gave me
And someone helpfully pointed out that this is the I know this is now off-topic, but is there any plan to propagate these errors through to the API as part of |
When I run the node without debug logging I get the usual logs.
(base) ➜ protocol git:(captcha_solution_key) ✗ substrate-contracts-node --dev --tmp
When I run with this:
(base) ➜ protocol git:(captcha_solution_key) ✗ substrate-contracts-node --dev --tmp -lerror,runtime::contracts=debug
Nothing is printed even though I am making RPC calls to the contract.
Version is
substrate-contracts-node 0.1.0-3f63edf-x86_64-linux-gnu
EDIT
I am building my contract using
--release
flag as I otherwise getCodeTooLarge
when instantiating it. Presumably, this will silence the debug messages as per the docs?I need to debug the contract as I'm getting a
ContractTrapped
when calling it from polkadot-js. The ink unit tests don't highlight any issues and the contract balance is10.0000 kUnit
.Ink version is
3.0.0-rc6
.The text was updated successfully, but these errors were encountered: