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