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
21 changes: 19 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ name: Release dig-node
# still published (a copy of the same bytes) so apt.dig.net + the installer fallback
# keep resolving byte-exact across the rename without editing the consumer repos.
#
# `dign` is a FIRST-CLASS alias binary for `dig-node` (issue #548, mirroring how `digs`
# aliases `digstore` #434): a SEPARATE `[[bin]]` target sharing the SAME entrypoint, so
# `dign <args>` behaves byte-for-byte like `dig-node <args>`. It is built + published
# ALONGSIDE `dig-node` under its own stem `dign-<ver>-<os>-<arch>[.exe]` (identical shape
# to `dig-node-*`), which the dig-installer resolves via `Repo::dign()` (a follow-up).
#
# Per OS/arch (each emitted under both stems above):
# * windows-x64 (x86_64-pc-windows-msvc, windows-latest)
# * linux-x64 (x86_64-unknown-linux-gnu, ubuntu-latest)
Expand Down Expand Up @@ -166,8 +172,10 @@ jobs:
target
key: ${{ runner.os }}-companion-build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-companion-build-${{ matrix.target }}-
- name: Build release binary
run: cargo build --release --locked --target ${{ matrix.target }} --bin dig-node
- name: Build release binaries (dig-node + dign alias)
# Build BOTH bins — `dign` is the first-class alias (issue #548, mirroring digs
# #434), published alongside `dig-node` under its own asset stem below.
run: cargo build --release --locked --target ${{ matrix.target }} --bin dig-node --bin dign
- name: Stage artifact (dual-named)
id: stage
shell: bash
Expand All @@ -183,6 +191,15 @@ jobs:
# template + the installer's pre-rename fallback). See the header comment.
cp "$SRC" "dist/dig-node-${VER}-${{ matrix.out_name }}"
cp "$SRC" "dist/dig-companion-${VER}-${{ matrix.out_name }}"
# The `dign` first-class alias (issue #548): a SEPARATE binary that behaves
# byte-for-byte like `dig-node`, published under its own `dign-*` stem (same
# shape as `dig-node-*`) so the dig-installer resolves it via Repo::dign(). Its
# filename differs from `dig-node` only by the `dig-node`->`dign` substring
# (incl. the `.exe` suffix on Windows).
DIGN_BIN="${{ matrix.bin }}"; DIGN_BIN="${DIGN_BIN/dig-node/dign}"
DIGN_SRC="target/${{ matrix.target }}/release/${DIGN_BIN}"
test -f "$DIGN_SRC" || { echo "dign binary not produced: $DIGN_SRC"; exit 1; }
cp "$DIGN_SRC" "dist/dign-${VER}-${{ matrix.out_name }}"
echo "ver=$VER" >> "$GITHUB_OUTPUT"
ls -la dist
- name: Upload build artifact
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ edition = "2021"
# (`[workspace.package].version`), so it MUST be set here for a release to fire
# (§3.6). The library crates (dig-node-core/dig-runtime/dig-wallet) keep their own
# independent versions — only the released binary tracks the workspace version.
version = "0.30.0"
version = "0.31.0"

# Release hardening, matching digstore: keep integer-overflow checks ON in release.
# The node parses untrusted serialized input and does offset/length arithmetic over
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ shipped as a **self-contained, cross-platform Rust binary** that installs as an
> configuration contract (see the Environment section). For the legacy Linux package + the
> installer's pre-rename fallback, the GitHub release also publishes each binary under the old
> `dig-companion-*` filename (identical bytes). See [`USER_JOURNEY.md`](USER_JOURNEY.md).
>
> **`dign` alias.** A shorter first-class alias binary, `dign`, ships alongside `dig-node` (mirroring
> `digs`↔`digstore`): `dign <args>` behaves identically to `dig-node <args>` — same subcommands,
> flags, `--json`, and exit codes — and each binary reports its own name in `--help`/`--version`. The
> release publishes it as `dign-<ver>-<os>-<arch>[.exe]` beside the `dig-node-*` asset.

The extension resolves `chia://` (DIG) URLs by fetching encrypted, Merkle-proven content over a DIG
RPC and then **verifying + decrypting it in the extension**. By default it talks to `rpc.dig.net`;
Expand Down Expand Up @@ -133,6 +138,8 @@ ways at once:
dig-node run # serve on 127.0.0.1:9778 until Ctrl-C
# or simply:
dig-node # bare invocation == run
# the `dign` alias is interchangeable everywhere:
dign run # identical to `dig-node run`
```

## Configuration
Expand Down
17 changes: 16 additions & 1 deletion SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,18 @@ the OS service, and every machine-readable service-identity surface are named `d
ENGINE library crate is `dig-node-core` (lib `dig_node_core`) — a distinct name from the `dig-node`
binary so the two are never confused (#216). Every machine-readable surface (`/health.service`,
`/version.service`, the CLI `--json` envelopes' `service` field) MUST report the service identity
string `"dig-node"` (`meta::SERVICE_NAME`).
string `"dig-node"` (`meta::SERVICE_NAME`) — the alias below renames only the invoked binary, never
the service identity.

2.1a. **`dign` first-class alias (issue #548).** The service shell also produces a second binary,
`dign`, a FIRST-CLASS alias for `dig-node` (mirroring how `digs` aliases `digstore`, #434). It is a
real installed binary — not a shell alias — defined as a second `[[bin]]` target
(`crates/dig-node-service/src/bin/dign.rs`) that shares the SINGLE entrypoint
`dig_node_service::run()` with `dig-node`, so there is NO duplicated logic. `dign <args>` MUST behave
IDENTICALLY to `dig-node <args>`: the same subcommands, flags, `--json` envelopes, and exit codes.
The displayed program name is derived from arg0, so `dign --help`/`--version` report `dign` while
`dig-node --help`/`--version` report `dig-node`. A release publishes `dign` alongside the primary
under the stem `dign-<ver>-<os>-<arch>[.exe]` (byte-identical shape to `dig-node-<ver>-<os>-<arch>`).

2.2. **Node library version.** The node is the first-party `dig-node-core` engine library crate in
this workspace. The constant `meta::DIG_NODE_VERSION` MUST equal the node library's crate version
Expand Down Expand Up @@ -1152,6 +1163,10 @@ passes through unchanged, with no shape to keep in sync on this side.
`run-service` (hidden; the Windows SCM entrypoint, §9.4; behaves as `run` off Windows) ·
`install` · `uninstall` · `start` · `stop` · `status` · `pair` (§7.11) · `open` (§8.5).

The `dign` alias binary (§2.1a) exposes this SAME subcommand set with the SAME semantics — `dign
<subcommand>` is equivalent to `dig-node <subcommand>` in every respect except the reported program
name.

### 8.5. `open` — the OS scheme handler (#389)

`dig-node open <link>` is the target the installer registers for the OS `chia://` and
Expand Down
9 changes: 9 additions & 0 deletions crates/dig-node-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ default-run = "dig-node"
name = "dig-node"
path = "src/main.rs"

# `dign` — a FIRST-CLASS alias binary for `dig-node` (issue #548), mirroring how `digs`
# aliases `digstore` (#434). It shares the SINGLE entrypoint `dig_node_service::run()`
# (see src/bin/dign.rs) so there is no duplicated logic; a build produces BOTH `dig-node`
# and `dign`, and each reflects its own invoked name in --help/--version. The release
# workflow publishes it alongside the primary as `dign-<ver>-<os_arch>[.exe]`.
[[bin]]
name = "dign"
path = "src/bin/dign.rs"

# A tiny stand-in for the REAL `dig-updater` beacon CLI (a separate repo/release, not
# vendored here), so the `updater.*` control-plane tests (#515) exercise a genuine child-
# process spawn — argv, stdout/exit-code parsing — without depending on that binary being
Expand Down
11 changes: 11 additions & 0 deletions crates/dig-node-service/src/bin/dign.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//! `dign` — a FIRST-CLASS alias binary for the `dig-node` service CLI (issue #548).
//!
//! `dign <args>` behaves IDENTICALLY to `dig-node <args>`: same subcommands, flags,
//! `--json`, exit codes, and help. It is a real installed binary (not a shell alias)
//! that shares the SINGLE entrypoint [`dig_node_service::run`] with `dig-node` — there is
//! no duplicated logic. clap derives the displayed program name from arg0, so
//! `dign --help`/`--version` all read `dign`.

fn main() -> std::process::ExitCode {
dig_node_service::run()
}
Loading
Loading