Advertisement
mheld

Compile bitcoin core on Macosx

Nov 15th, 2017
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. Mac OS X Build Instructions and Notes
  2.  
  3. The commands in this guide should be executed in a Terminal application. The built-in one is located in /Applications/Utilities/Terminal.app.
  4.  
  5. Preparation
  6.  
  7. Install the OS X command line tools:
  8.  
  9. xcode-select --install
  10.  
  11. When the popup appears, click Install.
  12.  
  13. Then install Homebrew.
  14.  
  15. Dependencies
  16.  
  17. brew install automake berkeley-db4 libtool boost --c++11 miniupnpc openssl pkg-config protobuf python3 qt libevent
  18. See dependencies.md for a complete overview.
  19.  
  20. If you want to build the disk image with make deploy (.dmg / optional), you need RSVG
  21.  
  22. brew install librsvg
  23. NOTE: Building with Qt4 is still supported, however, could result in a broken UI. Building with Qt5 is recommended.
  24.  
  25. Build Bitcoin Core
  26.  
  27. Clone the bitcoin source code and cd into bitcoin
  28.  
  29. git clone https://github.com/bitcoin/bitcoin
  30. cd bitcoin
  31. Build bitcoin-core:
  32.  
  33. Configure and build the headless bitcoin binaries as well as the GUI (if Qt is found).
  34.  
  35. You can disable the GUI build by passing --without-gui to configure.
  36.  
  37. ./autogen.sh
  38. ./configure
  39. make
  40. It is recommended to build and run the unit tests:
  41.  
  42. make check
  43. You can also create a .dmg that contains the .app bundle (optional):
  44.  
  45. make deploy
  46. Running
  47.  
  48. Bitcoin Core is now available at ./src/bitcoind
  49.  
  50. Before running, it's recommended you create an RPC configuration file.
  51.  
  52. echo -e "rpcuser=bitcoinrpc\nrpcpassword=$(xxd -l 16 -p /dev/urandom)" > "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"
  53.  
  54. chmod 600 "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"
  55. The first time you run bitcoind, it will start downloading the blockchain. This process could take several hours.
  56.  
  57. You can monitor the download process by looking at the debug.log file:
  58.  
  59. tail -f $HOME/Library/Application\ Support/Bitcoin/debug.log
  60. Other commands:
  61.  
  62. ./src/bitcoind -daemon # Starts the bitcoin daemon.
  63. ./src/bitcoin-cli --help # Outputs a list of command-line options.
  64. ./src/bitcoin-cli help # Outputs a list of RPC commands when the daemon is running.
  65. Using Qt Creator as IDE
  66.  
  67. You can use Qt Creator as an IDE, for bitcoin development. Download and install the community edition of Qt Creator. Uncheck everything except Qt Creator during the installation process.
  68.  
  69. Make sure you installed everything through Homebrew mentioned above
  70. Do a proper ./configure --enable-debug
  71. In Qt Creator do "New Project" -> Import Project -> Import Existing Project
  72. Enter "bitcoin-qt" as project name, enter src/qt as location
  73. Leave the file selection as it is
  74. Confirm the "summary page"
  75. In the "Projects" tab select "Manage Kits..."
  76. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler
  77. Select LLDB as debugger (you might need to set the path to your installation)
  78. Start debugging with Qt Creator
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement