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.14",
"version": "0.8.15",
"scripts": {
"install:deps": "npm install",
"start": "npm install && ng serve --configuration local --open",
Expand Down
43 changes: 22 additions & 21 deletions frontend/src/app/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export class AppService {
}

getActiveNodeDetails(): Observable<AppNodeDetails> {
return this.rust.get<NodeDetails>('/status')
return this.rust.get<NodeDetailsResponse>('/status')
.pipe(
map((data: NodeDetails) => ({
map((data: NodeDetailsResponse) => ({
status: this.getStatus(data),
blockHeight: data.transition_frontier.best_tip.height,
blockTime: data.transition_frontier.sync.time,
Expand All @@ -39,34 +39,34 @@ export class AppService {
snarks: data.snark_pool.snarks,
transactions: data.transaction_pool.transactions,
} as AppNodeDetails)),
catchError((err) => {
return of({
status: AppNodeStatus.OFFLINE,
blockHeight: null,
blockTime: null,
peers: 0,
download: 0,
upload: 0,
transactions: 0,
snarks: 0,
} as AppNodeDetails);
}),
catchError(() => of({
status: AppNodeStatus.OFFLINE,
blockHeight: null,
blockTime: null,
peers: 0,
download: 0,
upload: 0,
transactions: 0,
snarks: 0,
} as AppNodeDetails)),
);
}

private getStatus(data: NodeDetails): AppNodeStatus {
private getStatus(data: NodeDetailsResponse): AppNodeStatus {
if (data.transition_frontier.sync.status === 'Bootstrap') {
return AppNodeStatus.BOOTSTRAP;
}
if (data.transition_frontier.sync.status === 'Catchup') {
return AppNodeStatus.CATCHUP;
}
if (data.transition_frontier.sync.status === 'Synced') {
return AppNodeStatus.SYNCED;
} else {
if (data.transition_frontier.best_tip === null) {
return AppNodeStatus.BOOTSTRAP;
}
return AppNodeStatus.CATCHUP;
}
return AppNodeStatus.PENDING;
}
}

interface NodeDetails {
export interface NodeDetailsResponse {
transition_frontier: TransitionFrontier;
transaction_pool: { transactions: number };
peers: Peer[];
Expand All @@ -88,6 +88,7 @@ interface Sync {
time: number;
status: string;
target: any;
phase: 'Bootstrap' | 'Catchup' | 'Synced';
}

interface Peer {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/core/services/rust.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class RustService {
case '/stats/block_producer':
return this.webNodeService.blockProducerStats$;
default:
throw new Error('Unknown path for web node');
throw new Error(`Web node doesn't support "${path}" path!`);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@
<div class="button-group fx-row-vert-cent ml-5 mr-16">
<button class="fx-row-vert-cent pl-12 pr-12 lh-md"
[ngClass]="randomWallet ? 'btn-selected' : 'btn-primary'"
[tooltip]="'Send transactions from <b>random</b> senders to <b>random</b> receivers'"
[html]="true"
[maxWidth]="1000"
(click)="!randomWallet ? toggleRandomWallet() : null">Random Senders
</button>
<button class="fx-row-vert-cent pl-12 pr-12 lh-md"
[ngClass]="!randomWallet ? 'btn-selected' : 'btn-primary'"
[tooltip]="'Send transactions from <b>specific</b> sender to <b>random</b> receivers'"
[html]="true"
[maxWidth]="1000"
(click)="randomWallet ? toggleRandomWallet() : null">Specific Sender
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const initialState: BenchmarksWalletsState = {
sentTxCount: 0,
randomWallet: true,
activeWallet: undefined,
sendingFee: 1,
sendingFee: 0.001,
};

export function reducer(state: BenchmarksWalletsState = initialState, action: BenchmarksWalletsActions): BenchmarksWalletsState {
Expand Down Expand Up @@ -99,9 +99,9 @@ export function reducer(state: BenchmarksWalletsState = initialState, action: Be
from: wallet.publicKey,
nonce,
to: getRandomReceiver(wallet, state.wallets),
// to: 'B62qp6QqfMrDGULkuCTMhLYrG4iTxnjnyS3pv8bFppRsz488HCxExEY', // Teo's ledger address
// to: 'B62qp6QqfMrDGULkuCTMhLYrG4iTxnjnyS3pv8bFppRsz488HCxExEY', // Teo's work Ledger address
fee: (state.sendingFee * ONE_BILLION).toString(),
amount: (2 * ONE_BILLION).toString(),
amount: (1 * ONE_BILLION).toString(),
memo,
validUntil: '4294967295',
};
Expand All @@ -123,7 +123,7 @@ export function reducer(state: BenchmarksWalletsState = initialState, action: Be
nonce: nonce.toString(),
to: state.wallets[i].publicKey,
fee: (state.sendingFee * ONE_BILLION).toString(),
amount: (2 * ONE_BILLION).toString(),
amount: (1 * ONE_BILLION).toString(),
memo,
validUntil: '4294967295',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import { getTimeFromMemo, removeUnicodeEscapes } from '@shared/helpers/transacti
import { any, ONE_BILLION } from '@openmina/shared';

export const WALLETS: { privateKey: string, publicKey: string }[] = [
{
privateKey: 'EKEQGWy4TjbVeqKjbe7TW81DKQM34min5FNmXpKArHKLyGVd3KSP',
publicKey: 'B62qpD75xH5R19wxZG2uz8whNsHPTioVoYcPV3zfjjSbzTmaHQHKKEV',
},
{
privateKey: 'EKETKywEr7ktbzqj8D2aj4yYZVMyj33sHuWLQydbzt1M3sGnAbTh',
publicKey: 'B62qnLjgW4LAnrxkcdLc7Snb49qx6aP5qsmPsp6ueZN4XPMC621cqGc',
Expand Down Expand Up @@ -4009,10 +4013,10 @@ export const WALLETS: { privateKey: string, publicKey: string }[] = [
privateKey: 'EKEA8wHHpnBCzzNvCJSPqoaF66V9cQcpd7xNN9kQxs36PV293pcU',
publicKey: 'B62qrZG1qRV82D2CJa9FJW5BYMyC7AbL1J5aKVEgi6VMmBNcHVreozY',
},
{
privateKey: 'EKEeNntJDZ7whPrxjNKPTj2QisoKdzWzJ59s2KmxaLHJWJhPKKxY',
publicKey: 'B62qruoEM1ijZPXkkLubNKRn8DQHbdfTG2BP8ut4kE4EqxT7EmnMGRA',
},
// {
// privateKey: 'EKEeNntJDZ7whPrxjNKPTj2QisoKdzWzJ59s2KmxaLHJWJhPKKxY',
// publicKey: 'B62qruoEM1ijZPXkkLubNKRn8DQHbdfTG2BP8ut4kE4EqxT7EmnMGRA',
// },
];

@Injectable({
Expand All @@ -4037,9 +4041,15 @@ export class BenchmarksWalletsService {
nonce: wallet.nonce,
}))),
// TODO: This is a backend issue, must delete this map when we have all 1000 accounts in the backend
map(wall => {
map(wallets => {
return [
...wall.filter(w => WALLETS.map(w => w.publicKey).includes(w.publicKey)),
...wallets.filter(w => WALLETS.map(w => w.publicKey).includes(w.publicKey)),
...WALLETS.filter(w => !wallets.some(w1 => w1.publicKey === w.publicKey)).map(wallet => ({
privateKey: wallet.privateKey,
publicKey: wallet.publicKey,
minaTokens: 0,
nonce: 0,
})),
];
}),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export class BlockProductionWonSlotsService {
height: attempt.block?.height,
hash: attempt.block?.hash,
transactionsTotal: nanOrElse(attempt.block?.transactions.payments + attempt.block?.transactions.delegations + attempt.block?.transactions.zkapps, 0),
zkapps: nanOrElse(attempt.block?.transactions.zkapps, 0),
payments: nanOrElse(attempt.block?.transactions.payments, 0),
delegations: nanOrElse(attempt.block?.transactions.delegations, 0),
zkapps: nanOrElse(attempt.block?.transactions.zkapps, 0),
completedWorksCount: nanOrElse(attempt.block?.completed_works_count, 0),
snarkFees: attempt.block ? attempt.block.snark_fees / ONE_BILLION : undefined,
coinbaseRewards: attempt.block ? attempt.block.coinbase / ONE_BILLION : undefined,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/features/dashboard/dashboard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class DashboardService {

getTips({ url, name }: { url: string, name: string }): Observable<NodesOverviewNode[]> {
return this.rust.get<NodesOverviewNode[]>('/stats/sync?limit=1').pipe(
map((response: NodesOverviewNode[]) => this.nodesOverviewService.mapNodeTipsResponse(response, true, {
map((response: NodesOverviewNode[]) => this.nodesOverviewService.mapNodeTipsResponse([response, undefined], {
name,
url,
})),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div
class="h-sm fx-row-vert-cent pl-5 pr-5 border-rad-6 pointer mr-5 f-600"
[class.pointer-none]="zkApps === 0"
[ngClass]="(filters.zkApp && zkApps !== 0) ? 'bg-container primary' : 'bg-container tertiary'"
[ngClass]="(filters.zkApp && zkApps !== 0) ? 'bg-special-selected-alt-1-container special-alt-1-primary' : 'bg-container tertiary'"
(click)="changeFilter('zkApp', !filters.zkApp)">
<span class="mr-5">{{ zkApps }}</span>
ZKApp command
Expand All @@ -31,7 +31,7 @@
<div
class="h-sm fx-row-vert-cent pl-5 pr-5 border-rad-6 pointer mr-5 f-600"
[class.pointer-none]="payments === 0"
[ngClass]="(filters.payment && payments !== 0) ? 'bg-container primary' : 'bg-container tertiary'"
[ngClass]="(filters.payment && payments !== 0) ? 'bg-special-selected-alt-3-container special-alt-3-primary' : 'bg-container tertiary'"
(click)="changeFilter('payment', !filters.payment)">
<span class="mr-5">{{ payments }}</span>
Payment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<ng-container #minaTable></ng-container>

<ng-template #rowTemplate let-row="row">
<span class="primary">{{ row.kind }}</span>
<span>
<span class="status f-600"
[ngClass]="row.kind">{{ row.kind }}</span>
</span>
<span>{{ row.txHash | truncateMid }}</span>
<span>{{ row.sender | truncateMid }}</span>
<span class="secondary">{{ row.fee }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,18 @@
background-color: $special-selected-alt-2-container;
color: $special-selected-alt-2-primary;
}

.status {
padding: 3px 5px;
border-radius: 4px;

&.ZKApp {
background-color: $special-selected-alt-1-container;
color: $special-selected-alt-1-primary;
}

&.Payment {
background-color: $special-selected-alt-3-container;
color: $special-selected-alt-3-primary;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import {
MergedRoute,
SEC_CONFIG_GRAY_PALETTE,
SecDurationConfig,
TableColumnList
TableColumnList,
} from '@openmina/shared';
import { Router } from '@angular/router';
import {
NodesBootstrapSetActiveBlock,
NodesBootstrapSortNodes,
NodesBootstrapToggleSidePanel
NodesBootstrapToggleSidePanel,
} from '@nodes/bootstrap/nodes-bootstrap.actions';
import {
selectNodesBootstrapActiveNode,
Expand All @@ -38,24 +38,24 @@ export class NodesBootstrapTableComponent extends MinaTableRustWrapper<NodesBoot
colors: SEC_CONFIG_GRAY_PALETTE,
severe: 10,
warn: 1,
default: 0.01
default: 0.01,
};

openSidePanel: boolean = true;

protected readonly tableHeads: TableColumnList<NodesBootstrapNode> = [
{ name: '#', sort: 'index' },
{ name: 'global slot', sort: 'globalSlot', tooltip: 'The block’s slot irrespective of Mina epochs.' },
{ name: 'height', tooltip: 'The block height.' },
{ name: 'best tip', sort: 'bestTip', tooltip: 'Best tip to which node tried to synchronize.' },
{ name: 'amount', sort: 'fetchedBlocks', tooltip: 'Total amount of fetched blocks.' },
{ name: 'min', sort: 'fetchedBlocksMin', tooltip: 'Minimum time it took to fetch a block.' },
{ name: 'max', sort: 'fetchedBlocksMax', tooltip: 'Maximum time it took to fetch a block.' },
{ name: 'avg', sort: 'fetchedBlocksAvg', tooltip: 'Average time it took to fetch a block.' },
{ name: 'amount', sort: 'appliedBlocks', tooltip: 'Total amount of applied blocks.' },
{ name: 'min', sort: 'appliedBlocksMin', tooltip: 'Minimum time it took to apply a block.' },
{ name: 'max', sort: 'appliedBlocksMax', tooltip: 'Maximum time it took to apply a block.' },
{ name: 'avg', sort: 'appliedBlocksAvg', tooltip: 'Average time it took to apply a block.' },
{ name: 'global slot', sort: 'globalSlot' },
{ name: 'height' },
{ name: 'best tip', sort: 'bestTip' },
{ name: 'amount', sort: 'fetchedBlocks' },
{ name: 'min', sort: 'fetchedBlocksMin' },
{ name: 'max', sort: 'fetchedBlocksMax' },
{ name: 'avg', sort: 'fetchedBlocksAvg' },
{ name: 'amount', sort: 'appliedBlocks' },
{ name: 'min', sort: 'appliedBlocksMin' },
{ name: 'max', sort: 'appliedBlocksMax' },
{ name: 'avg', sort: 'appliedBlocksAvg' },
];

private indexFromRoute: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ export class NodesOverviewEffects extends MinaRustBaseEffect<NodesOverviewAction
ofType(NODES_OVERVIEW_GET_NODE_STATUS),
this.latestActionState<NodesOverviewGetNodeStatus>(),
mergeMap(({ action }) =>
this.nodesOverviewService.getNodeTips({
url: action.payload.url,
name: action.payload.name,
}, '?limit=1', true),
this.nodesOverviewService.getNodeTips({ url: action.payload.url, name: action.payload.name }, '?limit=1'),
),
map((nodeTips: NodesOverviewNode[]) => ({
type: NODES_OVERVIEW_GET_NODE_STATUS_SUCCESS,
Expand Down
Loading
Loading