Skip to content

Commit

Permalink
batch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Jun 9, 2017
1 parent b2ef78c commit 6f27483
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ poollogs.json to docs/poollogs.json and send the update to your git repo.
To display the pool frontend, enable docs-site on github repository settings.


## Batch mode

The script is also runnable by cron using the -y argument:

`python liskpool.py -y`

There is also a 'batch.sh' file which run liskpool, then payments.sh and copy the poollogs.json
in the docs folder.


## License
Copyright 2017 Davide Gessa

Expand Down
3 changes: 3 additions & 0 deletions batch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python3 liskpool.py -y
bash payments.sh
cp poollogs.json docs/poollogs.json
9 changes: 7 additions & 2 deletions liskpool.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import requests
import json
import sys
import time

NODE = "https://wallet.lisknode.io"
Expand Down Expand Up @@ -105,6 +106,10 @@ def estimatePayouts (log):

print (json.dumps (log, indent=4, separators=(',', ': ')))

yes = input ('save? y/n: ')
if yes == 'y':
if len (sys.argv) > 1 and sys.argv[1] == '-y':
print ('Saving...')
saveLog (log)
else:
yes = input ('save? y/n: ')
if yes == 'y':
saveLog (log)

0 comments on commit 6f27483

Please sign in to comment.