-
Notifications
You must be signed in to change notification settings - Fork 86
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
feat: dfx cycles top-up #3419
feat: dfx cycles top-up #3419
Conversation
Describe more about difference between sending to an account and sending to a canister.
…t stdout (#3420) If the replica reports a duplicate transaction in `dfx ledger transfer`, dfx prints out a message about this. This change logs that message at info level, rather than printing it to stdout. This makes the stdout output of `dfx ledger transfer` consistent. Why info level, rather than warn level? Anyone calling `dfx ledger transfer`, even without specifying `--created-at-time`, can see this duplicate transaction message. This is because dfx retries failures, and uses a consistent created_at_time (either from `--created-at-time`, or by getting the current system time before the first attempt). It's possible that a call succeeds, but there is an i/o error before dfx receives the response. In this case dfx will retry, and get a duplicate transaction result. Motivation: #3419 (comment)
| `--created-at-time <timestamp>` | Specify the timestamp-nanoseconds for the `created_at_time` field on the transfer request. Useful for controlling transaction-de-duplication. https://internetcomputer.org/docs/current/developer-docs/integrations/icrc-1/#transaction-deduplication- | | ||
|
||
### Examples | ||
|
||
Transfer 1 billion cycles to another account: | ||
|
||
``` bash | ||
dfx cycles transfer 1000000000 --to-owner raxcz-bidhr-evrzj-qyivt-nht5a-eltcc-24qfc-o6cvi-hfw7j-dcecz-kae --network ic | ||
dfx cycles transfer raxcz-bidhr-evrzj-qyivt-nht5a-eltcc-24qfc-o6cvi-hfw7j-dcecz-kae 1000000000 --network ic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there going to be support to specify the amount in a more human-readable format like 100B
or 10T
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great idea for a future improvement. I'll create a ticket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Thomas Locher <[email protected]>
Co-authored-by: Thomas Locher <[email protected]>
Co-authored-by: Thomas Locher <[email protected]>
Description
Added
dfx cycles top-up <to canister name or principal> <amount>
for transferring cycles from your account to a canister.Also changed the
--to-owner
parameter ofdfx cycles transfer
to be positional, and updated the tests and docs for it, sincedfx cycles transfer
anddfx cycles top-up
will now be separate commands.Fixes https://dfinity.atlassian.net/browse/SDK-1163
How Has This Been Tested?
Updated and added e2e tests.
Checklist: