I'm trying to send a transaction using the a deployed smart contract, the same data of the transaction will be stocked in the database, I added this code in the transaction.controllers, but the web3 part doesn't work,I'm new in both React and web3.Any suggestions please ? (there is no returned errors, just the whole path localhost:3000/transaction disappears) and thank you !

enter image description here enter image description here

  • 1
    What do you exactly mean by "the web3 part doesn't work"? It throws an error, it reverts, it does nothing, it does something unexpected, ... Please try to provide a minimal reproducible example with the problem, or a link to a github repo.
    – Ismael
    Jun 22 at 2:29
  • Hello, thank you for answering. Actually, what I mean by web3 part is the smart contract connection (185->191 lines in the image). It is supposed to enter 3 inputs in a form page that will be sent to the database (using axios for dispatching) and the smart contract function too. I tested the db part before adding the smart contract connection but the problem is that it's not working when I added the smart contract connection and it shows this error: xhr.js:210 POST http://localhost:3000/api/transaction 404 (Not Found)
    – Mayyy
    Jun 22 at 12:35
  • You should await every web3 method, you arent waiting for any of them
    – Julissa DC
    Jun 22 at 13:09
  • Thanks for suggestion, yes I did, but it didn't work
    – Mayyy
    Jun 22 at 13:13
  • @Mayyy The trace is in the frontend so it doesn't provide any details from the backend where the code is running. I suggest to try running the "web3" part isolated from the rest of the backend and check where it is failing.
    – Ismael
    Jun 22 at 13:26


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.