1 unstable release
0.1.0 | Jun 14, 2024 |
---|
#6 in #candid
26KB
460 lines
candid-gen
- Overview
- Features
- Installation
- Usage
- Configuration
- Contributing
- License
- Authors
- Acknowledgements
- Contact
- Links
Overview
candid-gen
is a CLI tool that automates the generation of Candid interface files from Rust canisters for Internet Computer (IC) projects. It simplifies the process of creating .did
files, ensuring that your Rust canisters are properly documented and ready for deployment on the IC.
Features
- Automatically generates Candid interface files from Rust canisters.
- Supports specifying individual canisters or generating files for all canisters in a project.
- Ensures that all necessary tools and targets are installed and available.
Installation
Prerequisites
- Rust and Cargo
rustup
withwasm32-unknown-unknown
target installedcandid-extractor
Installing
To install candid-gen
, you can use cargo install
to install the latest release published at crates.io
:
cargo install candid-gen
Or you can clone the repository and build the project from the master branch:
git clone https://github.com/cwnt-io/candid-gen.git
cd candid-gen
cargo install --path .
Usage
Command Line Interface
candid-gen [CANISTERS_NAMES]...
Arguments
[CANISTERS_NAMES]...
: Specify one or more canister names to generate Candid files. Each canister name should be provided as a separate argument. If no canister name is passed, this will generate the Candid files for every rust canister of the project.
Options
-h
,--help
: Print help information-V
,--version
: Print version information
Examples
Generate Candid files for all Rust canisters in the project:
candid-gen
Generate Candid files for specific canisters:
candid-gen canister1
candid-gen canister1 canister2
Configuration
Environment Setup
Ensure that the following tools are installed and available in your PATH:
rustup
cargo
candid-extractor
Also, make sure the wasm32-unknown-unknown
target is installed:
rustup target add wasm32-unknown-unknown
Contributing
Contributions are welcome! Please open an issue or submit a pull request if you would like to contribute to candid-gen
.
Development
To set up a development environment:
-
Clone the repository:
git clone https://github.com/cwnt-io/candid-gen.git cd candid-gen
-
Install dependencies:
cargo build
-
Run tests:
cargo test
License
This project is licensed under the terms of the Apache License 2.0. See the LICENSE file for details.
Authors
- Gustavo Basso - gubasso@cwnt.io
- Ismael Pamplona - isma@cwnt.io
Acknowledgements
- Inspired by the needs of the Internet Computer community.
- Built with Rust, Clap, and other open-source tools.
Contact
For any inquiries, please reach out to the authors via email or open an issue on GitHub.
Links
Dependencies
~5–14MB
~163K SLoC