¿Qué significa este error?
Error: 13 INTERNO: recibido RST_STREAM con código 0
En este momento, hay tres puntos finales que no funcionan muy bien y dan como resultado un error RST_STREAM que el SDK no maneja (incluso v2.1.1), si anula la lista predeterminada de nodos del SDK, debería estar bien.
Ya hay un problema para rastrear esto en github: https://github.com/hashgraph/hedera-sdk-js/issues/622
Mientras tanto, puede manejar los errores de la siguiente manera:
con promesa
let retry = true; while (retry) { await new AccountBalanceQuery() .setAccountId(operatorId) .execute(client) .then(() => { retry = false; console.log("---> SUCCESS"); }) .catch(error => { console.error(error); if (error.message.includes('RST_STREAM')) { console.log("---> RETRY"); } }); } }con intentar/atrapar
let retry = true; while (retry) { try { await new AccountBalanceQuery() .setAccountId(operatorId) .execute(client); retry = false; console.log("---> SUCCESS"); } catch (error) { console.error(error); if (error.message.includes('RST_STREAM')) { console.log("---> RETRY"); } } }De esa manera, si otros nodos no responden, lo manejará bien.