Skip to content
A standalone debugger enabling off-chain contract development
Rust C JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
js feat: Switch to npm based debugger loading Oct 11, 2019
src
tests feat: Upgrade debugger to CKB v0.22 Oct 9, 2019
.gitignore
.travis.yml
Cargo.toml feat: Use fixed CKB version to work around update errors Oct 10, 2019
LICENSE Initial commit Sep 10, 2019
README.md

README.md

ckb-standalone-debugger

A standalone debugger enabling off-chain contract development

Usage

For Rust usage, refer to the included tests, they are quite self-explanatory.

The interesting part here, is that by compiling this project to a WASM target, you can run CKB's script debugger either in node.js or in a modern browser. We have included a short js package showcasing how you can do that.

To make this easier, we have published an npm package which you can use directly. The js folder in the repo contains a minimal example calling the debugger. Follow those steps to set it up:

$ git clone https://github.com/nervosnetwork/ckb-standalone-debugger
$ cd ckb-standalone-debugger
$ cd js
$ npm install
$ npx webpack-dev-server

Note that you only need a valid node.js installation to play with this example, you don't need a Rust installation.

Now use your browser to open http://localhost:8080(or whatever address webpack-dev-server prompts in the terminal log), open developer tools, you will be able to find the script debugger's output.

Build notes for wasm32-unknown-unknown target

If you are building for x86_64 target, everything should works ok. However, due to certain bugs, it's now only possible to build for the wasm32-unknown-unknown target under Linux using LLVM 8. So if you do want to build the Rust package on your own, make sure you use Linux with LLVM 8 installation, have latest wasm-pack installed, then you can build via wasm-pack build.

You can’t perform that action at this time.