Hey everyone,
I could really use your input here. I've got my own node running on docker, and I’m trying to keep the daemon as lightweight as I can.
The way I compile is the same for both versions; I just swap out the version tag in the bitcoin repo.
Any ideas on what could be causing this? I’ll drop a link to the full dockerfile at the end of the post.
Thanks a ton
https://raw.githubusercontent.com/reverse-hash/bitcoin-full-node-with-docker/main/bitcoind/Dockerfile
Binary size of bitcoind skyrockets from 26.2 to 27.0
5 replies 379 views
I found the solution. I share it just in case it can be useful for someone.
In the LDFLAGS , just add the option "-s" or "--strip-all". Example: LDFLAGS="-static-libstdc++ -s"
According to GNU linker (ld) documentation:
In summary, symbol information is essential during development and debugging, but for a final product, especially if we're looking to optimize size, it can be removed without affecting the functionality of the executable.
That makes sense, since the symbols are the only way I can think of that make a binary with otherwise a few changes grow really large in size.
Is it possible that the build steps are running with the -g flag somewhere inside the configure script or the automake file? Because Bitcoin Core3 is not supposed to be including debug info by default.
Thank you. After reviewing again the documentation I found the key:
Doc: https://github.com/bitcoin/bitcoin/blob/43740f4971f45cd5499470b6a085b3ecd8b96d28/doc/build-unix.md
Not sure why, but -g is there by default :/.
--disable-debug is slightly misleading. It doesn't disable the inclusion of the debug symbols; rather it disables optimizations that make debugging very difficult.
Unless you override CFLAGS and/or CXXFLAGS, the debug symbols will always be included. For releases, we run strip on the result to produce a release binary with no debug symbols, and a separate file containing the debug symbols.
This is all likely to change very soon anyways as we switch to using cmake.
Thanks a lot achow101. All clear now.
Related topics
- What determines the average size of blk*.data files? 2
- bitcoin-qt sync issues and slow speeds 6
- Recovering a Bitcoin wallet and address 8
- Creating a list of non-zero wallets and their balances using Python 4
- CipherSeed: A Comprehensive Guide to Super-Secure Crypto Wallet Backups 5
- Curious about recovering BTC from 2010/2011 7