From 4f9e1502523c6822fa03c7ac48c92b44b74e0546 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Tue, 12 Dec 2023 21:39:47 -0500 Subject: [PATCH] add stratum rul to environment --- src/app/components/dashboard/dashboard.component.ts | 3 +++ src/app/components/splash/splash.component.html | 2 +- src/app/components/splash/splash.component.ts | 9 +++++++-- src/environments/environment.prod.ts | 1 + src/environments/environment.ts | 3 ++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/components/dashboard/dashboard.component.ts b/src/app/components/dashboard/dashboard.component.ts index d1331a4..0d56b47 100644 --- a/src/app/components/dashboard/dashboard.component.ts +++ b/src/app/components/dashboard/dashboard.component.ts @@ -7,6 +7,8 @@ import { HashSuffixPipe } from '../../pipes/hash-suffix.pipe'; import { AppService } from '../../services/app.service'; import { ClientService } from '../../services/client.service'; + + @Component({ selector: 'app-dashboard', templateUrl: './dashboard.component.html', @@ -28,6 +30,7 @@ export class DashboardComponent implements AfterViewInit { public expandedRows$: Observable; + constructor( private clientService: ClientService, private route: ActivatedRoute, diff --git a/src/app/components/splash/splash.component.html b/src/app/components/splash/splash.component.html index a3a61f4..cee89b9 100644 --- a/src/app/components/splash/splash.component.html +++ b/src/app/components/splash/splash.component.html @@ -31,7 +31,7 @@

- stratum+tcp://public-pool.io:21496 + stratum+tcp://{{stratumURL}}
username: <your BTC address>.<worker name>, password: x
diff --git a/src/app/components/splash/splash.component.ts b/src/app/components/splash/splash.component.ts index 27edea9..fbbc06d 100644 --- a/src/app/components/splash/splash.component.ts +++ b/src/app/components/splash/splash.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core'; import { FormControl } from '@angular/forms'; import { map, Observable, shareReplay } from 'rxjs'; +import { environment } from '../../../environments/environment'; import { HashSuffixPipe } from '../../pipes/hash-suffix.pipe'; import { AppService } from '../../services/app.service'; import { bitcoinAddressValidator } from '../../validators/bitcoin-address.validator'; @@ -22,14 +23,18 @@ export class SplashComponent { public chartOptions: any; - + public stratumURL = ''; constructor(private appService: AppService) { const info$ = this.appService.getInfo().pipe(shareReplay({ refCount: true, bufferSize: 1 })); - + if (environment.STRATUM_URL.length > 1) { + this.stratumURL = environment.STRATUM_URL; + } else { + this.stratumURL = window.location.hostname + ':3333'; + } this.blockData$ = info$.pipe(map(info => info.blockData)); this.userAgents$ = info$.pipe(map(info => info.userAgents)); diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 7d40dc6..b1b7d45 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,4 +1,5 @@ export const environment = { production: true, API_URL: 'https://public-pool.io:40557', + STRATUM_URL: 'public-pool.io:21496' }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 4a34310..a033fa0 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -1,4 +1,5 @@ export const environment = { production: false, - API_URL: 'http://localhost:3334' + API_URL: 'http://localhost:3334', + STRATUM_URL: 'public-pool.io:21496' };