@orangecheck/vote-cli 0.7.4 → 0.7.6

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
@@ -18,6 +18,8 @@ npx -y @orangecheck/vote-cli tally <poll_id>
18
18
 
19
19
  Fetch the poll and all ballots from Nostr, verify every BIP-322 signature, look up UTXO state at the declared snapshot block from mempool.space, and run the pure tally function. In an anchored poll (deadline on or after 2026-11-15T00:00:00Z) it also reads every OC Stamp over each ballot and checks each anchor against block headers itself, and says whether the count is final or provisional. Output matches what any conforming implementation produces.
20
20
 
21
+ It counts only from a complete ballot read: all but one of the relays asked (4 of the 5 defaults) must finish it, and none may cut its answer short. Otherwise a clock-dated poll's tally says it can't count and exits non-zero, and an anchored poll's count stays provisional and says why.
22
+
21
23
  ```
22
24
  $ oc-vote tally 3054390f047f2703186943a41178bc15931500b5139229517f26e56282026ee5
23
25
 
@@ -41,12 +43,26 @@ $ oc-vote tally 3054390f047f2703186943a41178bc15931500b5139229517f26e56282026ee5
41
43
 
42
44
  Flags:
43
45
 
44
- - `--relay wss://...` (repeatable) — custom relay set. Defaults to the canonical four.
46
+ - `--relay wss://...` (repeatable) — custom relay set. Defaults to the five in `@orangecheck/nostr-core`'s `DEFAULT_RELAYS`.
45
47
  - `--mempool-base https://...` — UTXO source. Defaults to `https://mempool.space/api`.
46
48
  - `--snapshot <height>` — pin a specific snapshot block (overrides `poll.snapshot_block`).
47
49
  - `--no-verify` — skip BIP-322 checks (faster, less safe — use only for sanity probes).
48
50
  - `--json` — JSON output instead of the human-readable bar chart.
49
51
 
52
+ ### `oc-vote vote --poll <poll_id> --voter <address> --option <id>`
53
+
54
+ Build the ballot, have it signed (`--sig`, or paste a BIP-322 signature of the printed ballot_id), publish it, then ask each relay alone for it back. The ballot is in only once at least 2 relays serve a copy whose ballot signature and Nostr signature both hold; an OK from a relay is not enough. Below that it says the ballot isn't in yet, prints the signed event, and exits 2. In an anchored poll its stamp is read back the same way, and `vote` exits 2 while the stamp is on fewer than 2 relays, even with the ballot in: a final count needs the stamp.
55
+
56
+ - `--json` — `in`, `served_by`, `asked`, `quorum` and the signed `event`.
57
+
58
+ ### `oc-vote create` and `oc-vote reveal`
59
+
60
+ The same read-back for a poll and a reveal: published only once at least 2 relays serve back a copy that verifies. Below that each says so, prints the signed event, and exits 2. `reveal` run again sends a reveal already signed and on a relay to the relays that lack it, with nothing new to sign.
61
+
62
+ ### `oc-vote republish <file>`
63
+
64
+ Send a signed poll, ballot, reveal or ballot stamp again, as it is, from an `event:` line or `--json` output. Nothing new is signed, so a poll keeps its id. Same read-back, same exit status: 0 once it is in, 2 while it isn't.
65
+
50
66
  ### `oc-vote verify <poll_id>`
51
67
 
52
68
  Verify every BIP-322 signature on the poll and on each ballot. Prints a short summary; `--json` gives per-ballot details.