Ethereum contracts require someone to execute the contract and are not self aware. Are EOS contracts self executing if some external thing happens like the weather changing when detected from a weather api site?

If not do I need to have cron run every minute on my system and monitor the weather api and if its sunny, it will execute the smart contract on EOS?

Otherwise, if it is shelf executing, won't I clog up the network if I accidentally created an infinity loop?

If not do I need to have cron run every minute on my system and monitor the weather api and if its sunny, it will execute the smart contract on EOS?

Yes, you'd need to make an explicit call to the blockchain yourself as the network cannot make calls to external services.

The closest native mechanism you may have to "self-execution" is deferred transactions: a contract may be programmed to schedule future transactions that do not require your input. However, as with anything else in the EOSIO, they cannot make API calls to off-chain services.

For what it's worth, oracles are the mechanism that are supposed to enable blockchains to communicate directly with the external world. Such services exist both on EOSIO and on other platforms: for instance, Oraclize simulates such activity by monitoring the chain and acting as a middleware: they see your EOSIO transaction, they make an off-chain request to the service requested, and they make an EOSIO transaction reporting the results to your contract to a callback.

won't I clog up the network if I accidentally created an infinity loop?

An infinite loop would still be bounded by the resources allocated to you based on the amount of bandwidth you staked for.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.