Home

Awesome

Rust Canister Development Kit

Documentation Crates.io License Downloads CI

Rust CDK provides tools for building Canisters on Internet Computer (IC).

You may be looking for:

If you are looking for a crate to communicate with existing canisters on IC, you may want to check agent-rs.

Introduction

A canister is a WebAssembly (wasm) module that can run on the Internet Computer.

To be a canister, a wasm module should communicate with the execution environment using Canister interfaces (System API).

This repo provides libraries and tools to facilitate developing canisters in Rust.

Rust CDK in Action

In Cargo.toml:

[lib]
crate-type = ["cdylib"]

[dependencies]
ic-cdk = "0.15"
candid = "0.10" # required if you want to define Candid data types

Then in Rust source code:

#[ic_cdk::query]
fn hello() -> String{
    "world".to_string()
}

Check tutorial for a detailed guidance.