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:...
The contract rightfully encapsulates the implementation details as private.
Instead, it provides the following function as the public interface:
static asset get_balance( name token_contract_account, name owner, symbol_code sym_code )
A better version of the code to get EOS balance is thus as follows:
auto how_much = token::get_balance("eosio.token"_n, "...
Take a look at inline actions (executed in the same transaction) or deferred transactions (executed in another transaction.
The link refers to the official developer portal. Inline actions will execute in the same transaction as the initiating action. If the inline action fails the whole transaction will fail. These actions also count to the ...
You need to include eosio.hpp before the other includes.
Sidenote: this actually seems to be a problem with cdt 1.6.1 and will hopefully be fixed with next releases Issue#532
require_auth(user) will ensure the sender of the transaction has the correct permission, which is what you're intending. Perhaps the way you're calling the action is incorrect?
When using cleos push action ... the -p (or --permission) option allows you to specify the account authority you want to use.
It isn't possible to use future in smart contracts, because the whole thing is single-thread C++. Multithreading isn't supported and wouldn't work within the contract because it would potentially make the results of any code non-deterministic