generate-did
A command-line tool to generate Candid (.did) files for Internet Computer Rust canisters.
Features
- Build your Rust canister and extract its Candid interface automatically.
- Simple, robust CLI.
Installation
Install from crates.io:
Usage
From your project root or from inside the canister directory, run:
- Replace
<canister_name>with the directory name of your canister (must contain aCargo.toml). - The
.didfile will always be placed in the canister directory.
Requirements
- candid-extractor must be installed and in your PATH:
- Ensure in your Rust canister code, you've called the
export_candidmacro at the end of yourlib.rsfile:
use query;
use update;
// Enable Candid export
export_candid!;
- The canister must be a Rust project with a valid
Cargo.tomland buildable to WASM.
License
This project is licensed under the MIT License.