Service to send alerts when unconfirmed txns do not empty
Using this endpoint: https://explorer.skycoin.net/api/pendingTxs
If an unconfirmed txn is in the array for more than 1 minute, send an alert
This service can be run in a cron job
The API response is documented here: https://github.com/skycoin/skycoin/blob/develop/src/api/README.md#get-unconfirmed-transactions The txid field can be used to identify the transaction.
Suggest the following config parameters:
- smtp server:port
- smtp username
- smtp password
- smtp from address
- unconfirmed duration (default 60) in seconds.
Params ideally can be set via command line, config file or env.
Suggest system logs to stdout AND sends an email when it gets an error including:
- Error calling the API or parsing the results.
- Unconfirmed trans > 1 min (i.e. when it sends alert sms)
- SMTP errors (no email can be sent in this case, just write to log)
- any exceptions etc.
Write a quick readme.md with how to use/configure
Does the email/log need to contain the json returned by the API in case of delayed transaction?
Email should include it, but if for some reason its excessively large it can be truncated to some max size.
The log can say how many unconfirmed txns, the timestamp of the oldest and timestamp of the newest, using a human readable timestamp. Email should include this information too
Alexey has written the code, he is just tweaking it and he will check it in to master branch (no develop branch)