Crates.io | icml |
lib.rs | icml |
version | 0.1.0 |
created_at | 2025-09-08 08:54:24.84441+00 |
updated_at | 2025-09-08 08:54:24.84441+00 |
description | `icml` (Internet Computer Memory Link) is a command-line utility to download and upload canister's memory as a way to backup an SQLite database to your local drive and upload it later. |
homepage | http://github.com/wasm-forge/ic-memory-link |
repository | http://github.com/wasm-forge/ic-memory-link |
max_upload_size | |
id | 1829013 |
size | 25,161 |
icml
(Internet Computer Memory Link) is a command-line utility to download and upload canister's memory as a way to backup an SQLite database to your local drive and upload it later.
Install the tool from command line:
cargo install icml
Note: dfx
needs to be installed for the tool to work.
icml download <CANISTER> <METHOD> <OUTPUT_FILE>
Expected Canister's download function signature: (offset: nat64) -> blob
This function will be called multiple times with the increasing offset until an empty blob is returned.
You can use icml
to upload your local file into a canister
icml upload <CANISTER> <METHOD> <INPUT-FILE>
Expected Canister's upload function signature: (offset: nat64, data: blob) -> ()
This function will be called multiple times with the increasing offset until a complete file is uploaded.
Download your canister snapshot with commands dfx canister snapshot download
.
Once you have access to the downloaded memory file stable_memory.bin
, you can list all the virtual memories with a non-zero length.
icml info -s stable_memory.bin
Download your canister snapshot with commands dfx canister snapshot download
.
Once you have access to the downloaded memory file stable_memory.bin
, you can extract one of the virtual memories into a local file.
In this example you have an SQLite database stored inside a virtual memory 120
:
icml extract -s stable_memory.bin -m 120 -o my_base.sqlite
In a similar fashion you can patch existing stable memory snapshot.
icml patch -s stable_memory.bin -m 120 -i my_base.sqlite
Note: currently patching only affects the stable memory file and will not change .json
in case the stable memory file size has changed.