Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Enhance wallet-tool.py to check correct directory and wallet name or file #747

Closed
unsystemizer opened this issue Jul 29, 2017 · 1 comment

Comments

@unsystemizer
Copy link

I just spent 30 mins troubleshooting bitcoin.conf, firewall, Python, etc. to fix the first two errors... Note how the errors differ depending on where you execute the script from.

These aren't necessarily "bugs", but maybe a pwd type of check could be done to suggest to execute it from the right directory and use wallet name (not wallet file name, with or without path).

From scripts with full path to wallet file:

dude@server:~/joinmarket-clientserver-master/scripts$ python wallet-tool.py wallets/wallet.json showseed
2017-07-29 12:49:21,643 [MainThread  ] [DEBUG]  filename interpreted as seed, only available in testnet because this probably has lower entropy
Traceback (most recent call last):
  File "wallet-tool.py", line 8, in <module>
    print(wallet_tool_main("wallets"))
  File "/usr/local/lib/python2.7/dist-packages/jmclient/wallet_utils.py", line 497, in wallet_tool_main
    wallet_dir=wallet_root_path)
  File "/usr/local/lib/python2.7/dist-packages/jmclient/wallet.py", line 421, in __init__
    wallet_dir=wallet_dir)
  File "/usr/local/lib/python2.7/dist-packages/jmclient/wallet.py", line 163, in __init__
    mixing_depth_keys = self.get_mixing_depth_keys(self.get_master_key())
  File "/usr/local/lib/python2.7/dist-packages/jmclient/wallet.py", line 176, in get_master_key
    self.seed.decode('hex'),(btc.MAINNET_PRIVATE if get_network(
  File "/usr/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode
    output = binascii.a2b_hex(input)
TypeError: Odd-length string

From one level below scripts:

dude@server:~/joinmarket-clientserver-master/scripts$ cd ..
dude@server:~/joinmarket-clientserver-master$ python scripts/wallet-tool.py scripts/wallets/wallet.json showseed
Traceback (most recent call last):
  File "scripts/wallet-tool.py", line 6, in <module>
    load_program_config()
  File "/usr/local/lib/python2.7/dist-packages/jmclient/configure.py", line 337, in load_program_config
    global_singleton.config)
  File "/usr/local/lib/python2.7/dist-packages/jmclient/configure.py", line 367, in get_blockchain_interface_instance
    bc_interface = BitcoinCoreInterface(rpc, network)
  File "/usr/local/lib/python2.7/dist-packages/jmclient/blockchaininterface.py", line 966, in __init__
    blockchainInfo = self.jsonRpc.call("getblockchaininfo", [])
  File "/usr/local/lib/python2.7/dist-packages/jmclient/jsonrpc.py", line 111, in call
    response = self.queryHTTP(request)
  File "/usr/local/lib/python2.7/dist-packages/jmclient/jsonrpc.py", line 100, in queryHTTP
    repr(exc))
jmclient.jsonrpc.JsonRpcConnectionError: JSON-RPC connection failed. Err:error(111, 'Connection refused')

From scripts, with wallet file:

dude@server:~/joinmarket-clientserver-master$ cd scripts/
dude@server:~/joinmarket-clientserver-master/scripts$ python wallet-tool.py wallet.json showseed
Enter wallet decryption passphrase:
@AdamISZ
Copy link
Member

AdamISZ commented Jul 29, 2017

Hi, since you're running jmcs could you reopen the issue there https://github.com/AdamISZ/joinmarket-clientserver? Thanks. Sorry for confusion I was hoping to move it into Joinmarket-Org but was waiting on feedback.

The issue partly occurs here too, but there is a delta. I'll give some more detail when you reopen, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants