When getting archiver stats if the archiver has no cycleinfo it is an empty array and fails with a not very useful error undefined => undefined
When this is most likely to happen is when starting up a local network if you start the RPC before the network is processing you get this error. This could be logged more gracefully
Unreachable Archiver @ 127.0.0.1:4000 | Error-code: undefined => undefined
|
const res = await axios.get(`http://${url.ip}:${url.port}/cycleinfo/1`) |
|
if (res?.data?.cycleInfo[0].counter > maxCycleValue) { |
|
maxCycleValue = res?.data?.cycleInfo[0].counter |
|
} |
|
|
|
return { url: `http://${url.ip}:${url.port}`, cycle_value: res?.data?.cycleInfo[0].counter } |
|
} catch (error: unknown) { |
|
console.error( |
|
`Unreachable Archiver @ ${url.ip}:${url.port} | Error-code: ${(error as NodeJSError).errno} => ${ |
|
(error as NodeJSError).code |
|
}` |
|
) |
|
return { url: `http://${url.ip}:${url.port}`, cycle_value: null } |

When getting archiver stats if the archiver has no cycleinfo it is an empty array and fails with a not very useful error
undefined => undefinedWhen this is most likely to happen is when starting up a local network if you start the RPC before the network is processing you get this error. This could be logged more gracefully
json-rpc-server/src/utils.ts
Lines 223 to 235 in e34f7fb