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
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @offckb/cli

## 0.4.10

### Patch Changes

- 406415e: Change the default devnet log filter from `warn,ckb-script=debug` to `info,ckb-script=debug` in the `ckb.toml` / `ckb-miner.toml` templates (and the config editor's embedded reference templates). A healthy devnet produces almost no `warn`-level output, which left the `offckb status` Logs panel permanently empty and looked broken; `info` keeps the per-block log stream visible while `ckb-script=debug` still surfaces script execution details. Applies to newly initialized chains — edit `[logger] filter` in your existing devnet `ckb.toml` to opt in.

- 699a850: Fix the `status` command showing missing data on devnet: enable the Terminal RPC module and the TCP listen address in the devnet `ckb.toml` template (and the config editor's embedded reference template), and pass the node's TCP listen address to ckb-tui so the system metrics, mempool, and log panels populate correctly. The devnet RPC now binds to `127.0.0.1` instead of `0.0.0.0` so the unauthenticated RPC (including the new host metrics) is no longer reachable from other machines on the network; edit `rpc.listen_address` in the devnet `ckb.toml` if you rely on remote access.
- 45b0e98: Rename `--allow-mainnet-replay-risk` to `--allow-external-key-on-mainnet-fork` (#460) — the old flag remains as a hidden deprecated alias so existing scripts keep working — and apply the fixes left over from the 0.4.9 review (#462):

- Enforce the Mainnet-fork replay guard (instead of warn-only) in `transfer-all`, `udt issue`, `udt destroy`, and `deploy`, and reject inputs created at or before the fork boundary in those transactions, mirroring `transfer`/`deposit`.
- Validate `--tx-hash` as a 0x-prefixed 32-byte hex string before it is used in debug cache paths.
- Read the fork boundary only from the spawned CKB process once it is the RPC listener, so a stale node sharing the port cannot clear the first-run flags.
- Refuse symlinked entries when copying source chain data for a fork.
- Accept xUDT type args longer than 32 bytes (owner lock hash plus flags/extension) while keeping SUDT at exactly 32 bytes.
- Give SUDT and xUDT balance scans independent `maxCells` budgets, return deep clones of the default settings from `readSettings` fallbacks, keep `config set` error messages accurate, preserve the original error in `devnet config`, use `execFile` for process lookups, align the ckb-tui download timeouts, handle cross-device installs, and add the missing Fork Mainnet/Testnet entry to the README table of contents.

- 00bfe6c: Fix the devnet config editor and `status` for existing installs. The config editor's "Edit RPC Modules" dialog now offers the `Terminal` (and `RichIndexer`) modules — its option list was still the pre-ckb-tui hardcoded set, so there was no way to enable `Terminal` from the TUI even though the bundled `ckb.toml` enables it. In addition, starting the node now upgrades a legacy devnet `ckb.toml` in place: configs initialized before the ckb-tui fix never received the `Terminal` RPC module or the enabled `tcp_listen_address` (the template is only copied into fresh config folders, and clearing chain `data/` does not touch config files), which left `offckb status` dashboards empty. The migration adds `"Terminal"` to `rpc.modules` and enables `tcp_listen_address = "127.0.0.1:18114"` while preserving existing comments and custom settings; restart the node to apply.

## 0.4.9

### Patch Changes
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ There are BREAKING CHANGES between v0.3.x and v0.4.x, make sure to read the [mig
- [4. Debug Your Contract {#debug-contract}](#4-debug-your-contract-debug-contract)
- [5. Explore Built-in Scripts {#explore-scripts}](#5-explore-built-in-scripts-explore-scripts)
- [6. Tweak Devnet Config {#tweak-devnet-config}](#6-tweak-devnet-config-tweak-devnet-config)
- [7. Fork Mainnet/Testnet Into Your Devnet {#fork-devnet}](#7-fork-mainnettestnet-into-your-devnet-fork-devnet)
- [Config Setting](#config-setting)
- [List All Settings](#list-all-settings)
- [Set CKB version](#set-ckb-version)
Expand Down Expand Up @@ -330,7 +331,7 @@ offckb system-scripts --output <output-file-path>

### 6. Tweak Devnet Config {#tweak-devnet-config}

By default, OffCKB use a fixed Devnet config. You can customize it, for example by modifying the default log level (`warn,ckb-script=debug`).
By default, OffCKB use a fixed Devnet config. You can customize it, for example by modifying the default log level (`info,ckb-script=debug`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the grammar and terminology.

Use “OffCKB uses” instead of “OffCKB use”, and call info,ckb-script=debug a log filter rather than a single log level.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 334, Update the README sentence to use the grammatically
correct “OffCKB uses” and describe `info,ckb-script=debug` as a default log
filter rather than a log level, preserving the existing customization example.


1. Open the interactive Devnet config editor:

Expand Down Expand Up @@ -414,7 +415,7 @@ On a forked devnet, `offckb system-scripts`, transfers, deploys and `offckb debu
> [!CAUTION]
> CKB transactions carry no chain id, so a transaction built on a mainnet fork that spends copied mainnet cells is also valid on mainnet (CKB provides no replay protection). offckb's own flows only use dev keys and fork-mined cells, which cannot replay. Never sign transactions with real mainnet keys against a fork unless you intend to broadcast them yourself.

`offckb transfer` fails closed on a Mainnet fork: non-built-in keys require `--allow-mainnet-replay-risk`, and inputs copied from Mainnet are rejected even with that override.
`offckb transfer` fails closed on a Mainnet fork: non-built-in keys require `--allow-external-key-on-mainnet-fork`, and inputs copied from Mainnet are rejected even with that override. (`--allow-mainnet-replay-risk` from 0.4.9 remains as a deprecated alias.)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document all guarded signing commands.

The changelog says the replay guard also covers transfer-all, udt issue, udt destroy, and deploy, but this README sentence documents only offckb transfer. Reword it as a cross-command rule and list the affected commands so users understand the same failure behavior and override requirements.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 418, Update the README replay-guard sentence to describe
the shared Mainnet-fork behavior across transfer, transfer-all, UDT issue, UDT
destroy, and deploy. Include the non-built-in-key override, Mainnet-copied input
rejection, and deprecated --allow-mainnet-replay-risk alias requirements for all
listed commands.


## Config Setting

Expand Down
2 changes: 1 addition & 1 deletion ckb/devnet/ckb-miner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data_dir = "data"
spec = { file = "specs/dev.toml" }

[logger]
filter = "warn,ckb-script=debug"
filter = "info,ckb-script=debug"
color = true
log_to_file = true
log_to_stdout = true
Expand Down
13 changes: 8 additions & 5 deletions ckb/devnet/ckb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data_dir = "data"
spec = { file = "specs/dev.toml" }

[logger]
filter = "warn,ckb-script=debug"
filter = "info,ckb-script=debug"
color = true
log_to_file = true
log_to_stdout = true
Expand Down Expand Up @@ -80,16 +80,19 @@ support_protocols = ["Ping", "Discovery", "Identify", "Feeler", "DisconnectMessa
#
# Allowing arbitrary machines to access the JSON-RPC port is dangerous and strongly discouraged.
# Please strictly limit the access to only trusted machines.
listen_address = "0.0.0.0:8114"
listen_address = "127.0.0.1:8114"

# Default is 10MiB = 10 * 1024 * 1024
max_request_body_size = 10485760

# List of API modules: ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment", "Debug", "Indexer"]
modules = ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment", "Debug", "Indexer"]
# List of API modules: ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment", "Debug", "Indexer", "RichIndexer", "Terminal"]
# "Terminal" powers ckb-tui's `get_overview` system metrics; without it those panels show N/A.
modules = ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment", "Debug", "Indexer", "Terminal"]

# By default RPC only binds to HTTP service, you can bind it to TCP and WebSocket.
# tcp_listen_address = "127.0.0.1:18114"
# The TCP service streams subscription topics (new_transaction, rejected_transaction, log, ...)
# that ckb-tui's mempool and logs dashboards rely on.
tcp_listen_address = "127.0.0.1:18114"
# ws_listen_address = "127.0.0.1:28114"
reject_ill_transactions = true

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@offckb/cli",
"version": "0.4.9",
"version": "0.4.10",
"description": "ckb development network for your first try",
"author": "CKB EcoFund",
"license": "MIT",
Expand Down Expand Up @@ -86,7 +86,7 @@
"https-proxy-agent": "^7.0.5",
"node-fetch": "2",
"semver": "^7.6.0",
"tar": "^7.5.3",
"tar": "^7.5.19",
"winston": "^3.17.0"
},
"optionalDependencies": {
Expand Down
Loading
Loading