This repo contains an easy setup for building simple dapps on CKB.
It is based off of the following two talks I gave in preparation for an internal hackathon.
Make sure to watch those before going through the code, which will make the code a lot easier to understand.
Here are the links to the videos:
And to the slide decks:
The app is divided into 3 high level directories:
/generator/app
directory contains boilerplate code for setting up an app with the js-sdk. It also provides
some abstractions I have found useful when experimenting with dapp development.The convenient methods provided by the boilerplate are not optimal. All new scripts in here, both in generator and verification should be treated as Proof of concept and not be used in production, as they have not undergone any auditing.
The ckb-miscellaneous-scripts submodule is a fork with the following modifications
Make sure to download ckb local node and follow setup instructions there for creating a local dev
chain with cli. The boilerplate includes hardcoded values for the genesis issued capacity for ckb v0.26.2. This project was built using that version of CKB.
Inside ckb.toml
, make sure to add "info, ckb-script=debug"
to the logger.
npm run generate-js-schema
. For verifier code, just make all-via-docker
with docker in verifier/ckb-miscellaneous-scripts
repo. The shared schema that both of these use is located at shared/schema/blockchain.mol