1

When attempting to create a legacy wallet using bitcoin-cli, I get the following error:

bitcoin-cli -named createwallet wallet_name="[...]" descriptors=false load_on_startup=true
error code: -4
error message:
Compiled without bdb support (required for legacy wallets)

I already have Berkeley 5.3 and SQLite3 installed and running Bitcoin Core 23. What else do I need?

Murch
  • 71,155
  • 33
  • 180
  • 600
Gervais
  • 11
  • 1

1 Answers1

0

Assuming that you're building in Linux, legacy wallet support will require Berkeley DB 4.8. You can find instructions in the corresponding section along with a helpful install script's location. There is also this comprehensive guide on how to compile bitcoind for testing by Jon Atack, which provides a few more details that might be helpful.

At the end of the mentioned install script, it prints instructions on how to configure the compilation of bitcoind. Look for something along the lines of

db4 build complete.

When compiling bitcoind, run `./configure` in the following way:

  export BDB_PREFIX='<SOME-PATH>/db4'
  ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...

Use these instructions to configure your installation after installing BDB. Run:

  • The export BDB_PREFIX='<SOME-PATH>/db4' from the scripts final output
  • ./autogen.sh
  • Also from the script output use ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ..., adding any other parameters you like
  • finally call, make or make install according to your intended outcome
Murch
  • 71,155
  • 33
  • 180
  • 600
  • Unfortunately, I am still getting the same error. I installed Berkeley DB 4.8 using the suggested script. It is located in /usr/local/BerkeleyDB.4.8. I have restarted the node after the install. Any suggestion? – Gervais Oct 01 '22 at 14:12
  • Did you run `configure…` and `make` again afterwards? The `configure` step defines which bdb your install is gonna use. – Murch Oct 01 '22 at 14:22
  • Yes, I did the following: '$ tar -xzvfdb-4.8.30.NC.tar.gz' '$ cd db-4.8.30.NC/build_unix/' '$ ../dist/configure --enable-cxx' '$ make' '$ make install' which I can find in '/usr/local/BerkeleyDB.4.8' – Gervais Oct 01 '22 at 15:55
  • I meant that after installing BDB 4.8, you'll need to rebuild Bitcoin, to make it use the other version of BDB – Murch Oct 01 '22 at 16:19
  • I just rebuilt Bitcoin Core 23 and I still have the same error. Is there a specific feature that needs enabling during configure? – Gervais Oct 01 '22 at 17:11
  • Hi Gervais, I added more details, I hope this helps – Murch Oct 01 '22 at 20:28
  • 1
    You can also build with `--with-incompatible-bdb`, which allows for building with BDB up to 5.3. The resulting wallet.dat files can't be opened with lower BDB versions, but that isn't necessarily a problem. – Pieter Wuille Oct 01 '22 at 20:38
  • 1
    After taking a close look at the configure messages while recompiling, I found the problem: configure: WARNING: libdb_cxx headers missing, configure: WARNING: Bitcoin Core requires this library for BDB (legacy) wallet support. Thank you all so much for your help! – Gervais Oct 02 '22 at 19:08