Repository navigation
Commit 1e7bb9a
committed
Add dht find-record/find-records/find-records-by-type
Wraps macula-go's existing dht.FindRecord/FindRecords/FindRecordsByType
-- already complete, just never exposed as a CLI surface. All three
always run under the DHT's own all-zero realm (macula-go's dhtRealm,
hardcoded, matches macula.erl's ?DHT_REALM); there is no -realm flag,
since DHT storage is protocol-internal infrastructure, not a
realm-scoped application concern. Each record's signature is verified
and reported (verified/verify_error) rather than silently assumed
good, matching the SDK's own stated caveat that a caller must check
this before trusting a payload.
find-records-by-type is the discovery entry point: list every
procedure_advertisement a station knows about, with each one's realm
decoded straight out of procedure_uri (dht.DiscoveryURI's own
hex(realm)+"/"+procedure construction -- reversed by splitting on
the first 64 chars, robust even if a procedure name itself contains a
slash) rather than requiring the caller already know it.
Built to answer a real question live, not hypothetically: whether
hecate_stations.list_stations -- unreachable via both plain call and
call -direct -- was in the DHT at all, under any realm. Verified
against the real demo fleet: find-records-by-type procedure_advertisement
returned 16 genuine records, all hecate_mail's or tube's, none
hecate_stations's -- confirming the advertisement never landed, not a
realm-targeting problem on the caller side. find-records and
find-record's not-found path verified live too (a real key from that
listing, and a well-formed-but-absent key respectively).
No unit tests, matching this repo's existing convention (every command
talks to a live station by design -- see README's Status section and
ci.yml's own comment on this). gofmt/vet/build all clean.1 parent 1f47239 commit 1e7bb9a
3 files changed
Lines changed: 422 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
69 | 79 | | |
70 | 80 | | |
71 | 81 | | |
| |||
106 | 116 | | |
107 | 117 | | |
108 | 118 | | |
109 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
110 | 134 | | |
111 | 135 | | |
112 | 136 | | |
| |||
0 commit comments