diff --git a/README.md b/README.md index 81890b4..367a38d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Biggest differences with v2 are: New features: - BitAxe integration - Zap notifier -- +- Braiins Pool and Ocean mining stats integration "Steal focus on new block" means that when a new block is mined, the display will switch to the block height screen if it's not on it already. @@ -27,4 +27,27 @@ Most [information](https://github.com/btclock/btclock_v2/wiki) about BTClock v2 ## Building -Use PlatformIO to build it yourself. Make sure you fetch the [WebUI](https://github.com/btclock/webui) submodule. \ No newline at end of file +Use PlatformIO to build it yourself. Make sure you fetch the [WebUI](https://github.com/btclock/webui) submodule. + + +## Braiins Pool and Ocean integration +Enable mining pool stats by accessing your btclock's web UI (point a web browser at the device's IP address). + +Under Settings -> Extra Features: toggle Enable Mining Pool Stats. + +New options will appear. Select your mining pool and enter your pool username (Ocean) or api key (Braiins). + + +### Braiins Pool integration +Create an API key based on the steps [here](https://academy.braiins.com/en/braiins-pool/monitoring/#api-configuration). + +The key's permissions should be: +* Web Access: no +* API Access: yes +* Access Permissions: Read-only + +Copy the token that is created for the new key. Enter this as your "Mining Pool username or api key" in the btclock web UI. + + +### Ocean integration +Your "Mining Pool username" is just the onchain withdrawal address that you specify when pointing your miners at Ocean. diff --git a/src/lib/config.cpp b/src/lib/config.cpp index 81e303f..29f74e2 100644 --- a/src/lib/config.cpp +++ b/src/lib/config.cpp @@ -92,7 +92,7 @@ void setup() setupBitaxeFetchTask(); } - if (preferences.getBool("miningPoolStatsEnabled", DEFAULT_MINING_POOL_STATS_ENABLED)) + if (preferences.getBool("miningPoolStats", DEFAULT_MINING_POOL_STATS_ENABLED)) { setupMiningPoolStatsFetchTask(); } @@ -333,7 +333,7 @@ void setupPreferences() addScreenMapping(SCREEN_BITAXE_BESTDIFF, "BitAxe Best Difficulty"); } - if (preferences.getBool("miningPoolStatsEnabled", DEFAULT_MINING_POOL_STATS_ENABLED)) + if (preferences.getBool("miningPoolStats", DEFAULT_MINING_POOL_STATS_ENABLED)) { addScreenMapping(SCREEN_MINING_POOL_STATS_HASHRATE, "Mining Pool Hashrate"); addScreenMapping(SCREEN_MINING_POOL_STATS_EARNINGS, "Mining Pool Earnings"); diff --git a/src/lib/screen_handler.cpp b/src/lib/screen_handler.cpp index 84f91d6..6c4357c 100644 --- a/src/lib/screen_handler.cpp +++ b/src/lib/screen_handler.cpp @@ -192,7 +192,7 @@ void setCurrentScreen(uint newScreen) { } case SCREEN_MINING_POOL_STATS_HASHRATE: case SCREEN_MINING_POOL_STATS_EARNINGS: { - if (preferences.getBool("miningPoolStatsEnabled", DEFAULT_MINING_POOL_STATS_ENABLED)) { + if (preferences.getBool("miningPoolStats", DEFAULT_MINING_POOL_STATS_ENABLED)) { WorkItem miningPoolStatsUpdate = {TASK_MINING_POOL_STATS_UPDATE, 0}; xQueueSend(workQueue, &miningPoolStatsUpdate, portMAX_DELAY); } else { diff --git a/src/lib/webserver.cpp b/src/lib/webserver.cpp index 0a55ff8..4dc0c1e 100644 --- a/src/lib/webserver.cpp +++ b/src/lib/webserver.cpp @@ -549,7 +549,7 @@ void onApiSettingsPatch(AsyncWebServerRequest *request, JsonVariant &json) "mowMode", "suffixShareDot", "flOffWhenDark", "flAlwaysOn", "flDisable", "flFlashOnUpd", "mempoolSecure", "useNostr", "bitaxeEnabled", - "miningPoolStatsEnabled", "verticalDesc", + "miningPoolStats", "verticalDesc", "nostrZapNotify", "stagingSource", "httpAuthEnabled"}; for (String setting : boolSettings) @@ -714,7 +714,7 @@ void onApiSettingsGet(AsyncWebServerRequest *request) root["bitaxeEnabled"] = preferences.getBool("bitaxeEnabled", DEFAULT_BITAXE_ENABLED); root["bitaxeHostname"] = preferences.getString("bitaxeHostname", DEFAULT_BITAXE_HOSTNAME); - root["miningPoolStatsEnabled"] = preferences.getBool("miningPoolStatsEnabled", DEFAULT_MINING_POOL_STATS_ENABLED); + root["miningPoolStats"] = preferences.getBool("miningPoolStats", DEFAULT_MINING_POOL_STATS_ENABLED); root["miningPoolName"] = preferences.getString("miningPoolName", DEFAULT_MINING_POOL_NAME); root["miningPoolUser"] = preferences.getString("miningPoolUser", DEFAULT_MINING_POOL_USER);