rename command: notify
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
# Release 2.6
|
# Release 2.6
|
||||||
* separation between plugins and GUIs
|
* separation between plugins and GUIs
|
||||||
|
* the daemon supports jsonrpc commands
|
||||||
|
* new command: 'notify <address> <url>'
|
||||||
|
|
||||||
# Release 2.5.4
|
# Release 2.5.4
|
||||||
* increase MIN_RELAY_TX_FEE to avoid dust transactions
|
* increase MIN_RELAY_TX_FEE to avoid dust transactions
|
||||||
|
|||||||
@@ -601,7 +601,7 @@ class Commands:
|
|||||||
self.wallet.remove_payment_request(k, self.config)
|
self.wallet.remove_payment_request(k, self.config)
|
||||||
|
|
||||||
@command('n')
|
@command('n')
|
||||||
def watchaddress(self, address, URL):
|
def notify(self, address, URL):
|
||||||
"""Watch an address. Everytime the address changes, a http POST is sent to the URL."""
|
"""Watch an address. Everytime the address changes, a http POST is sent to the URL."""
|
||||||
def callback(x):
|
def callback(x):
|
||||||
import urllib2
|
import urllib2
|
||||||
@@ -614,8 +614,7 @@ class Commands:
|
|||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
util.print_error(str(e))
|
util.print_error(str(e))
|
||||||
self.network.send([('blockchain.address.subscribe', [address])], callback)
|
self.network.send([('blockchain.address.subscribe', [address])], callback)
|
||||||
return "ok"
|
return True
|
||||||
|
|
||||||
|
|
||||||
param_descriptions = {
|
param_descriptions = {
|
||||||
'privkey': 'Private key. Type \'?\' to get a prompt.',
|
'privkey': 'Private key. Type \'?\' to get a prompt.',
|
||||||
|
|||||||
@@ -75,13 +75,13 @@ class Daemon(util.DaemonThread):
|
|||||||
self.server.register_function(getattr(self.cmd_runner, cmdname), cmdname)
|
self.server.register_function(getattr(self.cmd_runner, cmdname), cmdname)
|
||||||
self.server.register_function(self.run_cmdline, 'run_cmdline')
|
self.server.register_function(self.run_cmdline, 'run_cmdline')
|
||||||
self.server.register_function(self.ping, 'ping')
|
self.server.register_function(self.ping, 'ping')
|
||||||
self.server.register_function(self.daemon, 'daemon')
|
self.server.register_function(self.run_daemon, 'daemon')
|
||||||
self.server.register_function(self.run_gui, 'gui')
|
self.server.register_function(self.run_gui, 'gui')
|
||||||
|
|
||||||
def ping(self):
|
def ping(self):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def daemon(self, config):
|
def run_daemon(self, config):
|
||||||
sub = config.get('subcommand')
|
sub = config.get('subcommand')
|
||||||
assert sub in ['start', 'stop', 'status']
|
assert sub in ['start', 'stop', 'status']
|
||||||
if sub == 'start':
|
if sub == 'start':
|
||||||
|
|||||||
Reference in New Issue
Block a user