-
Notifications
You must be signed in to change notification settings - Fork 8
/
prelude.sh
37 lines (33 loc) · 910 Bytes
/
prelude.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function install(wasm, args, cycle) {
let id = call ic.provisional_create_canister_with_cycles(record { settings = null; amount = cycle });
let S = id.canister_id;
let _ = call ic.install_code(
record {
arg = args;
wasm_module = gzip(wasm);
mode = variant { install };
canister_id = S;
}
);
S
};
function upgrade(id, wasm, args) {
call ic.install_code(
record {
arg = args;
wasm_module = gzip(wasm);
mode = variant { upgrade };
canister_id = id;
}
);
};
function uninstall(id) {
call ic.stop_canister(record { canister_id = id });
call ic.delete_canister(record { canister_id = id });
};
function get_memory(cid) {
let _ = call ic.canister_status(record { canister_id = cid });
_.memory_size
};
let mo_config = record { start_page = 16; page_limit = 4096 };
let rs_config = record { start_page = 1; page_limit = 4096 };