Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
13e2683
Add stub for 'dfx canister snapshot download'.
vincent-dfinity Jun 23, 2025
13450f2
Update to a new revision that works.
vincent-dfinity Jun 23, 2025
fb0a58b
Check if the directory is empty and writable, then write the metadata…
vincent-dfinity Jun 24, 2025
ed5f7e0
Support downloading snapshot data into a directory.
vincent-dfinity Jun 24, 2025
bf05133
Support downloading the Wasm chunks.
vincent-dfinity Jun 26, 2025
b92881f
Cleanup log level.
vincent-dfinity Jun 26, 2025
d6d79c9
Support uploading snapshot metadata.
vincent-dfinity Jun 27, 2025
d340568
Support uploading snapshot data.
vincent-dfinity Jul 2, 2025
c6790a1
Add the e2e test.
vincent-dfinity Jul 3, 2025
01353ce
Add retry mechanism.
vincent-dfinity Jul 3, 2025
eca43f0
Support replacing an existing snapshot.
vincent-dfinity Jul 3, 2025
f616a31
Merge branch 'master' into vincent/SDK-2010
vincent-dfinity Jul 3, 2025
d47bb8e
Reuse the logic that deals with the binary data.
vincent-dfinity Jul 7, 2025
150be2d
Merge branch 'master' into vincent/SDK-2010
vincent-dfinity Jul 7, 2025
cc3ff38
Fixed a dumb bug.
vincent-dfinity Jul 8, 2025
b6b43ba
Do not retry for snapshot metadata.
vincent-dfinity Jul 8, 2025
8cb1d0b
Handle retryable case.
vincent-dfinity Jul 9, 2025
b464562
Cast the error to AgentError.
vincent-dfinity Jul 9, 2025
bc3ba4b
Updated the agent-rs revision.
vincent-dfinity Jul 9, 2025
fa951b1
Merge branch 'master' into vincent/SDK-2010
vincent-dfinity Jul 9, 2025
d73850f
Updated Cargo.lock.
vincent-dfinity Jul 9, 2025
9b44695
Update changelog and document.
vincent-dfinity Jul 9, 2025
130386c
Adjust the test according to the review comment.
vincent-dfinity Jul 9, 2025
2f93f5d
Updated to the latest agent-r on the main branch.
vincent-dfinity Jul 10, 2025
cdf625a
Merge branch 'master' into vincent/SDK-2010
vincent-dfinity Jul 10, 2025
ae007d4
Fixed lint.
vincent-dfinity Jul 10, 2025
3adf374
Use existing json related functions.
vincent-dfinity Jul 11, 2025
b44f432
Update src/dfx/src/util/clap/parsers.rs
vincent-dfinity Jul 11, 2025
7a22ebd
Fix format.
vincent-dfinity Jul 11, 2025
0de9c63
Update the test according to the review comment.
vincent-dfinity Jul 11, 2025
9cda06a
Merge branch 'master' into vincent/SDK-2010
vincent-dfinity Jul 11, 2025
8bef0db
Use the published agent-rs instead.
vincent-dfinity Jul 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# UNRELEASED

### feat: support canister snapshot download and upload.

Added `dfx canister snapshot download` and `dfx canister snapshot upload` commands to download and upload the canister snapshot.

# 0.28.0

### fix: deps deploy works with Canister ID out of the ranges of the pocket-ic subnets
Expand Down
151 changes: 138 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ future_not_send = "warn"
candid = "0.10.11"
candid_parser = "0.1.4"
dfx-core = { path = "src/dfx-core", version = "0.1.0" }
ic-agent = { version = "0.40.1" }
ic-agent = { version = "0.41.0" }
ic-asset = { path = "src/canisters/frontend/ic-asset", version = "0.24.0" }
ic-cdk = "0.18.4"
ic-identity-hsm = { version = "0.40.1" }
ic-utils = { version = "0.40.1" }
ic-identity-hsm = { version = "0.41.0" }
ic-utils = { version = "0.41.0" }

aes-gcm = { version = "0.10.3", features = ["std"] }
anyhow = "1.0.56"
Expand Down
56 changes: 56 additions & 0 deletions docs/cli-reference/dfx-canister.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,62 @@ Use the `dfx canister snapshot list` command to list the snapshots in canister `
dfx canister snapshot list hello
```

## dfx canister snapshot download

Use the `dfx canister snapshot download` command to download an existing canister snapshot to a given directory. The downloaded data can be uploaded with `dfx canister snapshot upload`.

### Basic usage

```sh
dfx canister snapshot download <canister> <snapshot> --dir <DIR>
```

### Arguments

You can use the following arguments with the `dfx canister snapshot download` command.

| Argument | Description |
|---------------|----------------------------------------------------------------------------|
| `<canister>` | The canister to download the snapshot from. |
| `<snapshot>` | The ID of the snapshot to download. |
| --dir `<dir>` | The directory to download the snapshot to. It should be created and empty. |

### Examples

Use the `dfx canister snapshot download` command to download the snapshot `0000000000000000ffffffffff9000010101` in canister `hello` to the `output` directory:

```sh
dfx canister snapshot download hello 0000000000000000ffffffffff9000010101 --dir output
```

## dfx canister snapshot upload

Use the `dfx canister snapshot upload` command to upload a downloaded snapshot from a given directory to a canister.

### Basic usage

```sh
dfx canister snapshot upload <canister> --dir <DIR>
```

### Arguments

You can use the following arguments with the `dfx canister snapshot upload` command.

| Argument | Description |
|-----------------------|--------------------------------------------------------------------------------|
| `<canister>` | The canister to upload the snapshot to. |
| --dir `<dir>` | The directory to upload the snapshot from. |
| --replace `<replace>` | If a snapshot ID is specified, this snapshot will replace it and reuse the ID. | |

### Examples

Use the `dfx canister snapshot upload` command to upload a downloaded snapshot from the `output` directory to canister `hello`:

```sh
dfx canister snapshot upload hello --dir output
```

## dfx canister start

Use the `dfx canister start` command to restart a stopped canister on the mainnet or the local development environment.
Expand Down
Loading