diff options
| author | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-13 11:11:59 -0300 |
|---|---|---|
| committer | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-13 11:11:59 -0300 |
| commit | d2b86473a267c960a1f0c012a983176e5d962187 (patch) | |
| tree | 002423e5987a3c544f469befae83519ccb29fffb /src/nostr.h | |
| parent | 851811b43be38bea48ba5d04d16987bd541dca53 (diff) | |
net: add signed direct onion peer endpoints
Diffstat (limited to 'src/nostr.h')
| -rw-r--r-- | src/nostr.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/nostr.h b/src/nostr.h index b5eb5e3..dc4288c 100644 --- a/src/nostr.h +++ b/src/nostr.h | |||
| @@ -40,6 +40,13 @@ std::string BtfActiveRelay(); | |||
| 40 | // Record the relay this node just registered its service at (thread-safe). | 40 | // Record the relay this node just registered its service at (thread-safe). |
| 41 | void BtfSetActiveRelay(const std::string& relay); | 41 | void BtfSetActiveRelay(const std::string& relay); |
| 42 | 42 | ||
| 43 | // Optional Tor hidden-service endpoint for this node's normal P2P listener. | ||
| 44 | // Set by /onionservice=HOST.onion:PORT. The endpoint is signed into this node's | ||
| 45 | // .btf descriptor, so peers with -tor can dial it directly before falling back | ||
| 46 | // to rendezvous relays. | ||
| 47 | bool BtfSetLocalOnionEndpoint(const std::string& endpoint, std::string& errOut); | ||
| 48 | std::string BtfLocalOnionEndpoint(); | ||
| 49 | |||
| 43 | // If set (via /announcerelay=host:port), this node announces that relay on | 50 | // If set (via /announcerelay=host:port), this node announces that relay on |
| 44 | // Nostr so other nodes discover it automatically -- no manual seed-list edit. | 51 | // Nostr so other nodes discover it automatically -- no manual seed-list edit. |
| 45 | extern std::string strBtfAnnounceRelay; | 52 | extern std::string strBtfAnnounceRelay; |
| @@ -94,12 +101,15 @@ void* BtfSecpContext(); | |||
| 94 | // self-certified descriptor and return its meeting node ("host:port") and | 101 | // self-certified descriptor and return its meeting node ("host:port") and |
| 95 | // x25519 public key for the end-to-end channel. | 102 | // x25519 public key for the end-to-end channel. |
| 96 | bool BtfResolve(const std::string& btfAddr, std::string& meetingHostPort, | 103 | bool BtfResolve(const std::string& btfAddr, std::string& meetingHostPort, |
| 97 | unsigned char enc_pub[32]); | 104 | unsigned char enc_pub[32], |
| 105 | std::string* onionHostPort = NULL); | ||
| 98 | 106 | ||
| 99 | // Result of resolving one .btf address via BtfResolveMany. | 107 | // Result of resolving one .btf address via BtfResolveMany. |
| 100 | struct BtfResolvedPeer | 108 | struct BtfResolvedPeer |
| 101 | { | 109 | { |
| 102 | std::string meetingHostPort; | 110 | std::string meetingHostPort; |
| 111 | std::string onionHostPort; | ||
| 112 | std::string descriptor; | ||
| 103 | unsigned char enc_pub[32]; | 113 | unsigned char enc_pub[32]; |
| 104 | }; | 114 | }; |
| 105 | 115 | ||