Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

327
Vistas
Failed to evaluate transaction: TypeError: Cannot read properties of undefined (reading 'toString') reactJS

frontend code reactJS:

await axios
.put("http://localhost:8080/api/updateBudget/"+gmail, bud)
.then((response) => {
  console.log(response);
})
.catch((error) => {
  if (error.response) {
    console.log(error.response);
    console.log("server responded");
  } else if (error.request) {
    console.log("network error");
  } else {
    console.log(error);
  }
});

Backend code NodeJS:

app.put('/api/updateBudget/:gmail', async function (req, res) {
    try {
    const ccpPath = path.resolve(__dirname, '..', 'dev','fabric-samples','test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');
    const ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));
     
    const walletPath = path.join(process.cwd(), 'wallet');
    const wallet = await Wallets.newFileSystemWallet(walletPath);
    console.log(`Wallet path: ${walletPath}`);
     
    const identity = await wallet.get('appUser');
    if (!identity) {
    console.log('An identity for the user "appUser" does not exist in the wallet');
    console.log('Run the registerUser.js application before retrying');
    return;
    }
     
    const gateway = new Gateway();
    await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } });
     
    const network = await gateway.getNetwork('testchannel');
     
    const contract = network.getContract('supply_chain');
     

     
    await contract.submitTransaction('updateBudget',req.body.gmail,req.body.bud);
    console.log('Transaction has been submitted');
    res.send('Transaction has been submitted');
     
    await gateway.disconnect();
     
    } catch (error) {
    console.error(`Failed to evaluate transaction: ${error}`);
    process.exit(1);
    }
    });

i am getting network error in console and typeError in terminal whenver i hit the api. In frontend i have used ReactJS and in backend i have used NodeJS and i am storing data in blockchain.

about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda