Skip to content

Commit

Permalink
Fix OP Erigon not showing peers (#1623)
Browse files Browse the repository at this point in the history
  • Loading branch information
dappnodedev authored Sep 29, 2023
1 parent ad24097 commit 110be03
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/dappmanager/src/modules/chains/drivers/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export async function ethereum(
const provider = new ethers.providers.JsonRpcProvider(apiUrl);
const [syncing, peersCount, blockNumber] = await Promise.all([
provider.send("eth_syncing", []).then(parseEthersSyncing),
provider.send("net_peerCount", []).then(parseInt),
// net_peerCount is not always available. OP Erigon does not support it
// Not logging error because it would flood the logs
provider.send("net_peerCount", []).then(parseInt).catch(() => undefined),
provider.getBlockNumber()
]);

Expand All @@ -61,7 +63,7 @@ export async function ethereum(
export function parseEthereumState(
syncing: EthSyncing,
blockNumber: number,
peersCount: number
peersCount?: number
): ChainDataResult {
if (syncing) {
const {
Expand Down

0 comments on commit 110be03

Please sign in to comment.