add stratum rul to environment

This commit is contained in:
Ben Wilson 2023-12-12 21:39:47 -05:00
parent 463fc9b676
commit 4f9e150252
5 changed files with 14 additions and 4 deletions

@ -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<any>;
constructor(
private clientService: ClientService,
private route: ActivatedRoute,

@ -31,7 +31,7 @@
<br>
<br>
<div class="info mb-2 p-4 border-dashed border-1 border-round">
<code>stratum+tcp://public-pool.io:21496</code>
<code>stratum+tcp://{{stratumURL}}</code>
<br>
<code>username: &lt;your BTC address&gt;.&lt;worker name&gt;, password: x</code>
</div>

@ -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));

@ -1,4 +1,5 @@
export const environment = {
production: true,
API_URL: 'https://public-pool.io:40557',
STRATUM_URL: 'public-pool.io:21496'
};

@ -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'
};