(copied from #15638 (comment) by @ryanofsky) Here is how I am thinking about the organization:
-
libbitcoin_server.a
,libbitcoin_wallet.a
, andlibbitcoinqt.a
should all be terminal dependencies. They should be able to depend on other symbols in other libraries, but no other libraries should depend on symbols in them (and they shouldn’t depend on each other). -
libbitcoin_consensus.a
should be a standalone library that doesn’t depend on symbols in other libraries mentioned here -
libbitcoin_common.a
andlibbitcoin_util.a
seem very interchangeable right now and mutually depend on each other. I think we should either merge them into one library, or create a new top-levelsrc/common/
directory complementingsrc/util/
, and start to distinguish general purpose utility code (like argument parsing) from bitcoin-specific utility code (like formatting bip32 paths and using ChainParams). Both these libraries can be depended on bylibbitcoin_server.a
,libbitcoin_wallet.a
, andlibbitcoinqt.a
, and they can depend onlibbitcoin_consensus.a
. If we want to split util and common up, as opposed to merging them together, then util shouldn’t depend on libconsensus, but common should.
Over time, I think it’d be nice if source code organization reflected library organization . I think it’d be nice if all libbitcoin_util
source files lived in src/util
, all libbitcoin_consensus.a
source files lived in src/consensus
, and all libbitcoin_server.a
code lived in src/node
(and maybe the library was called libbitcoin_node.a
).