mirror of
https://github.com/monero-project/monero.git
synced 2025-05-02 08:16:07 -04:00
console.py: can now connect to several daemons/wallets
Also throw exceptions instead of print+exit, since that makes the error print last, below the python stack trace, where it's much less easy to miss it.
This commit is contained in:
parent
9f9571aa3d
commit
047af5c343
3 changed files with 69 additions and 53 deletions
|
@ -33,6 +33,8 @@ from .rpc import JSONRPC
|
|||
class Daemon(object):
|
||||
|
||||
def __init__(self, protocol='http', host='127.0.0.1', port=0, idx=0):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.rpc = JSONRPC('{protocol}://{host}:{port}'.format(protocol=protocol, host=host, port=port if port else 18180+idx))
|
||||
|
||||
def getblocktemplate(self, address, prev_block = ""):
|
||||
|
|
|
@ -33,6 +33,8 @@ from .rpc import JSONRPC
|
|||
class Wallet(object):
|
||||
|
||||
def __init__(self, protocol='http', host='127.0.0.1', port=0, idx=0):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.rpc = JSONRPC('{protocol}://{host}:{port}'.format(protocol=protocol, host=host, port=port if port else 18090+idx))
|
||||
|
||||
def make_uniform_destinations(self, address, transfer_amount, transfer_number_of_destinations=1):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue