Skip to content

Commit fe849ca

Browse files
authored
Merge pull request #7 from GitGab19/main
Add SRI mainnet endpoints to wizard + improvements in binaries deployment steps + Demand Pool renaming + other improvements
2 parents feeb977 + fddc304 commit fe849ca

17 files changed

+546
-394
lines changed

package-lock.json

Lines changed: 2 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PoolConnectionWizard.tsx

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Available pools:
1515
* - SRI Community Pool: mainnet & testnet4
1616
* - Braiins Pool: mainnet (non-JD only)
17-
* - Demand Pool: mainnet (JD or non-JD)
17+
* - DMND Pool: mainnet (JD or non-JD)
1818
*/
1919

2020
import { Wizard, WizardConfig } from "./components/ui/wizard-framework";
@@ -66,8 +66,7 @@ const POOL_CONNECTION_WIZARD_CONFIG: WizardConfig = {
6666
description: "Which network will your Bitcoin Node operate on?",
6767
options: [
6868
{ id: 'opt_main', label: "Mainnet", subLabel: "Production Network", value: "mainnet", nextStepId: "bitcoin_guide_mainnet", icon: Globe },
69-
{ id: 'opt_test', label: "Testnet4", subLabel: "Testing Network", value: "testnet4", nextStepId: "bitcoin_guide_testnet", icon: Activity },
70-
{ id: 'opt_sig', label: "Signet", subLabel: "Developer Network", value: "signet", nextStepId: "bitcoin_guide_signet", icon: Terminal, warning: "Coming soon", disabled: true }
69+
{ id: 'opt_test', label: "Testnet4", subLabel: "Testing Network", value: "testnet4", nextStepId: "bitcoin_guide_testnet", icon: Activity }
7170
]
7271
},
7372
bitcoin_guide_mainnet: {
@@ -84,13 +83,6 @@ const POOL_CONNECTION_WIZARD_CONFIG: WizardConfig = {
8483
nextStepId: 'select_pool_construct_testnet4',
8584
component: <BitcoinSetupContent network="testnet4" showBitcoinConf={false} />
8685
},
87-
bitcoin_guide_signet: {
88-
id: 'bitcoin_guide_signet',
89-
type: 'instruction',
90-
title: "Bitcoin Core Setup (Signet)",
91-
nextStepId: 'select_pool_construct_mainnet',
92-
component: <BitcoinSetupContent network="signet" showBitcoinConf={false} />
93-
},
9486
select_pool_construct_mainnet: {
9587
id: 'select_pool_construct_mainnet',
9688
type: 'question',
@@ -107,20 +99,18 @@ const POOL_CONNECTION_WIZARD_CONFIG: WizardConfig = {
10799
iconUrl: getPoolConfig("community_sri")?.iconUrl,
108100
badge: "Testing",
109101
badgeColor: "blue",
110-
warning: "Not for production use – rewards are not paid out."
102+
warning: "Not for production use – any blocks found will be donated to the SRI project"
111103
},
112104
{
113105
id: 'pool_demand',
114-
label: "DEMAND",
115-
subLabel: "Work in progress",
106+
label: "DMND",
116107
value: "demand",
117108
nextStepId: "jd_client_configuration",
118109
icon: Zap,
119110
iconUrl: getPoolConfig("demand")?.iconUrl,
120-
badge: "Soon",
121-
badgeColor: "orange",
122-
warning: "This option is coming soon.",
123-
disabled: true
111+
warning: "Pool for registered businesses only at the moment",
112+
disabled: true,
113+
url: "https://dmnd.work/"
124114
}
125115
]
126116
},
@@ -140,7 +130,7 @@ const POOL_CONNECTION_WIZARD_CONFIG: WizardConfig = {
140130
iconUrl: getPoolConfig("community_sri")?.iconUrl,
141131
badge: "Testing",
142132
badgeColor: "blue",
143-
warning: "Not for production use – rewards are not paid out."
133+
warning: "Not for production use – any blocks found will be donated to the SRI project"
144134
}
145135
]
146136
},
@@ -160,7 +150,7 @@ const POOL_CONNECTION_WIZARD_CONFIG: WizardConfig = {
160150
iconUrl: getPoolConfig("community_sri")?.iconUrl,
161151
badge: "Testing",
162152
badgeColor: "blue",
163-
warning: "Not for production use – no share accounting / no payouts."
153+
warning: "Not for production use – any blocks found will be donated to the SRI project."
164154
},
165155
{
166156
id: 'pool_braiins',
@@ -173,16 +163,14 @@ const POOL_CONNECTION_WIZARD_CONFIG: WizardConfig = {
173163
},
174164
{
175165
id: 'pool_demand',
176-
label: "DEMAND",
177-
subLabel: "Work in progress",
166+
label: "DMND",
178167
value: "demand",
179168
nextStepId: "translator_proxy_configuration",
180169
icon: Zap,
181170
iconUrl: getPoolConfig("demand")?.iconUrl,
182-
badge: "Soon",
183-
badgeColor: "orange",
184-
warning: "Coming soon.",
185-
disabled: true
171+
warning: "Pool for registered businesses only at the moment",
172+
disabled: true,
173+
url: "https://dmnd.work/"
186174
}
187175
]
188176
},
@@ -199,9 +187,10 @@ const POOL_CONNECTION_WIZARD_CONFIG: WizardConfig = {
199187
value: "community_sri",
200188
nextStepId: "translator_proxy_configuration",
201189
icon: Globe,
190+
iconUrl: getPoolConfig("community_sri")?.iconUrl,
202191
badge: "Testing",
203192
badgeColor: "blue",
204-
warning: "Not for production use – no share accounting / no payouts."
193+
warning: "Not for production use – any blocks found will be donated to the SRI project"
205194
}
206195
]
207196
},

src/components/ui/wizard-framework/WizardStepCard.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,22 @@ export const WizardStepCard: React.FC<WizardStepCardProps> = ({
3838
{step.options?.map((option) => {
3939
const Icon = getIcon(option.iconName, option.icon);
4040
const isDisabled = option.disabled;
41+
const hasUrl = !!option.url;
42+
const Component = isDisabled && hasUrl ? 'div' : 'button';
4143
return (
42-
<button
44+
<Component
4345
key={option.value}
44-
type="button"
45-
disabled={isDisabled}
46+
{...(Component === 'button' ? { type: 'button', disabled: isDisabled } : {})}
4647
onClick={() => {
4748
if (!isDisabled) {
4849
onOptionSelect(option.nextStepId, option.value);
50+
} else if (hasUrl) {
51+
window.open(option.url, '_blank', 'noopener,noreferrer');
4952
}
5053
}}
5154
className={cn(
5255
"group relative flex flex-col items-center justify-center p-8 rounded-xl border border-border/50 bg-card/30 transition-all duration-300 text-left md:text-center h-full",
53-
isDisabled
56+
isDisabled && !hasUrl
5457
? "opacity-60 cursor-not-allowed"
5558
: "hover:bg-card/80 hover:border-primary/50 hover:shadow-[0_0_30px_-10px_rgba(34,211,238,0.3)] cursor-pointer"
5659
)}
@@ -107,7 +110,7 @@ export const WizardStepCard: React.FC<WizardStepCardProps> = ({
107110
</span>
108111
)}
109112
<div className="absolute inset-0 border-2 border-transparent group-hover:border-primary/20 rounded-xl transition-colors pointer-events-none" />
110-
</button>
113+
</Component>
111114
);
112115
})}
113116
</div>

src/components/ui/wizard-framework/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface WizardOption {
1717
badgeColor?: "green" | "orange" | "blue" | "default";
1818
warning?: string;
1919
disabled?: boolean;
20+
url?: string; // URL to open when option is clicked (for disabled options)
2021
}
2122

2223
export interface WizardStep {

src/config-templates/config-builder.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { getPoolConfig } from './pools';
2222
*/
2323
export function buildJdClientConfig(data: ConfigTemplateData): string {
2424
const network = data.network || 'mainnet';
25-
const selectedPoolConfig = getPoolConfig(data.selectedPool);
25+
const selectedPoolConfig = getPoolConfig(data.selectedPool, network);
2626
const jdcPoolAddress = selectedPoolConfig?.address || DEFAULT_CONFIG_VALUES.localhost;
2727
const jdcPoolPort = selectedPoolConfig?.port || DEFAULT_CONFIG_VALUES.poolPort;
2828
const jdcJdsAddress = selectedPoolConfig?.jdsAddress || DEFAULT_CONFIG_VALUES.localhost;
@@ -69,7 +69,8 @@ export function buildTranslatorConfig(data: ConfigTemplateData, options?: {
6969
// Connecting to pool (pool templates)
7070
// In full stack: connects to local pool (127.0.0.1:34254)
7171
// In pool connection: connects to selected external pool
72-
const poolConfig = getPoolConfig(data.selectedPool);
72+
const network = data.network || 'mainnet';
73+
const poolConfig = getPoolConfig(data.selectedPool, network);
7374
if (poolConfig) {
7475
// External pool (pool connection wizard)
7576
upstreamAddress = poolConfig.address;

src/config-templates/constants.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ export const DEFAULT_CONFIG_VALUES = {
2323
// RPC ports by network
2424
rpcPorts: {
2525
mainnet: 8332,
26-
testnet4: 48332,
27-
signet: 38332
26+
testnet4: 48332
2827
},
2928

3029
// Addresses
@@ -39,18 +38,17 @@ export const DEFAULT_CONFIG_VALUES = {
3938
// Address placeholders
4039
addressPlaceholders: {
4140
mainnet: "bc1q...",
42-
testnet4: "tb1q...",
43-
signet: "bc1q..."
41+
testnet4: "tb1q..."
4442
}
4543
} as const;
4644

4745
// Network-specific RPC ports
48-
export function getRpcPort(network: 'mainnet' | 'testnet4' | 'signet' = 'mainnet'): number {
46+
export function getRpcPort(network: 'mainnet' | 'testnet4' = 'mainnet'): number {
4947
return DEFAULT_CONFIG_VALUES.rpcPorts[network];
5048
}
5149

5250
// Get address placeholder for network
53-
export function getAddressPlaceholder(network: 'mainnet' | 'testnet4' | 'signet' = 'mainnet'): string {
51+
export function getAddressPlaceholder(network: 'mainnet' | 'testnet4' = 'mainnet'): string {
5452
return DEFAULT_CONFIG_VALUES.addressPlaceholders[network];
5553
}
5654

src/config-templates/pools.ts

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
* - Non-JD mode only (uses pool's templates)
1313
* - Leading mining pool provider
1414
*
15-
* - demand: Demand Pool (mainnet only)
15+
* - demand: DMND Pool (mainnet only)
1616
* - Supports both JD and non-JD modes
17-
* - Work in progress
1817
*/
1918

2019
import type { PoolConfig } from './types';
@@ -34,15 +33,25 @@ export const POOLS: Record<string, PoolConfig> = {
3433
community_sri: {
3534
name: "Community SRI Pool",
3635
address: "75.119.150.111",
37-
port: 34254,
36+
port: 3333, // Default (mainnet), will be overridden by network-specific configs
3837
authorityPubkey: "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72",
3938
aggregateChannels: false,
4039
jdsAddress: "75.119.150.111",
41-
jdsPort: 34264,
42-
iconUrl: "https://stratumprotocol.org/assets/sv2-logo.png"
40+
jdsPort: 3334, // Default (mainnet), will be overridden by network-specific configs
41+
iconUrl: "https://stratumprotocol.org/assets/sv2-logo.png",
42+
networks: {
43+
mainnet: {
44+
port: 3333,
45+
jdsPort: 3334,
46+
},
47+
testnet4: {
48+
port: 43333,
49+
jdsPort: 43334,
50+
}
51+
}
4352
},
4453
demand: {
45-
name: "DEMAND",
54+
name: "DMND",
4655
address: "127.0.0.1", // Placeholder - update when available
4756
port: 34254,
4857
authorityPubkey: "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72", // Placeholder
@@ -53,7 +62,10 @@ export const POOLS: Record<string, PoolConfig> = {
5362
}
5463
};
5564

56-
export function getPoolConfig(poolValue: string | undefined): PoolConfig | null {
65+
export function getPoolConfig(
66+
poolValue: string | undefined,
67+
network?: 'mainnet' | 'testnet4'
68+
): PoolConfig | null {
5769
if (!poolValue) return null;
5870

5971
// Map pool values to config keys
@@ -64,6 +76,18 @@ export function getPoolConfig(poolValue: string | undefined): PoolConfig | null
6476
};
6577

6678
const poolKey = poolMap[poolValue];
67-
return poolKey ? POOLS[poolKey] : null;
79+
if (!poolKey || !POOLS[poolKey]) return null;
80+
81+
const baseConfig = POOLS[poolKey];
82+
83+
// If network is specified and pool has network-specific config, merge it
84+
if (network && baseConfig.networks?.[network]) {
85+
return {
86+
...baseConfig,
87+
...baseConfig.networks[network]
88+
};
89+
}
90+
91+
return baseConfig;
6892
}
6993

0 commit comments

Comments
 (0)