Skip to content

Commit

Permalink
major changes to switch-keys uploading to make it easier to test on r…
Browse files Browse the repository at this point in the history
…emote servers.
  • Loading branch information
gileadmcgee committed Oct 25, 2015
1 parent 21e0727 commit 2216850
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 100 deletions.
13 changes: 13 additions & 0 deletions scripts/switch-keys/producer1/config-example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
path_to_cli_wallet =

wallet_password =

remote_ws = "ws://

private_active_key =

witnessname =

producer_number =

rpc_port = "8093"
35 changes: 35 additions & 0 deletions scripts/switch-keys/producer1/producer1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import sys
import json
from grapheneapi import GrapheneWebsocket, GrapheneWebsocketProtocol
import time
import config
import subprocess

rpc = GrapheneWebsocket("localhost", config.rpc_port, "", "")
local_port = "127.0.0.1:" + config.rpc_port

def openProducer():
subprocess.call(["screen","-dmS","wallet"+config.producer_number,config.path_to_cli_wallet,"-H",local_port,"-s",config.remote_ws])

def unlockWallet():
rpc.unlock(config.wallet_password)

def setPassword():
rpc.set_password(config.wallet_password)

def importActiveKey():
rpc.import_key(config.witnessname, config.private_active_key)

def getSigningKey():
witness = rpc.get_witness(config.witnessname)
signingKey = witness["signing-key"]
return signingKey

def setSigningKey(signingKey):
rpc.update_witness(config.witnessname,"",signingKey,"true")


def info():
info = rpc.info()
part = info["participation"]
return part
13 changes: 13 additions & 0 deletions scripts/switch-keys/producer2/config-example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
path_to_cli_wallet =

wallet_password =

remote_ws = "ws://

private_active_key =

witnessname =

producer_number = 2

rpc_port = "8094"
35 changes: 35 additions & 0 deletions scripts/switch-keys/producer2/producer2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import sys
import json
from grapheneapi import GrapheneWebsocket, GrapheneWebsocketProtocol
import time
import config
import subprocess

rpc = GrapheneWebsocket("localhost", config.rpc_port, "", "")
local_port = "127.0.0.1:" + config.rpc_port

def openProducer():
subprocess.call(["screen","-dmS","wallet"+config.producer_number,config.path_to_cli_wallet,"-H",local_port,"-s",config.remote_ws])

def unlockWallet():
rpc.unlock(config.wallet_password)

def setPassword():
rpc.set_password(config.wallet_password)

def importActiveKey():
rpc.import_key(config.witnessname, config.private_active_key)

def getSigningKey():
witness = rpc.get_witness(config.witnessname)
signingKey = witness["signing-key"]
return signingKey

def setSigningKey(signingKey):
rpc.update_witness(config.witnessname,"",signingKey,"true")


def info():
info = rpc.info()
part = info["participation"]
return part
Loading

0 comments on commit 2216850

Please sign in to comment.