add method to get blockstackd's URL

This commit is contained in:
Jude Nelson
2018-02-15 13:07:44 -05:00
parent 37a8a1783b
commit 448c871cf0

View File

@@ -1422,3 +1422,15 @@ def configure_zonefile(name, zonefile, data_pubkey ):
log.debug("zonefile is now:\n{}".format(json.dumps(zonefile, indent=4, sort_keys=True)))
return zonefile
def get_blockstackd_url(config_path=CONFIG_PATH):
"""
Get the URL to the blockstackd instance
"""
conf = get_config(config_path)
blockstack_server = conf['server']
blockstack_port = conf['port']
protocol = conf['protocol']
blockstack_hostport = '{}://{}:{}'.format(protocol, blockstack_server, blockstack_port)
return blockstack_hostport