I decided to build a python GUI wrapper around
monero-wallet-rpc. Following https://getmonero.org/knowledge-base/developer-guides/wallet-rpc and https://moneroexamples.github.io/python-json-rpc/ are great, but this requires a wallet to have already been created. Is there a way to generate a new address via API calls? My instinct says no but I thought I would ask. What is another option for wallet creation? Extracting the relevant wallet creation methods in the monero-project/monero source?
Current working solution:
#!/usr/bin/env python from subprocess import PIPE, Popen wallet_name = 'new' wallet_pw = 'new' p = Popen(["./monero-wallet-cli", "--generate-new-wallet", wallet_name, "--password", wallet_pw, "--log-level", '1', '>stdout.log'], stdout=PIPE, stdin=PIPE, bufsize=1, ) out = p.communicate(input='0\n') print('response:\n\n\n') print(out)
This doesn't seem elegant, but it's my current solution. New wallet is created with user specified password, then I open monero-wallet-rpc as a process and make RPC calls from python.