CKB local development network for your first try.
- One-line command to start a devnet
- no docker required
- pre-funded test accounts
- built-in scripts like Omnilock and Spore-contract
- multiple minimal dApp templates to learn and get your hands dirty
Start building on Nervos blockchain, right now, right away!
- OffCKB
- Table of Contents
- Install
- Usage
- Get started
- Built-in scripts
- Accounts
- About Lumos
- Contributing
npm install -g @offckb/cli
We recommand using LTS version of Node to run offckb
Usage: offckb [options] [command]
ckb development network for your first try
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
create [your-project-name] Create a new dApp from bare templates
node Use the CKB to start devnet
clean Clean the devnet data, need to stop running the chain first
accounts Print account list info
list-hashes Use the CKB to list blockchain scripts hashes
inject-config Add offckb.config.ts to your workspace
sync-config sync offckb.config.ts in your workspace
deposit [options] [toAddress] [amountInShannon] Deposit CKB tokens to address, only devnet and testnet
transfer [options] [toAddress] [amountInShannon] Transfer CKB tokens to address, only devnet and testnet
balance [options] [toAddress] Check account balance, only devnet and testnet
deploy [options] Deploy contracts to different networks, only supports devnet and testnet
deployed-scripts [options] Show deployed contracts info on networks, only supports devnet and testnet
help [command] display help for command
Use offckb [command] -h
to learn more about a specific command.
Sometimes you might encounter sudo permission problems. Granting the current user write access to the node_modules directory can resolve the problem.
sudo chown -R $(whoami) /usr/local/lib/node_modules
npm install -g @offckb/cli
Create a new project from predefined boilerplates.
offckb create <your-project-name, eg:my-first-ckb-project>
The boilerplate can be targeting on different CKB networks. Check README.md in the project to get started.
You can create a new script project without a frontend. This is useful when you only want to develop smart contracts for CKB.
offckb create <your-project-name> --script
Note: you need to have rust/cargo/cargo-generate/clang 16+ installed in your environment to use this command. offckb doesn't do anything really, it just call ckb-script-template to do all the magic.
- xUDT nervosnetwork/rfcs#428
- commit id: 410b16c
- Omnilock https://github.com/cryptape/omnilock
- commit id: cd764d7
- AnyoneCanPay https://github.com/cryptape/anyone-can-pay
- commit id: b845b3b
- AlwaysSuccess https://github.com/nervosnetwork/ckb-production-scripts/blob/master/c/always_success.c
- commit id: 410b16c
- Spore https://github.com/sporeprotocol/spore-contract
- version: 0.2.2-beta.1
offckb
comes with 20 accounts, each account is funded with 42_000_000_00000000 capacity in the genesis block.
all the private keys are recorded in the account/keys
file.
detail informations about each account are recorded in the account/account.json
file.
offckb
uses Lumos as the CKB dApp framework to build the template projects.
check development doc