upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/nostr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nostr.h')
-rw-r--r--src/nostr.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/nostr.h b/src/nostr.h
index 827b2f3..0dd919d 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).
41void BtfSetActiveRelay(const std::string& relay); 41void 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.
47bool BtfSetLocalOnionEndpoint(const std::string& endpoint, std::string& errOut);
48std::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.
45extern std::string strBtfAnnounceRelay; 52extern std::string strBtfAnnounceRelay;
@@ -53,6 +60,9 @@ extern bool fBtfRelayPinned;
53bool LooksLikeRelay(const std::string& r); 60bool LooksLikeRelay(const std::string& r);
54// Every relay to try: curated seeds + relays discovered from Nostr announcements. 61// Every relay to try: curated seeds + relays discovered from Nostr announcements.
55std::vector<std::string> BtfAllRelays(); 62std::vector<std::string> BtfAllRelays();
63// Relays discovered from Nostr, ignoring the pin. For reporting what a pin
64// excludes -- never for choosing a relay to register or dial at.
65std::vector<std::string> BtfDiscoveredRelays();
56 66
57struct BtfPoolAnnouncement 67struct BtfPoolAnnouncement
58{ 68{
@@ -102,12 +112,15 @@ void* BtfSecpContext();
102// self-certified descriptor and return its meeting node ("host:port") and 112// self-certified descriptor and return its meeting node ("host:port") and
103// x25519 public key for the end-to-end channel. 113// x25519 public key for the end-to-end channel.
104bool BtfResolve(const std::string& btfAddr, std::string& meetingHostPort, 114bool BtfResolve(const std::string& btfAddr, std::string& meetingHostPort,
105 unsigned char enc_pub[32]); 115 unsigned char enc_pub[32],
116 std::string* onionHostPort = NULL);
106 117
107// Result of resolving one .btf address via BtfResolveMany. 118// Result of resolving one .btf address via BtfResolveMany.
108struct BtfResolvedPeer 119struct BtfResolvedPeer
109{ 120{
110 std::string meetingHostPort; 121 std::string meetingHostPort;
122 std::string onionHostPort;
123 std::string descriptor;
111 unsigned char enc_pub[32]; 124 unsigned char enc_pub[32];
112}; 125};
113 126