CKB local development environment for your first try
npm install -g @offckb/cli
offckb node # start the devnet of CKB, `ctrl-c` to stop running the chain
offckb clean # clean the devnet data, needs to stop running the chain first
offckb init <project-name> # init a CKB Dapp typescript boilerplate from multiple templates
offckb accounts # list 20 accounts info with prefund CKB tokens
offckb list-hashes # list built-in scripts hashes, equals `ckb list-hashes`
offckb init my-awesome-ckb-dapp
## select the template for your boilerplate
? Select a dapp template (Use arrow keys)
❯ Transfer CKB
Issue Coin With XUDT scripts
a simple dapp to check CKB balance and transfer CKB from address to address
init CKB dapp project: /Users/ckb/Desktop/offckb/my-awesome-ckb-dapp
✨ Done in 7.52s.
## start running
cd my-awesome-ckb-dapp
yarn && yarn start
## results
yarn run v1.22.19
$ parcel index.html
Server running at http://localhost:1234
✨ Built in 10ms
open another terminal and start the devnet:
offckb node
open another terminal and check the accounts to use:
offckb accounts
Copy some private keys and visit http://localhost:1234 to play basic CKB transfer!
- xUDT nervosnetwork/rfcs#428
- Omnilock https://github.com/cryptape/omnilock
- AnyoneCanPay https://github.com/cryptape/anyone-can-pay
- AlwaysSuccess https://github.com/nervosnetwork/ckb-production-scripts/blob/master/c/always_success.c
- Spore https://github.com/sporeprotocol/spore-contract
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.
check development doc