0

I read this article https://medium.com/@robinagist/building-an-ethereum-oracle-with-web3-js-1-0-1272b59cfc31 but there are some things I didn't understand. Does the oracle need a node (like geth or parity) to communicate with the oracle smart contract? At this link there is the code https://github.com/robinagist/EthereumWeatherOracle in wxoracle.js I did not understand the sleep function what it is for.

7
  • 1
    yeah , it needs a node because it needs to send a transaction to feed the data about weather every hour or so to update the temperatures. Or this node can be "borrowed" from Infura. – Nulik Feb 1 at 15:18
  • 1
    the sleep() function is probably because every X minutes of time, somebody needs to feed temperatures to the contract – Nulik Feb 1 at 15:20
  • @Nulik thank you. I noticed that the same sleep function is present in the client. What is it for here? – Mario Roma Feb 1 at 15:24
  • @Nulik also in this article there is a wait function which I cannot understand <medium.com/decentlabs/…>. Should it have the same purpose? – Mario Roma Feb 1 at 15:28
  • I don't know , what is the resolve() function doing? thats the answer – Nulik Feb 1 at 15:30

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.