Getting Started Guide
_ _ _ _ ____ _ _ _
| | (_) __ _ _ _ (_) __| | / ___| ___ | |__ ___ __| | _ _ | | ___ _ __
| | | | / _` | | | | | | | / _` | \___ \ / __| | '_ \ / _ \ / _` | | | | | | | / _ \ | '__|
| |___ | | | (_| | | |_| | | | | (_| | ___) | | (__ | | | | | __/ | (_| | | |_| | | | | __/ | |
|_____| |_| \__, | \__,_| |_| \__,_| |____/ \___| |_| |_| \___| \__,_| \__,_| |_| \___| |_|
LiquidScheduler is an on chain scheduling solution for EOS based actions.
The service has 2 parts, a transaction scheduler, and an interval. The scheduler is used for scheduling actions to take place in the future and the interval may be used for running services on a reliable cron such as a price feed.
LiquidScheduler takes a
name timer, a
std::vector<char> payloadobject, and an
uint32_t secondsinterval/deferred schedule time as its parameters. Multiple timers may be used within the same contract. For example, if a contract deals with multiple accounts, a timer can be set up for each account. The
payloadparameter can be used to pass data to the
start_intervalfor intervals) which is used to run the scheduled task/interval. At the end of the
timer_callbackis a return response to reschedule the transaction if needed. If the return is truthy, the task will reschedule again based on the interval passed, if it is false, the task will not be rescheduled.
Currently there can only be 1
timer_callbackso it is recommended to separate the
intervalservices into separate contracts if needed.
The price feed example uses LiquidHarmony web oracles and the LiquidScheduler to periodically update a price on chain only when the new price is more or less than 1% of the last updated price, conserving CPU by only running actions when necessary. See here
This box contains the LiquidScheduler smart contract libraries, DSP node logic, unit tests, and everything else needed to get started integrating / testing the DAPP Network LiquidScheduler in your smart contract.
mkdir cron-dapp-service; cd cron-dapp-service
# npm install -g @liquidapps/zeus-cmd
zeus box create
zeus unbox cron-dapp-service
zeus test -c