Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't handle alternate datadir for bitcoin core #43

Open
winchip2 opened this issue Nov 18, 2021 · 1 comment
Open

Can't handle alternate datadir for bitcoin core #43

winchip2 opened this issue Nov 18, 2021 · 1 comment

Comments

@winchip2
Copy link

After confirming the mnemonic, this error will occur if the bitcoin core is installed but the datadir is in a different location than the default of /home/[USERNAME]/.bitcoin/

This error will occur even if you make a symbolic link from the alternate datadir to /home/[USERNAME]/.bitcoin/ and even if bitcoind is running with the datadir specified.

Please provide a method to specify the Bitcoin core data directory if it does not reside in the default path.

WARNING:root:[Errno 2] No such file or directory: '/home/[USERNAME]/.bitcoin/.cookie'
Traceback (most recent call last):
  File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/bitcoincore.py", line 127, in __init__
    http_auth_header = Connection.get_http_auth_header(config, args.network)
  File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/bitcoincore.py", line 90, in get_http_auth_header
    auth_data = open(rpccookiefile, "r").read().strip().encode("ascii")
FileNotFoundError: [Errno 2] No such file or directory: '/home/[USERNAME]/.bitcoin/.cookie'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/[USERNAME]/Downloads/garecovery-master/venv/bin/garecovery-cli", line 7, in <module>
    sys.exit(recoverycli.main(sys.argv))
  File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/recoverycli.py", line 98, in main
    txs = recovery.get_transactions()
  File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/two_of_two_csv.py", line 198, in get_transactions
    utxos = self.scan_subaccount(subaccount_pointer, clargs.args.key_search_depth)
  File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/two_of_two_csv.py", line 94, in scan_subaccount
    new_utxos = self.get_utxos(outputs)
  File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/two_of_two_csv.py", line 29, in get_utxos
    core = bitcoincore.Connection(clargs.args)
  File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/bitcoincore.py", line 153, in __init__
    raise exceptions.BitcoinCoreConnectionError(CORE_CONNECT_ERR.format(connstr))
UnboundLocalError: local variable 'connstr' referenced before assignment

@LeoComandini
Copy link
Collaborator

Hi @winchip2 , if the cookie file or conf file does not reside in the default location you can use --rpccookiefile RPCCOOKIEFILE, --config-filename CONFIG_FILENAME or --rpcuser RPCUSER --rpcpassword RPCPASSWORD to specify the authentication credentials.

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

No branches or pull requests

2 participants