Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nya1/balance-actions
Executes a script when the provided address reach the balance limit.
https://github.com/nya1/balance-actions
actions address alert balance ethereum monitor watch
Last synced: 19 days ago
JSON representation
Executes a script when the provided address reach the balance limit.
- Host: GitHub
- URL: https://github.com/nya1/balance-actions
- Owner: nya1
- License: mit
- Created: 2017-05-01T12:23:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-01T16:02:12.000Z (over 7 years ago)
- Last Synced: 2024-11-07T08:50:18.850Z (2 months ago)
- Topics: actions, address, alert, balance, ethereum, monitor, watch
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Balance Actions
Executes a script when the provided address reach the balance limit.
Cronjob is recommended for an automated check.
See a [general example](#example) or a [cronjob example](#cronjob-example)
Tested on Python 2.7 and 3
`python balance-actions.py `
```
-h, --help show this help message and exit
--url URL http node
--url-list URL_LIST [URL_LIST ...]
http node list (N+1 is a backup node)
--address ADDRESS address to watch for
--script-path SCRIPT_PATH
script location (full path)
--limit LIMIT balance limit (in wei)```
### Example
```bash
python balance-actions.py
--address 0x0000000000000000000000000000000000000000
--url-list http://localhost:8545 http://my.remote.eth.node.com https://pub-node26224.etherscan.io/
--limit 2000000000000000000
--script-path /home/user/refill_account.sh
```Trigger `/home/user/refill_account.sh` if the account balance of `0x0000000000000000000000000000000000000000` is less than 2000000000000000000 wei (2 ether), using more than 1 node for backup.
**Please note:** The `--script-path` script file must be executable (`chmod +x `)
### Cronjob example
Edit the crontab
```bash
crontab -e
```Add a new cronjob, every 30 minutes the `balance-actions.py` script will be executed with the [custom options](#example).
```bash
*/30 * * * * /home/user/balance-actions/balance-actions.py <my-options>
```**Please note:** `balance-actions.py` and the script that will be executed must be executable (`chmod +x <script>`)