mirror of
https://github.com/mempool/mempool.git
synced 2025-04-01 00:18:05 +02:00
Renaming default to root network
This commit is contained in:
parent
c0ec9f70c3
commit
2ee656a176
@ -13,7 +13,7 @@
|
||||
"BLOCK_WEIGHT_UNITS": 4000000,
|
||||
"MEMPOOL_BLOCKS_AMOUNT": 8,
|
||||
"BASE_MODULE": "mempool",
|
||||
"DEFAULT_NETWORK": "",
|
||||
"ROOT_NETWORK": "",
|
||||
"MEMPOOL_WEBSITE_URL": "https://mempool.space",
|
||||
"LIQUID_WEBSITE_URL": "https://liquid.network",
|
||||
"MINING_DASHBOARD": true,
|
||||
|
@ -23,7 +23,7 @@ export class LightningApiService {
|
||||
}
|
||||
this.apiBasePath = ''; // assume mainnet by default
|
||||
this.stateService.networkChanged$.subscribe((network) => {
|
||||
this.apiBasePath = network && network !== this.stateService.env.DEFAULT_NETWORK ? '/' + network : '';
|
||||
this.apiBasePath = network && network !== this.stateService.env.ROOT_NETWORK ? '/' + network : '';
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ export class ApiService {
|
||||
}
|
||||
this.apiBasePath = ''; // assume mainnet by default
|
||||
this.stateService.networkChanged$.subscribe((network) => {
|
||||
this.apiBasePath = network && network !== this.stateService.env.DEFAULT_NETWORK ? '/' + network : '';
|
||||
this.apiBasePath = network && network !== this.stateService.env.ROOT_NETWORK ? '/' + network : '';
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ export class ElectrsApiService {
|
||||
}
|
||||
this.apiBasePath = ''; // assume mainnet by default
|
||||
this.stateService.networkChanged$.subscribe((network) => {
|
||||
this.apiBasePath = network && network !== this.stateService.env.DEFAULT_NETWORK ? '/' + network : '';
|
||||
this.apiBasePath = network && network !== this.stateService.env.ROOT_NETWORK ? '/' + network : '';
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -13,9 +13,9 @@ export class NavigationService {
|
||||
bitcoin: {
|
||||
subnets: [
|
||||
{ name: 'mainnet', path: '' },
|
||||
{ name: 'testnet', path: this.stateService.env.DEFAULT_NETWORK === 'testnet' ? '/' : '/testnet' },
|
||||
{ name: 'testnet4', path: this.stateService.env.DEFAULT_NETWORK === 'testnet4' ? '/' : '/testnet4' },
|
||||
{ name: 'signet', path: this.stateService.env.DEFAULT_NETWORK === 'signet' ? '/' : '/signet' },
|
||||
{ name: 'testnet', path: this.stateService.env.ROOT_NETWORK === 'testnet' ? '/' : '/testnet' },
|
||||
{ name: 'testnet4', path: this.stateService.env.ROOT_NETWORK === 'testnet4' ? '/' : '/testnet4' },
|
||||
{ name: 'signet', path: this.stateService.env.ROOT_NETWORK === 'signet' ? '/' : '/signet' },
|
||||
],
|
||||
},
|
||||
liquid: {
|
||||
|
@ -53,7 +53,7 @@ export interface Env {
|
||||
KEEP_BLOCKS_AMOUNT: number;
|
||||
OFFICIAL_MEMPOOL_SPACE: boolean;
|
||||
BASE_MODULE: string;
|
||||
DEFAULT_NETWORK: string;
|
||||
ROOT_NETWORK: string;
|
||||
NGINX_PROTOCOL?: string;
|
||||
NGINX_HOSTNAME?: string;
|
||||
NGINX_PORT?: string;
|
||||
@ -86,7 +86,7 @@ const defaultEnv: Env = {
|
||||
'LIQUID_ENABLED': false,
|
||||
'LIQUID_TESTNET_ENABLED': false,
|
||||
'BASE_MODULE': 'mempool',
|
||||
'DEFAULT_NETWORK': '',
|
||||
'ROOT_NETWORK': '',
|
||||
'ITEMS_PER_PAGE': 10,
|
||||
'KEEP_BLOCKS_AMOUNT': 8,
|
||||
'OFFICIAL_MEMPOOL_SPACE': false,
|
||||
@ -206,7 +206,7 @@ export class StateService {
|
||||
this.env.MINING_DASHBOARD = false;
|
||||
}
|
||||
|
||||
this.network = this.env.DEFAULT_NETWORK;
|
||||
this.network = this.env.ROOT_NETWORK;
|
||||
|
||||
if (this.isBrowser) {
|
||||
this.setNetworkBasedonUrl(window.location.pathname);
|
||||
@ -363,8 +363,8 @@ export class StateService {
|
||||
this.networkChanged$.next(this.env.BASE_MODULE);
|
||||
}
|
||||
} else if (this.network !== '') {
|
||||
this.network = this.env.DEFAULT_NETWORK;
|
||||
this.networkChanged$.next(this.env.DEFAULT_NETWORK);
|
||||
this.network = this.env.ROOT_NETWORK;
|
||||
this.networkChanged$.next(this.env.ROOT_NETWORK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ export class WebsocketService {
|
||||
.pipe(take(1))
|
||||
.subscribe((response) => this.handleResponse(response));
|
||||
} else {
|
||||
this.network = this.stateService.network === this.stateService.env.DEFAULT_NETWORK ? '' : this.stateService.network;
|
||||
this.network = this.stateService.network === this.stateService.env.ROOT_NETWORK ? '' : this.stateService.network;
|
||||
this.websocketSubject = webSocket<WebsocketResponse>(this.webSocketUrl.replace('{network}', this.network ? '/' + this.network : ''));
|
||||
|
||||
const { response: theInitData } = this.transferState.get<any>(initData, null) || {};
|
||||
@ -75,7 +75,7 @@ export class WebsocketService {
|
||||
if (network === this.network) {
|
||||
return;
|
||||
}
|
||||
this.network = network === this.stateService.env.DEFAULT_NETWORK ? '' : network;
|
||||
this.network = network === this.stateService.env.ROOT_NETWORK ? '' : network;
|
||||
clearTimeout(this.onlineCheckTimeout);
|
||||
clearTimeout(this.onlineCheckTimeoutTwo);
|
||||
|
||||
|
@ -12,7 +12,7 @@ export class RelativeUrlPipe implements PipeTransform {
|
||||
|
||||
transform(value: string, swapNetwork?: string): string {
|
||||
let network = swapNetwork || this.stateService.network;
|
||||
if (network === 'mainnet' || network === this.stateService.env.DEFAULT_NETWORK) {
|
||||
if (network === 'mainnet' || network === this.stateService.env.ROOT_NETWORK) {
|
||||
network = '';
|
||||
}
|
||||
if (this.stateService.env.BASE_MODULE === 'liquid' && network === 'liquidtestnet') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user