bitcoinops / taproot-workshop

Taproot & Schnorr Python Library & Documentation.
MIT License
369 stars 111 forks source link

test = TestWrapper() fails on macOS Ventura with FileNotFoundError even though I have bitcoin installed #181

Closed ChristianOConnor closed 1 year ago

ChristianOConnor commented 1 year ago

I made my config file look like this:
replacing MYUSERNAME with my actual username...

# Config file for the Optech Taproot workshop

[path]
# Set this to the source directory for your Optech Taproot Bitcoin Core
# eg SOURCE_DIRECTORY=/Users/username/bitcoin
SOURCE_DIRECTORY=/Users/MYUSERNAME/Library/Application Support/Bitcoin

When I run this code:

test = TestWrapper()
# Start TestNodes

test.setup()

I get this error:

FileNotFoundError                         Traceback (most recent call last)
Cell In[3], line 4
      1 test = TestWrapper()
      2 # Start TestNodes
----> 4 test.setup()

File [~/Desktop/Dev/ScratchSpace/taproot-workshop/util.py:103](https://file+.vscode-resource.vscode-cdn.net/Users/MYUSERNAME/Desktop/Dev/ScratchSpace/taproot-workshop/~/Desktop/Dev/ScratchSpace/taproot-workshop/util.py:103), in TestWrapper.__TestWrapper.setup(self, bitcoind, bitcoincli, setup_clean_chain, num_nodes, network_thread, rpc_timeout, supports_cli, bind_to_localhost_only, nocleanup, noshutdown, cachedir, tmpdir, loglevel, trace_rpc, port_seed, coveragedir, configfile, pdbonfailure, usecli, perf, randomseed)
    100 self.options.bitcoind = bitcoind
    101 self.options.bitcoincli = bitcoincli
--> 103 super().setup()
    105 # Add notebook-specific methods
    106 for node in self.nodes:

File [~/Desktop/Dev/ScratchSpace/taproot-workshop/test_framework/test_framework.py:162](https://file+.vscode-resource.vscode-cdn.net/Users/MYUSERNAME/Desktop/Dev/ScratchSpace/taproot-workshop/~/Desktop/Dev/ScratchSpace/taproot-workshop/test_framework/test_framework.py:162), in BitcoinTestFramework.setup(self)
    159 self.options.cachedir = os.path.abspath(self.options.cachedir)
    161 config = configparser.ConfigParser()
--> 162 config.read_file(open(self.options.configfile))
    163 self.config = config
    164 self.options.bitcoind = os.getenv("BITCOIND", default=config["environment"]["BUILDDIR"] + '[/src/bitcoind](https://file+.vscode-resource.vscode-cdn.net/src/bitcoind)' + config["environment"]["EXEEXT"])

FileNotFoundError: [Errno 2] No such file or directory: '[/Users/MYUSERNAME/Library/Application](https://file+.vscode-resource.vscode-cdn.net/Users/MYUSERNAME/Library/Application) Support[/Bitcoin/test/config.ini](https://file+.vscode-resource.vscode-cdn.net/Bitcoin/test/config.ini)'

Btw I have bitcoin core installed from source.

ChristianOConnor commented 1 year ago

Nevermind, I see now from the Readme that you don't put your bitcoin installed save data directory into the config.ini file, you actually clone bitcoin's source repo and link to that