Installation Guide
This installation guide provides a step-by-step setup of all essential tools needed for completing every tutorial across the documentation.
CKB Basic Developement
This section covers the essential tools you need to develop CKB applications, including setting up the local development environment and JavaScript SDK.
1. OffCKB (≥v0.3.0)
OffCKB sets up a local CKB Devnet, allowing you to test dApps without connecting to the main network. We recommend using ≥v0.3.0.
npm install -g @offckb/cli
2. CCC (≥v0.1.0-alpha.4)
CCC is the JavaScript SDK used for interacting with CKB, helping you build transactions and interact with the blockchain. We recommend using ≥v0.1.0-alpha.4.
- NodeJS
- Custom UI
- Web Component
- React
npm install @ckb-ccc/core
npm install @ckb-ccc/ccc
npm install @ckb-ccc/connector
npm install @ckb-ccc/connector-react
Script Development-Specific Tools
This section covers additional tools needed for Script development on CKB, focusing on compiling and cross-compiling setups.
1. Make, Sed, Bash, sha256sum
These tools are often pre-installed on Unix-based systems but can be installed manually if needed. We recommend using Make (≥v4.3), Sed (≥v4.7), Bash (≥v5.0), and sha256sum (≥v9.0)
- MacOS
- Linux
- Windows
First, install Homebrew if you haven't already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then, install:
brew install make gnu-sed bash coreutils
sudo apt install make sed bash coreutils # Debian/Ubuntu
sudo dnf install make sed bash coreutils # Fedora
sudo pacman -S make sed bash coreutils # ArchLinux
Install using WSL (Windows Subsystem for Linux)
2. Rust (≥v1.71.1) and riscv64 Target
Ensure Rust is set up with the riscv64imac-unknown-none-elf target:
- MacOS
- Linux
- Windows
First, install Homebrew if you haven't already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then, install Rust:
brew install rustup
We recommend using ≥v1.71.1. You will need to add the riscv64
target:
rustup target add riscv64imac-unknown-none-elf
First, install Rust using the Rust installer:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
We recommend using ≥v1.71.1. You will need to add the riscv64
target:
rustup target add riscv64imac-unknown-none-elf
First, open your terminal and run the following command to enable script execution and install Scoop:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
iwr -useb get.scoop.sh | iex
After installing Scoop, you can install Rust:
scoop install rust
We recommend using ≥v1.71.1. You will need to add the riscv64
target:
rustup target add riscv64imac-unknown-none-elf
3. Clang (≥v18)
Clang is a compiler essential for building and running CKB Scripts. You must install ≥v18 to ensure compatibility with the latest tools and libraries.
- MacOS
- Linux
- Windows
First, install Homebrew if you haven't already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then, install Clang (≥v18):
brew install llvm@18
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18 && rm llvm.sh # Debian/Ubuntu
sudo dnf -y install clang # Fedora
sudo pacman --noconfirm -Syu clang # ArchLinux
First, open your terminal and run the following command to enable script execution and install Scoop
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
iwr -useb get.scoop.sh | iex
After installing Scoop, you can install Clang (≥v18):
scoop install llvm yasm
4. Cargo-generate (≥0.17.0)
Cargo-generate creates new Rust projects from pre-defined templates, helping set up project structure quickly and consistently. We recommend using ≥0.17.0.
cargo install cargo-generate
5. CKB-Debugger (≥0.113.0)
CKB-Debugger is a CLI tool that enables off-chain Script development and testing. We recommend using ≥0.113.0.
cargo install --git https://github.com/nervosnetwork/ckb-standalone-debugger ckb-debugger
6. ckb-js-vm
Built from the lightweight QuickJS engine, ckb-js-vm
enables you to write and execute Scripts within the CKB-VM environment.
git clone https://github.com/nervosnetwork/ckb-js-vm
cd ckb-js-vm
git submodule update --init
make all
Other Tools
This section lists additional tools commonly used in development environments. You may already have these installed, but just in case you still need them, here are installation instructions for each operating system.
1. npm (Node.js v20.18.0 LTS)
npm is a package manager included with Node.js, which helps to manage dependencies. We recommend using the v20.18.0 LTS version.
- MacOS
- Linux
- Windows
First, install Homebrew if you haven't already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then, install Node.js
brew install node@20.18.0
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
2. Yarn (≥1.22.0)
Yarn is a package manager for JavaScript projects. We recommend using ≥v1.22.0. After installing npm, you can run the following command on any operating system to install Yarn:
npm install --global yarn
3. Git (≥2.40.0)
Git is a version control system for managing and tracking code changes. We recommend using ≥v2.40.0.
- MacOS
- Linux
- Windows
First, install Homebrew if you haven't already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then, install Git:
brew install git
sudo apt install git