How to get my cycles from canisters to wallet?

When I run dfx deploy backend --network ic or dfx deploy frotnend --network icI got an error saying there are not enough cycles but I have more than enough. However, I ran dfx wallet send lwdq3-vqaaa-aaaal-acwda-cai 10000000000000 --network=ic few times which causes issues

That first image looks to only have 314B cycles. You may need more on there. If you have a front end and back end canister then there should be two separate canister Ids. check .dfx/ic/canister_ds.json maybe? If that isn’t there then maybe your canister ids are elsewhere in the root in canister_ids.json? How did you create the canisters? Via dfx?

1 Like

yes via dfx. I already had 14 TC before . But after runing dfx wallet send … I lost them somewhere, However in status it still shows i have 32 TC

my canister_ids.json not inside the .dfx? it is in the root.

i create the canister via dfx long time a go

I believe i have to transfer the cycles
from the backend canister to wallet
and from frontend canister to wallet

So IIUC you have 32T cycles in canister backend, 0.3T in canister frontend, and ~1T in your wallet. To send cycles from the backend canister to the wallet it has to either call deposit_cycles on the management canister with the wallet canister’s principal as the target, or it can call wallet_receive on the wallet canister directly. In both cases you need to attach however many cycles you want to send out directly to the call

1 Like