bitcoin-tools / nodebuilder

Run a secure Bitcoin Core node with ease.
MIT No Attribution
7 stars 1 forks source link
bitcoin bitcoin-api bitcoin-blockchain bitcoin-blocks bitcoin-core bitcoin-core-rpc bitcoin-development bitcoin-docker bitcoin-explorer bitcoin-full-node bitcoin-network bitcoin-node bitcoin-nodes bitcoin-rpc bitcoin-wallet bitcoincore bitcoind bitcoind-docker blockchain full-node

Bitcoin Core Node Builder

Run a secure Bitcoin Core node with ease.

Copy-paste the following command into Terminal:

sh -c "$(curl -fsSL https://github.com/bitcoin-tools/nodebuilder/raw/v1.10.0/nodebuilder)"

Supports: Docker Supports: Linux Supports: macOS Suppprts: FreeBSD Suppprts: OpenBSD

Run Bitcoin Core 28.0 License: MIT-0 Language: POSIX shell

Health Checks

Validation CI Build and Push Docker Images

Table of Contents

Usage

As mentioned above, start the script from the command line. Open Terminal and run:

sh -c "$(curl -fsSL https://github.com/bitcoin-tools/nodebuilder/raw/v1.10.0/nodebuilder)"

Or download the script to your local system, set permissions, and run it:

wget https://github.com/bitcoin-tools/nodebuilder/raw/v1.10.0/nodebuilder
chmod u+x nodebuilder
./nodebuilder

(Optional) Command-Line Arguments

nodebuilder supports optional arguments to override the default semi-automated settings:

Short Long Version Description
-b --bitcoin-version Specify the Bitcoin version. Requires one argument, for example: -b 28.0
-c --compile Build Bitcoin from source. Requires no arguments.
-h --help Display the help message. Overrides all other arguments.
-p --prune Set a prune value in MiB. Requires one argument, for example: -p 50000
-r --skip-reboot Skip reboot after installing system update. Requires no arguments.
-s --skip-update Skip installation of system updates. Requires no arguments.
-t --test Run unit tests on functions.
-u --unattended Run in non-interactive mode. Requires no arguments.

You can set multiple options. Here are two ways to compile Bitcoin 28.0 unattended with a 50000 MiB prune:

./nodebuilder -b 28.0 -c -p 50000 -u
./nodebuilder --bitcoin-version 28.0 --compile --prune 50000 --unattended

(Optional) Docker Container

A nodebuilder Docker container can either run on Ubuntu (default) or on an alternative Linux distribution: Alpine, Amazon, Arch, Clear, Debian, Fedora, Gentoo, Manjaro, openSUSE Leap, openSUSE Tumbleweed, Oracle, Red Hat Enterprise, Rocky, and SUSE Enterprise.

To run the Ubuntu base image, clone the repository and build the default container.

git clone https://github.com/bitcoin-tools/nodebuilder
cd nodebuilder/docker/
docker build .

To use an alternative base image, clone the repository and build a different container. For example, to run nodebuilder on Alpine Linux, run:

docker build -f Dockerfile_alpine .

Prerequisites

  1. An active internet connection
  2. curl, which the script will attempt to automatically install or you can install with a package manager
  3. A supported operating system

This POSIX-compliant script installs a minimal number of runtime dependencies that aren't defined in POSIX.

What Does This Script Do?

The script performs the following actions:

  1. Update the system (including reboot, if required) and install dependencies.
  2. Either download, validate, and extract Bitcoin Core or build directly from the source code.
  3. Set a prune for Bitcoin Core based on the disk free space.
  4. Create shortcuts for Bitcoin Core on the desktop and the "Show Applications" list.
  5. Start Bitcoin Core.
  6. Prevent the system from sleeping, suspending, and hibernating.
  7. Display relevant info while the initial block download proceeds, such as the percent synced, blocks left to sync, current chain tip date, and the free disk space remaining.
  8. After the initial block download completes, tell the user that the script has finished and end the script.

Which Parts of My System Does This Script Touch?

This script modifies the following in your file system:

How Do I Uninstall Everything?

An automated solution is in the backlog. For now, here are a series of manual steps to follow:

If you have any questions or ideas on how this section can be improved, please open an issue.

Acknowledgements

Inspiration for this project came from these Open Source projects:

Contributing

Please open an issue for any bug reports or feature requests. You can see the list of open issues here.

If you plan to submit a pull request, please first look over our automated and manual test procedures.

License

This project is licensed under the terms of the MIT No Attribution / MIT-0 license.