Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

228
Visualizações
Getting an error while trying to connect to Hedera network. How can the error be in node_modules?

So this is the error `\node_modules@hashgraph\sdk\lib\channel\NodeChannel.cjs:92 }, 10_000);

I'm just setting up a basic connection to get the balance of my account. Here is my code:

const { Client, AccountBalanceQuery } = require("@hashgraph/sdk");

require("dotenv").config();

async function main() {


// Grab your Hedera account ID and Key
const myAccountId = process.env.MY_ACCOUNT_ID;
const myPrivateKey = process.env.MY_PRIVATE_KEY;


// throw an error if you couldn't get the id
if (myAccountId == null || myPrivateKey == null ) {
    throw new Error("Environment variables must be present");
}

console.log("I made it this far");


// connect to the hedera network
const client = Client.forTestnet();

client.setOperator(myAccountId, myPrivateKey);



// Now the connection to the hedera network is established


// get your balance 
const balance = await new AccountBalanceQuery()
    .setAccountId(myAccountId)
    .execute(client)


console.log(`${myAccountId} balance =  ${balance.value()}`);
 }


main();
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda