Skip to content
Snippets Groups Projects
Commit cf7a70fd authored by Caner Candan's avatar Caner Candan
Browse files

* added lookup and peering subcommands

parent dec8e194
No related branches found
No related tags found
No related merge requests found
...@@ -23,13 +23,6 @@ from collections import OrderedDict ...@@ -23,13 +23,6 @@ from collections import OrderedDict
logger = logging.getLogger("cli") logger = logging.getLogger("cli")
# def action_peering():
# pprint(ucoin.ucg.Peering().get())
# def action_amendments():
# for am in ucoin.hdc.amendments.List().get():
# print(am['number'])
# def action_transactions(): # def action_transactions():
# for tx in ucoin.hdc.transactions.All().get(): # for tx in ucoin.hdc.transactions.All().get():
# print(tx['hash']) # print(tx['hash'])
...@@ -74,9 +67,24 @@ def contract(): ...@@ -74,9 +67,24 @@ def contract():
def lookup(): def lookup():
logger.debug('lookup') logger.debug('lookup')
print(ucoin.pks.Lookup().get(search=ucoin.settings['search'], op='get'))
def peering(): def peering():
logger.debug('peering') logger.debug('peering')
peer = ucoin.ucg.Peering().get()
print('Currency\t', peer['currency'])
print('Public key FPR\t', peer['key'])
print('Contract\t', peer['contract']['currentNumber'] + '-' + peer['contract']['hash'])
print('Public keys\t', peer['merkles']['pks/all']['leavesCount'])
print('Remote host\t', peer['remote']['host'])
if peer['remote']['ipv4']:
print('Remote ipv4\t', peer['remote']['ipv4'])
if peer['remote']['ipv6']:
print('Remote ipv6\t', peer['remote']['ipv6'])
print('Remote port\t', peer['remote']['port'])
def pubkey(): def pubkey():
logger.debug('pubkey') logger.debug('pubkey')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment