How do i add more 'cycles' to the canister created from quickstart/ network deploy using public subnet?

Thanks for the public subnet!!! (i just asked on friday for a ‘common good’ subnet… your welcome :wink:

did this:
dfx ledger --network ic create-canister <dfx ledger --network ic create-canister --amount .25

returned:
Transfer sent at BlockHeight: 177260
Canister created with id: “uoewz-fiaaa-aaaah-aaacq-cai”

do:
dfx wallet --network ic balance

currently returns:
10680750675655 cycles.

do:
dfx deploy --network ic

returns:
Deploying all canisters.
Creating canisters…
Creating canister “helloIC”…
The Replica returned an error: code 5, message: “Canister uoewz-fiaaa-aaaah-aaacq-cai attempted to send 11000000000000 cycles when only 10659232753230 were available in its balance”

not sure what to do at this point… tia

try the --with-cycles flag described here

did:
dfx deploy --network ic --with-cycles 1000000000000

returned:
Deploying all canisters.
Creating canisters…
Creating canister “helloIC”…
“helloIC” canister created on network “ic” with canister id: “sfnao-7yaaa-aaaah-aaavq-cai”
Creating canister “helloIC_assets”…
“helloIC_assets” canister created on network “ic” with canister id: “sqkrd-6qaaa-aaaah-aaawa-cai”
Building canisters…
Building frontend…
Installing canisters…
Installing code for canister helloIC, with canister_id sfnao-7yaaa-aaaah-aaavq-cai
The invocation to the wallet call forward method failed with the error: An error happened during the call: 5: Could not install canister sfnao-7yaaa-aaaah-aaavq-cai as it has only 0 cycles but 858999459200 are required.

which would work if i started with that command. but I was following the guide and it said to:

did:
dfx ledger --network ic create-canister vrn7l-uocji-qfnzf-6xdsx-r33f2-qj7fd-ckbup-b4o52-azj6j-mazny-mqe --amount .25

returned:
Transfer sent at BlockHeight: 177260
Canister created with id: “uoewz-fiaaa-aaaah-aaacq-cai”

which need more added to it to complete the hello tutorial.

this is really frustrating for a new person when the basic quickstart does not compile.

You’ll want to try dfx canister --network ic deposit-cycles <cycles> [canister] for both your canisters

5 Likes

did:
dfx canister --network ic deposit-cycles 1000000000000 --all

returned:
Depositing 1000000000000 cycles onto helloIC
Deposited 1000000000000 cycles, updated balance: 1_000_000_000_000 cycles
Depositing 1000000000000 cycles onto helloIC_assets
Deposited 1000000000000 cycles, updated balance: 1_000_000_000_000 cycles

that is what i needed to know -thanks

2 Likes

I ran into a separate issue that required me to set my wallet flag. Note that this is for dfx 0.9.3

% dfx canister --network=ic deposit-cycles 200000000000 <canister_id>               
Error: The deposit cycles call needs to proxied via the wallet canister. Invoke this command without the `--no-wallet` flag.

So then I added in my wallet to the command and it worked.

% dfx canister --network=ic --wallet=<wallet_id> deposit-cycles 200000000000 <canister_id>
Depositing 200000000000 cycles onto <canister_id>
Deposited 200000000000 cycles, updated balance: 200_000_000_000 cycles

I was then able to deploy my canister.

1 Like