Topping up canister just hanging

I can’t seem to send cycles:

Maybe I need to wait… It just hangs forever

Restarted my PC and it worked… weird.

Hi @jamesbeadle,

I can’t judge about the command that send cycles, but I am glad it worked now! :slight_smile:

Definitely it shouldn’t be stuck and leave you without any feedback. Wondering when this can happen :thinking: (cc @Severin)

In the future it would be great if you share the commands or at least the canister id in a written form such as y22zx-giaaa-aaaal-qmzpq-cai. That makes it easier to analyse stuff quickly, though it isn’t that important in your case.

I assume your wallet is on one of the overloaded subnets and did not respond because of that

1 Like

Yeah like now, it’s still hanging:

dfx wallet --network ic send y22zx-giaaa-aaaal-qmzpq-cai 25_000_000_000_000

I’ll just keep trying

Yeah so worked again after a little while

I’m just a new person here.
But, I noticed that the top-up canister command recently changed from
Existing: dfx cycles top-up AMOUNT CANISTER_ID --network ic
New: dfx cycles top-up CANISTER_ID AMOUNT --network ic

and I see that you’re using send rather than top-up, this could be a rookie mistake from my side, but can it be that it’s the command fault? or could be the load like @Severin said, but can you try the top-up command?

Ah nice spot could be this, I’ve actually got them topped up but I’ll try this new command next time.

The command I was using ultimately worked, just kept intermittently timing out.

1 Like

I don’t think that specifically changed, but dfx ledger top-up, dfx cycles top-up, and dfx canister deposit-cycles` have no consistent order of arguments.

In general I try to steer people away from dfx wallet send as it calls wallet_receive on the target canister which the target canister then needs to accept manually. The other commands all do deposit_cycles via the management canister, which will always succeed

here: fix: topping-up-canister Option 2 command by wantedbear007 · Pull Request #3548 · dfinity/portal · GitHub
I see that on entering the existing order there’s an error generated:
invalid value ‘jqylk-byaaa-aaaal-qbymq-cai’ for ‘’: Unknown amount specifier: ‘i’
Can you confirm me this please?
and apparently this pull was approved and docs are updated accordingly also, so I’d like to know if the change is necessary or not, thanks.

The --help flag is always the source of truth. That output is autogenerated by clap (the CLI args parsing crate we use).

❯ dfx cycles top-up --help
Send cycles to a canister

Usage: dfx cycles top-up [OPTIONS] <TO> <AMOUNT>

So yes, that PR was correct

Hi @Severin,

How do I add cycles to use this command:

I have a cycles canister in my NNS account but not sure how i get it so i can use it with dfx cycles for my user.

You have to deposit to the cycles ledger with cycles attached, specifying (record { to = record {owner = principal "[...]"}}) in the args. I don’t think that’s possible using the NNS dapp

I got it working with this command:

dfx canister --network ic deposit-cycles 30_000_000_000_000 5gbds-naaaa-aaaal-qmzqa-cai

Thanks