Skip to content

Commit 2b6b3af

Browse files
authored
Merge pull request #452 from ckb-devrel/develop
Merge develop into v4
2 parents a078424 + 303f54e commit 2b6b3af

30 files changed

Lines changed: 2794 additions & 670 deletions

.changeset/brave-falcons-dance.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@offckb/cli": patch
3+
---
4+
5+
Add daemon mode and structured JSON output for agent-friendly usage, plus a `node stop` command to terminate the daemon.
6+
7+
- `offckb node --daemon` starts the CKB devnet as a detached background process and writes the PID and logs to the devnet data folder.
8+
- `offckb --json <command>` emits structured JSON log output for programmatic consumption.
9+
- `offckb node stop` reads the daemon PID file and gracefully shuts down the daemon, falling back to force-kill if necessary. It now verifies the target process identity, handles stale PID files, and cleans up on error paths.
10+
- Hardened daemon lifecycle: duplicate daemon starts are rejected, CLI entry resolution supports packaged/npx environments via `OFFCKB_CLI_PATH`, and log/PID directory creation failures are handled gracefully.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"@offckb/cli": patch
3+
---
4+
5+
Resolve Dependabot security alerts via pnpm overrides for transitive dependencies:
6+
7+
- `qs` 6.15.0 → 6.15.2
8+
- `ip-address` 10.1.0 → 10.1.1
9+
- `js-yaml` 3.14.2 → 3.15.0 / 4.1.1 → 4.2.0
10+
- `@babel/core` 7.28.6 → 7.29.7
11+
- `@eslint/plugin-kit` 0.2.8 → 0.3.4
12+
- `brace-expansion` 5.0.5 → 5.0.6
13+
14+
`elliptic` remains unfixed because a patched version (>=6.6.2) is not yet published on npm.

.changeset/integrate-ckb-tui.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@offckb/cli": minor
3+
---
4+
5+
Add `status` command to launch ckb-tui for monitoring CKB network from your node

.changeset/tasty-walls-appear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@offckb/cli": minor
3+
---
4+
5+
Refactor UDT CLI support: reuse `balance` and `transfer` commands for CKB and UDT queries, and add `offckb udt issue` / `offckb udt destroy` subcommands.

.changeset/wise-candies-stop.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/workflows/changeset-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
fi
4545
4646
- name: Comment on PR (success)
47-
if: steps.check.outputs.has_changeset == 'true'
47+
if: steps.check.outputs.has_changeset == 'true' && !github.event.pull_request.head.repo.fork
4848
uses: actions/github-script@v7
4949
with:
5050
script: |
@@ -68,7 +68,7 @@ jobs:
6868
}
6969
7070
- name: Comment on PR (failure)
71-
if: failure()
71+
if: failure() && !github.event.pull_request.head.repo.fork
7272
uses: actions/github-script@v7
7373
with:
7474
script: |

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# @offckb/cli
22

3+
## 0.4.8
4+
5+
### Patch Changes
6+
7+
- Override `form-data@>=4.0.0 <4.0.6` to `4.0.6` to fix CRLF injection (GHSA).
8+
- Override `hono@<4.12.25` to `4.12.25` to fix CORS origin reflection with credentials.
9+
10+
## 0.4.7
11+
12+
### Patch Changes
13+
14+
- 1c17600: Bump @ckb-ccc/core to 1.14.0 to fix the ws vulnerability (ws >= 8.21.0).
15+
- a687c6f: Bump default CKB version to 0.207.0
16+
- 3da9777: Replace ckb-transaction-dumper with ccc-based implementation
17+
18+
- Rewrite transaction dumper to use ccc Client and molecule codecs
19+
- Implement dep_group unpacking using ccc.mol
20+
- Remove ckb-transaction-dumper npm dependency
21+
322
## 0.4.6
423

524
### Patch Changes

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ Options:
7070

7171
Commands:
7272
node [CKB-Version] Use the CKB to start devnet
73+
node stop Stop the running CKB devnet daemon
7374
create [options] [project-name] Create a new CKB Smart Contract project in JavaScript.
7475
deploy [options] Deploy contracts to different networks, only supports devnet and testnet
7576
debug [options] Quickly debug transaction with tx-hash
@@ -81,6 +82,7 @@ Commands:
8182
transfer-all [options] [toAddress] Transfer All CKB tokens to address, only devnet and testnet
8283
balance [options] [toAddress] Check account balance, only devnet and testnet
8384
debugger Port of the raw CKB Standalone Debugger
85+
status [options] Show ckb-tui status interface
8486
config <action> [item] [value] do a configuration action
8587
help [command] display help for command
8688
```
@@ -118,6 +120,40 @@ offckb node --binary-path /path/to/your/ckb/binary
118120

119121
When using `--binary-path`, it will ignore the specified version and network, and only work for devnet.
120122

123+
**Run in Daemon Mode**
124+
125+
Start the devnet in the background so your terminal stays free:
126+
127+
```sh
128+
offckb node --daemon
129+
```
130+
131+
The daemon writes its logs and PID to the devnet data folder, for example:
132+
133+
- Logs: `~/Library/Application Support/offckb-nodejs/devnet/data/logs/daemon.log`
134+
- PID file: `~/Library/Application Support/offckb-nodejs/devnet/data/logs/daemon.pid`
135+
136+
Stop the daemon later with:
137+
138+
```sh
139+
offckb node stop
140+
```
141+
142+
**Agent-Friendly JSON Output**
143+
144+
For programmatic consumption or agent integration, add `--json` to any command to emit structured JSON logs:
145+
146+
```sh
147+
offckb node --json
148+
offckb node --daemon --json
149+
```
150+
151+
Each log line is a single JSON object:
152+
153+
```json
154+
{"level":"info","message":"Launching CKB devnet Node...","timestamp":"2026-07-07T07:10:00.000Z"}
155+
```
156+
121157
**RPC & Proxy RPC**
122158

123159
When the Devnet starts:
@@ -134,6 +170,10 @@ offckb node --network <testnet or mainnet>
134170
```
135171
Using a proxy RPC server for Testnet/Mainnet is especially helpful for debugging transactions, since failed transactions are dumped automatically.
136172

173+
**Watch Network with TUI**
174+
175+
Once you start the CKB Node, you can use `offckb status --network devnet/testnet/mainnet` to start a CKB-TUI interface to monitor the CKB network from your node.
176+
137177
### 2. Create a New Contract Project {#create-project}
138178

139179
Generate a ready-to-use smart-contract project in JS/TS using templates:

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@offckb/cli",
3-
"version": "0.4.6",
3+
"version": "0.4.8",
44
"description": "ckb development network for your first try",
55
"author": "CKB EcoFund",
66
"license": "MIT",
@@ -25,11 +25,6 @@
2525
"publishConfig": {
2626
"access": "public"
2727
},
28-
"pnpm": {
29-
"onlyBuiltDependencies": [
30-
"secp256k1"
31-
]
32-
},
3328
"scripts": {
3429
"build": "node scripts/build.js",
3530
"start": "ts-node-dev --transpile-only src/cli.ts",
@@ -78,7 +73,7 @@
7873
"typescript": "^5.3.3"
7974
},
8075
"dependencies": {
81-
"@ckb-ccc/core": "1.5.3",
76+
"@ckb-ccc/core": "1.14.0",
8277
"@iarna/toml": "^2.2.5",
8378
"@inquirer/prompts": "^7.8.6",
8479
"@types/http-proxy": "^1.17.15",

0 commit comments

Comments
 (0)