dfx wallet --network ic balance
7601652844295 cycles.
Thanks, I’ll have to look at it tomorrow, but it might be that the error message of the cdk needs to be improved. If adding more cycles into your cycles wallet is what’s necessary to fix the problem a message like
The invocation to the wallet call forward method failed with the error: An error happened during the call: 2: Couldn’t send message
certainly is not helpful.
As I said before, it should be similar to
The Replica returned an error: code 5, message: "Canister x6x47-ziaaa-aaaah-aaakq-cai attempted to send 11000000000000 cycles when only 10341424315024 were available in its balance"
if possible.
This might be a change to the cdk-rs, I cannot say for certain right now. Thanks for the report!
Why does it cost 11T (cycles mentioned in the error message) while canister creation fee currently is only 1T?
It doesn’t “cost” 11T, I was using dfx 0.7.1 which deposits 10T cycles in addition to paying the 1T fee.
This behavior is changed in 0.7.2, where depending on if you’re deploying to a verified app versus a regular app subnet, dfx will deposit either 3T or 4T cycles after accounting for the create fee.
Of course, you can always use --with-cycles
in either dfx canister create
or dfx deploy
to specify the initial cycle balance your canister should have instead of using the default values.