From 0db8dc2433121bf6e7a7492b025bafcd339209ba Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Mon, 1 Jan 2024 11:52:23 +0100 Subject: [PATCH 1/3] add miner stats to web server output Signed-off-by: Florian Brandes --- .../statistics/app/p2pool_statistics.py | 9 ++++++++ .../statistics/app/templates/index.html | 23 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/docker-compose/statistics/app/p2pool_statistics.py b/docker-compose/statistics/app/p2pool_statistics.py index 2e847e6..a09e5ee 100755 --- a/docker-compose/statistics/app/p2pool_statistics.py +++ b/docker-compose/statistics/app/p2pool_statistics.py @@ -60,6 +60,14 @@ def render(): network_stats = json.loads(reader.read()) with open("/data/local/stratum", "r") as reader: local_stats = json.loads(reader.read()) + workers = local_stats["workers"][:30] # limit workers output list + workers_concat = [] + for w in workers: + w_list = w.split(",") + w_list[1] = humanfriendly.format_timespan(int(w_list[1])) + w_list[2] = human_numbers(int(w_list[2])) + w_list[3] = human_numbers(int(w_list[3])) + workers_concat.append(w_list) return render_template( "index.html", my_bday=my_bday, @@ -67,6 +75,7 @@ def render(): pool_stats=pool_stats, network_stats=network_stats, local_stats=local_stats, + workers=workers_concat, ) except Exception as e: return render_template("oops.html", error=str(e)) diff --git a/docker-compose/statistics/app/templates/index.html b/docker-compose/statistics/app/templates/index.html index a62cd3b..aacab50 100644 --- a/docker-compose/statistics/app/templates/index.html +++ b/docker-compose/statistics/app/templates/index.html @@ -64,6 +64,29 @@ Block reward share {{ local_stats["block_reward_share_percent"] }}% + + Workers +
(note: limited to the first 30 workers)
+ + + + + + + + + + + {% for w in workers %} + + {% for w_detail in w %} + + {% endfor %} + + {% endfor %} +
IP:PortUptimeDifficultyHashrateName
{{ w_detail }}
+ + From 71da808969ebdd9db0831be80c5cc55bea3ae98b Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Mon, 1 Jan 2024 15:23:39 +0100 Subject: [PATCH 2/3] sort by hashrate Signed-off-by: Florian Brandes --- docker-compose/statistics/app/p2pool_statistics.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose/statistics/app/p2pool_statistics.py b/docker-compose/statistics/app/p2pool_statistics.py index a09e5ee..9ca8d7d 100755 --- a/docker-compose/statistics/app/p2pool_statistics.py +++ b/docker-compose/statistics/app/p2pool_statistics.py @@ -66,8 +66,10 @@ def render(): w_list = w.split(",") w_list[1] = humanfriendly.format_timespan(int(w_list[1])) w_list[2] = human_numbers(int(w_list[2])) - w_list[3] = human_numbers(int(w_list[3])) workers_concat.append(w_list) + workers_concat = sorted(workers_concat, key=lambda x: int(x[3]), reverse=True) + for w in workers_concat: + w[3] = human_numbers(int(w[3])) return render_template( "index.html", my_bday=my_bday, From 3797f017e94047a41e5f622e1a299c6f71c37df0 Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Thu, 4 Jan 2024 09:29:53 +0100 Subject: [PATCH 3/3] p2pool v3.10 --- src/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.h b/src/util.h index 1703d2d..8dfb79d 100644 --- a/src/util.h +++ b/src/util.h @@ -35,7 +35,7 @@ namespace p2pool { #define P2POOL_VERSION_MAJOR 3 -#define P2POOL_VERSION_MINOR 9 +#define P2POOL_VERSION_MINOR 10 #define P2POOL_VERSION_PATCH 0 extern const char* VERSION;