ix ckpool.conf render dropping the TLS bind port; Let deployments declare what each stratum bind is
This commit is contained in:
10 files changed
+159
-45
No files matched your search
@@ -8,6 +8,7 @@
|
||||
detectHardware,
|
||||
isOpenSource,
|
||||
btcAddressOf,
|
||||
connectionOf,
|
||||
} from "../format";
|
||||
import type { StratumClient, Worker } from "../types";
|
||||
|
||||
@@ -18,6 +19,7 @@
|
||||
hardware: string;
|
||||
openSource: boolean;
|
||||
tls: boolean;
|
||||
tlsLabel: string;
|
||||
hashrate1m: number;
|
||||
hashrate1h: number;
|
||||
bestSession: number;
|
||||
@@ -35,9 +37,10 @@
|
||||
// from the joined worker_instance, which ckpool keys by full
|
||||
// workername with user = the BTC.
|
||||
//
|
||||
// ckpool's serverurl array gives us a second piece of info: TLS
|
||||
// traffic comes in via stunnel on the loopback-only bind (server
|
||||
// index 1), so client.server === 1 means this miner is using TLS.
|
||||
// ckpool's serverurl array gives us a second piece of info: which
|
||||
// bind the connection arrived on. connectionOf() maps that index to
|
||||
// the transport the deployment declared, so the lock badge can name
|
||||
// the certificate in play rather than just "encrypted".
|
||||
const rows = $derived.by<Row[]>(() => {
|
||||
const clients = snap.data?.clients ?? [];
|
||||
const workers = snap.data?.workers ?? [];
|
||||
@@ -52,13 +55,15 @@
|
||||
seen.add(wname);
|
||||
const w = byWorker.get(wname);
|
||||
const btcAddress = w?.user ?? btcAddressOf(wname);
|
||||
const conn = connectionOf(c.server, snap.data?.stratum_servers);
|
||||
out.push({
|
||||
workerName: wname,
|
||||
btcAddress,
|
||||
sourceIp: c.address,
|
||||
hardware: detectHardware(c.useragent),
|
||||
openSource: isOpenSource(c.useragent),
|
||||
tls: c.server === 1,
|
||||
tls: conn.tls,
|
||||
tlsLabel: conn.label,
|
||||
hashrate1m: c.dsps1 * 2 ** 32,
|
||||
hashrate1h: c.dsps60 * 2 ** 32,
|
||||
bestSession: c.bestdiff,
|
||||
@@ -79,6 +84,7 @@
|
||||
hardware: "offline",
|
||||
openSource: false,
|
||||
tls: false,
|
||||
tlsLabel: "",
|
||||
hashrate1m: 0,
|
||||
hashrate1h: 0,
|
||||
bestSession: 0,
|
||||
@@ -133,7 +139,7 @@
|
||||
title="View per-worker stats"
|
||||
>{r.workerName}</button>
|
||||
{#if r.tls}
|
||||
<span class="badge tls" title="Encrypted connection via TLS">
|
||||
<span class="badge tls" title={r.tlsLabel}>
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true">
|
||||
<path d="M8 1a3.5 3.5 0 0 0-3.5 3.5V7H4a1.5 1.5 0 0 0-1.5 1.5v5A1.5 1.5 0 0 0 4 15h8a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 12 7h-.5V4.5A3.5 3.5 0 0 0 8 1Zm2 6H6V4.5a2 2 0 1 1 4 0V7Z"/>
|
||||
</svg>
|
||||
|
||||
Reference in new issue
Block a user