make name operations work through openname cli

This commit is contained in:
Ryan Shea
2015-02-12 20:22:29 -05:00
parent dc275eab93
commit 830c96efcd
2 changed files with 19 additions and 13 deletions

View File

@@ -39,6 +39,7 @@ proxy = Proxy(config.OPENNAMED_SERVER, config.OPENNAMED_PORT)
def printValue(value):
logger.info(pretty_dump(value))
print pretty_dump(value)
def getFormat(result):
@@ -57,7 +58,6 @@ def getFormat(result):
def printError(error):
reply = {}
reply['error'] = "Got an error"
@@ -196,8 +196,8 @@ def run_cli():
elif args.action == 'preorder':
logger.debug('Preordering %s', args.name)
client = proxy.callRemote('preorder', args.name, args.privatekey)
client = proxy.callRemote(
'preorder', str(args.name), str(args.privatekey))
elif args.action == 'register':
logger.debug('Registering %s', args.name)

View File

@@ -55,7 +55,8 @@ from lib import preorder_name, register_name, update_name, \
bitcoind_client = BitcoindClient(
config.BITCOIND_USER, config.BITCOIND_PASSWD,
server=config.BITCOIND_SERVER, port=str(config.BITCOIND_PORT))
server=config.BITCOIND_SERVER, port=str(config.BITCOIND_PORT),
use_https=True)
try:
chain_com_client = ChainComClient(config.CHAIN_COM_API_ID,
@@ -134,8 +135,8 @@ class OpennamedRPC(jsonrpc.JSONRPC):
consensus_hash = db.consensus_hashes.get('current')
resp = preorder_name(
name, consensus_hash, str(privatekey),
blockchain_client=bitcoind_client, testset=True)
str(name), str(consensus_hash), str(privatekey),
blockchain_client=chain_com_client, testset=True)
log.debug('preorder <%s, %s>' % (name, privatekey))
@@ -145,10 +146,13 @@ class OpennamedRPC(jsonrpc.JSONRPC):
""" Register a name
"""
resp = register_name(name, privatekey,
blockchain_client=bitcoind_client, testset=True)
log.info("name: %s" % name)
log.debug('register <%s, %s, %s>' % (name, privatekey))
resp = register_name(
str(name), str(privatekey),
blockchain_client=chain_com_client, testset=True)
log.debug('register <%s, %s>' % (name, privatekey))
return resp
@@ -156,8 +160,9 @@ class OpennamedRPC(jsonrpc.JSONRPC):
""" Update a name
"""
resp = update_name(name, data, privatekey,
blockchain_client=bitcoind_client, testset=True)
resp = update_name(
str(name), str(data), str(privatekey),
blockchain_client=chain_com_client, testset=True)
log.debug('update <%s, %s, %s>' % (name, data, privatekey))
@@ -167,8 +172,9 @@ class OpennamedRPC(jsonrpc.JSONRPC):
""" Transfer a name
"""
resp = transfer_name(name, address, privatekey,
blockchain_client=bitcoind_client, testset=True)
resp = transfer_name(
str(name), str(address), str(privatekey),
blockchain_client=chain_com_client, testset=True)
log.debug('transfer <%s, %s, %s>' % (name, address, privatekey))