Skip to content

Commit ea3a4fc

Browse files
authored
Merge pull request #290 from pmienk/version3
Update README.
2 parents 9af28f1 + 5f93b93 commit ea3a4fc

File tree

1 file changed

+246
-10
lines changed

1 file changed

+246
-10
lines changed

README.md

Lines changed: 246 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,255 @@
1-
[![Build Status](https://travis-ci.org/libbitcoin/libbitcoin-client.svg?branch=master)](https://travis-ci.org/libbitcoin/libbitcoin-client)
1+
[![Build Status](https://github.com/libbitcoin/libbitcoin-client/actions/workflows/ci.yml/badge.svg?branch=version3)](https://github.com/libbitcoin/libbitcoin-client/actions/workflows/ci.yml)
22

3-
[![Coverage Status](https://coveralls.io/repos/libbitcoin/libbitcoin-client/badge.svg)](https://coveralls.io/r/libbitcoin/libbitcoin-client)
3+
[![Coverage Status](https://coveralls.io/repos/libbitcoin/libbitcoin-client/badge.svg?branch=version3)](https://coveralls.io/r/libbitcoin/libbitcoin-client?branch=version3)
44

55
# Libbitcoin Client
66

7-
*Bitcoin Client Query Library*
7+
*The Bitcoin Client Query Library*
88

9-
Make sure you have installed [libbitcoin-protocol](https://github.com/libbitcoin/libbitcoin-protocol) beforehand according to its build instructions.
9+
**License Overview**
1010

11+
All files in this repository fall under the license specified in [COPYING](COPYING). The project is licensed as [AGPL with a lesser clause](https://wiki.unsystem.net/en/index.php/Libbitcoin/License). It may be used within a proprietary project, but the core library and any changes to it must be published online. Source code for this library must always remain free for everybody to access.
12+
13+
**About Libbitcoin**
14+
y
15+
The libbitcoin toolkit is a set of cross platform C++ libraries for building bitcoin applications. The toolkit consists of several libraries, most of which depend on the foundational [libbitcoin-system](https://github.com/libbitcoin/libbitcoin-system) library. Each library's repository can be cloned and built using common [automake](http://www.gnu.org/software/automake) 1.14+ instructions or [cmake](https://cmake.org) 3.5+ instructions. There are no packages yet in distribution however each library includes an installation script (described below) which is regularly verified via [github actions](https://github.com/features/actions).
16+
17+
## Installation
18+
19+
On Linux and macOS libbitcoin-client can be build using Autotools and cmake. This process is accomplished via the provided installation scripts `install.sh` or `install-cmake.sh`. These scripts provide a basis for installation of the dependencies of the project. Both support the use of the argument `--help` for further parameterization.
20+
21+
Installation of libbitcoin-client comes with requirements listed below.
22+
23+
* C++11 compiler, currently minimum [GCC 4.8.0](https://gcc.gnu.org/projects/cxx0x.html) or Clang based on [LLVM 3.5](http://llvm.org/releases/3.5.0/docs/ReleaseNotes.html)
24+
* [Autoconf](https://www.gnu.org/software/autoconf/)
25+
* [Automake](https://www.gnu.org/software/automake/) 1.14+
26+
* [libtool](https://www.gnu.org/software/libtool/)
27+
* [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
28+
* [git](https://git-scm.com/)
29+
* [wget](https://www.gnu.org/software/wget/)
30+
31+
Use of `install-cmake.sh` additionally requires [cmake](https://cmake.org) 3.5+.
32+
33+
A minimal libbitcoin-client build requires boost 1.72.0 to 1.76.0, libsecp256k1, and [zmq](http://www.zeromq.org) 4.3.4. The [libbitcoin/secp256k1](https://github.com/libbitcoin/secp256k1/tree/version7) repository is forked from [bitcoin-core/secp256k1](https://github.com/bitcoin-core/secp256k1) in order to control for changes and to incorporate the necessary Visual Studio build. The original repository can be used directly but recent changes to the public interface may cause build breaks. The `--enable-module-recovery` switch is required. Both of these are able to be provided via the installation script(s).
34+
35+
Detailed instructions are provided below.
36+
37+
* [Debian/Ubuntu](#debianubuntu)
38+
* [Macintosh](#macintosh)
39+
* [Install Script Execution](#install-script-execution)
40+
* [Windows](#windows)
41+
42+
### Debian/Ubuntu
43+
44+
Below is a breakdown of preparation required to install libbitcoin-client. Once an appropriate [compiler](http://en.wikipedia.org/wiki/Compiler) and [build system](http://wikipedia.org/wiki/GNU_build_system) are in place, proceed to [Install Script Execution](#installscript) below to perform installation.
45+
46+
#### Compiler
47+
48+
The current minimum verified compilers for this project are [gcc](https://en.wikipedia.org/wiki/GNU_Compiler_Collection) 9.4.0 and [clang](https://en.wikipedia.org/wiki/Clang) 11.0.0.
49+
50+
To see your GCC version:
1151
```sh
12-
$ ./autogen.sh
13-
$ ./configure
14-
$ make
15-
$ sudo make install
16-
$ sudo ldconfig
52+
$ g++ --version
1753
```
54+
```
55+
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
56+
Copyright (C) 2019 Free Software Foundation, Inc.
57+
This is free software; see the source for copying conditions. There is NO
58+
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
59+
```
60+
If necessary, upgrade your GCC compiler as follows:
61+
```sh
62+
$ sudo apt install g++-9
63+
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9.4 50
64+
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9.4 50
65+
$ sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9.4 50
66+
```
67+
68+
To see your clang version:
69+
```sh
70+
$ clang++ --version
71+
```
72+
```
73+
Ubuntu clang version 11.0.0-2~ubuntu20.04.1
74+
Target: x86_64-pc-linux-gnu
75+
Thread model: posix
76+
InstalledDir: /usr/bin
77+
```
78+
If necessary, upgrade your clang compiler as follows:
79+
```sh
80+
$ sudo apt install clang-11
81+
$ sudo update-alternatives --install /usr/bin/clang++ /usr/bin/clang++-11 50
82+
$ sudo update-alternatives --install /usr/bin/clang /usr/bin/clang-11 50
83+
```
84+
85+
#### Build System
86+
87+
Next install the [build system](http://wikipedia.org/wiki/GNU_build_system) (Automake minimum 1.14) and git:
88+
```sh
89+
$ sudo apt install build-essential autoconf automake libtool pkg-config git
90+
```
91+
92+
#### Boost (Not Recommended)
93+
94+
Next install the [Boost](http://www.boost.org) (1.72.0 - 1.76.0) development package. This can be accomplished via parameterization of the installation script during libbitcoin-client installation and it is recommended to the reader that this approach be used.
95+
96+
Due to the current state of packaging, boost is not provided by the standard packaging system at the required minimum version. This requires either manual source compilation (as is controlled within the installation scripts) or trusting a 3rd party [Personal Package Archive](https://launchpad.net/ubuntu/+ppas). Verification of the build is done against the sources (required for proper use of ICU).
97+
98+
A user may find [Martin Hierholzer's PPA](https://launchpad.net/~mhier/+archive/ubuntu/libboost-latest) useful. This is left for the adventurous reader.
99+
100+
#### ZMQ
101+
102+
Next install the [ZMQ](http://www.zeromq.org) (4.3.4) development package. This can be accomplished via parameterization of the installation script during libbitcoin-client installation or via the `libzmq3-dev` package as follows:
103+
104+
```sh
105+
$ sudo apt install libzmq3-dev
106+
```
107+
108+
### Macintosh
109+
110+
The macOS preparation differs from Linux the supported compiler and manner of dependency installation.
111+
112+
#### Compiler
113+
114+
Libbitcoin compiles with [clang](https://clang.llvm.org) on macOS and requires C++11 support. Installation has been verified using Clang based on [LLVM 14](http://llvm.org/t/llvm-14-0-6-release). This version or newer should be installed as part of the Xcode command line tools.
115+
116+
To see your Clang/LLVM version:
117+
```sh
118+
$ clang++ --version
119+
```
120+
You may encounter a prompt to install the Xcode command line developer tools, in which case accept the prompt.
121+
```
122+
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
123+
Target: x86_64-apple-darwin14.0.0
124+
Thread model: posix
125+
```
126+
If required update your version of the command line tools as follows:
127+
```sh
128+
$ xcode-select --install
129+
```
130+
131+
#### Build System
132+
133+
Libbitcoin supports both [Homebrew](http://brew.sh) and [MacPorts](https://www.macports.org) package managers. Both require Apple's [Xcode](https://developer.apple.com/xcode) command line tools. Neither requires Xcode as the tools may be installed independently.
134+
135+
##### Using Homebrew
136+
137+
First install [Homebrew](https://brew.sh).
138+
139+
Next install the [build system](http://wikipedia.org/wiki/GNU_build_system) (Automake minimum 1.14) and [wget](http://www.gnu.org/software/wget):
140+
```sh
141+
$ brew install autoconf automake libtool pkgconfig wget
142+
```
143+
144+
##### Using MacPorts
145+
146+
First install [MacPorts](https://www.macports.org/install.php).
147+
148+
Next install the [build system](http://wikipedia.org/wiki/GNU_build_system) (Automake minimum 1.14) and [wget](http://www.gnu.org/software/wget):
149+
```sh
150+
$ sudo port install autoconf automake libtool pkgconfig wget
151+
```
152+
153+
#### Boost (Not Recommended)
154+
155+
As above, it has been noted that the installation scripts can control the installation of boost from sources. This is desirable due to package system support changes. Installation from Homebrew or MacPorts may be accomplished, however significant parameterization may be required due to version requirements. This is left to the adventerous reader.
156+
157+
#### ZMQ
158+
159+
Next install the [ZMQ](http://www.zeromq.org) (4.3.4) development package. This can be accomplished via parameterization of the installation script during libbitcoin-client installation or via [Homebrew](https://formulae.brew.sh) as follows:
160+
161+
```sh
162+
$ brew install zeromq
163+
```
164+
165+
### Install Script Execution
166+
167+
The [autotools install script](https://github.com/libbitcoin/libbitcoin-client/blob/version3/install.sh) and [cmake install script](https://github.com/libbitcoin/libbitcoin-client/blob/version3/install-cmake.sh) are written so that the manual build steps for each dependency can be inferred by a developer.
168+
169+
You can run either install script from any directory on your system. By default this will build libbitcoin-client in a subdirectory named `build-libbitcoin-client` and install it to `/usr/local/`. The install script requires `sudo` only if you do not have access to the installation location, which you can change using the `--prefix` option on the installer command line.
170+
171+
The build script clones, builds and installs four unpackaged repositories, namely:
172+
173+
- [libbitcoin/secp256k1](https://github.com/libbitcoin/secp256k1)
174+
- [libbitcoin/libbitcoin-system](https://github.com/libbitcoin/libbitcoin-system)
175+
- [libbitcoin/libbitcoin-protocol](https://github.com/libbitcoin/libbitcoin-protocol)
176+
- [libbitcoin/libbitcoin-client](https://github.com/libbitcoin/libbitcoin-client)
177+
178+
The script builds from the head of their `version7` and `version3` branches respectively. The `master` branch is a staging area for changes. The version branches are considered release quality.
179+
180+
The below provides examples for install script execution. The use of `./install.sh` may be substituted with `./install-cmake.sh` in order to use cmake tools to build the libbitcoin repositories. It should be noted that autotools is still required for [libbitcoin/secp256k1](https://github.com/libbitcoin/secp256k1) and most other install script managed dependencies.
181+
182+
#### Build Options
183+
184+
Any set of `./configure` options can be passed via the build script, for example:
185+
```sh
186+
$ CFLAGS="-Og -g" ./install.sh --prefix=/home/me/myprefix
187+
```
188+
189+
#### Compiling with ICU (International Components for Unicode)
190+
191+
Since the addition of [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) and later [BIP-38](https://github.com/bitcoin/bips/blob/master/bip-0038.mediawiki) support, libbitcoin conditionally incorporates [ICU](http://site.icu-project.org). To use the BIP-38 and BIP-39 passphrase normalization features libbitcoin must be compiled with the `--with-icu` option. Currently [libbitcoin-explorer](https://github.com/libbitcoin/libbitcoin-explorer) is the only library that accesses this feature, so if you do not intend to use passphrase normalization this dependency can be avoided.
192+
```sh
193+
$ ./install.sh --with-icu
194+
```
195+
196+
#### Building ICU, Boost and/or ZMQ
197+
198+
The installer can download and install any or all of these dependencies. ICU is a large package that is not typically preinstalled at a sufficient level. Using these builds ensures compiler and configuration compatibility across all of the build components. It is recommended to use a prefix directory when building these components.
199+
```sh
200+
$ ./install.sh --with-icu --build-icu --build-boost --build-zmq --prefix=/home/me/myprefix
201+
```
202+
203+
### Windows
204+
205+
Visual Studio solutions are maintained for all libbitcoin libraries. NuGet packages exist for dependencies. ICU is integrated into Windows and therefore not required as an additional dependency when using ICU features.
206+
207+
> The libbitcoin execution environment supports `Windows XP Service Pack 2` and newer.
208+
209+
#### Supported Compilers
210+
211+
Libbitcoin requires a C++11 compiler, which means Visual Studio 2013 (with a pre-release compiler update) or later. Download and install one of the following free tools as necessary:
212+
213+
* [Visual Studio 2022 Community](https://www.visualstudio.com/downloads)
214+
215+
#### NuGet Repository
216+
217+
Dependencies apart from the libbitcoin libraries are available as [NuGet packages](https://www.nuget.org):
218+
219+
* Packages maintained by [sergey.shandar](http://www.nuget.org/profiles/sergey.shandar)
220+
* [boost](http://www.nuget.org/packages/boost)
221+
* [boost\_chrono-vc141](http://www.nuget.org/packages/boost_chrono-vc141)
222+
* [boost\_date\_time-vc141](http://www.nuget.org/packages/boost_date_time-vc141)
223+
* [boost\_filesystem-vc141](http://www.nuget.org/packages/boost_filesystem-vc141)
224+
* [boost\_iostreams-vc141](http://www.nuget.org/packages/boost_iostreams-vc141)
225+
* [boost\_locale-vc141](http://www.nuget.org/packages/boost_locale-vc141)
226+
* [boost\_log_setup-vc141](http://www.nuget.org/packages/boost_log_setup-vc141)
227+
* [boost\_log-vc141](http://www.nuget.org/packages/boost_log-vc141)
228+
* [boost\_program\_options-vc141](http://www.nuget.org/packages/boost_program_options-vc141)
229+
* [boost\_regex-vc141](http://www.nuget.org/packages/boost_regex-vc141)
230+
* [boost\_system-vc141](http://www.nuget.org/packages/boost_system-vc141)
231+
* [boost\_thread-vc141](http://www.nuget.org/packages/boost_thread-vc141)
232+
* [boost\_unit\_test\_framework-vc141](http://www.nuget.org/packages/boost_unit_test_framework-vc141)
233+
* Packages maintained by [evoskuil](http://www.nuget.org/profiles/evoskuil)
234+
* [secp256k1\_vc141](http://www.nuget.org/packages/secp256k1_vc141)
235+
* [libzmq\_vc141](http://www.nuget.org/packages/libzmq_vc141)
236+
237+
The packages can be viewed using the [NuGet package manager](http://docs.nuget.org/docs/start-here/managing-nuget-packages-using-the-dialog) from the libbitcoin solution. The package manager will prompt for download of any missing packages.
238+
239+
The libbitcoin solution files are configured with references to these packages. The location of the NuGet repository is controlled by the [nuget.config](https://github.com/libbitcoin/libbitcoin-client/blob/version3/builds/msvc/nuget.config) file `repositoryPath` setting **and** the `NuGetPackageRoot` element of **each** [\[project\].props](https://github.com/libbitcoin/libbitcoin-client/blob/version3/builds/msvc/vs2022/libbitcoini-client/libbitcoin-client.props) file.
240+
241+
#### Build Libbitcoin Projects
242+
243+
After cloning the the repository the libbitcoin build can be performed from within Visual Studio or using the `build_all.bat` script provided in the `builds\msvc\build\` subdirectory. The script automatically downloads all required NuGet packages.
244+
245+
> Tip: The `build_all.bat` script builds *all* valid configurations for *all* compilers. The build time can be significantly reduced by disabling all but the desired configuration in `build_base.bat` and `build_all.bat`.
246+
247+
The libbitcoin dynamic (DLL) build configurations do not compile, as the exports have not yet been fully implemented. These are currently disabled in the build scripts but you will encounter numerous errors if you build then manually.
248+
249+
#### Optional: Building secp256k1
250+
251+
The secp256k1 package above is maintained using the same [Visual Studio template](https://github.com/evoskuil/visual-studio-template) as all libbitcoin libraries. If so desired it can be built locally, in the same manner as libbitcoin.
252+
253+
* [libbitcoin/secp256k1/version7](https://github.com/libbitcoin/secp256k1/tree/version7/builds/msvc)
18254

19-
libbitcoin-client is now installed in `/usr/local/`.
255+
This change is properly accomplished by disabling the "NuGet Dependencies" in the Visual Studio properties user interface and then importing `secp256k1.import.props`, which references `secp256k1.import.xml`.

0 commit comments

Comments
 (0)