Giter Club home page Giter Club logo

ican's Introduction

image

iCAN

“The best easy-to-use Canister Management Platform in IC ecosystem”

  • Personal development space

  • Comprehensive graphical centralized management

  • Webassemblies are saved uniformly and support reuse WebAssembly

Introduction

Easy to use UI interface to deploy and manage your CANISTERS

  1. iCAN = “I” C + “Canister”

    It is an on-chain Canister management tool built on the ICP blockchain.

  2. iCAN helps developers manage the Canister they create by a graphical interface, to create contracts, download WebAssembly modules, manage Canister indicators, etc.

Functions

1.Detailed Management

  • Dynamic change of Canister’s Settings

  • More convenient Canister Management

  • Detailed description of Canister

2.Status Detection

  • Support ICP-Cycles exchange, and deposit Cycles to Canister directly

  • Timely feedback on the status of Canister, so that developers can understand the current status of Canister and manage it in time

3.Graphical Canister management Interface

  • The iCAN platform generates the user's private CAN (hub) for management, which provides the function of manage canisters and implements the logical collection of methods, making deployment more convenient and displaying details more clearly with a graphical interface.

4.Created Canister Import

  • By smart contracts, developers can safely host the Canisters they create to iCAN

5.WebAssembly Management

  • Save the lastest version of Canister's WebAssembly

  • Download the latest WebAssembly

iCAN Interface

Introduce the public interface of iCAN Canister and Hub Canister

Types

    module{
    
        public type Error = {
            #Invalid_Caller;
            #Invalid_CanisterId;
            #No_Wasm;
            #No_Record;
            #Insufficient_Cycles;
            #Ledger_Transfer_Failed : Nat; // value : log id
            #Create_Canister_Failed : Nat;
        };
    
        public type Canister = {
            name : Text;
            description : Text;
            canister_id : Principal;
            wasm : ?[Nat8];
        };
    
        public type Status = {
            cycle_balance : Nat;
            memory : Nat;
        };
    
        public type UpdateSettingsArgs = {
            canister_id : Principal;
            settings : canister_settings
        };
    
        public type TransformArgs = {
            icp_amount : Nat64; // e8s
            to_canister_id : Principal
        };
    
        public type DeployArgs = {
            name : Text;
            description : Text;
            settings : ?canister_settings;
            deploy_arguments : ?[Nat8];
            wasm : ?[Nat8];
            cycle_amount : Nat;
            preserve_wasm : Bool;
        };
    
        public type canister_settings = {
            freezing_threshold : ?Nat;
            controllers : ?[Principal];
            memory_allocation : ?Nat;
            compute_allocation : ?Nat;
        };
    
    };

iCAN Interface

    // iCAN Canister Public Service Interface
    public type iCAN = actor{

        // get your own hubs' info (call this function use your identity)
        // @return array of (Hub Name, Hub Canister Id)
        getHub : query () -> async [(Text, Principal)];

        // get current hub wasm and cycle withdraw wasm in use
        // @return (hub wasm, cycle withdraw wasm)
        getWasms : query () -> async ([Nat8], [Nat8]);

        // get administrators of ican at present
        // @return array of administrators
        getAdministrators : query () -> async [Principal];

        // create canister management hub
        // @param name : hub name
        // @param amount : icp e8s amount
        createHub : (name : Text, amount : Nat64) -> async Result.Result<Principal, Error>;

        // add hub info to your hubs
        // @param name : hub name
        // @param hub_id : hub canister principal
        addHub : (name : Text, hub_id : Principal) -> async Text;

        // delete hub from your hub set
        deleteHub : (hub_id : Principal) -> async Result.Result<(), Error>;

        // transform icp to cycles and deposit the cycles to target cansiter
        transformIcp : (args : TransformArgs) -> async Result.Result<(), Error>;

    };

Hub Interface

    public type Hub = actor{

        // get current version hub canister's wasm
        // @return Wasm Version
        getVersion : query() -> async Nat;

        // get owners of this hub canister
        // @return owners array
        getOwners : query() -> async [Principal];

        // get status of hub canister ( owner only )
        getStatus : query() -> async Result.Result<Status, Error>;

        // get canisters managed by this hub ( owner only )
        getCanisters : query() -> async Result.Result<[Canister], Error>;

        // get wasm of specified canister ( owner only )
        getWasm : query (canister_id : Principal) -> async Result.Result<[Nat8], Error>;

        // put canister into hub ( not matter if not controlled by hub canister ) ( owner only )
        // @param c : should be put into hub canister
        putCanister : (c : Canister) -> async Result.Result<(), Error>;

        // deploy canister by hub canister  ( owner only )
        // @return #ok(new canister's principal) or #err(Error)
        deployCanister : (args : DeployArgs) -> async Result.Result<Principal, Error>;

        // update canister settings  ( owner only )
        updateCanisterSettings : (args : UpdateSettingsArgs) -> async Result.Result<(), Error>;

        // start the specify canister, which should be controlled by hub canister  ( owner only )
        // @param principal : target canister's principal
        startCanister : (principal : Principal) -> async Result.Result<(), Error>;

        // stop canister ( owner only )
        // @param principal : target canister's principal
        stopCanister : (principal : Principal) -> async Result.Result<(), Error>;

        // deposit cycles to target canister ( equal to top up to target canister)
        // @param id : target canister principal, cycle amount : how much cycles should be top up
        depositCycles(id : Principal, cycle_amount : Nat, ) : async Result.Result<(), Error>;

        // delete canister from hub canister and withdraw cycles from it ( owner only )
        // @param canister's principal
        delCanister : ( id : Principal ) -> async Result.Result<(), Error>;

        // install cycle wasm to hub canister ( owner only )
        // @param wasm : cycle wasm blob (you can deploy your own cycle wasm to your hub canister)
        installCycleWasm : (wasm : [Nat8]) -> async Result.Result<(), Error>;

        // change hub owner ( owner only )
        // @param : new owners array
        changeOwner : (newOwners : [Principal]) -> async Result.Result<(), Error>;

    };

ican's People

Contributors

c-b-elite avatar zhenghaooo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.