Skip to content

Commit 653c6ff

Browse files
committed
add JDC_AUTHORITY_PUBLIC_KEY to the Sv2 endpoint
1 parent 7658b8f commit 653c6ff

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

server/src/config-generator.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
1313
interface PortsConfig {
1414
TRANSLATOR_PORT: number;
1515
JDC_PORT: number;
16+
JDC_AUTHORITY_PUBLIC_KEY: string;
1617
}
1718

1819
function loadPorts(): PortsConfig {
@@ -35,6 +36,7 @@ function loadPorts(): PortsConfig {
3536
const ports = loadPorts();
3637
export const TRANSLATOR_PORT = ports.TRANSLATOR_PORT;
3738
export const JDC_PORT = ports.JDC_PORT;
39+
export const JDC_AUTHORITY_PUBLIC_KEY = ports.JDC_AUTHORITY_PUBLIC_KEY;
3840

3941
/**
4042
* Generate Translator Proxy config (tproxy-config.toml)
@@ -54,7 +56,7 @@ export function generateTranslatorConfig(data: SetupData): string {
5456
// When connecting to local JDC, we don't need authority key (using hardcoded keys)
5557
// When connecting to external pool, we need the pool's authority key
5658
const authorityPubkey = mode === 'jd'
57-
? '9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72'
59+
? JDC_AUTHORITY_PUBLIC_KEY
5860
: pool.authority_public_key;
5961

6062
// Min hashrate from user config (default 100 TH/s if not set)
@@ -131,7 +133,7 @@ max_supported_version = 2
131133
min_supported_version = 2
132134
133135
# Auth keys for downstream connections
134-
authority_public_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72"
136+
authority_public_key = "${JDC_AUTHORITY_PUBLIC_KEY}"
135137
authority_secret_key = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n"
136138
cert_validity_sec = 3600
137139

shared/ports.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"TRANSLATOR_PORT": 34255,
3-
"JDC_PORT": 34265
3+
"JDC_PORT": 34265,
4+
"JDC_AUTHORITY_PUBLIC_KEY": "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72"
45
}

src/components/setup/MinerConnectionInfo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useState } from 'react';
22
import { Copy, Check } from 'lucide-react';
3-
import { TRANSLATOR_PORT, JDC_PORT } from '@/lib/ports';
3+
import { TRANSLATOR_PORT, JDC_PORT, JDC_AUTHORITY_PUBLIC_KEY } from '@/lib/ports';
44

55
function CopyableAddress({ address }: { address: string }) {
66
const [copied, setCopied] = useState(false);
@@ -32,7 +32,7 @@ interface MinerConnectionInfoProps {
3232

3333
export function MinerConnectionInfo({ isJdMode, centered = false }: MinerConnectionInfoProps) {
3434
const translatorUrl = `stratum+tcp://<your-machine-ip>:${TRANSLATOR_PORT}`;
35-
const jdcUrl = `stratum+tcp://<your-machine-ip>:${JDC_PORT}`;
35+
const jdcUrl = `stratum2+tcp://<your-machine-ip>:${JDC_PORT}/${JDC_AUTHORITY_PUBLIC_KEY}`;
3636

3737
const hint = (
3838
<p className="text-xs text-muted-foreground">

src/lib/ports.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/**
2-
* SV2 stack port configuration.
2+
* SV2 stack configuration constants.
33
* Single source of truth: shared/ports.json
44
*/
55

66
import ports from '../../shared/ports.json';
77

88
export const TRANSLATOR_PORT = ports.TRANSLATOR_PORT;
99
export const JDC_PORT = ports.JDC_PORT;
10+
export const JDC_AUTHORITY_PUBLIC_KEY = ports.JDC_AUTHORITY_PUBLIC_KEY;

0 commit comments

Comments
 (0)