-
-
Save lovesh/56b947b051f55619f2885feb09354b47 to your computer and use it in GitHub Desktop.
Script for creating schedule. Generates POOL_UPGRADE command that can be send useing CLI to cluster
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
# Script for creating schedule | |
# Generates POOL_UPGRADE command that can be send useing CLI to cluster | |
```from datetime import datetime, timedelta | |
from dateutil import tz | |
# Following two parameters need to modified for each upgrade. | |
UPGRADE_NAME = "upgrade-11" | |
UPGRADE_VERSION = "0.1" | |
tempalte = "send POOL_UPGRADE name={name} version={version} sha256={sha256} " \ | |
"action={action} schedule={schedule} timeout={timeout}"\ | |
now = datetime.utcnow().replace(tzinfo=tz.tzutc()) + timedelta(minutes=5) | |
nodeIds = [ | |
"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv", | |
"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb", | |
"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya", | |
"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA" | |
] | |
schedule = dict((nodeId, str(now + (timedelta(minutes=5) * i))) | |
for i, nodeId in enumerate(nodeIds)) | |
command = tempalte.format(name="upgrade-11", | |
version="0.1", | |
sha256="aad1242", | |
action="start", | |
schedule=schedule, | |
timeout=10) | |
print(command) | |
exit()``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script assumes there are 4 nodes running created with script
generate_sovrin_pool_transactions
. Please note that you need to specify own upgrade version and name.