aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-05 12:24:03 -0700
committerAdam Soltys <[email protected]>2026-08-05 12:24:03 -0700
commit68fd614f8cb404904e1939ab711f7c7ba4350c32 (patch)
tree861637d85964802e37211d98d536d35d796ca1bd /tools
parent1307f8930283393fcf987cfa7e5cfa054676396a (diff)
downloadcoinosv3-68fd614f8cb404904e1939ab711f7c7ba4350c32.tar.gz
coinosv3-68fd614f8cb404904e1939ab711f7c7ba4350c32.zip
hal speaks pver 5: preimages prove their size, and fees round up as one
0.6.0 servers require the new hashlock clauses (OP_SIZE 32 guard) for Lightning and rounds. New policies/transitions carry the v1 scripts and type bytes; _v0 variants keep old vtxos reconstructing and exiting. The retired third-party HTLC policy is dropped (upstream took 0x08). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01M5kFodm9azZJVTQxnkDdKe
Diffstat (limited to 'tools')
-rw-r--r--tools/concord-live-delivery-test.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/concord-live-delivery-test.js b/tools/concord-live-delivery-test.js
new file mode 100644
index 0000000..5f4733d
--- /dev/null
+++ b/tools/concord-live-delivery-test.js
@@ -0,0 +1,34 @@
+// Publish one labeled test message to coinos #general via the Concord
+// protocol, exactly as hal would, from a throwaway key — used to test
+// live delivery into an already-open client.
+import { channelKey, wrapRumor, msTags } from '../src/concord.js';
+import { getPublicKey, finalizeEvent, generateSecretKey } from 'nostr-tools/pure';
+import { getEventHash } from 'nostr-tools/pure';
+import { SimplePool } from 'nostr-tools/pool';
+
+const hexToBytes = (s) => Uint8Array.from(s.match(/../g).map((b) => parseInt(b, 16)));
+const root = hexToBytes('58b2ce26eba30fbd19d9a57bce4c61e65838686998f10bba1d3e822fb72b372e');
+const CH = '56bf8b96c1a3768c85444873df507cdbc3275fcbc21996af09e60003f850f85c';
+const stream = channelKey(root, CH, 0);
+
+const sk = generateSecretKey();
+const pubkey = getPublicKey(sk);
+const signer = {
+ pubkey,
+ signEvent: async (e) => finalizeEvent(e, sk),
+};
+
+const { created_at, ms } = msTags(Date.now());
+const rumor = {
+ kind: 9, pubkey, content: '🤖 delivery test (claude, debugging) — ignore',
+ tags: [['channel', CH], ['epoch', '0'], ms], created_at,
+};
+rumor.id = getEventHash({ ...rumor });
+
+const wrap = await wrapRumor(rumor, signer, stream);
+const pool = new SimplePool();
+const relays = ['wss://relay.coinos.io', 'wss://nos.lol'];
+const res = await Promise.allSettled(pool.publish(relays, wrap));
+console.log('published wrap', wrap.id.slice(0, 12), res.map((r) => r.status));
+pool.close(relays);
+process.exit(0);