#!/usr/bin/python import os import urllib import xmlrpclib api_user=os.getenv('BITMESSAGE_API_USER', 'bitmessage_api_user') ; api_password=os.getenv('BITMESSAGE_API_PASSWORD', 'bitmessage_api_password') ; api_port=os.getenv('BITMESSAGE_API_PORT', '8442') ; addr_num=os.getenv('BITMESSAGE_SEED_ADDRESSES', '0') ; addr_seed=os.getenv('BITMESSAGE_SEED_PHRASE') ; # Percent-encode the credentials before they go into the URL -- see the same # note in healthy_check.py. api_link="http://{}:{}@127.0.0.1:{}/".format( urllib.quote(api_user, safe=''), urllib.quote(api_password, safe=''), api_port) api = xmlrpclib.ServerProxy(api_link) print api.createDeterministicAddresses(addr_seed.encode('base64'),int(addr_num))