diff options
| -rw-r--r-- | COPYING | 1 | ||||
| -rw-r--r-- | INSTALL.md | 83 | ||||
| -rw-r--r-- | README.md | 181 | ||||
| -rw-r--r-- | doc/FAQ.md | 54 | ||||
| -rw-r--r-- | doc/build-archlinux.md | 20 | ||||
| -rw-r--r-- | doc/build-fedora.md | 20 | ||||
| -rw-r--r-- | doc/build-freebsd.md | 35 | ||||
| -rw-r--r-- | doc/build-nixos.md | 23 | ||||
| -rw-r--r-- | doc/build-openbsd.md | 3 | ||||
| -rw-r--r-- | doc/build-unix.md | 400 |
10 files changed, 435 insertions, 385 deletions
@@ -1,6 +1,7 @@ The MIT License (MIT) Copyright (c) 2009-2017 The Bitcoin Core developers +Copyright (c) 2013-2021 The Dogecoin Core developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/INSTALL.md b/INSTALL.md index b6602e0f4..51fb2dc2c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,5 +1,80 @@ -Building Dogecoin -================ +# Installing Dogecoin Core -See doc/build-*.md for instructions on building the various -elements of the Dogecoin Core reference implementation of Dogecoin. +### Pre-compiled binaries + +The easiest way to install the latest version of the Dogecoin Core software is +by to download the latest precompiled binaries for your platform from the +[release page](https://github.com/dogecoin/dogecoin/releases). Currently, +binaries are released for the following platforms: + +- Windows, 64-bit and 32-bit +- Linux, 64-bit and 32-bit +- MacOS, Intel 64-bit +- ARM, 64-bit and 32-bit Linux + +These binaries are created and verified by multiple independent people, to +ensure honest and malware-free releases. See +[the gitian building documentation](doc/gitian-building.md) for more information +regarding that process. + +### Compiling using packaged dependencies + +It is possible to build your own copy of Dogecoin Core with the exact, tested, +dependencies, as used for the binary releases, by using the +[depends system](depends/description.md). Please refer to the +[depends README](depends/README.md) for instructions to build Dogecoin using +these dependencies. + +### Compiling using system-provided libraries + + The following are developer notes on how to build Dogecoin on your native + platform, using the dependencies as provided by your system's package manager. + They are not complete guides, but include notes on the necessary libraries, + compile flags, etc. + + - [Unix Build Notes](doc/build-unix.md) + - [Windows Build Notes](doc/build-windows.md) + - [macOS Build Notes](doc/Building-Dogecoin-1.14-for-Mac.md) + +### Testing + +Unit tests can be compiled and ran with `make check`. Further details on running +and extending unit tests can be found in [/src/test/README.md](/src/test/README.md). + +There are also [regression and integration tests](/qa) written in Python, that +are run automatically on the build server. These tests can be run (if the +[test dependencies](/qa) are installed) with: `qa/pull-tester/rpc-tests.py` + +### Tips and tricks + +**compiling for debugging** + +Run `configure` with the `--enable-debug` option, then `make`. Or run `configure` with +`CXXFLAGS="-g -ggdb -O0"` or whatever debug flags you need. + +**debug.log** + +If the code is behaving strangely, take a look in the debug.log file in the data directory; +error and debugging messages are written there. + +The `-debug=...` command-line option controls debugging; running with just `-debug` will turn +on all categories (and give you a very large debug.log file). + +The Qt code routes `qDebug()` output to debug.log under category "qt": run with `-debug=qt` +to see it. + +**testnet and regtest modes** + +Run with the `-testnet` option to run with "play dogecoins" on the test network, if you +are testing multi-machine code that needs to operate across the internet. + +If you are testing something that can run on one machine, run with the `-regtest` option. +In regression test mode, blocks can be created on-demand; see qa/rpc-tests/ for tests +that run in `-regtest` mode. + +**DEBUG_LOCKORDER** + +Dogecoin Core is a multithreaded application, and deadlocks or other multithreading bugs +can be very difficult to track down. Compiling with `-DDEBUG_LOCKORDER` (`configure +CXXFLAGS="-DDEBUG_LOCKORDER -g"`) inserts run-time checks to keep track of which locks +are held, and adds warnings to the debug.log file if inconsistencies are detected. @@ -7,32 +7,55 @@ Dogecoin Core [DOGE, Ð] <div align="center"> [](https://dogecoin.com) -[](https://travis-ci.com/dogecoin/dogecoin) [](https://dogecoin.com) </div> -Select Doc Language: ENG | [CN_simplified](./README_zh_CN.md) | [more...](./README.md) +Select language: EN | [CN](./README_zh_CN.md) Dogecoin is a cryptocurrency like Bitcoin, although it does not use SHA256 as its proof of work (POW). Taking development cues from Tenebrix and Litecoin, Dogecoin currently employs a simplified variant of scrypt. -- **Website:** [dogecoin.com](https://dogecoin.com) -## License – Much license ⚖️ -Dogecoin Core is released under the terms of the MIT license. See -[COPYING](COPYING) for more information or see -[opensource.org](https://opensource.org/licenses/MIT) +**Website:** [dogecoin.com](https://dogecoin.com) + +## Installation 💻 + +Please see [the installation guide](INSTALL.md) for information about installing +Dogecoin Core. + +### Such ports -## Development and contributions – omg developers -Development is ongoing, and the development team, as well as other volunteers, -can freely work in their own trees and submit pull requests when features or -bug fixes are ready. +Dogecoin Core by default uses port `22556` for peer-to-peer communication that +is needed to synchronize the "mainnet" blockchain and stay informed of new +transactions and blocks. Additionally, a JSONRPC port can be opened, which +defaults to port `22555` for mainnet nodes. It is strongly recommended to not +expose RPC ports to the public internet. -#### Version strategy +| Function | mainnet | testnet | regtest | +| :------- | ------: | ------: | ------: | +| P2P | 22556 | 44556 | 18444 | +| RPC | 22555 | 44555 | 18332 | + +## Ongoing development - Moon plan 🌒 + +Dogecoin Core is an open source and community driven software. The development +process is open and publicly visible; anyone can see, discuss and work on the +software. + +Main development resources: + +* [Github Projects](https://github.com/dogecoin/dogecoin/projects) is used to + follow planned and in-progress work for upcoming releases. +* [Github Discussion](https://github.com/dogecoin/dogecoin/discussions) is used + to discuss features, planned and unplanned, related to both the development of + the Dogecoin Core software, the underlying protocols and the DOGE asset. +* [Dogecoindev subreddit](https://www.reddit.com/r/dogecoindev/) + +### Version strategy Version numbers are following ```major.minor.patch``` semantics. -#### Branches +### Branches There are 3 types of branches in this repository: - **master:** Stable, contains the latest version of the latest *major.minor* release. @@ -44,119 +67,37 @@ There are 3 types of branches in this repository: *submitted against those. Maintenance branches are there for **bug fixes only,*** *please submit new features against the development branch with the highest version.* -#### Contributions ✍️ - -Developers are strongly encouraged to write [unit tests](src/test/README.md) for new code, and to -submit new unit tests for old code. Unit tests can be compiled and run -(assuming they weren't disabled in configure) with: `make check`. Further details on running -and extending unit tests can be found in [/src/test/README.md](/src/test/README.md). - -There are also [regression and integration tests](/qa) of the RPC interface, written -in Python, that are run automatically on the build server. -These tests can be run (if the [test dependencies](/qa) are installed) with: `qa/pull-tester/rpc-tests.py` +## Contributing 🤝 -Changes should be tested by somebody other than the developer who wrote the -code. This is especially important for large or high-risk changes. It is useful -to add a test plan to the pull request description if testing the changes is -not straightforward. +If you find a bug or experience issues with this software, please report it +using the [issue system](https://github.com/dogecoin/dogecoin/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5Bbug%5D+). -## Very Much Frequently Asked Questions ❓ - -### How much doge can exist? – So many puppies! 🐕 -Early 2015 (approximately a year and a half after release) there were -approximately 100,000,000,000 coins. -Each subsequent block will grant 10,000 coins to encourage miners to continue to -secure the network and make up for lost wallets on hard drives/phones/lost -encryption passwords/etc. - - -### Such mining information ⛏ - -Dogecoin uses a simplified variant of the scrypt key derivation function as its -proof of work with a target time of one minute per block and difficulty -readjustment after every block. The block rewards are fixed and halve every -100,000 blocks. Starting with the 600,000th block, a permanent reward of -10,000 Dogecoin per block will be issued. - -Originally, a different payout scheme was envisioned with block rewards being -determined by taking the maximum reward as per the block schedule and applying -the result of a Mersenne Twister pseudo-random number generator to arrive at a -number between 0 and the maximum reward. - -This was changed starting with block 145,000, to prevent large pools from gaming -the system and mining only high reward blocks. At the same time, the difficulty -retargeting was also changed from four hours to once per block (every minute), -implementing an algorithm courtesy of the DigiByte Coin development team, to -lessen the impact of sudden increases and decreases of network hashing rate. - -**The current block reward schedule:** - -| Block | Reward in Dogecoin | -| :------------------- | -----------------: | -| 1–99,999 | 0–1,000,000 | -| 100,000–144,999 | 0–500,000 | -| 145,000–199,999 | 250,000 | -| 200,000–299,999 | 125,000 | -| 300,000–399,999 | 62,500 | -| 400,000–499,999 | 31,250 | -| 500,000–599,999 | 15,625 | -| 600,000+ | 10,000 | - -**The original block reward schedule, with one-minute block targets and four-hour difficulty readjustment:** - -| Block | Reward in Dogecoin | -| :------------------- | -----------------: | -| 1–99,999 | 0–1,000,000 | -| 100,000–199,999 | 0–500,000 | -| 200,000–299,999 | 0–250,000 | -| 300,000–399,999 | 0–125,000 | -| 400,000–499,999 | 0–62,500 | -| 500,000–599,999 | 0–31,250 | -| 600,000+ | 10,000 | - -### Wow plz make dogecoind/dogecoin-cli/dogecoin-qt - - The following are developer notes on how to build Dogecoin on your native platform. They are not complete guides, but include notes on the necessary libraries, compile flags, etc. - - - [OSX Build Notes](doc/build-osx.md) - - [Unix Build Notes](doc/build-unix.md) - - [Windows Build Notes](doc/build-windows.md) - -### Such ports - -- RPC 22555 -- P2P 22556 - -## Development tips and tricks - -**compiling for debugging** +Please see [the contribution guide](CONTRIBUTING.md) to see how you can +participate in the development of Dogecoin Core. There are often +[topics seeking help](https://github.com/dogecoin/dogecoin/labels/help%20wanted) +where your contributions will have high impact and get very appreciation. wow. -Run `configure` with the `--enable-debug` option, then `make`. Or run `configure` with -`CXXFLAGS="-g -ggdb -O0"` or whatever debug flags you need. +## Communities 🚀🍾 -**debug.log** +You can join the communities on different social media. +To see what's going on, meet people & discuss, find the lastest meme, learn +about Dogecoin, give or ask for help, to share your project. -If the code is behaving strangely, take a look in the debug.log file in the data directory; -error and debugging messages are written there. +Here are some places to visit: -The `-debug=...` command-line option controls debugging; running with just `-debug` will turn -on all categories (and give you a very large debug.log file). +* [Dogecoin subreddit](https://www.reddit.com/r/dogecoin/) +* [Dogeducation subreddit](https://www.reddit.com/r/dogeducation/) +* [Discord](https://discord.gg/dogecoin) +* [Dogecoin Twitter](https://twitter.com/dogecoin) -The Qt code routes `qDebug()` output to debug.log under category "qt": run with `-debug=qt` -to see it. - -**testnet and regtest modes** - -Run with the `-testnet` option to run with "play dogecoins" on the test network, if you -are testing multi-machine code that needs to operate across the internet. - -If you are testing something that can run on one machine, run with the `-regtest` option. -In regression test mode, blocks can be created on-demand; see qa/rpc-tests/ for tests -that run in `-regtest` mode. +## Very Much Frequently Asked Questions ❓ -**DEBUG_LOCKORDER** +Do you have a question regarding Dogecoin? An answer is perhaps already in the +[FAQ](doc/FAQ.md) or the +[Q&A section](https://github.com/dogecoin/dogecoin/discussions/categories/q-a) +of the discussion board! -Dogecoin Core is a multithreaded application, and deadlocks or other multithreading bugs -can be very difficult to track down. Compiling with `-DDEBUG_LOCKORDER` (`configure -CXXFLAGS="-DDEBUG_LOCKORDER -g"`) inserts run-time checks to keep track of which locks -are held, and adds warnings to the debug.log file if inconsistencies are detected. +## License - Much license ⚖️ +Dogecoin Core is released under the terms of the MIT license. See +[COPYING](COPYING) for more information or see +[opensource.org](https://opensource.org/licenses/MIT) diff --git a/doc/FAQ.md b/doc/FAQ.md new file mode 100644 index 000000000..d09d60bba --- /dev/null +++ b/doc/FAQ.md @@ -0,0 +1,54 @@ +## Very Much Frequently Asked Questions ❓ + +### How much doge can exist? – So many puppies! 🐕 +Early 2015 (approximately a year and a half after release) there were +approximately 100,000,000,000 coins. +Each subsequent block will grant 10,000 coins to encourage miners to continue to +secure the network and make up for lost wallets on hard drives/phones/lost +encryption passwords/etc. + + +### Such mining information ⛏ + +Dogecoin uses a simplified variant of the scrypt key derivation function as its +proof of work with a target time of one minute per block and difficulty +readjustment after every block. The block rewards are fixed and halve every +100,000 blocks. Starting with the 600,000th block, a permanent reward of +10,000 Dogecoin per block will be issued. + +Originally, a different payout scheme was envisioned with block rewards being +determined by taking the maximum reward as per the block schedule and applying +the result of a Mersenne Twister pseudo-random number generator to arrive at a +number between 0 and the maximum reward. + +This was changed starting with block 145,000, to prevent large pools from gaming +the system and mining only high reward blocks. At the same time, the difficulty +retargeting was also changed from four hours to once per block (every minute), +implementing an algorithm courtesy of the DigiByte Coin development team, to +lessen the impact of sudden increases and decreases of network hashing rate. + +**The current block reward schedule:** + +| Block | Reward in Dogecoin | +| :------------------- | -----------------: | +| 1–99,999 | 0–1,000,000 | +| 100,000–144,999 | 0–500,000 | +| 145,000–199,999 | 250,000 | +| 200,000–299,999 | 125,000 | +| 300,000–399,999 | 62,500 | +| 400,000–499,999 | 31,250 | +| 500,000–599,999 | 15,625 | +| 600,000+ | 10,000 | + +**The original block reward schedule, with one-minute block targets and +four-hour difficulty readjustment:** + +| Block | Reward in Dogecoin | +| :------------------- | -----------------: | +| 1–99,999 | 0–1,000,000 | +| 100,000–199,999 | 0–500,000 | +| 200,000–299,999 | 0–250,000 | +| 300,000–399,999 | 0–125,000 | +| 400,000–499,999 | 0–62,500 | +| 500,000–599,999 | 0–31,250 | +| 600,000+ | 10,000 | diff --git a/doc/build-archlinux.md b/doc/build-archlinux.md new file mode 100644 index 000000000..cc7a9a3b8 --- /dev/null +++ b/doc/build-archlinux.md @@ -0,0 +1,20 @@ +Arch Linux build guide +----------------------------------- + +***NOTE: This documentation is outdated and needs to be updated*** + +This example lists the steps necessary to setup and build a command line only, non-wallet distribution of the latest changes on Arch Linux: + + pacman -S git base-devel boost libevent python + git clone https://github.com/bitcoin/bitcoin.git + cd bitcoin/ + ./autogen.sh + ./configure --disable-wallet --without-gui --without-miniupnpc + make check + +Note: +Enabling wallet support requires either compiling against a Berkeley DB newer than 4.8 (package `db`) using `--with-incompatible-bdb`, +or building and depending on a local version of Berkeley DB 4.8. The readily available Arch Linux packages are currently built using +`--with-incompatible-bdb` according to the [PKGBUILD](https://projects.archlinux.org/svntogit/community.git/tree/bitcoin/trunk/PKGBUILD). +As mentioned above, when maintaining portability of the wallet between the standard Dogecoin Core distributions and independently built +node software is desired, Berkeley DB 4.8 must be used. diff --git a/doc/build-fedora.md b/doc/build-fedora.md new file mode 100644 index 000000000..0bfd28bdb --- /dev/null +++ b/doc/build-fedora.md @@ -0,0 +1,20 @@ +Fedora build dependencies +-------------------------- + +***NOTE: This documentation is outdated and needs to be updated*** + +Build requirements: + + sudo dnf install gcc-c++ libtool make autoconf automake openssl-devel libevent-devel boost-devel libdb4-devel libdb4-cxx-devel + +Optional: + + sudo dnf install miniupnpc-devel + +To build with Qt 5 (recommended) you need the following: + + sudo dnf install qt5-qttools-devel qt5-qtbase-devel protobuf-devel + +libqrencode (optional) can be installed with: + + sudo dnf install qrencode-devel diff --git a/doc/build-freebsd.md b/doc/build-freebsd.md new file mode 100644 index 000000000..f69c43f4c --- /dev/null +++ b/doc/build-freebsd.md @@ -0,0 +1,35 @@ +Building on FreeBSD +-------------------- + +***NOTE: This documentation is outdated and needs to be updated*** + +(Updated as of FreeBSD 11.0) + +Clang is installed by default as `cc` compiler, this makes it easier to get +started than on [OpenBSD](build-openbsd.md). Installing dependencies: + + pkg install autoconf automake libtool pkgconf + pkg install boost-libs openssl libevent + pkg install gmake + +You need to use GNU make (`gmake`) instead of `make`. +(`libressl` instead of `openssl` will also work) + +For the wallet (optional): + + pkg install db5 + +This will give a warning "configure: WARNING: Found Berkeley DB other +than 4.8; wallets opened by this build will not be portable!", but as FreeBSD never +had a binary release, this may not matter. If backwards compatibility +with 4.8-built Dogecoin Core is needed follow the steps under "Berkeley DB" above. + +Then build using: + + ./autogen.sh + ./configure --with-incompatible-bdb BDB_CFLAGS="-I/usr/local/include/db5" BDB_LIBS="-L/usr/local/lib -ldb_cxx-5" + gmake + +*Note on debugging*: The version of `gdb` installed by default is [ancient and considered harmful](https://wiki.freebsd.org/GdbRetirement). +It is not suitable for debugging a multi-threaded C++ program, not even for getting backtraces. Please install the package `gdb` and +use the versioned gdb command e.g. `gdb7111`. diff --git a/doc/build-nixos.md b/doc/build-nixos.md new file mode 100644 index 000000000..b87e30225 --- /dev/null +++ b/doc/build-nixos.md @@ -0,0 +1,23 @@ +NixOS build guide +------------------------------ +This guide lists the steps necessary to setup and build a full GUI distribution +of the latest changes on NixOS. + +Clone and enter the repo: + + $ git clone https://github.com/dogecoin/dogecoin + $ cd dogecoin + +Enter the `nix-shell` environment with all the Dogecoin dependencies present: + + $ nix-shell ./contrib/nixos/shell.nix + +Run the build steps with flags necessary for NixOS: + + $ ./autogen.sh + $ ./configure --with-incompatible-bdb --with-boost-libdir="$(nix eval --raw nixpkgs.boost.out)/lib" --with-gui + $ make + +Start the GUI! + + $ ./src/qt/dogecoin-qt diff --git a/doc/build-openbsd.md b/doc/build-openbsd.md index c7d5927a8..64f1e01bf 100644 --- a/doc/build-openbsd.md +++ b/doc/build-openbsd.md @@ -1,5 +1,8 @@ OpenBSD build guide ====================== + +***NOTE: This documentation is outdated and needs to be updated*** + (updated for OpenBSD 6.0) This guide describes how to build dogecoind and command-line utilities on OpenBSD. diff --git a/doc/build-unix.md b/doc/build-unix.md index 3126b4355..21927e149 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -1,35 +1,36 @@ -UNIX BUILD NOTES -==================== -Some notes on how to build Dogecoin Core in Unix. - -(for OpenBSD specific instructions, see [build-openbsd.md](build-openbsd.md)) - -Note ---------------------- -Always use absolute paths to configure and compile Dogecoin and the dependencies, -for example, when specifying the path of the dependency: - - ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX - -Here BDB_PREFIX must be an absolute path - it is defined using $(pwd) which ensures -the usage of the absolute path. - -To Build ---------------------- - -```bash -./autogen.sh -./configure -make -make install # optional -``` - -This will build Dogecoin-Qt as well if the dependencies are met. - -Dependencies ---------------------- - -These dependencies are required: +# Unix Build of Dogecoin Core + +This installation guide serves as a basis for all UNIX and UNIX-like operating +systems. All examples in this guide are illustrated using an Ubuntu/Debian OS, +and guides for different OSs can be found in separate documentation, as listed +below. + +1. [Install dependencies](#install-dependencies) + * [Using packaged dependencies](#using-packaged-dependencies) + * [Ubuntu & Debian example](#ubuntu--debian-example) +2. [Build steps](#build-steps) +3. [Build configuration](#build-configuration) + * [Enable Qt GUI](#enable-qt-gui) + * [Wallet](#wallet) + * [Disable-wallet mode](#disable-wallet-mode) + * [Miniupnpc](#miniupnpc) + * [Security](#security) + * [Memory requirements](#memory-requirements) +4. [ARM Cross-compilation](#arm-cross-compilation) +5. OS-specific documentation: + * [Archlinux](build-archlinux.md) + * [Fedora](build-fedora.md) + * [FreeBSD](build-freebsd.md) + * [NixOs](build-nixos.md) + * [OpenBSD](build-openbsd.md) + +## Install dependencies + +You must install required dependencies to build a basic Dogecoin daemon, optional dependencies may vary according to your requirements. + +Wallet is optional to run a node, see [Wallet](#wallet) section to enable them. + +**Required dependencies :** Library | Purpose | Description ------------|------------------|---------------------- @@ -37,7 +38,7 @@ These dependencies are required: libboost | Utility | Library for threading, data structures, etc libevent | Networking | OS independent asynchronous networking -Optional dependencies: +**Optional dependencies:** Library | Purpose | Description ------------|------------------|---------------------- @@ -51,165 +52,127 @@ Optional dependencies: For the versions used in the release, see [release-process.md](release-process.md) under *Fetch and build inputs*. -Memory Requirements --------------------- +### Using packaged dependencies -C++ compilers are memory-hungry. It is recommended to have at least 1.5 GB of -memory available when compiling Dogecoin Core. On systems with less, gcc can be -tuned to conserve memory with additional CXXFLAGS: +Dogecoin Core's released binaries are built using the "depends system", which +contains exact, tested versions of all dependencies. To create binaries that are +using only fully tested dependencies, see the documentation in the +[depends directory](../depends/README.md) and the +[Release process documentation](release-process.md). - ./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" +### Ubuntu & Debian example -Dependency Build Instructions: Ubuntu & Debian ----------------------------------------------- -Build requirements: - - sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils - -Options when installing required Boost library files: - -1. On at least Ubuntu 14.04+ and Debian 7+ there are generic names for the -individual boost development packages, so the following can be used to only -install necessary parts of boost: - - sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev - -2. If that doesn't work, you can install all boost development packages with: - - sudo apt-get install libboost-all-dev - -BerkeleyDB is required for the wallet. - - sudo apt-get install libdb5.1-dev libdb5.1++-dev - - Note that if you have Berkeley DB 4.8 packages installed (i.e. for other - wallet software), they are incompatible with the packages for 5.1. You - will have to manually download 5.1 from - http://download.oracle.com/berkeley-db/db-5.1.29.NC.tar.gz and compile - it, install it to /usr/local where the configure script should locate it - automatically. - - -See the section "Disable-wallet mode" to build Dogecoin Core without wallet. - -Optional (see --with-miniupnpc and --enable-upnp-default): +**Required dependencies** : +```bash +sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils +sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev +``` - sudo apt-get install libminiupnpc-dev +**Optional dependencies** : +```bash +# Qt (required for dogecoin-qt GUI) +sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libqrencode-dev -ZMQ dependencies (provides ZMQ API 4.x): +# BerkeleyDB (version 5.3) +sudo apt install libdb5.3++-dev libdb5.3++ libdb5.3-dev - sudo apt-get install libzmq3-dev +# ZMQ (provides ZMQ API 4.x) +sudo apt-get install libzmq3-dev -Dependencies for the GUI: Ubuntu & Debian ------------------------------------------ +# Miniupnpc +sudo apt-get install libminiupnpc-dev +``` -If you want to build Dogecoin-Qt, make sure that the required packages for Qt development -are installed. Either Qt 5 or Qt 4 are necessary to build the GUI. -If both Qt 4 and Qt 5 are installed, Qt 5 will be used. Pass `--with-gui=qt4` to configure to choose Qt4. -To build without GUI pass `--without-gui`. +## Build steps -To build with Qt 5 (recommended) you need the following: +According to installed dependencies, the following steps will compile `dogecoind`, `dogecoin-cli` and `dogecoin-qt`. - sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler +```bash +./autogen.sh +./configure +make +make install # optional +``` +See [Build configuration](#build-configuration) for extra settings. -Alternatively, to build with Qt 4 you need the following: +## Build configuration - sudo apt-get install libqt4-dev libprotobuf-dev protobuf-compiler +Configurations are done during the `./configure` step. Use `--help` to see all available options. -libqrencode (optional) can be installed with: +#### Enable Qt GUI +Create `dogecoin-qt`, the core wallet GUI. +```bash +./configure --with-gui +``` - sudo apt-get install libqrencode-dev +#### Wallet +BerkeleyDB is required for wallet functionality and use the `wallet.dat` file. -Once these are installed, they will be found by configure and a dogecoin-qt executable will be -built by default. +By default, **Dogecoin Core expect BerkeleyDB 5.1**. +You can use a different version by specifying `--with-incompatible-bdb` flag. -Dependency Build Instructions: Fedora -------------------------------------- -Build requirements: +If no package is available for your distribution in optional dependencies, you can build BerkeleyDB from source : +```bash +# Install script for BerkeleyDB 5.1 - sudo dnf install gcc-c++ libtool make autoconf automake openssl-devel libevent-devel boost-devel libdb4-devel libdb4-cxx-devel +# BerkeleyDB installation directory +BDB_PREFIX=$(pwd)/bdb +mkdir $BDB_PREFIX -Optional: +# Fetch the source and verify shasum +wget 'http://download.oracle.com/berkeley-db/db-5.1.29.NC.tar.gz' +echo '08238e59736d1aacdd47cfb8e68684c695516c37f4fbe1b8267dde58dc3a576c db-5.1.29.NC.tar.gz' | sha256sum -c - sudo dnf install miniupnpc-devel +# Extract sources +tar -xzvf db-5.1.29.NC.tar.gz +cd db-5.1.29.NC/build_unix/ -To build with Qt 5 (recommended) you need the following: +# Apply patch (see https://gist.github.com/danieldk/5700533) +sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' ../src/dbinc/atomic.h - sudo dnf install qt5-qttools-devel qt5-qtbase-devel protobuf-devel +# Note: Do a static build so that it can be embedded into the executable, instead of having to find a .so at runtime +../dist/configure --prefix=$BDB_PREFIX --enable-cxx --disable-shared --with-pic +make install +``` -libqrencode (optional) can be installed with: +Then use `LDFLAGS` and `CPPFLAGS` during configuration to link the database : +```bash +./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" +``` - sudo dnf install qrencode-devel +#### Disable-wallet mode +When the intention is to run only a P2P node without a wallet, Dogecoin may be compiled in +disable-wallet mode with: -Notes ------ -The release is built with GCC and then "strip dogecoind" to strip the debug -symbols, which reduces the executable size by about 90%. +```bash +./configure --disable-wallet +``` +Mining is also possible in disable-wallet mode, but only using the `getblocktemplate` RPC +call, not `getwork`. -miniupnpc ---------- +#### Miniupnpc [miniupnpc](http://miniupnp.free.fr/) may be used for UPnP port mapping. It can be downloaded from [here]( http://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and turned off by default. See the configure options for upnp behavior desired: - --without-miniupnpc No UPnP support miniupnp not required - --disable-upnp-default (the default) UPnP support turned off by default at runtime - --enable-upnp-default UPnP support turned on by default at runtime - - -Berkeley DB ------------ -It is recommended to use Berkeley DB 5.1. If you have to build it yourself: - ```bash -BITCOIN_ROOT=$(pwd) - -# Pick some path to install BDB to, here we create a directory within the dogecoin directory -BDB_PREFIX="${BITCOIN_ROOT}/db5" -mkdir -p $BDB_PREFIX - -# Fetch the source and verify that it is not tampered with -wget 'http://download.oracle.com/berkeley-db/db-5.1.29.NC.tar.gz' -echo '08238e59736d1aacdd47cfb8e68684c695516c37f4fbe1b8267dde58dc3a576c db-5.1.29.NC.tar.gz' | sha256sum -c -# -> db-5.1.29.NC.tar.gz: OK -tar -xzvf db-5.1.29.NC.tar.gz - -# Build the library and install to our prefix -cd db-5.1.29.NC/build_unix/ -# Note: Do a static build so that it can be embedded into the executable, instead of having to find a .so at runtime -../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX -make install - -# Configure Dogecoin Core to use our own-built instance of BDB -cd $BITCOIN_ROOT -./autogen.sh -./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" # (other args...) +--without-miniupnpc #No UPnP support miniupnp not required +--disable-upnp-default #(the default) UPnP support turned off by default at runtime +--enable-upnp-default #UPnP support turned on by default at runtime ``` -**Note**: You only need Berkeley DB if the wallet is enabled (see the section *Disable-Wallet mode* below). - -Boost ------ -If you need to build Boost yourself: - - sudo su - ./bootstrap.sh - ./bjam install - - -Security --------- +#### Security To help make your Dogecoin installation more secure by making certain attacks impossible to exploit even if a vulnerability is found, binaries are hardened by default. This can be disabled with: Hardening Flags: - - ./configure --enable-hardening - ./configure --disable-hardening - +```bash +./configure --enable-hardening +./configure --disable-hardening +``` Hardening enables the following features: @@ -221,16 +184,15 @@ Hardening enables the following features: randomly located as well. On an AMD64 processor where a library was not compiled with -fPIC, this will cause an error - such as: "relocation R_X86_64_32 against `......' can not be used when making a shared object;" + such as: `relocation R_X86_64_32 against '......' can not be used when making a shared object;` To test that you have built PIE executable, install scanelf, part of paxutils, and use: - scanelf -e ./dogecoin + `scanelf -e ./dogecoin` The output should contain: - TYPE - ET_DYN + `TYPE ET_DYN` * Non-executable Stack If the stack is executable, trivial stack-based buffer overflow exploits are possible if @@ -243,123 +205,39 @@ Hardening enables the following features: `scanelf -e ./dogecoin` the output should contain: - STK/REL/PTL - RW- R-- RW- - - The STK RW- means that the stack is readable and writeable, but not executable. - -Disable-wallet mode --------------------- -When the intention is to run only a P2P node without a wallet, Dogecoin may be compiled in -disable-wallet mode with: - - ./configure --disable-wallet - -In this case there is no dependency on Berkeley DB 4.8. - -Mining is also possible in disable-wallet mode, but only using the `getblocktemplate` RPC -call, not `getwork`. - -Additional Configure Flags --------------------------- -A list of additional configure flags can be displayed with: - - ./configure --help - + `STK/REL/PTL RW- R-- RW-` -Setup and Build Example: Arch Linux ------------------------------------ -This example lists the steps necessary to setup and build a command line only, non-wallet distribution of the latest changes on Arch Linux: + The `STK RW-` means that the stack is readable and writeable, but not executable. - pacman -S git base-devel boost libevent python - git clone https://github.com/bitcoin/bitcoin.git - cd bitcoin/ - ./autogen.sh - ./configure --disable-wallet --without-gui --without-miniupnpc - make check -Note: -Enabling wallet support requires either compiling against a Berkeley DB newer than 4.8 (package `db`) using `--with-incompatible-bdb`, -or building and depending on a local version of Berkeley DB 4.8. The readily available Arch Linux packages are currently built using -`--with-incompatible-bdb` according to the [PKGBUILD](https://projects.archlinux.org/svntogit/community.git/tree/bitcoin/trunk/PKGBUILD). -As mentioned above, when maintaining portability of the wallet between the standard Dogecoin Core distributions and independently built -node software is desired, Berkeley DB 4.8 must be used. +#### Memory Requirements -Setup and Build Example: NixOS ------------------------------- -This example lists the steps necessary to setup and build a full GUI distribution of the latest changes on NixOS. +C++ compilers are memory-hungry. It is recommended to have at +least 1.5 GB of memory available when compiling Dogecoin Core. +On systems with less, gcc can be tuned to conserve memory with additional CXXFLAGS: -Clone and enter the repo: - - $ git clone https://github.com/dogecoin/dogecoin - $ cd dogecoin - -Enter the `nix-shell` environment with all the Dogecoin dependencies present: - - $ nix-shell ./contrib/nixos/shell.nix - -Run the build steps with flags necessary for NixOS: - - $ ./autogen.sh - $ ./configure --with-incompatible-bdb --with-boost-libdir="$(nix eval --raw nixpkgs.boost.out)/lib" --with-gui - $ make - -Start the GUI! +```bash +./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" +``` - $ ./src/qt/dogecoin-qt +## ARM Cross-compilation -ARM Cross-compilation -------------------- These steps can be performed on, for example, an Ubuntu VM. The depends system will also work on other Linux distributions, however the commands for installing the toolchain will be different. Make sure you install the build requirements mentioned above. Then, install the toolchain and curl: - - sudo apt-get install g++-arm-linux-gnueabihf curl +```bash +sudo apt-get install g++-arm-linux-gnueabihf curl +``` To build executables for ARM: - - cd depends - make HOST=arm-linux-gnueabihf NO_QT=1 - cd .. - ./configure --prefix=$PWD/depends/arm-linux-gnueabihf --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++ - make - - +```bash +cd depends +make HOST=arm-linux-gnueabihf NO_QT=1 +cd .. +./configure --prefix=$PWD/depends/arm-linux-gnueabihf --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++ +make +``` For further documentation on the depends system see [README.md](../depends/README.md) in the depends directory. - -Building on FreeBSD --------------------- - -(Updated as of FreeBSD 11.0) - -Clang is installed by default as `cc` compiler, this makes it easier to get -started than on [OpenBSD](build-openbsd.md). Installing dependencies: - - pkg install autoconf automake libtool pkgconf - pkg install boost-libs openssl libevent - pkg install gmake - -You need to use GNU make (`gmake`) instead of `make`. -(`libressl` instead of `openssl` will also work) - -For the wallet (optional): - - pkg install db5 - -This will give a warning "configure: WARNING: Found Berkeley DB other -than 4.8; wallets opened by this build will not be portable!", but as FreeBSD never -had a binary release, this may not matter. If backwards compatibility -with 4.8-built Dogecoin Core is needed follow the steps under "Berkeley DB" above. - -Then build using: - - ./autogen.sh - ./configure --with-incompatible-bdb BDB_CFLAGS="-I/usr/local/include/db5" BDB_LIBS="-L/usr/local/lib -ldb_cxx-5" - gmake - -*Note on debugging*: The version of `gdb` installed by default is [ancient and considered harmful](https://wiki.freebsd.org/GdbRetirement). -It is not suitable for debugging a multi-threaded C++ program, not even for getting backtraces. Please install the package `gdb` and -use the versioned gdb command e.g. `gdb7111`. |