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.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nostr.h b/src/nostr.h
index b878db9..63fc095 100644
--- a/src/nostr.h
+++ b/src/nostr.h
@@ -15,6 +15,7 @@
15 15
16// Thread entry point (signature compatible with _beginthread) 16// Thread entry point (signature compatible with _beginthread)
17void ThreadNostrSeed(void* parg); 17void ThreadNostrSeed(void* parg);
18void ThreadBtfPoolAnnouncer(void* parg);
18 19
19// Public relays used for discovery. Tunable. 20// Public relays used for discovery. Tunable.
20extern const char* pszNostrRelays[]; 21extern const char* pszNostrRelays[];
@@ -38,6 +39,32 @@ extern std::string strBtfAnnounceRelay;
38// Every relay to try: curated seeds + relays discovered from Nostr announcements. 39// Every relay to try: curated seeds + relays discovered from Nostr announcements.
39std::vector<std::string> BtfAllRelays(); 40std::vector<std::string> BtfAllRelays();
40 41
42struct BtfPoolAnnouncement
43{
44 std::string btfAddress;
45 std::string poolName;
46 std::string dashboardUrl;
47 double feePercent;
48 int connectedMiners;
49 int blocksFound;
50 double hashRate;
51 int64 createdAt;
52
53 BtfPoolAnnouncement()
54 : feePercent(0.0), connectedMiners(0), blocksFound(0), hashRate(0.0), createdAt(0)
55 {
56 }
57};
58
59// Current live pool announcements discovered from Nostr relays.
60void BtfGetPoolAnnouncements(std::vector<BtfPoolAnnouncement>& out);
61
62// Publish a live pool announcement on Nostr.
63bool BtfPublishPoolAnnouncement(const BtfPoolAnnouncement& ann);
64
65// Query the latest pool announcement for a specific .btf pool address.
66bool BtfQueryPoolAnnouncement(const std::string& poolBtfAddr, BtfPoolAnnouncement& out);
67
41// Copy this node's .btf identity (lazily loading or generating it): the x-only 68// Copy this node's .btf identity (lazily loading or generating it): the x-only
42// pubkey (= the .btf address) and the x25519 secret for the end-to-end channel. 69// pubkey (= the .btf address) and the x25519 secret for the end-to-end channel.
43bool BtfGetIdentity(unsigned char pubkey[32], unsigned char enc_sk[32]); 70bool BtfGetIdentity(unsigned char pubkey[32], unsigned char enc_sk[32]);