when i read
"If you need to preserve wallet compatibility with distributed Gapcoin executables, then do a "depends" build", i'm sat here thinking, i don't even know what that means, nevermind knowing if i should worry about it....
Although I provided instructions on how to perform a “depends” build, I failed to include a pointer to the documentation. The concept of a “depends build” is fully detailed in the Bitcoin docs:
https://github.com/bitcoin/bitcoin/blob/master/depends/description.md and can be summarised as “a system of building and caching dependencies necessary for building Bitcoin”.
As regards “preserve wallet compatibility with distributed Gapcoin executables”, this basically means - if you have a wallet created by one of the distributed Gapcoin binaries, then it'll have been created by BerkeleyDB 4.8 (as an outcome of performing a “depends build”) and that file will contain a BerkeleyDB 4.8 database in loadable binary form.
(Aside: if you install the Ubuntu 20 package db5.3-util, you'll have access to a small clutch of db5_* routines, one of which is db5_stat, you can navigate to your datadir and run “db5_stat -f wallet.dat” and view the statistics for the database.)The version difference can impact the user in a couple of ways.
1. The client automatically upgrades its
wallet.dat to whatever version of libdb the client was linked against. So, if you use a binary linked against libdb5.3, the
wallet.dat file will get upgraded to the 5.3 format. If you then use that wallet with a client linked against libdb4.8, the client may not be able to successfully load the upgraded-to-db5.3-wallet.
2. Distributed binaries use libdb4.8 by default, so a
wallet.db created/upgraded by a self-compiled client linked against libdb5.3 may not be copyable across platforms.
Generally, if you exclusively use a modern Linux distro and have no need to copy wallets to clients running on Windows/OS X that have been linked against libdb4.8, there's no other reason not to take advantage of the improvements in speed/reliability between libdb4.8 and libdb5.3. Just use the
--with-incompatible-bdb option to
configure and the client will be linked against the latest version of BerkeleyDB provided by your distro.
OTOH, if you
do need to “preserve wallet compatibility with distributed Gapcoin executables”, then you will need to link your client against libdb4.8. This can be achieved in a couple of ways:
1. Use a "depends build" as detailed in the
depends/README.md.
(It's worth bearing in mind that the latest Bitcoin docs are more up-to-date than the now-ageing Gapcoin 0.16.3 docs and more properly reflect changes in the ecosystem since Feb 2018 - for example, note the removal of the Ubuntu ppa reference from the
latest Bitcoin docs vs the old
0.16 docs)
2. Use the
install_db4.sh shell script to download and compile the BerkeleyDB 4.8 sources then configure their use in the compilation. (There is one from back in 2018 in the
Gapcoin contrib folder but it's better to use the more recent version from the Bitcoin repos. I found I needed to add a line
chown -R u+w * immediately after
LoC#68)
If I need to build a Gapcoin client linked against libdb4.8, I just use the recommended default:
./install_db4.sh `pwd`. It creates a
db4 directory in
contrib which I can then use when running
configure:
export BDB_PREFIX='/tmp/gapcoin-core/contrib/db4'
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" --with-gui --disable-tests --disable-bench
This will give me a client linked against the latest boost, ssl and Qt libs etc whilst retaining compatibility with libdb4.8 wallet files, should I need it.
Cheers
Graham