Skip to content

Commit

Permalink
Merge branch 'SAGA-develop' of https://github.com/decenomy/DSW
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-at-decenomy committed Feb 5, 2024
2 parents e9d77f2 + 60a155b commit 2732f2e
Show file tree
Hide file tree
Showing 38 changed files with 4,448 additions and 75 deletions.
144 changes: 144 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: Build and Extract Files from Docker Container

on:
push:
branches:
- master

jobs:
build-files-linux-x64:
runs-on: ubuntu-22.04
if: ${{ false }} # Set condition to false to make the workflow inactive

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Build and Extract Files from Docker Container
run: |
# Build the Docker image from the Dockerfile in the repository
docker build \
--build-arg CPU_CORES=$(nproc) \
--build-arg TICKER=__DSW__ \
--build-arg NAME=__Decenomy__ \
--build-arg BASE_NAME=__decenomy__ \
--build-arg TARGET=master \
-t __decenomy__-linux-x64-build \
-f contrib/docker/Dockerfile.dsw-linux-x64-wallet .
# Start the container (if it's not already running)
docker run -d --name __decenomy__-linux-x64-build-container __decenomy__-linux-x64-build
# Create a temporary directory to hold the extracted files
mkdir release_files
# Copy files from the Docker container to the local filesystem
docker cp __decenomy__-linux-x64-build-container:/__DSW__/deploy/linux-x64 release_files/
- name: Archive and Upload Extracted Files
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: release_files
build-files-linux-arm64:
runs-on: ubuntu-22.04
if: ${{ false }} # Set condition to false to make the workflow inactive

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Build and Extract Files from Docker Container
run: |
# Build the Docker image from the Dockerfile in the repository
docker build \
--build-arg CPU_CORES=$(nproc) \
--build-arg TICKER=__DSW__ \
--build-arg NAME=__Decenomy__ \
--build-arg BASE_NAME=__decenomy__ \
--build-arg TARGET=master \
-t __decenomy__-linux-arm64-build \
-f contrib/docker/Dockerfile.dsw-linux-arm64-wallet .
# Start the container (if it's not already running)
docker run -d --name __decenomy__-linux-arm64-build-container __decenomy__-linux-arm64-build
# Create a temporary directory to hold the extracted files
mkdir release_files
# Copy files from the Docker container to the local filesystem
docker cp __decenomy__-linux-arm64-build-container:/__DSW__/deploy/linux-arm64 release_files/
- name: Archive and Upload Extracted Files
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: release_files
build-windows-x64:
runs-on: ubuntu-22.04
if: ${{ false }} # Set condition to false to make the workflow inactive

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Build and Extract Files from Docker Container
run: |
# Build the Docker image from the Dockerfile in the repository
docker build \
--build-arg CPU_CORES=$(nproc) \
--build-arg TICKER=__DSW__ \
--build-arg NAME=__Decenomy__ \
--build-arg BASE_NAME=__decenomy__ \
--build-arg TARGET=master \
-t __decenomy__-windows-x64-build \
-f contrib/docker/Dockerfile.dsw-windows-x64-wallet .
# Start the container (if it's not already running)
docker run -d --name __decenomy__-windows-x64-build-container __decenomy__-windows-x64-build
# Create a temporary directory to hold the extracted files
mkdir release_files
# Copy files from the Docker container to the local filesystem
docker cp __decenomy__-windows-x64-build-container:/__DSW__/deploy/windows-x64 release_files/
- name: Archive and Upload Extracted Files
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: release_files
build-macos-x64:
runs-on: ubuntu-22.04
if: ${{ false }} # Set condition to false to make the workflow inactive

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Build and Extract Files from Docker Container
run: |
# Build the Docker image from the Dockerfile in the repository
docker build \
--build-arg CPU_CORES=$(nproc) \
--build-arg TICKER=__DSW__ \
--build-arg NAME=__Decenomy__ \
--build-arg BASE_NAME=__decenomy__ \
--build-arg TARGET=master \
-t __decenomy__-macos-x64-build \
-f contrib/docker/Dockerfile.dsw-macos-x64-wallet .
# Start the container (if it's not already running)
docker run -d --name __decenomy__-macos-x64-build-container __decenomy__-macos-x64-build
# Create a temporary directory to hold the extracted files
mkdir release_files
# Copy files from the Docker container to the local filesystem
docker cp __decenomy__-macos-x64-build-container:/__DSW__/deploy/macos-x64 release_files/
- name: Archive and Upload Extracted Files
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: release_files
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ if(OPENSSL_FOUND)
endif()
endif()

find_package(CURL REQUIRED)
# Add libcurl include directories
target_include_directories(WALLET_A ${CURL_INCLUDE_DIRS})
# Link against libcurl
target_link_libraries(WALLET_A ${CURL_LIBRARIES})

find_package(LibEvent REQUIRED)

find_package(GMP)
Expand Down
115 changes: 85 additions & 30 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 4)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_BUILD, 2)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2022)
define(_COPYRIGHT_YEAR, 2024)
AC_INIT([CryptoSaga Core],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_REVISION, m4_if(_CLIENT_VERSION_BUILD, [0], [], _CLIENT_VERSION_BUILD))m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/cryptosagacoin/SAGA/issues],[cryptosaga],[http://www.cryptosaga.net/])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADERS([src/config/pivx-config.h])
Expand All @@ -18,6 +18,8 @@ BITCOIN_GUI_NAME=cryptosaga-qt
BITCOIN_CLI_NAME=cryptosaga-cli
BITCOIN_TX_NAME=cryptosaga-tx

BOOTSTRAP_URL_DEFAULT=https://bootstraps.decenomy.net/

dnl Unless the user specified ARFLAGS, force it to be cr
AC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to <cr> if not set])
if test "x${ARFLAGS+set}" != "xset"; then
Expand Down Expand Up @@ -113,13 +115,27 @@ AC_ARG_WITH([params-dir],
],
[params_path=""])

# Allow the user to specify a different value for BOOTSTRAP_URL
AC_ARG_WITH([bootstrap-url],
[AS_HELP_STRING([--with-bootstrap-url=URL],
[URL for bootstrap data])],
[BOOTSTRAP_URL="$withval"],
[BOOTSTRAP_URL="$BOOTSTRAP_URL_DEFAULT"])

# Enable wallet
AC_ARG_ENABLE([wallet],
[AS_HELP_STRING([--disable-wallet],
[disable wallet (enabled by default)])],
[enable_wallet=$enableval],
[enable_wallet=yes])

# Enable bootstrap
AC_ARG_ENABLE([bootstrap],
[AS_HELP_STRING([--disable-bootstrap],
[disable bootstrap (enabled by default)])],
[enable_bootstrap=$enableval],
[enable_bootstrap=yes])

AC_ARG_WITH([miniupnpc],
[AS_HELP_STRING([--with-miniupnpc],
[enable UPNP (default is yes if libminiupnpc is found)])],
Expand Down Expand Up @@ -501,6 +517,12 @@ case $host in
AC_MSG_ERROR("windres not found")
fi

# Check for curl-config
AC_PATH_PROG([CURL_CONFIG], [curl-config], none, [$prefix/bin])
if test x$CURL_CONFIG = xnone; then
AC_MSG_ERROR("curl-config not found")
fi

CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
if test "x$CXXFLAGS_overridden" = "xno"; then
CXXFLAGS="$CXXFLAGS -w"
Expand Down Expand Up @@ -1056,6 +1078,8 @@ if test x$use_pkgconfig = xyes; then
PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)])
PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])])
PKG_CHECK_MODULES([CURL], [libcurl],, [AC_MSG_ERROR(curl not found.)])
PKG_CHECK_MODULES([ZLIB], [zlib],, [AC_MSG_ERROR(zlib not found.)])
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode],,[BITCOIN_QT_FAIL(libqrencode not found)])])
if test x$use_qtcharts != xno; then
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([CHARTS], [Qt5Charts],[have_qtcharts=yes], [have_qtcharts=no])])
Expand All @@ -1077,6 +1101,7 @@ if test x$use_pkgconfig = xyes; then
else
AC_DEFINE_UNQUOTED([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])
fi
]
)
else
Expand Down Expand Up @@ -1119,6 +1144,20 @@ else

BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], BITCOIN_QT_FAIL(libprotobuf not found)))

AC_CHECK_HEADER([curl/curl.h],, AC_MSG_ERROR(curl headers missing),)
AC_CHECK_LIB([curl] ,[main],[CURL_LIBS=-lcurl], AC_MSG_ERROR(curl not found))

# Use curl-config to get libcurl flags and add -DCURL_STATICLIB to CURL_CFLAGS
if test "x$CURL_CONFIG" != "xnone"; then
CURL_CONFIG_CFLAGS=`$CURL_CONFIG --cflags`
CURL_CFLAGS="$CURL_CFLAGS -DCURL_STATICLIB $CURL_CONFIG_CFLAGS"
CURL_CONFIG_LIBS=`$CURL_CONFIG --libs`
CURL_LIBS="$CURL_LIBS $CURL_CONFIG_LIBS"
fi

AC_CHECK_HEADER([zlib.h],, AC_MSG_ERROR(zlib headers missing),)
AC_CHECK_LIB([z] ,[main],[ZLIB_LIBS=-lz], AC_MSG_ERROR(zlib not found))

BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], BITCOIN_QT_FAIL(libqrencode not found))])
BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, BITCOIN_QT_FAIL(libqrencode not found))])
if test x$use_qtcharts != xno; then
Expand Down Expand Up @@ -1228,6 +1267,16 @@ else
AC_MSG_RESULT(no)
fi

dnl enable bootstrap
AC_MSG_CHECKING([if bootstrap should be enabled])
if test x$enable_bootstrap != xno; then
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED([ENABLE_BOOTSTRAP],[1],[Define to 1 to enable bootstrap functions])

else
AC_MSG_RESULT(no)
fi

dnl enable upnp support
AC_MSG_CHECKING([whether to build with support for UPnP])
if test x$have_miniupnpc = xno; then
Expand Down Expand Up @@ -1322,6 +1371,7 @@ AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])
AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
AM_CONDITIONAL([ENABLE_BOOTSTRAP],[test x$enable_bootstrap = xyes])
AM_CONDITIONAL([ENABLE_TESTS],[test x$BUILD_TEST = xyes])
AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])
AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$BUILD_TEST_QT = xyes])
Expand All @@ -1346,6 +1396,7 @@ AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build])
AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release])
AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Version is release])
AC_DEFINE_UNQUOTED(PARAMS_DIR, ["$params_path"], [Path to the zk params dir during unit tests on windows])
AC_DEFINE_UNQUOTED([BOOTSTRAP_URL], ["$BOOTSTRAP_URL"], [URL for bootstrap data])
AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR)
AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR)
AC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION)
Expand Down Expand Up @@ -1391,6 +1442,8 @@ AC_SUBST(EVENT_LIBS)
AC_SUBST(EVENT_PTHREADS_LIBS)
AC_SUBST(ZMQ_LIBS)
AC_SUBST(PROTOBUF_LIBS)
AC_SUBST(CURL_LIBS)
AC_SUBST(ZLIB_LIBS)
AC_SUBST(QR_LIBS)
AC_SUBST(USE_NUM_GMP)
AC_SUBST(USE_NUM_OPENSSL)
Expand Down Expand Up @@ -1462,37 +1515,39 @@ esac

echo
echo "Options used to compile and link:"
echo " with wallet = $enable_wallet"
echo " with gui / qt = $bitcoin_enable_qt"
echo " with wallet = $enable_wallet"
echo " with bootstrap = $enable_bootstrap"
echo " bootstrap url = $BOOTSTRAP_URL"
echo " with gui / qt = $bitcoin_enable_qt"
if test x$bitcoin_enable_qt != xno; then
echo " with qtcharts = $use_qtcharts"
fi
echo " with zmq = $use_zmq"
echo " with test = $use_tests"
echo " with bench = $use_bench"
echo " with upnp = $use_upnp"
echo " with params = $params_path"
echo " use asm = $use_asm"
echo " sanitizers = $use_sanitizers"
echo " debug enabled = $enable_debug"
echo " gprof enabled = $enable_gprof"
echo " werror = $enable_werror"
echo " host = $host"
echo " with zmq = $use_zmq"
echo " with test = $use_tests"
echo " with bench = $use_bench"
echo " with upnp = $use_upnp"
echo " with params = $params_path"
echo " use asm = $use_asm"
echo " sanitizers = $use_sanitizers"
echo " debug enabled = $enable_debug"
echo " gprof enabled = $enable_gprof"
echo " werror = $enable_werror"
echo " host = $host"
echo
echo " target os = $TARGET_OS"
echo " build os = $BUILD_OS"
echo " target os = $TARGET_OS"
echo " build os = $BUILD_OS"
echo
echo " CC = $CC"
echo " CFLAGS = $CFLAGS"
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CPPFLAGS"
echo " CXX = $CXX"
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS"
echo " LDFLAGS = $PTHREAD_CFLAGS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
echo " ARFLAGS = $ARFLAGS"
echo " PIC_FLAGS = $PIC_FLAGS"
echo " QT_PIE_FLAGS = $QT_PIE_FLAGS"
echo " SVG_LIBS = $QT_SVG_LIBS "
echo " SVG_CFLAGS = $QT_SVG_INCLUDES "
echo " CHARTS_LIBS = $CHARTS_LIBS "
echo " CHARTS_CFLAGS = $CHARTS_CFLAGS "
echo " CC = $CC"
echo " CFLAGS = $CFLAGS"
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CPPFLAGS"
echo " CXX = $CXX"
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS"
echo " LDFLAGS = $PTHREAD_CFLAGS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
echo " ARFLAGS = $ARFLAGS"
echo " PIC_FLAGS = $PIC_FLAGS"
echo " QT_PIE_FLAGS = $QT_PIE_FLAGS"
echo " SVG_LIBS = $QT_SVG_LIBS "
echo " SVG_CFLAGS = $QT_SVG_INCLUDES "
echo " CHARTS_LIBS = $CHARTS_LIBS "
echo " CHARTS_CFLAGS = $CHARTS_CFLAGS "
echo
Loading

0 comments on commit 2732f2e

Please sign in to comment.