Skip to content

zk-steve/offckb

Repository files navigation

OffCKB

CKB local development environment for your first try

Install

npm install -g @offckb/cli

Usage

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`

Get started

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!

Built-in scripts

Accounts

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.

Development

check development doc

About

CKB local development network for your first try.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 76.1%
  • Makefile 9.5%
  • Rust 7.0%
  • JavaScript 5.8%
  • Shell 1.2%
  • CSS 0.4%