Skip to content

Commit 930a37c

Browse files
authored
Merge pull request #136 from Beldex-Coin/dev
Merge Dev Branch into Master for New Hardfork-18
2 parents 7944a6c + 4e375a9 commit 930a37c

File tree

230 files changed

+8144
-11779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+8144
-11779
lines changed

.drone.jsonnet

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
local default_deps_base='libsystemd-dev libboost-thread-dev libgtest-dev ' +
2-
'libboost-serialization-dev libboost-program-options-dev libunbound-dev nettle-dev libevent-dev libminiupnpc-dev ' +
2+
'libboost-serialization-dev libboost-program-options-dev libunbound-dev nettle-dev libevent-dev ' +
33
'libunwind8-dev libsodium-dev libssl-dev libreadline-dev libhidapi-dev libusb-1.0-0-dev python3 ' +
44
'pkg-config libsqlite3-dev qttools5-dev libcurl4-openssl-dev';
55
local default_deps='g++ ' + default_deps_base; // g++ sometimes needs replacement
@@ -137,7 +137,7 @@ local android_build_steps(android_abi, android_platform=21, jobs=6, cmake_extra=
137137
'-DCMAKE_BUILD_TYPE=Release ' +
138138
'-DCMAKE_TOOLCHAIN_FILE=/usr/lib/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake ' +
139139
'-DANDROID_PLATFORM=' + android_platform + ' -DANDROID_ABI=' + android_abi + ' ' +
140-
'-DMONERO_SLOW_HASH=ON ' +
140+
'-DMONERO_SLOW_HASH=ON'+' -DWARNINGS_AS_ERRORS=OFF'+' -DBUILD_TESTS=OFF ' +
141141
'-DLOCAL_MIRROR=https://builds.belnet.dev/deps ' +
142142
'-DBUILD_STATIC_DEPS=ON -DSTATIC=ON -G Ninja ' + cmake_extra,
143143
'ninja -j' + jobs + ' -v wallet_merged',
@@ -228,11 +228,11 @@ local gui_wallet_step_darwin = {
228228
{ name: 'Android wallet_api', kind: 'pipeline', type: 'docker', platform: { arch: 'amd64' },
229229
steps: [submodules, {
230230
name: 'build',
231-
image: 'debian:sid',
231+
image: 'debian:bullseye',
232232
environment: { SSH_KEY: { from_secret: "SSH_KEY" } },
233233
commands: [
234234
'echo "man-db man-db/auto-update boolean false" | debconf-set-selections',
235-
'echo deb http://deb.debian.org/debian sid contrib >/etc/apt/sources.list.d/sid-contrib.list',
235+
'echo deb http://deb.debian.org/debian bullseye contrib >/etc/apt/sources.list.d/bullseye-contrib.list',
236236
apt_get_quiet + ' update',
237237
apt_get_quiet + ' install -y eatmydata',
238238
'eatmydata ' + apt_get_quiet + ' dist-upgrade -y',

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,6 @@ nbproject
113113
/testnet
114114

115115
__pycache__/
116+
117+
# brew build lock file
118+
contrib/brew/Brewfile.lock.json

.gitmodules

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "external/miniupnp"]
2-
path = external/miniupnp
3-
url = https://github.com/miniupnp/miniupnp
41
[submodule "external/rapidjson"]
52
path = external/rapidjson
63
url = https://github.com/Tencent/rapidjson
@@ -28,3 +25,9 @@
2825
[submodule "external/ghc-filesystem"]
2926
path = external/ghc-filesystem
3027
url = https://github.com/gulrak/filesystem.git
28+
[submodule "external/fmt"]
29+
path = external/fmt
30+
url = https://github.com/fmtlib/fmt.git
31+
[submodule "external/oxen-encoding"]
32+
path = external/oxen-encoding
33+
url = https://github.com/oxen-io/oxen-encoding.git

CMakeLists.txt

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ message(STATUS "CMake version ${CMAKE_VERSION}")
5151
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "macOS deployment target (Apple clang only)")
5252

5353
project(beldex
54-
VERSION 4.1.0
54+
VERSION 5.0.0
5555
LANGUAGES CXX C)
56-
set(BELDEX_RELEASE_CODENAME "Bucephalus")
56+
set(BELDEX_RELEASE_CODENAME "Bern")
5757

5858
# String value to append to the full version string; this is intended to easily identify whether a
5959
# binary was build from the release or development branches. This should be permanently set to an
@@ -283,8 +283,7 @@ if(NOT MANUAL_SUBMODULES)
283283
endforeach()
284284
endfunction ()
285285

286-
message(STATUS "Checking submodules")
287-
check_submodule(external/miniupnp)
286+
message(STATUS "Checking submodules")
288287
check_submodule(external/rapidjson)
289288
check_submodule(external/trezor-common)
290289
check_submodule(external/randomx)
@@ -322,7 +321,6 @@ else()
322321
endif()
323322
message(STATUS "Building for a ${ARCH_WIDTH}-bit system")
324323

325-
# Check if we're on FreeBSD so we can exclude the local miniupnpc (it should be installed from ports instead)
326324
# CMAKE_SYSTEM_NAME checks are commonly known, but specifically taken from libsdl's CMakeLists
327325
if(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*|FreeBSD")
328326
set(FREEBSD TRUE)
@@ -357,6 +355,7 @@ if(APPLE)
357355
endif()
358356

359357
option(BUILD_STATIC_DEPS "Download, build and statically link against core dependencies" OFF)
358+
option(HTTPS_AND_SSL "Use https and ssl while statically build" ON)
360359
if(BUILD_STATIC_DEPS)
361360
include(StaticBuild)
362361
endif()
@@ -429,24 +428,6 @@ find_package(Threads)
429428

430429
if (APPLE AND NOT IOS)
431430
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -fvisibility=default")
432-
if (NOT OpenSSL_DIR)
433-
EXECUTE_PROCESS(COMMAND brew --prefix openssl
434-
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
435-
OUTPUT_STRIP_TRAILING_WHITESPACE)
436-
message(STATUS "Using OpenSSL found at ${OPENSSL_ROOT_DIR}")
437-
endif()
438-
endif()
439-
440-
if(BUILD_STATIC_DEPS)
441-
# SSL::* targets already set up
442-
else()
443-
find_package(OpenSSL REQUIRED)
444-
endif()
445-
message(STATUS "Using OpenSSL include dir at ${OPENSSL_INCLUDE_DIR}")
446-
447-
if(MINGW)
448-
# OpenSSL doesn't seem to properly set up its dependencies on Windows, leading to linking errors
449-
target_link_libraries(OpenSSL::Crypto INTERFACE ws2_32)
450431
endif()
451432

452433
add_definition_if_library_exists(c memset_s "string.h" HAVE_MEMSET_S)
@@ -456,7 +437,6 @@ add_definition_if_function_found(strptime HAVE_STRPTIME)
456437
# Generate header for embedded translations
457438
add_subdirectory(translations)
458439

459-
add_library(miniupnpc INTERFACE)
460440
add_library(systemd INTERFACE) # Will do nothing unless we find and enable systemd support
461441

462442
if(NOT TARGET sodium)
@@ -483,12 +463,6 @@ if(NOT TARGET sodium)
483463
export(TARGETS sodium NAMESPACE sodium:: FILE sodium-exports.cmake)
484464
endif()
485465

486-
if (NOT BUILD_STATIC_DEPS)
487-
find_package(PkgConfig REQUIRED)
488-
pkg_check_modules(UNBOUND libunbound REQUIRED IMPORTED_TARGET)
489-
add_library(libunbound INTERFACE)
490-
target_link_libraries(libunbound INTERFACE PkgConfig::UNBOUND)
491-
endif()
492466

493467
option(WITH_SYSTEMD "Attempts to link against and enable systemd daemon notification support" ON)
494468
if (WITH_SYSTEMD AND NOT BUILD_STATIC_DEPS)
@@ -560,7 +534,7 @@ else()
560534
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_FLAG}")
561535
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_FLAG}")
562536

563-
set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-variable -Wno-error=unused-variable -Wno-error=uninitialized")
537+
set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-variable -Wno-error=unused-variable -Wno-error=uninitialized")
564538

565539
option(WARNINGS_AS_ERRORS "Enable warning as errors" OFF)
566540
if(NOT MINGW AND WARNINGS_AS_ERRORS)
@@ -790,20 +764,14 @@ set(Boost_USE_MULTITHREADED TRUE) # Needed for macOS, at least, and won't hurt e
790764
if(BUILD_STATIC_DEPS)
791765
# StaticBuild.cmake sets Boost targets up for us
792766
else()
793-
find_package(Boost 1.58 QUIET REQUIRED COMPONENTS system thread serialization program_options)
767+
find_package(Boost 1.62 QUIET REQUIRED COMPONENTS system thread serialization program_options)
794768
endif()
795769

796770
set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_LIB_SUFFIXES})
797771
if(NOT Boost_FOUND)
798772
message(FATAL_ERROR "Could not find Boost libraries, please make sure you have installed Boost or libboost-all-dev (>=1.58) or the equivalent")
799773
elseif(Boost_FOUND)
800774
message(STATUS "Found Boost Version: ${Boost_VERSION}")
801-
if (OPENSSL_VERSION VERSION_GREATER_EQUAL 1.1 AND (
802-
Boost_VERSION VERSION_LESS 1.62.0 OR (Boost_VERSION VERSION_GREATER 100000 AND Boost_VERSION VERSION_LESS 106200)))
803-
message(FATAL_ERROR "Boost ${Boost_VERSION} (older than 1.62) is too old to link with OpenSSL ${OPENSSL_VERSION} (1.1 or newer) found at ${OPENSSL_INCLUDE_DIR} and ${OPENSSL_LIBRARIES}. "
804-
"Update Boost or install OpenSSL 1.0 and set path to it when running cmake: "
805-
"cmake -DOPENSSL_ROOT_DIR='/usr/include/openssl-1.0'")
806-
endif()
807775
endif()
808776

809777
# Interface target for random extra system libraries that we need to link everything against

Dockerfile

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ RUN set -ex && \
3333

3434
WORKDIR /usr/local/src
3535

36-
ARG OPENSSL_VERSION=1.1.1g
37-
ARG OPENSSL_HASH=ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46
38-
RUN set -ex \
39-
&& curl -s -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
40-
&& echo "${OPENSSL_HASH} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c \
41-
&& tar xf openssl-${OPENSSL_VERSION}.tar.gz \
42-
&& cd openssl-${OPENSSL_VERSION} \
43-
&& ./Configure --prefix=/usr linux-x86_64 no-shared --static \
44-
&& make -j$(nproc) \
45-
&& make install_sw -j$(nproc)
36+
# ARG OPENSSL_VERSION=1.1.1g
37+
# ARG OPENSSL_HASH=ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46
38+
# RUN set -ex \
39+
# && curl -s -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
40+
# && echo "${OPENSSL_HASH} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c \
41+
# && tar xf openssl-${OPENSSL_VERSION}.tar.gz \
42+
# && cd openssl-${OPENSSL_VERSION} \
43+
# && ./Configure --prefix=/usr linux-x86_64 no-shared --static \
44+
# && make -j$(nproc) \
45+
# && make install_sw -j$(nproc)
4646

4747
ARG BOOST_VERSION=1_72_0
4848
ARG BOOST_VERSION_DOT=1.72.0
@@ -95,17 +95,17 @@ RUN set -ex \
9595
&& make install
9696

9797
RUN set -ex \
98-
&& apt install wget -y \
99-
&& wget https://github.com/libexpat/libexpat/releases/download/R_2_3_0/expat-2.3.0.tar.gz \
100-
&& tar xf expat-2.3.0.tar.gz \
101-
&& cd expat-2.3.0 \
102-
&& ./configure --enable-static --prefix=/usr && make && make install
98+
&& apt install wget -y
99+
# && wget https://github.com/libexpat/libexpat/releases/download/R_2_3_0/expat-2.3.0.tar.gz \
100+
# && tar xf expat-2.3.0.tar.gz \
101+
# && cd expat-2.3.0 \
102+
# && ./configure --enable-static --prefix=/usr && make && make install
103103

104104
RUN set -ex \
105105
&& wget https://curl.se/download/curl-7.76.1.tar.gz \
106106
&& tar xf curl-7.76.1.tar.gz \
107107
&& cd curl-7.76.1 \
108-
&& ./configure --with-openssl --enable-static --prefix=/usr && make && make install
108+
&& ./configure --enable-static --prefix=/usr && make && make install
109109

110110
RUN set -ex \
111111
&& apt-get update -y \
@@ -118,20 +118,20 @@ RUN set -ex \
118118
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7 --slave /usr/bin/gcov gcov /usr/bin/gcov-7 \
119119
&& gcc --version
120120

121-
RUN set -ex \
122-
&& apt install libevent-dev -y \
123-
&& wget https://nlnetlabs.nl/downloads/unbound/unbound-1.13.1.tar.gz \
124-
&& tar xf unbound-1.13.1.tar.gz \
125-
&& cd unbound-1.13.1 \
126-
&& ./configure --enable-static --disable-flto --prefix=/usr CFLAGS=-fPIC && make && make install
121+
# RUN set -ex \
122+
# && apt install libevent-dev -y \
123+
# && wget https://nlnetlabs.nl/downloads/unbound/unbound-1.13.1.tar.gz \
124+
# && tar xf unbound-1.13.1.tar.gz \
125+
# && cd unbound-1.13.1 \
126+
# && ./configure --enable-static --disable-flto --prefix=/usr CFLAGS=-fPIC && make && make install
127127

128128
WORKDIR /src
129129
COPY . .
130130

131131
RUN set -ex && \
132132
git submodule update --init --recursive && \
133133
rm -rf build/release && mkdir -p build/release && cd build/release && \
134-
cmake -DSTATIC=ON -DARCH=x86-64 -DCMAKE_BUILD_TYPE=Release ../.. && \
134+
cmake -DSTATIC=ON -DARCH=x86-64 -DHTTPS_AND_SSL=OFF -DCMAKE_BUILD_TYPE=Release ../.. && \
135135
make -j$(nproc) VERBOSE=1
136136

137137
RUN set -ex && \

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ release-test:
101101
102102
release-all:
103103
mkdir -p $(builddir)/release
104-
cd $(builddir)/release && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE)
104+
cd $(builddir)/release && cmake -D BUILD_TESTS=OFF -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE)
105105
106106
release-static:
107107
mkdir -p $(builddir)/release

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,14 @@ library archives (`.a`).
4444
| CMake | 3.10 | NO | `cmake` | `cmake` | `cmake` | NO | |
4545
| pkg-config | any | NO | `pkg-config` | `base-devel` | `pkgconf` | NO | |
4646
| Boost | 1.65 | NO | `libboost-all-dev`[2] | `boost` | `boost-devel` | NO | C++ libraries |
47-
| OpenSSL | basically any | NO | `libssl-dev` | `openssl` | `openssl-devel` | NO | sha256 sum |
4847
| libzmq | 4.3.0 | YES | `libzmq3-dev` | `zeromq` | `zeromq-devel` | NO | ZeroMQ library |
4948
| sqlite3 | ? | YES | `libsqlite3-dev` | `sqlite` | `sqlite-devel` | NO | Beldex Name System |
50-
| libunbound | 1.4.16 | NO | `libunbound-dev` | `unbound` | `unbound-devel` | NO | DNS resolver |
5149
| libsodium | 1.0.9 | YES | `libsodium-dev` | `libsodium` | `libsodium-devel` | NO | cryptography |
52-
| libcurl | 4.0 | NO | `libcurl4-openssl-dev` | `curl` | `curl-devel` | NO | HTTP RPC |
50+
| libcurl | 4.0 | NO | `curl` | `curl-devel` | NO | HTTP | RPC |
5351
| libuv (Win) | any | NO | (Windows only) | -- | -- | NO | RPC event loop |
5452
| libunwind | any | NO | `libunwind8-dev` | `libunwind` | `libunwind-devel` | YES | Stack traces |
5553
| liblzma | any | NO | `liblzma-dev` | `xz` | `xz-devel` | YES | For libunwind |
5654
| libreadline | 6.3.0 | NO | `libreadline-dev` | `readline` | `readline-devel` | YES | Input editing |
57-
| ldns | 1.6.17 | NO | `libldns-dev` | `ldns` | `ldns-devel` | YES | SSL toolkit |
58-
| expat | 1.1 | NO | `libexpat1-dev` | `expat` | `expat-devel` | YES | XML parsing |
5955
| Doxygen | any | NO | `doxygen` | `doxygen` | `doxygen` | YES | Documentation |
6056
| Graphviz | any | NO | `graphviz` | `graphviz` | `graphviz` | YES | Documentation |
6157
| Qt tools | 5.x | NO | `qttools5-dev` | `qt5-tools` | `qt5-linguist` | YES | Translations |
@@ -74,14 +70,14 @@ breakdown of the minimum set of required boost packages.
7470
Install all dependencies at once on Debian/Ubuntu:
7571

7672
```
77-
sudo apt update && sudo apt install build-essential cmake pkg-config libboost-all-dev libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libldns-dev libexpat1-dev doxygen graphviz libpgm-dev libsqlite3-dev libcurl4-openssl-dev
73+
sudo apt update && sudo apt install build-essential cmake pkg-config libboost-all-dev libzmq3-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev doxygen graphviz libpgm-dev libsqlite3-dev curl
7874
```
7975

8076
Install all dependencies at once on macOS with the provided Brewfile:
8177
``` brew update && brew bundle --file=contrib/brew/Brewfile ```
8278

8379
FreeBSD one liner for required to build dependencies
84-
```pkg install git gmake cmake pkgconf boost-libs libzmq4 libsodium sqlite3 openssl unbound miniupnpc```
80+
```pkg install git gmake cmake pkgconf boost-libs libzmq4 libsodium sqlite3 miniupnpc```
8581

8682
### Cloning the repository
8783

@@ -202,13 +198,13 @@ application.
202198
To build for 64-bit Windows:
203199
204200
```bash
205-
pacman -S git mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-unbound
201+
pacman -S git mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-sqlite3
206202
```
207203
208204
To build for 32-bit Windows:
209205
210206
```bash
211-
pacman -S git mingw-w64-i686-toolchain make mingw-w64-i686-cmake mingw-w64-i686-boost mingw-w64-i686-openssl mingw-w64-i686-zeromq mingw-w64-i686-libsodium mingw-w64-i686-hidapi mingw-w64-i686-sqlite3 mingw-w64-i686-unbound
207+
pacman -S git mingw-w64-i686-toolchain make mingw-w64-i686-cmake mingw-w64-i686-boost mingw-w64-i686-zeromq mingw-w64-i686-libsodium mingw-w64-i686-hidapi mingw-w64-i686-sqlite3
212208
```
213209
214210
* Close and reopen the MSYS MinGW shell via `MSYS2 MinGW 64-bit` shortcut on

0 commit comments

Comments
 (0)