pik / pypayd

a small daemon for processing bitcoin payments
MIT License
5 stars 4 forks source link

wallet creation issues #3

Closed ser closed 9 years ago

ser commented 9 years ago

Hi, it is not the end of problems :-) Following quick example:

$ python pypayd.py wallet --from-mnemonic "like just love know never want time out there make look eye" --mnemonic-type="electrum" --to-file="payment_wallet.txt" --encrypt-pw="foobar"
usage: pypayd [-h] [-S] [-V] [-v] [--testnet] [--data-dir DATA_DIR]
              [--config-file CONFIG_FILE] [--log-file LOG_FILE]
              [--pid-file PID_FILE] [--rpc-host RPC_HOST]
              [--rpc-port RPC_PORT]
              {wallet} ...
pypayd: error: unrecognized arguments: --mnemonic-type=electrum

and it is not strange, because $ python pypayd.py wallet --help does not offer such a parameter, indeed.

Worse is, that it does not work at all:

$ python pypayd.py wallet --from-mnemonic "like just love know never want time out there make look eye" --to-file="payment_wallet.txt" --encrypt-pw="foobar"
Loading config settings...
['BIP32Node', 'EncodingError', 'Key', 'KeyPath', 'NETCODES', 'PublicPrivateMismatchError', 'PyPayWallet', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'a2b_hashed_base58', 'b2a_hashed_base58', 'config', 'decrypt', 'encrypt', 'from_bytes_32', 'hashlib', 'hmac', 'itertools', 'json', 'mnemonicToEntropy', 'netcode_and_type_for_data', 'os', 'prv32_prefix_for_netcode', 'pub32_prefix_for_netcode', 'public_pair_to_hash160_sec', 'sec_to_public_pair', 'struct', 'subkey_public_pair_chain_code_pair', 'subkey_secret_exponent_chain_code_pair', 'time', 'to_bytes_32'] PPP\m
Traceback (most recent call last):
  File "pypayd.py", line 109, in <module>
    pypay_wallet = wallet.PyPayWallet.fromMnemonic(args.mnemonic)  
AttributeError: 'Namespace' object has no attribute 'mnemonic'  

PS I have installed mnemonic from pip, is it the correct one, or it is completely unrelated module?

# pip install mnemonic
Collecting mnemonic
  Downloading mnemonic-0.12.tar.gz
Collecting pbkdf2 (from mnemonic)
  Downloading pbkdf2-1.3.tar.gz
Installing collected packages: pbkdf2, mnemonic
  Running setup.py install for pbkdf2
  Running setup.py install for mnemonic
Successfully installed mnemonic-0.12 pbkdf2-1.3
pik commented 9 years ago

Sorry about that - the README had mnemonic-type but args-parse was still using mnemonic-parser also mnemonic got changed to from-mnemonic. Both should be fixed now(https://github.com/pik/pypayd/commit/d85c96b72e3aaf8c863faf3f6a86d552ef1d838e). You don't need a mnemonic package.

ser commented 9 years ago

fantastic, wallet is created.

thanks!