Capsule is an out-of-box development framework for creating smart contract on Nervos' CKB.
Capsule consists of:
- Capsule CLI - Scaffolding tool.
- CKB-testtool - CKB scripts testing framework.
CKB supports several programming languages for writing scripts, and the language supporting libraries are maintained in the following repositories:
- ckb-std - Rust
- ckb-c-stdlib - C
- ckb-lua - Lua
- Linux
- macOS
- Windows (WSL2)
The following must be installed and available to use Capsule.
- cargo - Capsule uses
cargo
to generate Rust contracts and run tests. - docker - Capsule uses
docker
container to reproducible build contracts. https://docs.docker.com/get-docker/ - ckb-cli (optional) - Capsule requires
ckb-cli
to enable the smart contract deployment feature. https://github.com/nervosnetwork/ckb-cli/releases
Note: Docker and ckb-cli must be accessible in the PATH
in order for them to be used by Capsule.
Note: The current user must have permission to manage Docker instances. How to manage Docker as a non-root user.
Install the latest version
cargo install ckb-capsule
Install the develop branch
cargo install ckb-capsule --git https://github.com/nervosnetwork/capsule.git --branch develop
capsule help
# check environment
capsule check
# create project
capsule new my-demo
cd my-demo
capsule build
capsule test
capsule.toml
- Capsule manifest file.deployment.toml
- Deployment configuration.contracts
- Contracts directory.tests
- Contracts tests.build
- Contracts binaries.migrations
- Deployment histories.