@did-btcr2/cli 0.18.1 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,6 +12,8 @@ Out of the box, `btcr2 resolve` works with zero configuration. The Bitcoin netwo
12
12
 
13
13
  Signing operations (`update`, `deactivate`, and generated `create` keys) read secret keys from an encrypted on-disk keystore. Choose a key with `--signing-key <ref>` or set an active key with `btcr2 key use <ref>`.
14
14
 
15
+ Full reference documentation lives in [`docs/`](./docs/README.md): a page per command, the global options and configuration precedence, and a guided end-to-end walkthrough on Mutinynet in [`docs/DEMO.md`](./docs/DEMO.md).
16
+
15
17
  ## Install
16
18
 
17
19
  ```bash
@@ -70,7 +72,7 @@ On a testnet with a public faucet, text-mode `create` (for a `-t k` identifier)
70
72
 
71
73
  ### resolve (alias: read)
72
74
 
73
- Required flag: `-i/--identifier`. At most one of `-r` or `-p` may be given.
75
+ Required flag: `-i/--identifier`. If both `-r` and `-p` are given, `-r` wins and `-p` is silently ignored.
74
76
 
75
77
  | Flag | Description |
76
78
  |---|---|
@@ -178,7 +180,7 @@ Read and write CLI configuration.
178
180
  |---|---|---|
179
181
  | `config init` | - | Create a default config file with one profile per network. `--force` overwrites |
180
182
  | `config get [path]` | - | Print a value at a dotted path, or the whole config. Secret values are redacted; `--show-secrets` reveals them |
181
- | `config set <path> <value>` | - | Set a value at a dotted path (value parsed as JSON when valid, else a string). An invalid enum for a known key is rejected; an unknown path warns but writes |
183
+ | `config set <path> <value>` | - | Set a value at a dotted path (value parsed as JSON when valid, else a string; known endpoint/credential/name paths are always stored as strings). An invalid enum for a known key is rejected; an unknown path warns but writes |
182
184
  | `config unset <path>` | - | Delete a value at a dotted path |
183
185
  | `config list` | `ls` | Print the entire config file. Secret values are redacted; `--show-secrets` reveals them |
184
186
  | `config validate` | - | Report unknown keys, invalid enum values, and an unsupported schema version |
@@ -194,7 +196,7 @@ Manage configuration profiles.
194
196
  |---|---|---|
195
197
  | `profile add <name>` | - | Add an empty profile |
196
198
  | `profile use <name>` | - | Set the active profile (writes `defaults.profile`) |
197
- | `profile show [name]` | - | Show a profile (defaults to the active profile) |
199
+ | `profile show [name]` | - | Show a profile (defaults to the active profile). Secret values are redacted; `--show-secrets` reveals them |
198
200
  | `profile remove <name>` | `rm` | Remove a profile |
199
201
 
200
202
  ### completion
@@ -287,10 +289,10 @@ Override precedence, highest wins: CLI flags, then environment variables, then c
287
289
  | `--btc-rest <url>` | Override Bitcoin REST endpoint (Esplora API) |
288
290
  | `--btc-rpc-url <url>` | Override Bitcoin Core RPC endpoint |
289
291
  | `--btc-rpc-user <user>` | Bitcoin Core RPC username |
290
- | `--btc-rpc-pass <pass>` | Bitcoin Core RPC password (accepts an `env:<VAR>` or `file:<path>` secret reference) |
291
292
  | `--btc-rpc-wallet <name>` | Bitcoin Core wallet name for wallet-scoped RPCs (`/wallet/<name>`) |
292
- | `--btc-rpc-header <header>` | Extra Bitcoin Core RPC header `"Key: Value"` (repeatable) |
293
- | `--btc-rest-header <header>` | Extra Bitcoin REST header `"Key: Value"` (repeatable), e.g. an API key |
293
+ | `--btc-rpc-header <header>` | Extra Bitcoin Core RPC header `"Key: Value"` (repeatable). A credential passed here is on argv: prefer `btc.rpcHeaders` in a profile |
294
+ | `--btc-signal-discovery <mode>` | Where beacon signals are read from `<indexer\|fullnode>` (default: `indexer`; `fullnode` scans blocks over Bitcoin Core RPC) |
295
+ | `--btc-rest-header <header>` | Extra Bitcoin REST header `"Key: Value"` (repeatable). A credential passed here (an API key, a bearer token) is on argv and readable through `ps`: prefer `btc.headers` in a profile |
294
296
  | `--btc-timeout <ms>` | Bitcoin REST/RPC request timeout in milliseconds (default: unbounded) |
295
297
  | `--cas-gateway <url>` | IPFS HTTP gateway for CAS reads (read-only) |
296
298
  | `--cas-rpc-url <url>` | IPFS HTTP RPC endpoint for a writable CAS (reads + writes; enables `--publish-to-cas`) |
@@ -306,10 +308,11 @@ Override precedence, highest wins: CLI flags, then environment variables, then c
306
308
  | `BTCR2_BTC_REST` | `--btc-rest` |
307
309
  | `BTCR2_BTC_RPC_URL` | `--btc-rpc-url` |
308
310
  | `BTCR2_BTC_RPC_USER` | `--btc-rpc-user` |
309
- | `BTCR2_BTC_RPC_PASS` | `--btc-rpc-pass` |
311
+ | `BTCR2_BTC_RPC_PASS` | no flag: a password on argv is readable through `ps` and shell history |
310
312
  | `BTCR2_BTC_RPC_PASS_FILE` | file whose contents are the RPC password |
311
313
  | `BTCR2_CAS_GATEWAY` | `--cas-gateway` |
312
314
  | `BTCR2_CAS_RPC_URL` | `--cas-rpc-url` |
315
+ | `BTCR2_BTC_SIGNAL_DISCOVERY` | `--btc-signal-discovery` |
313
316
  | `BTCR2_BTC_TIMEOUT` | `--btc-timeout` |
314
317
  | `BTCR2_CAS_TIMEOUT` | `--cas-timeout` |
315
318
  | `BTCR2_FEE_RATE` | `--fee-rate` |
@@ -326,7 +329,7 @@ The CLI keeps its config and keystore side by side in one home directory, resolv
326
329
 
327
330
  Default location: `<home>/config.json`. A malformed config file fails loudly (the CLI never silently falls back to public endpoints, and never overwrites an unparseable file).
328
331
 
329
- Profiles are matched by network name when `--profile` is not specified. For example, resolving a regtest DID automatically selects the `"regtest"` profile. A profile that is not named after a network can declare its network with a `network` field.
332
+ Profiles are matched by network name when neither `--profile` nor the config's `defaults.profile` selects one. For example, with no active profile set, resolving a regtest DID automatically selects the `"regtest"` profile. A profile that is not named after a network can declare its network with a `network` field.
330
333
 
331
334
  ```json
332
335
  {
@@ -365,7 +368,8 @@ Profiles are matched by network name when `--profile` is not specified. For exam
365
368
  Field notes:
366
369
 
367
370
  - **`defaults`**: `profile` selects the active profile; `network` fixes the network `create` encodes when `-n` is absent; `output` sets the default output format. `schemaVersion` is stamped on every write; a file written by a newer CLI is refused.
368
- - **`btc`**: `rest`/`rpcUrl`/`rpcUser`/`rpcPass` are endpoints and credentials; `wallet` targets a Bitcoin Core wallet (`/wallet/<name>`); `headers`/`rpcHeaders` add REST/RPC headers; `feeRate` (sats/vByte), `changeAddress`, and `timeoutMs` set broadcast and request behavior. The RPC url, user, and pass are resolved as one atomic unit, so a URL from a higher-precedence layer never inherits credentials from a lower one.
371
+ - **`btc`**: `rest`/`rpcUrl`/`rpcUser`/`rpcPass` are endpoints and credentials; `wallet` targets a Bitcoin Core wallet (`/wallet/<name>`); `headers`/`rpcHeaders` add REST/RPC headers; `feeRate` (sats/vByte), `changeAddress`, and `timeoutMs` set broadcast and request behavior;
372
+ `signalDiscovery` (`"indexer"` or `"fullnode"`) picks where beacon signals are read from. The RPC url, user, and pass are resolved as one atomic unit, so a URL from a higher-precedence layer never inherits credentials from a lower one.
369
373
  - **`cas`**: `gateway` is a read-only IPFS HTTP gateway; `cas.rpcUrl` is a writable IPFS HTTP RPC endpoint (enables `--publish-to-cas`; `rpcUrl` wins over `gateway`); `timeoutMs` bounds CAS operations (`0` disables).
370
374
  - **`identity`**: `keystore` points the profile at its own keystore file, and `default` is the profile's default signing key. Both fall **below** the corresponding `--keystore` / `--signing-key` flags.
371
375
 
@@ -373,7 +377,7 @@ Use `config validate` to check a file, and `config effective` to see the resolve
373
377
 
374
378
  ### RPC password and secrets
375
379
 
376
- `config get` and `config list` redact secret-looking values (RPC password and any `pass`/`secret`/`token` key) by default; pass `--show-secrets` to reveal them.
380
+ `config get`, `config list`, and `profile show` redact secret-looking values (the RPC password and any key matching `pass`/`secret`/`token`/`auth`/`api-key`/`credential`/`bearer`, e.g. an `Authorization` header) by default; pass `--show-secrets` to reveal them.
377
381
 
378
382
  An `rpcPass` written directly into `config.json` is stored in cleartext (the file is mode 0600 but not encrypted). For anything sensitive, keep the secret out of the file with a reference or an RPC-URL-embedded credential:
379
383