Getting Started
Your go-to resources for dApp development on CKB.
Quick Setup with offckb
You can set up your local development environment by installing @offckb/cli. It provides a one-line command to start a Devnet, pre-funded test accounts and useful Scripts (Smart Contracts) like Omnilock and Spore-contract.
Install
npm install -g @offckb/cli
Start the Devnet
- Command
- Response
offckb node
/bin/sh: /Users/nervosDocs/.nvm/versions/node/v18.12.1/lib/node_modules/@offckb/cli/target/ckb/ckb: No such file or directory
/Users/nervosDocs/.nvm/versions/node/v18.12.1/lib/node_modules/@offckb/cli/target/ckb/ckb not found, download and install the new version 0.113.1..
CKB installed successfully.
init Devnet config folder: /Users/nervosDocs/.nvm/versions/node/v18.12.1/lib/node_modules/@offckb/cli/target/devnet
modified /Users/nervosDocs/.nvm/versions/node/v18.12.1/lib/node_modules/@offckb/cli/target/devnet/ckb-miner.toml
CKB output: 2024-03-20 07:56:44.765 +00:00 main INFO sentry sentry is disabled
CKB output: 2024-03-20 07:56:44.766 +00:00 main INFO ckb_bin::helper raise_fd_limit newly-increased limit: 61440
CKB output: 2024-03-20 07:56:44.854 +00:00 main INFO ckb_bin::subcommand::run ckb version: 0.113.1 (95ad24b 2024-01-31)
CKB output: 2024-03-20 07:56:45.320 +00:00 main INFO ckb_db_migration Init database version 20230206163640
CKB output: 2024-03-20 07:56:45.329 +00:00 main INFO ckb_launcher Touch chain spec hash: Byte32(0x3036c73473a371f3aa61c588c38924a93fb8513e481fa7c8d884fc4cf5fd368a)
While offckb offers a streamlined, one-line command to quickly start a Devnet, you can check out Custom Devnet Setup for a more nuanced configuration.
Tutorials
The examples below show in code how dApps interact with CKB Testnet scripts, along with detailed tutorials explaining how to custom/build these dApps on your local CKB dev blockchain.
Note: Never use these address in production, or share your private key with anyone.
- Transfer CKB
- Write a Message
- Create a Fungible Token
- Create a DOB
View and transfer CKB from one address to another.
Full Tutorial →Write 'Hello CKB!' to a CKB Cell and then retrieve it.
Full Tutorial →Create, view, and transfer a custom token.
Full Tutorial →Create a digital object using spore protocol.
Full Tutorial →Dev Tools
Tools tailored for dApp development to deployment on CKB.