Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
[submodule "ckb/nostr-binding"]
path = ckb/nostr-binding
url = https://github.com/cryptape/nostr-binding.git
[submodule "ckb/ckb-standalone-debugger"]
path = ckb/ckb-standalone-debugger
url = https://github.com/nervosnetwork/ckb-standalone-debugger.git
[submodule "ckb/pw-lock"]
path = ckb/pw-lock
url = https://github.com/nervosnetwork/pw-lock.git
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @offckb/cli

## 0.4.12

### Patch Changes

- a591136: Update the ckb-tui download URL to the new `nervosnetwork/ckb-tui` org repository after ckb-tui was transferred out of the original personal repo. Release assets moved with the transfer, so the pinned SHA-256 digests still match byte-for-byte and verified installs are unaffected.
- e156a5a: Fix `offckb debug` failing with `ENOENT` on the tx-file path. The debugger now splits its command line quote-aware, so the quotes `encodeBinPathForTerminal` adds around space-containing paths are stripped instead of becoming part of the file name (a regression from the native ckb-debugger switch, which passes array argv to `execFileSync` instead of a shell string).
- 4f27ae9: Add `offckb install ckb-debugger` to install the native `ckb-debugger` binary. Instead of compiling from source with `cargo install` (which needs a Rust toolchain), offckb now downloads the prebuilt release asset for the current platform from the official ckb-standalone-debugger GitHub releases, verifies its SHA-256 digest, publishes it under the offckb data directory, and puts a `ckb-debugger` shim next to the offckb binary so generated projects can find it on PATH. `offckb create` installs the native debugger automatically when it is missing. The bundled WASM debugger and its fallback logic have been removed — `offckb debug` now requires the native binary. Version checks against the configured minimum now compare numerically, so an installed binary that satisfies `tools.ckbDebugger.minVersion` is correctly recognized.
- 852b68b: Fix review findings from the v0.4.11 release merge. `offckb logs script` now scans a wider window before filtering so sparse script entries are not missed, and an unknown `offckb logs` target is rejected instead of silently reading the node log. `offckb logs -f` detects log rotation by inode change, so a rotated-in file that is already larger than the old one is re-read from the start. `offckb logs --tail` rejects zero and negative values instead of printing the entire filtered log. CKB 0.205.0 prerelease binaries (rc builds), including prereleases of newer versions, are now correctly treated as Terminal-RPC capable during chain init. A ckb-tui binary that lost its execute bit is reinstalled instead of failing at spawn time. The RPC proxy keeps appending events when a proxy.log rollover fails (previously all further events were dropped) and preserves the previous archive when the rollover's rename fails, records batched JSON-RPC requests including batched `send_transaction`, skips malformed batch members without aborting the rest of the batch, and warns instead of misreporting a parse error when `send_transaction` has no usable params. `--verbose` on `offckb node` now also enables the proxy's per-request debug lines.

## 0.4.11

### Patch Changes
Expand Down
26 changes: 2 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all omnilock anyone-can-pay xudt spore ckb-js-vm nostr-lock ckb-debugger apply-debugger-patches clean-debugger-patches
.PHONY: all omnilock anyone-can-pay xudt spore ckb-js-vm nostr-lock pw-lock secp256k1_multisig_v2

all: omnilock anyone-can-pay xudt spore ckb-js-vm nostr-lock pw-lock secp256k1_multisig_v2 ckb-debugger
all: omnilock anyone-can-pay xudt spore ckb-js-vm nostr-lock pw-lock secp256k1_multisig_v2

omnilock:
@echo "Building omnilock via submodule"
Expand Down Expand Up @@ -52,25 +52,3 @@ secp256k1_multisig_v2:
@echo "Building secp256k1_multisig_v2 via submodule"
cd ckb/ckb-system-scripts/ && make all-via-docker
cp ckb/ckb-system-scripts/specs/cells/secp256k1_blake160_multisig_all ckb/devnet/specs/secp256k1_blake160_multisig_all_v2

ckb-debugger:
@echo "Building ckb-debugger via submodule"
@echo "Applying patches to ckb-standalone-debugger..."
$(MAKE) apply-debugger-patches
cd ckb/ckb-standalone-debugger/ckb-debugger && cargo build --target wasm32-wasip1 --release
cp -r ckb/ckb-standalone-debugger/target/wasm32-wasip1/release/ckb-debugger.wasm src/tools/ckb-debugger.wasm

apply-debugger-patches:
@echo "Checking if patches need to be applied..."
@cd ckb/ckb-standalone-debugger && \
if ! git diff --quiet HEAD -- ckb-debugger/src/syscall_file_operation.rs 2>/dev/null; then \
echo "Patches already applied."; \
else \
echo "Applying WASM FileOperation patches..."; \
git apply ../../patches/0001-Add-WASM-FileOperation-syscalls-implementation.patch; \
fi

clean-debugger-patches:
@echo "Reverting ckb-debugger patches..."
@cd ckb/ckb-standalone-debugger && git reset --hard origin/develop && git clean -fd

43 changes: 26 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Commands:
transfer [options] [toAddress] [amountInCKB] Transfer CKB tokens to address, only devnet and testnet
transfer-all [options] [toAddress] Transfer All CKB tokens to address, only devnet and testnet
balance [options] [toAddress] Check account balance, only devnet and testnet
install <tool> Install a tool binary used by offckb (e.g. the native ckb-debugger)
debugger Port of the raw CKB Standalone Debugger
status [options] Show ckb-tui status interface
logs [options] [target] Show devnet logs: node (default), contract script debug output, miner, or RPC proxy events
Expand Down Expand Up @@ -218,31 +219,27 @@ offckb create <your-project-name> -c <your-contract-name>

**Note for Windows Users:**

To run mock tests in the generated project, you need to manually install `ckb-debugger` until [this upstream fix about ckb-testtool wasm](https://github.com/nervosnetwork/ckb-js-vm/pull/98) is applied.
The generated project uses `ckb-testtool` with the WASM debugger by default, which works on all platforms. To run mock tests with the _native_ debugger instead (for example, while debugging upstream WASM issues), install `ckb-debugger` once with offckb:

**Installation Steps:**
```sh
offckb install ckb-debugger
```

1. Download the latest `ckb-debugger` release for Windows from the [releases page](https://github.com/nervosnetwork/ckb-standalone-debugger/releases)
2. Extract the downloaded archive (e.g., `ckb-debugger-win64.zip`)
3. Add the extracted binary to your system PATH:
- Open "System Properties" → "Environment Variables"
- Under "System variables" or "User variables", find and edit the `Path` variable
- Click "New" and add the full path to the folder containing `ckb-debugger.exe`
- Click "OK" to save
4. Verify installation by opening a new terminal and running:
```sh
ckb-debugger --version
```
5. Disable WASM debugger in your mock test file:
- Open the mock test file (e.g., `<your-contract-name>.mock.test.ts`)
- Comment out or delete the `verifier.setWasmDebuggerEnabled(true)` line:
This downloads the prebuilt `ckb-debugger` binary for your platform from the official [ckb-standalone-debugger releases](https://github.com/nervosnetwork/ckb-standalone-debugger/releases) and puts a `ckb-debugger` shim next to the offckb binary so it is available on PATH.
Comment thread
RetricSu marked this conversation as resolved.

Then disable the WASM debugger in your mock test file:

1. Open the mock test file (e.g., `<your-contract-name>.mock.test.ts`)
2. Comment out or delete the `verifier.setWasmDebuggerEnabled(true)` line:
```typescript
// When using native ckb-debugger, comment out or delete the following line:
// verifier.setWasmDebuggerEnabled(true);
```

After completing these steps, `npm run test` should pass without mock test failures.

`offckb create` installs `ckb-debugger` for you automatically when it is missing.

### 3. Deploy Your Contract {#deploy-contract}

```sh
Expand Down Expand Up @@ -317,7 +314,19 @@ Example:
offckb debug --tx-hash <tx-hash> --single-script input[0].lock
```

All debug utilities are powered by [ckb-debugger](https://github.com/nervosnetwork/ckb-standalone-debugger/tree/develop/ckb-debugger).
All debug utilities are powered by [ckb-debugger](https://github.com/nervosnetwork/ckb-standalone-debugger/tree/develop/ckb-debugger).

**Install the Native ckb-debugger**

`offckb debug` requires the native `ckb-debugger` binary. Install it once with:

```sh
offckb install ckb-debugger
```

This downloads the prebuilt binary for your platform from the official [ckb-standalone-debugger releases](https://github.com/nervosnetwork/ckb-standalone-debugger/releases) (no Rust toolchain or compilation needed), verifies its checksum, and exposes it on PATH.

To uninstall, remove the binary under the offckb data directory (see `offckb config list`) and the `ckb-debugger` shim next to the offckb binary.

### 5. Explore Built-in Scripts {#explore-scripts}

Expand Down
1 change: 0 additions & 1 deletion ckb/ckb-standalone-debugger
Submodule ckb-standalone-debugger deleted from 991e8b
15 changes: 0 additions & 15 deletions docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,18 +284,3 @@ All script configs are generated by `ckb list-hashes` — you don't need to manu
## Updating Templates

Edit files in `templates/v4/`. Template files use `.template` extension and are processed by `src/templates/processor.ts`.

---

## Updating CKB WASM Debugger

**Prerequisites:**
- rust/cargo
- wasm32-wasip1 target: `rustup target add wasm32-wasip1`
- On Linux: `sudo apt install gcc-multilib`

Update the `ckb-standalone-debugger` submodule, then run:

```sh
make ckb-debugger
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@offckb/cli",
"version": "0.4.11",
"version": "0.4.12",
"description": "ckb development network for your first try",
"author": "CKB EcoFund",
"license": "MIT",
Expand Down
Loading
Loading