-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tick): add tick cron handler source code and update tick state to…
… increment based on epoch index
- Loading branch information
Showing
3 changed files
with
63 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Cron Handler | ||
|
||
This process is responsible for sending messages to the AO/IO contract on a cron basis to ensure state is properly ticked throughout Epochs. | ||
|
||
### Loading in AOS | ||
|
||
Example loading in AOS: | ||
|
||
```bash | ||
aos devnet-tick-state --cron 1-hour | ||
``` | ||
|
||
The `Target` object can be manually modified by running. | ||
|
||
```bash | ||
aos> Target="" -- insert process ID to tick | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Target = Target or "GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc" | ||
Handlers.add( | ||
"CronTick", -- handler name | ||
Handlers.utils.hasMatchingTag("Action", "Cron"), -- handler pattern to identify cron message | ||
function () -- handler task to execute on cron message | ||
ao.send({Target=Target, Action= "Tick"}) | ||
end | ||
) |