Skip to content

Commit 19f9a88

Browse files
authored
Merge pull request #2162 from nathanielcwm/bitcoindocs
doc: Port newer build documentation from Bitcoin
2 parents c393549 + 74b20f7 commit 19f9a88

File tree

4 files changed

+245
-232
lines changed

4 files changed

+245
-232
lines changed

doc/build-freebsd.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
Building on FreeBSD
2+
--------------------
3+
4+
**Updated for FreeBSD [12.2](https://www.freebsd.org/releases/12.2R/announce.html)**
5+
6+
This guide describes how to build gridcoinresearchd, command-line utilities, and GUI on FreeBSD.
7+
8+
Preparing the Build
9+
--------------------
10+
11+
Install the required dependencies the usual way you [install software on FreeBSD](https://www.freebsd.org/doc/en/books/handbook/ports.html) - either with `pkg` or via the Ports collection. The example commands below use `pkg` which is usually run as `root` or via `sudo`. If you want to use `sudo`, and you haven't set it up: [use this guide](http://www.freebsdwiki.net/index.php/Sudo%2C_configuring) to setup `sudo` access on FreeBSD.
12+
#### General Dependencies
13+
```bash
14+
pkg install autoconf automake boost-libs git gmake libevent libtool pkgconf db5 openssl libzip
15+
16+
```
17+
---
18+
#### GUI Dependencies
19+
```bash
20+
pkg install qt5 libqrencode
21+
```
22+
23+
---
24+
#### Test Suite Dependencies
25+
There is an included test suite that is useful for testing code changes when developing.
26+
To run the test suite (recommended), you will need to have Python 3 installed:
27+
28+
```bash
29+
pkg install python3
30+
```
31+
32+
Clone the repository and cd into it:
33+
34+
``` bash
35+
git clone https://github.com/gridcoin-community/Gridcoin-Research
36+
cd Gridcoin-Research
37+
git checkout master
38+
```
39+
40+
To Build
41+
---------------------
42+
### 1. Configuration
43+
44+
There are many ways to configure Gridcoin, here are a few common examples:
45+
##### Wallet Support, No GUI:
46+
This explicitly enables wallet support and disables the GUI.
47+
```bash
48+
./autogen.sh
49+
./configure --with-gui=no --with-incompatible-bdb \
50+
BDB_LIBS="-ldb_cxx-5" \
51+
BDB_CFLAGS="-I/usr/local/include/db5" \
52+
MAKE=gmake
53+
```
54+
55+
56+
### 2. Compile
57+
**Important**: Use `gmake` (the non-GNU `make` will exit with an error).
58+
59+
```bash
60+
gmake # use "-j N" for N parallel jobs
61+
gmake check # Run tests if Python 3 is available
62+
```

doc/build-macos.md

Lines changed: 116 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,138 @@
11
# macOS Build Instructions and Notes
22

3+
**Updated for MacOS [11.2](https://www.apple.com/macos/big-sur/)**
4+
5+
This guide describes how to build gridcoinresearchd, command-line utilities, and GUI on macOS
6+
7+
**Note:** The following is for Intel Macs only!
8+
9+
## Preparation
310
The commands in this guide should be executed in a Terminal application.
4-
The built-in one is located at:
11+
macOS comes with a built-in Terminal located in:
12+
513
```
614
/Applications/Utilities/Terminal.app
715
```
16+
### 1. Xcode Command Line Tools
17+
The Xcode Command Line Tools are a collection of build tools for macOS.
18+
These tools must be installed in order to build Gridcoin from source.
819

9-
## Preparation
10-
Install the macOS command line tools:
20+
To install, run the following command from your terminal:
1121

1222
```shell
1323
xcode-select --install
1424
```
1525

16-
When the popup appears, click `Install`.
26+
Upon running the command, you should see a popup appear.
27+
Click on `Install` to continue the installation process.
28+
29+
### 2. Homebrew Package Manager
30+
Homebrew is a package manager for macOS that allows one to install packages from the command line easily.
31+
While several package managers are available for macOS, this guide will focus on Homebrew as it is the most popular.
32+
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.
33+
Otherwise, you can adapt the commands to your package manager of choice.
34+
35+
To install the Homebrew package manager, see: https://brew.sh
1736

18-
Then install [Homebrew](https://brew.sh).
37+
Note: If you run into issues while installing Homebrew or pulling packages, refer to [Homebrew's troubleshooting page](https://docs.brew.sh/Troubleshooting).
38+
### 3. Install Required Dependencies
39+
The first step is to download the required dependencies.
40+
These dependencies represent the packages required to get a barebones installation up and running.
41+
To install, run the following from your terminal:
1942

20-
## Dependencies
2143
```shell
22-
brew install automake libtool boost miniupnpc openssl@1.1 pkg-config python qt@5 qrencode libzip
44+
brew install automake libtool boost openssl pkg-config libzip berkeley-db@4
2345
```
2446

25-
If you run into issues, check [Homebrew's troubleshooting page](https://docs.brew.sh/Troubleshooting).
47+
### 4. Clone Gridcoin repository
2648

27-
If you want to build the disk image with `make deploy` (.dmg / optional), you need RSVG:
28-
```shell
29-
brew install librsvg
49+
`git` should already be installed by default on your system.
50+
Now that all the required dependencies are installed, let's clone the Gridcoin repository to a directory.
51+
All build scripts and commands will run from this directory.
52+
53+
``` bash
54+
git clone https://github.com/gridcoin-community/Gridcoin-Research
55+
cd Gridcoin-Research
56+
git checkout master
3057
```
3158

32-
...as well as [`macdeployqtplus`](../contrib/macdeploy/README.md) dependencies:
33-
```shell
34-
pip3 install ds_store mac_alias
59+
### 5. Install Optional Dependencies
60+
61+
#### GUI Dependencies
62+
63+
###### Qt
64+
65+
Gridcoin includes a GUI built with the cross-platform Qt Framework.
66+
To compile the GUI, we need to install `qt@5`.
67+
Skip if you don't intend to use the GUI.
68+
69+
``` bash
70+
brew install qt@5
3571
```
3672

37-
#### Berkeley DB
73+
Ensure that the `qt@5` package is installed, not the `qt` package.
74+
If 'qt' is installed, the build process will fail.
75+
if installed, remove the `qt` package with the following command:
3876

39-
It is recommended to use Berkeley DB 4.8. If you have to build it yourself,
40-
you can use [this](/contrib/install_db4.sh) script to install it
41-
like so:
77+
``` bash
78+
brew uninstall qt
79+
```
4280

43-
```shell
44-
./contrib/install_db4.sh .
81+
Note: Building with Qt binaries downloaded from the Qt website is not officially supported.
82+
See the notes in [Bitcoin#7714](https://github.com/bitcoin/bitcoin/issues/7714).
83+
84+
###### qrencode
85+
86+
The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `qrencode`.
87+
Skip if not using the GUI or don't want QR code functionality.
88+
89+
``` bash
90+
brew install qrencode
4591
```
92+
---
4693

47-
from the root of the repository.
94+
#### Port Mapping Dependencies
4895

49-
Also, the Homebrew package could be installed:
96+
###### miniupnpc
5097

51-
```shell
52-
brew install berkeley-db4
98+
miniupnpc may be used for UPnP port mapping.
99+
Skip if you do not need this functionality.
100+
101+
``` bash
102+
brew install miniupnpc
53103
```
54104

55-
## Build Gridcoin
105+
---
56106

57-
1. Clone the Gridcoin source code:
58-
```shell
59-
git clone https://github.com/gridcoin-community/Gridcoin-Research
60-
cd Gridcoin-Research
61-
git checkout master
62-
```
107+
#### Test Suite Dependencies
108+
109+
There is an included test suite that is useful for testing code changes when developing.
110+
To run the test suite (recommended), you will need to have Python 3 installed:
63111

64-
2. Build Gridcoin:
112+
``` bash
113+
brew install python
114+
```
115+
116+
---
117+
118+
#### Deploy Dependencies
119+
120+
You can deploy a `.dmg` containing the Gridcoin application using `make deploy`.
121+
This command depends on a couple of python packages, so it is required that you have `python` installed.
122+
123+
Ensuring that `python` is installed, you can install the deploy dependencies by running the following commands in your terminal:
124+
125+
``` bash
126+
brew install librsvg
127+
```
128+
129+
``` bash
130+
pip3 install ds_store mac_alias
131+
```
132+
133+
## Build Gridcoin
134+
135+
1. Build Gridcoin:
65136

66137
Prepare the assembly code (requires Perl):
67138
```shell
@@ -78,34 +149,38 @@ brew install berkeley-db4
78149
```
79150
You can disable the GUI build by passing `--without-gui` to configure.
80151

81-
3. It is recommended to build and run the unit tests:
152+
2. It is recommended to build and run the unit tests:
82153
```shell
83154
make check
84155
```
85156

86-
4. You can also create a `.dmg` that contains the `.app` bundle (optional):
157+
3. You can also create a `.dmg` that contains the `.app` bundle (optional):
87158
```shell
88159
make deploy
89160
```
90161

91-
5. Testnet participation info is found at [Using Testnet](https://wiki.gridcoin.us/OS_X_Guide#Using_Testnet).
92-
93-
To open the app in testnet mode:
94-
```shell
95-
open -a /your/path/to/gridcoinresearch.app --args -testnet
96-
```
97-
98162
## Running
99163

100164
The daemon binary is placed in _src/_ and the GUI client is found in _src/qt/_.
101165
For example, to run the GUI client for production or testnet:
102166

167+
**Important:** [Please read this before using testnet.](https://gridcoin.us/wiki/testnet)
168+
103169
```shell
104170
./src/qt/gridcoinresearch
105171
./src/qt/gridcoinresearch -testnet
106172
./src/qt/gridcoinresearch -printtoconsole -debug -testnet
107173
```
108174

175+
The first time you run Gridcoin, it will start downloading the blockchain. This process could
176+
take several hours.
177+
178+
By default, blockchain and wallet data files will be stored in:
179+
180+
``` bash
181+
/Users/${USER}/Library/Application Support/GridcoinResearch
182+
```
183+
109184
Before running, you may create an empty configuration file:
110185
```shell
111186
mkdir -p "/Users/${USER}/Library/Application Support/GridcoinResearch"
@@ -115,13 +190,7 @@ touch "/Users/${USER}/Library/Application Support/GridcoinResearch/gridcoinresea
115190
chmod 600 "/Users/${USER}/Library/Application Support/GridcoinResearch/gridcoinresearch.conf"
116191
```
117192

118-
The first time you run Gridcoin, it will start downloading the blockchain. This process could
119-
take several hours.
120-
121193
You can monitor the download process by looking at the debug.log file:
122194
```shell
123195
tail -f $HOME/Library/Application\ Support/GridcoinResearch/debug.log
124196
```
125-
126-
## Notes
127-
* Building with downloaded Qt binaries is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714).

0 commit comments

Comments
 (0)