diff --git a/src/renderer/Presentational/NodeScreen/NodeScreen.tsx b/src/renderer/Presentational/NodeScreen/NodeScreen.tsx index e9f457c5..38aa3a12 100644 --- a/src/renderer/Presentational/NodeScreen/NodeScreen.tsx +++ b/src/renderer/Presentational/NodeScreen/NodeScreen.tsx @@ -66,6 +66,7 @@ const NodeScreen = () => { { rpcTranslation: selectedNode?.spec.rpcTranslation, httpPort: selectedNode?.config?.configValuesMap?.httpPort, + specId: selectedNode?.spec.specId, }, { pollingInterval }, ); @@ -75,6 +76,7 @@ const NodeScreen = () => { { rpcTranslation: selectedNode?.spec.rpcTranslation, httpPort: selectedNode?.config?.configValuesMap?.httpPort, + specId: selectedNode?.spec.specId, }, { pollingInterval }, ); diff --git a/src/renderer/state/rpcExecuteTranslation.ts b/src/renderer/state/rpcExecuteTranslation.ts index 497b41d9..02202fe4 100644 --- a/src/renderer/state/rpcExecuteTranslation.ts +++ b/src/renderer/state/rpcExecuteTranslation.ts @@ -288,11 +288,19 @@ export const executeTranslation = async ({ } } if (rpcCall === 'peers') { + if (specId === 'op-node') { + const resp = await provider.send('opp2p_peers', [true]); + return resp?.totalConnected || 0; + } const resp = await provider.send('net_peerCount'); if (resp) { return hexToDecimal(resp); } } else if (rpcCall === 'latestBlock') { + if (specId === 'op-node') { + const resp = await provider.send('optimism_syncStatus', []); + return resp?.unsafe_l2.number || 0; + } const resp = await provider.send('eth_getBlockByNumber', [ 'latest', true, diff --git a/src/renderer/state/services.ts b/src/renderer/state/services.ts index 23d11231..364d0c80 100644 --- a/src/renderer/state/services.ts +++ b/src/renderer/state/services.ts @@ -107,7 +107,7 @@ export const RtkqExecutionWs: any = createApi({ }, }), getExecutionPeers: builder.query<ProviderResponse, QueryArg>({ - queryFn: async ({ rpcTranslation, httpPort }) => { + queryFn: async ({ rpcTranslation, httpPort, specId }) => { let data; // let error; try { @@ -116,6 +116,7 @@ export const RtkqExecutionWs: any = createApi({ rpcCall: 'peers', rpcTranslation, httpPort, + specId, }); console.log('peers data', data);