diff options
Diffstat (limited to 'src/nostr.h')
| -rw-r--r-- | src/nostr.h | 27 |
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) |
| 17 | void ThreadNostrSeed(void* parg); | 17 | void ThreadNostrSeed(void* parg); |
| 18 | void ThreadBtfPoolAnnouncer(void* parg); | ||
| 18 | 19 | ||
| 19 | // Public relays used for discovery. Tunable. | 20 | // Public relays used for discovery. Tunable. |
| 20 | extern const char* pszNostrRelays[]; | 21 | extern 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. |
| 39 | std::vector<std::string> BtfAllRelays(); | 40 | std::vector<std::string> BtfAllRelays(); |
| 40 | 41 | ||
| 42 | struct 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. | ||
| 60 | void BtfGetPoolAnnouncements(std::vector<BtfPoolAnnouncement>& out); | ||
| 61 | |||
| 62 | // Publish a live pool announcement on Nostr. | ||
| 63 | bool BtfPublishPoolAnnouncement(const BtfPoolAnnouncement& ann); | ||
| 64 | |||
| 65 | // Query the latest pool announcement for a specific .btf pool address. | ||
| 66 | bool 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. |
| 43 | bool BtfGetIdentity(unsigned char pubkey[32], unsigned char enc_sk[32]); | 70 | bool BtfGetIdentity(unsigned char pubkey[32], unsigned char enc_sk[32]); |