Based on https://github.com/dfinity/interface-spec/blob/master/spec/_attachments/ic.did
import IC "mo:ic";
let ic = actor("aaaaa-aa") : IC.Service;
or
import {ic} "mo:ic";
import {ic} "mo:ic";
let canisterId = Principal.fromText("e3mmv-5qaaa-aaaah-aadma-cai");
let canisterStatus = await ic.canister_status({canister_id = canisterId});
Debug.print("status = " # debug_show canisterStatus.status);
Debug.print("memory_size = " # debug_show canisterStatus.memory_size);
Debug.print("module_hash = " # debug_show canisterStatus.module_hash);
Debug.print("settings = " # debug_show canisterStatus.settings);
Here we set the canister controllers to a single blackhole canister.
import {ic; CanisterSettings} "mo:ic";
let canisterId = Principal.fromText("e3mmv-5qaaa-aaaah-aadma-cai");
let settings : CanisterSettings = {
freezing_threshold = null;
controllers = ?[Principal.fromText("e3mmv-5qaaa-aaaah-aadma-cai")];
memory_allocation = null;
compute_allocation = null;
};
await ic.update_settings({
canister_id = canisterId;
settings = settings;
});