mirror of
https://github.com/monero-project/monero.git
synced 2025-05-02 08:16:07 -04:00
python-rpc: add console.py
It allows one to connect to a running daemon or wallet, and use its RPC API from python. Usage: python -i console.py <port> It will detect whether it's talking to a daemon or wallet and initialize itself accordingly.
This commit is contained in:
parent
22b644f47e
commit
c7bfdc3566
4 changed files with 66 additions and 1 deletions
|
@ -196,3 +196,11 @@ class Daemon(object):
|
|||
'id': '0'
|
||||
}
|
||||
return self.rpc.send_json_rpc_request(flush_txpool)
|
||||
|
||||
def get_version(self):
|
||||
get_version = {
|
||||
'method': 'get_version',
|
||||
'jsonrpc': '2.0',
|
||||
'id': '0'
|
||||
}
|
||||
return self.rpc.send_json_rpc_request(get_version)
|
||||
|
|
|
@ -590,3 +590,11 @@ class Wallet(object):
|
|||
'id': '0'
|
||||
}
|
||||
return self.rpc.send_json_rpc_request(verify)
|
||||
|
||||
def get_version(self):
|
||||
get_version = {
|
||||
'method': 'get_version',
|
||||
'jsonrpc': '2.0',
|
||||
'id': '0'
|
||||
}
|
||||
return self.rpc.send_json_rpc_request(get_version)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue