Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
[FINAL] feat: Canister backup and restore (#259)
Browse files Browse the repository at this point in the history
* feat: Canister backup and restore - management api

* Update comments

* Add note for stop canister

* Add comma

* fix

* Change api

* Update description and add 2 semantics methods

* Add semantics

* Add note

* Address part of comments

* Address comments

* .

* Update

* Remove didc

* Address comments

* .

* .

* changelog

* .

* Sender canister version

* address last suggestions

* .

* add version to load

* .

* .

* .

* update return type

* Change snapshot id type (#285)

* address comments

* ic.did

* ic.did

* syntax

* fixes

* fix

* Introduce `snapshot_id` in canister change details (#307)

* introduce snapshot_id in canister change details

* .

* Update spec/index.md

---------

Co-authored-by: mraszyk <[email protected]>

* fix list snapshots formal spec

* Update did file

* Move snapshot_id definition before it's used

* fix

* Update spec/index.md

* Update spec/index.md

* fixes

* notes

* changelog

---------

Co-authored-by: mraszyk <[email protected]>
Co-authored-by: Martin Raszyk <[email protected]>
Co-authored-by: Dimitris Sarlis <[email protected]>
  • Loading branch information
4 people authored Sep 26, 2024
1 parent becba5c commit ac416ec
Show file tree
Hide file tree
Showing 3 changed files with 353 additions and 19 deletions.
42 changes: 42 additions & 0 deletions spec/_attachments/ic.did
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
type canister_id = principal;
type wasm_module = blob;
type snapshot_id = blob;

type log_visibility = variant {
controllers;
Expand Down Expand Up @@ -45,6 +46,11 @@ type change_details = variant {
mode : variant { install; reinstall; upgrade };
module_hash : blob;
};
load_snapshot : record {
canister_version : nat64;
snapshot_id : snapshot_id;
taken_at_timestamp : nat64;
};
controllers_change : record {
controllers : vec principal;
};
Expand Down Expand Up @@ -358,6 +364,36 @@ type stored_chunks_result = vec chunk_hash;

type upload_chunk_result = chunk_hash;

type snapshot = record {
id : snapshot_id;
taken_at_timestamp : nat64;
total_size : nat64;
};

type take_canister_snapshot_args = record {
canister_id : canister_id;
replace_snapshot : opt snapshot_id;
};

type take_canister_snapshot_result = snapshot;

type load_canister_snapshot_args = record {
canister_id : canister_id;
snapshot_id : snapshot_id;
sender_canister_version : opt nat64;
};

type list_canister_snapshots_args = record {
canister_id : canister_id;
};

type list_canister_snapshots_result = vec snapshot;

type delete_canister_snapshot_args = record {
canister_id : canister_id;
snapshot_id : snapshot_id;
};

type fetch_canister_logs_args = record {
canister_id : canister_id;
};
Expand Down Expand Up @@ -412,6 +448,12 @@ service ic : {
provisional_create_canister_with_cycles : (provisional_create_canister_with_cycles_args) -> (provisional_create_canister_with_cycles_result);
provisional_top_up_canister : (provisional_top_up_canister_args) -> ();

// Canister snapshots
take_canister_snapshot : (take_canister_snapshot_args) -> (take_canister_snapshot_result);
load_canister_snapshot : (load_canister_snapshot_args) -> ();
list_canister_snapshots : (list_canister_snapshots_args) -> (list_canister_snapshots_result);
delete_canister_snapshot : (delete_canister_snapshot_args) -> ();

// canister logging
fetch_canister_logs : (fetch_canister_logs_args) -> (fetch_canister_logs_result) query;
};
1 change: 1 addition & 0 deletions spec/_attachments/interface-spec-changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Changelog {#changelog}

### ∞ (unreleased)
* Add new management canister methods for canister snapshot support.

### 0.27.0 (2024-09-20) {#0_27_0}
* EXPERIMENTAL: Management canister API to fetch Bitcoin block headers.
Expand Down
Loading

0 comments on commit ac416ec

Please sign in to comment.