Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "0.8.18",
"version": "0.8.20",
"scripts": {
"install:deps": "npm install",
"start": "npm install && ng serve --configuration local --open",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
</div>
<div class="fx-row-vert-cent">
<button class="btn-primary mr-10"
*ngIf="workingPoolEnabled"
(clickOutside)="detach()"
(click)="openNavDropdown($event)">
<span class="fx-row-vert-cent">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { StoreDispatcher } from '@shared/base-classes/store-dispatcher.class';
import { ScanStateSetActiveLeaf, ScanStateToggleSidePanel } from '@snarks/scan-state/scan-state.actions';
import { selectScanStateActiveLeaf, selectScanStateBlock } from '@snarks/scan-state/scan-state.state';
import { ScanStateBlock } from '@shared/types/snarks/scan-state/scan-state-block.type';
import { CONFIG } from '@shared/constants/config';
import { filter } from 'rxjs';
import { Router } from '@angular/router';
import { Routes } from '@shared/enums/routes.enum';
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
import { TemplatePortal } from '@angular/cdk/portal';
import { ScanStateLeaf } from '@shared/types/snarks/scan-state/scan-state-leaf.type';
import { AppSelectors } from '@app/app.state';
import { getFeaturesConfig } from '@shared/constants/config';

@Component({
selector: 'mina-scan-state-side-panel',
Expand All @@ -24,6 +25,7 @@ export class ScanStateSidePanelComponent extends StoreDispatcher implements OnIn
workingSnarkersLength: number;
hasError: boolean = false;
activeLeaf: ScanStateLeaf;
workingPoolEnabled: boolean = false;

@ViewChild('navDropdown') private dropdown: TemplateRef<void>;

Expand All @@ -36,6 +38,7 @@ export class ScanStateSidePanelComponent extends StoreDispatcher implements OnIn
ngOnInit(): void {
this.listenToBlockChange();
this.listenToActiveJobID();
this.listenToActiveNode();
}

toggleSidePanel(): void {
Expand All @@ -62,6 +65,13 @@ export class ScanStateSidePanelComponent extends StoreDispatcher implements OnIn
});
}

private listenToActiveNode(): void {
this.select(AppSelectors.activeNode, (node) => {
this.workingPoolEnabled = getFeaturesConfig(node).snarks?.includes('work-pool');
this.detect();
});
}

openSnarkerDetails(leaf: ScanStateLeaf): void {
this.dispatch(ScanStateSetActiveLeaf, { ...leaf, scrolling: true });
this.routeToJobId(leaf.bundle_job_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ export class SnarksWorkPoolEffects extends MinaRustBaseEffect<SnarksWorkPoolActi
),
map((payload: [WorkPoolSpecs, WorkPoolDetail]) => ({
type: SNARKS_WORK_POOL_GET_WORK_POOL_DETAIL_SUCCESS,
payload
payload,
})),
catchErrorAndRepeat(MinaErrorType.GENERIC, SNARKS_WORK_POOL_GET_WORK_POOL_DETAIL_SUCCESS),
catchErrorAndRepeat(MinaErrorType.GENERIC, SNARKS_WORK_POOL_GET_WORK_POOL_DETAIL_SUCCESS, []),
));
}
}
37 changes: 37 additions & 0 deletions frontend/src/assets/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
export default {
production: false,
globalConfig: {
features: {
'dashboard': [],
'nodes': ['overview', 'live', 'bootstrap'],
'state': ['actions'],
'network': ['messages', 'connections', 'blocks', 'topology', 'node-dht', 'graph-overview', 'bootstrap-stats'],
'snarks': ['scan-state', 'work-pool'],
'testing-tool': ['scenarios'],
'resources': ['memory'],
'block-production': ['overview', 'won-slots'],
'mempool': [],
'benchmarks': ['wallets'],
},
canAddNodes: false,
minaExplorerNetwork: 'devnet',
},
configs: [
{
name: 'staging-devnet-bp-0',
url: 'https://staging-devnet-openmina-bp-0.minaprotocol.network',
},
{
name: 'staging-devnet-bp-1',
url: 'https://staging-devnet-openmina-bp-1.minaprotocol.network',
},
{
name: 'staging-devnet-bp-2',
url: 'https://staging-devnet-openmina-bp-2.minaprotocol.network',
},
{
name: 'staging-devnet-bp-3',
url: 'https://staging-devnet-openmina-bp-3.minaprotocol.network',
},
],
};
60 changes: 2 additions & 58 deletions frontend/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,4 @@
import { MinaEnv } from '@shared/types/core/environment/mina-env.type';
import env from '../assets/env';

export const environment: Readonly<MinaEnv> = {
production: true,
identifier: 'Rust based nodes',
globalConfig: {
features: {
dashboard: [],
nodes: ['overview', 'live', 'bootstrap'],
state: ['actions'],
network: ['node-dht', 'graph-overview', 'bootstrap-stats'],
snarks: ['scan-state'],
},
canAddNodes: true,
},
configs: [
{
name: 'Node with mem profiler',
url: 'http://1.k8.openmina.com:30252',
memoryProfiler: 'http://1.k8.openmina.com:31164',
features: {
dashboard: [],
nodes: ['overview', 'live', 'bootstrap'],
state: ['actions'],
network: ['node-dht', 'graph-overview', 'bootstrap-stats'],
snarks: ['scan-state'],
resources: ['memory'],
},
},
{
name: 'Node with debugger',
url: 'http://1.k8.openmina.com:31688',
debugger: 'http://1.k8.openmina.com:31072',
features: {
dashboard: [],
nodes: ['overview', 'live', 'bootstrap'],
state: ['actions'],
network: ['messages', 'connections', 'blocks', 'topology', 'node-dht', 'graph-overview', 'bootstrap-stats'],
snarks: ['scan-state'],
},
},
{
name: 'feat/frontend-api-peers',
url: 'http://176.9.147.28:3000',
},
{
name: 'Snarker 1',
url: 'http://webrtc2.webnode.openmina.com:10000',
},
{
name: 'Snarker 2',
url: 'http://webrtc3.webnode.openmina.com:10000',
},
{
name: 'Snarker 3',
url: 'http://webrtc4.webnode.openmina.com:10000',
},
],
};

export const environment: Readonly<MinaEnv> = env as MinaEnv;
1 change: 1 addition & 0 deletions frontend/src/environments/environment.staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const environment: Readonly<MinaEnv> = {
'nodes': ['overview', 'live', 'bootstrap'],
'mempool': [],
'state': ['actions'],
'snarks': ['scan-state', 'work-pool'],
'benchmarks': ['wallets'],
},
canAddNodes: false,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,4 @@ export const environment: Readonly<MinaEnv> = {
// },
],
};

Loading