Post
Topic
Board Development & Technical Discussion
Re: Pywallet 2.2: manage your wallet [Update required]
by
HCP
on 18/06/2017, 03:55:52 UTC
I have the wallet.dat file in the same directory as pywallet.py
If I try to dump the wallet, I get:

ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this again.
By default... pywallet works on the default Bitcoin directory and wallet.dat file (Hence the error telling you to shut it down, it doesn't want to work on a "live" wallet).

You likely need to use the following commandline options to get it to point to the wallet.dat you want to work on:

Quote from: pywallet README
--dumpwallet          dump wallet in json format
...
--datadir=DATADIR     wallet directory (defaults to bitcoin default)
--wallet=WALLETFILE   wallet filename (defaults to wallet.dat)


Just as an FYI...
Quote
If I try to recover, I get:
$ ./pywallet.py --recover --recov_size 30.1Gio --recov_device ./wallet.dat --recov_outputdir ./rec2/
Recover is used when you're effectively scanning a drive to try and find accidentally deleted wallet files and/or keys... it probably isn't what you want to be using...

  • Read a device to find deleted keys (CLI only)
    • Assuming that:
      • The device you want to read is /dev/sda3
      • The size of /dev/sda3 is 30.1Gio
      • You want pywallet to write the new wallet containing the found keys in /home/jackjack/recovered_wallets
    • Run "sudo ./pywallet.py --recover --recov_device /dev/sda3 --recov_size 30.1Gio --recov_outputdir /home/jackjack/recovered_wallets"
    • Then replace your wallet (back it up before) with the recovered wallet and run "bitcoin -rescan"
--recov_device needs to be set to a disk (ie. harddrive or maybe usb). The --recov_size is used to specify the size of the device in Gigabytes...