I'm using a html code connected to my smart contract via testrpc node, where users submit temperature data.

How can I view that data from the smart contract, each time I view from the contract I see the last data entry not all entries?

How can I see all?

  • Did you store your data in array? If no, then use an array to store the data and return the whole to get all data. – biplavo Jul 28 '19 at 15:58
  • Was thinking of doing so. However, arent there any other way? – user51821 Jul 28 '19 at 17:29
  • Alternative way might be searching for events in the blockchain. You should have event emitted when adding each data. Collect all of your data entry events, parse and show them. – biplavo Jul 28 '19 at 17:57
  • I do have an event when users input the data, but dont know how to parse all of those events and show them. – user51821 Jul 28 '19 at 18:44
  • @user51821 This might be helpful for you to getting past events: web3js.readthedocs.io/en/v1.2.0/… – Meet Siraja Jul 29 '19 at 9:07

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.