Infrastructure for Bitcoin builders 🥷

Infrastructure for Bitcoin builders 🥷
JUNGLELABᵀᴹ ExCeL London U.K. 2022

Anyone, anywhere can get started.
A tech stack that's designed to be used.

Running A Full Node - Bitcoin
running 🏃‍♂️ bitcoin

Bitcoin JungleLab macOS Arm64 M1/M2 Developer Build Guide

Nigiri 🍣 Bitcoin
A delicious docker box for special Bitcoin and Liquid cookings.
One-click Blockchain 

We provided a comprehensive guide for installing Bitcoin Core on an Arm Apple M1/M2 computer running macOS. This guide covers the installation of required dependencies, cloning the Bitcoin repository, and installing optional dependencies such as the GUI dependencies, port mapping dependencies, ZMQ dependencies, test suite dependencies, and deploy dependencies. These steps are crucial for building Bitcoin Core from source on an Arm Apple M1/M2 computer.

One thing I would like to add is that users should ensure that they have the latest version of Xcode installed on their system before proceeding with the installation. This can be done by downloading Xcode from the Mac App Store or from the Apple Developer website.

Also, users should ensure that they have enough disk space available on their system before starting the installation process. Building Bitcoin Core from source can take up a significant amount of disk space, so it is recommended to have at least 20GB of free space available.

Overall, these instructions should help users successfully install and run Bitcoin Core on their Arm Apple M1/M2 computer.


Bitcoin Core

Setup

Bitcoin Core is the original Bitcoin client and it builds the backbone of the network. It downloads and, by default, stores the entire history of Bitcoin transactions, which requires a few hundred gigabytes of disk space. Depending on the speed of your computer and network connection, the synchronization process can take anywhere from a few hours to a day or more.

To download Bitcoin Core, visit bitcoincore.org.

Running

The following are some helpful notes on how to run Bitcoin Core on your native platform.

Unix

Unpack the files into a directory and run:

  • bin/bitcoin-qt (GUI) or
  • bin/bitcoind (headless)

Windows

Unpack the files into a directory, and then run bitcoin-qt.exe.

macOS

Drag Bitcoin Core to your applications folder, and then run Bitcoin Core.

Need Help?

Building

The following are developer notes on how to build Bitcoin Core on your native platform. They are not complete guides, but include notes on the necessary libraries, compile flags, etc.

Development

The Bitcoin repo's root README contains relevant information on the development process and automated testing.

Resources

bitcoin/README.md at master · bitcoin/bitcoin
Bitcoin Core integration/staging tree. Contribute to bitcoin/bitcoin development by creating an account on GitHub.
Read Me
bitcoin/files.md at master · bitcoin/bitcoin
Bitcoin Core integration/staging tree. Contribute to bitcoin/bitcoin development by creating an account on GitHub.
Bitcoin Core file system
bitcoin/CONTRIBUTING.md at master · bitcoin/bitcoin
Bitcoin Core integration/staging tree. Contribute to bitcoin/bitcoin development by creating an account on GitHub.
Contributing to Bitcoin Core

Bitcoin JungleLab macOS Arm64 M1/M2 Developer Build Guide 🥷

Updated for MacOS 11.2

This guide describes how to build bitcoind, command-line utilities, and GUI on macOS

Preparation

The commands in this guide should be executed in a Terminal application. macOS comes with a built-in Terminal located in:

/Applications/Utilities/Terminal.app

1. Xcode Command Line Tools

The Xcode Command Line Tools are a collection of build tools for macOS. These tools must be installed in order to build Bitcoin Core from source.

To install, run the following command from your terminal:xcode-select --install

Upon running the command, you should see a popup appear. Click on Install to continue the installation process.

2. Homebrew Package Manager

Homebrew is a package manager for macOS that allows one to install packages from the command line easily. While several package managers are available for macOS, this guide will focus on Homebrew as it is the most popular. Since the examples in this guide which walk through the installation of a package will use Homebrew, it is recommended that you install it to follow along. Otherwise, you can adapt the commands to your package manager of choice.

To install the Homebrew package manager, see: https://brew.sh

Note: If you run into issues while installing Homebrew or pulling packages, refer to Homebrew's troubleshooting page.

*aarch64*)
dnl The preferred Homebrew prefix for Apple Silicon is /opt/homebrew.
dnl Therefore, as we do not use pkg-config to detect miniupnpc and libnatpmp

here are the steps to install Homebrew on an Apple Silicon (M1) Mac:

  1. Open the Terminal app. You can find it in the Applications folder, or by searching for it using Spotlight.

Install the Xcode command line tools by running the following command in Terminal:luaCopy codexcode-select --install

Install Rosetta 2 by running the following command in Terminal:cssCopy codesoftwareupdate --install-rosetta

Install Homebrew by running the following command in Terminal:bashCopy code/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

This will download and install the Homebrew package manager on your Mac.

After the installation is complete, you may need to add Homebrew to your PATH environment variable. You can do this by running the following command in Terminal:bashCopy codeecho 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/USERNAME/.zprofile

Replace USERNAME with your username. This command will add the necessary Homebrew initialization code to your shell profile file.

Close and reopen Terminal, or run the following command in Terminal to apply the changes:bashCopy codesource /Users/USERNAME/.zprofile

Again, replace USERNAME with your username.

That's it! Homebrew should now be installed and ready to use on your Apple Silicon Mac.

3. Install Required Dependencies

The first step is to download the required dependencies. These dependencies represent the packages required to get a barebones installation up and running.

See dependencies.md for a complete overview.

To install, run the following from your terminal:brew install automake libtool boost pkg-config libevent

4. Clone Bitcoin repository

git should already be installed by default on your system. Now that all the required dependencies are installed, let's clone the Bitcoin Core repository to a directory. All build scripts and commands will run from this directory.git clone https://github.com/bitcoin/bitcoin.git

5. Install Optional Dependencies

Wallet Dependencies

It is not necessary to build wallet functionality to run bitcoind or  bitcoin-qt.

Descriptor Wallet Support

sqlite is required to support for descriptor wallets.

macOS ships with a useable sqlite package, meaning you don't need to install anything.

Legacy Wallet Support

berkeley-db@4 is only required to support for legacy wallets. Skip if you don't intend to use legacy wallets.brew install berkeley-db@4


GUI Dependencies

Qt

Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install qt@5. Skip if you don't intend to use the GUI.brew install qt@5

Note: Building with Qt binaries downloaded from the Qt website is not officially supported. See the notes in #7714.

qrencode

The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install qrencode. Skip if not using the GUI or don't want QR code functionality.brew install qrencode


Port Mapping Dependencies

miniupnpc

miniupnpc may be used for UPnP port mapping. Skip if you do not need this functionality.brew install miniupnpc

libnatpmp

libnatpmp may be used for NAT-PMP port mapping. Skip if you do not need this functionality.brew install libnatpmp

Note: UPnP and NAT-PMP support will be compiled in and disabled by default. Check out the further configuration section for more information.


ZMQ Dependencies

Support for ZMQ notifications requires the following dependency. Skip if you do not need ZMQ functionality.brew install zeromq

ZMQ is automatically compiled in and enabled if the dependency is detected. Check out the further configuration section for more information.

For more information on ZMQ, see: zmq.md


Test Suite Dependencies

There is an included test suite that is useful for testing code changes when developing. To run the test suite (recommended), you will need to have Python 3 installed:brew install python


Deploy Dependencies

You can deploy a .dmg containing the Bitcoin Core application using make deploy. This command depends on a couple of python packages, so it is required that you have python installed.

Ensuring that python is installed, you can install the deploy dependencies by running the following commands in your terminal: pip3 install ds_store mac_alias

Building Bitcoin Core

1. Configuration

There are many ways to configure Bitcoin Core, here are a few common examples:

Wallet (BDB + SQlite) Support, No GUI:

If berkeley-db@4 is installed, then legacy wallet support will be built. If berkeley-db@4 is not installed, then this will throw an error. If sqlite is installed, then descriptor wallet support will also be built. Additionally, this explicitly disables the GUI../autogen.sh ./configure --with-gui=no

Wallet (only SQlite) and GUI Support:

This explicitly enables the GUI and disables legacy wallet support. If qt is not installed, this will throw an error. If sqlite is installed then descriptor wallet functionality will be built. If sqlite is not installed, then wallet functionality will be disabled../autogen.sh ./configure --without-bdb --with-gui=yes

No Wallet or GUI./autogen.sh ./configure --without-wallet --with-gui=no
Further Configuration

You may want to dig deeper into the configuration options to achieve your desired behavior. Examine the output of the following command for a full list of configuration options:./configure -help

2. Compile

After configuration, you are ready to compile. Run the following in your terminal to compile Bitcoin Core:make        # use "-j N" here for N parallel jobsmake check  # Run tests if Python 3 is available

3. Deploy (optional)

You can also create a  .dmg containing the .app bundle by running the following command: make deploy

Running Bitcoin Core

Bitcoin Core should now be available at ./src/bitcoind. If you compiled support for the GUI, it should be available at ./src/qt/bitcoin-qt.

The first time you run bitcoind or bitcoin-qt, it will start downloading the blockchain. This process could take many hours, or even days on slower than average systems.

By default, blockchain and wallet data files will be stored in:/Users/${USER}/Library/Application Support/Bitcoin/

Before running, you may create an empty configuration file:mkdir -p "/Users/${USER}/Library/Application Support/Bitcoin" touch "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf" chmod 600 "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"

You can monitor the download process by looking at the debug.log file:tail -f $HOME/Library/Application\ Support/Bitcoin/debug.log

Other commands:

./src/bitcoind -daemon      # Starts the bitcoin daemon.
./src/bitcoin-cli --help    # Outputs a list of command-line options.
./src/bitcoin-cli help      # Outputs a list of RPC commands when the daemon is running.
./src/qt/bitcoin-qt -server # Starts the bitcoin-qt server mode, allows bitcoin-cli control

A quick technical overview guide 🤓

synchronous event notification, which Bitcoin Core uses to handle network connections and socket I/O.

  • Boost: A set of C++ libraries that provide a range of functionality, including data structures, networking, and concurrency. Bitcoin Core uses Boost extensively for its implementation.
  • LevelDB: A fast key-value storage library that Bitcoin Core uses to store Bitcoin blocks and transactions.
  • OpenSSL: An open-source implementation of the SSL and TLS protocols, which Bitcoin Core uses to provide secure communications over the Bitcoin network.

Dependencies:

  • Autoconf: A tool for generating configure scripts, which are used to configure software builds.
  • Automake: A tool for generating Makefiles, which are used to build software from source code.
  • Clang: A C++ compiler that is used to build Bitcoin Core.
  • GCC: A C++ compiler that is also used to build Bitcoin Core.
  • Python: A programming language that is used to run Bitcoin Core's test suite.
  • Systemtap: A tool for tracing system calls and other events in Linux. Systemtap is used to trace Bitcoin Core's performance.

Bitcoin Core is a complex piece of software that requires a significant amount of computational resources to run. It is designed to be run on powerful hardware and requires a high-speed internet connection to operate efficiently.


running 🏃‍♂️ liquid
elements/build-osx.md at master · ElementsProject/elements
Open Source implementation of advanced blockchain features extending the Bitcoin protocol - elements/build-osx.md at master · ElementsProject/elements
GitHub - ElementsProject/lightning: Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Core Lightning — Lightning Network implementation focusing on spec compliance and performance - GitHub - ElementsProject/lightning: Core Lightning — Lightning Network implementation focusing on spe...
Build On L2 - The Community For Bitcoin Builders
Connect with a global community of Bitcoiners launching, iterating, and scaling the next great things on layer 2.
Vulpem Ventures
Enabling the next generation of bitcoin-native financial services

The Bitcoin whitepaper is the original thesis paper written under the pseudonym Satoshi Nakamoto on October 31, 2008 that set the basic structure of the Bitcoin network. 🐇

Satoshi's Apple Easter Egg via your mac terminal 🐣:

open /System/Library/Image\ Capture/Devices/VirtualScanner.app/Contents/Resources/simpledoc.pdf