Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

23 add hunter #24

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e0bf39e
update build script lin cli testnet
Snider Jan 31, 2023
91c16d0
makefile target: linux-cli-testnet
Snider Jan 31, 2023
bfd6f44
ci update - lin
Snider Jan 31, 2023
9b3beec
removes dep req libboost, icu4c, openssl
Snider Jan 31, 2023
ab81053
adds hunter cache
Snider Jan 31, 2023
8f60452
makefile - add help, static host native compile, macos cli testnet
Snider Feb 1, 2023
2509cdb
update macos binary package script
Snider Feb 1, 2023
2d58509
use boost config vs project config for boost
Snider Feb 1, 2023
8ee3701
boost updates
Snider Feb 1, 2023
3c74aa0
removes deps from macos ci build
Snider Feb 1, 2023
afa4411
ci updates
Snider Feb 1, 2023
f0930c2
hunter cache
Snider Feb 1, 2023
4747fa3
hunter compile type setting
Snider Feb 1, 2023
d9653d2
arch aware filenames + hunter cache
Snider Feb 1, 2023
199ef6b
docker build fix
Snider Feb 1, 2023
90be4f2
hunter cache token env
Snider Feb 1, 2023
6841a46
adds pip install for gitpython
Snider Feb 1, 2023
f075682
adds macos pip install for gitpython
Snider Feb 1, 2023
b0b11b1
adds pythong reqs
Snider Feb 1, 2023
3fea044
macos pip install
Snider Feb 1, 2023
1ae7961
macos hunter debug
Snider Feb 1, 2023
268fc10
macos python fix
Snider Feb 1, 2023
9aa5281
macos python fix
Snider Feb 1, 2023
9d4e76a
linux gui build
Snider Feb 1, 2023
ec9d279
windows testnet build cli
Snider Feb 1, 2023
32d0460
windows testnet build cli
Snider Feb 1, 2023
97dc005
windows testnet build cli
Snider Feb 1, 2023
eed1251
windows testnet build cli
Snider Feb 1, 2023
b333421
windows debug for the python hack
Snider Feb 1, 2023
cfe934b
windows python hack
Snider Feb 1, 2023
9f8d64b
windows python hack
Snider Feb 1, 2023
a2663b6
windows python hack
Snider Feb 1, 2023
3702be5
windows python hack
Snider Feb 1, 2023
a668803
windows python hack
Snider Feb 1, 2023
fce69b5
windows python hack
Snider Feb 1, 2023
c467fcc
windows python hack
Snider Feb 1, 2023
a2fdad9
windows python hack
Snider Feb 1, 2023
7d130b8
windows python hack
Snider Feb 1, 2023
e995eb7
windows build update
Snider Feb 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
build
.idea
poolstate_lmdb_v1
blockchain_lmdb_v1
lethean-*
lock.lck
market.bin
miner_conf.json
p2pstate.bin
profile_details.log
77 changes: 36 additions & 41 deletions .github/workflows/cli-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- '**.md'

env:
HUNTER_CACHE_TOKEN: ${{ secrets.HUNTER_CACHE_TOKEN }}
CCACHE_SETTINGS: |
ccache --max-size=150M
ccache --set-config=compression=true
Expand All @@ -29,21 +30,28 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
- uses: actions/cache@v3
- name: Process Hunter Cache
uses: actions/cache@v3
with:
path: /home/runner/.hunter
key: hunter-${{ runner.os }}
restore-keys: hunter-${{ runner.os }}
- name: Process Ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-build-testnet-cli-${{ github.sha }}
restore-keys: ccache-${{ runner.os }}-build-testnet-cli-
key: ccache-${{ runner.os }}-build-testnet-cli
restore-keys: ccache-${{ runner.os }}-build-testnet-cli
- name: update apt
run: sudo apt update & sudo apt-get upgrade -y
run: sudo apt update
- name: install dependencies
run: sudo apt-get install -y python-dev autotools-dev libboost-all-dev libicu-dev libbz2-dev git screen checkinstall zlib1g-dev ccache miniupnpc
run: |
sudo apt-get install -y python-dev autotools-dev libbz2-dev git screen checkinstall zlib1g-dev ccache miniupnpc
pip install gitpython requests
- name: build server
run: |
${{env.CCACHE_SETTINGS}}
./utils/build/testnet_linux_cli.sh
- name: Move Tarball
run: cd build/release && mv lethean-linux-cli-*.tar.bz2 ../../
- uses: actions/upload-artifact@v3
with:
name: lethean-linux-cli
Expand All @@ -67,26 +75,28 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
- uses: actions/cache@v3
- name: Process Hunter Cache
uses: actions/cache@v3
with:
path: /Users/runner/.hunter
key: hunter-${{ runner.os }}
restore-keys: hunter-${{ runner.os }}
- name: Process ccache
uses: actions/cache@v3
with:
path: /Users/runner/Library/Caches/ccache
key: ccache-${{ runner.os }}-build-testnet-cli
restore-keys: ccache-${{ runner.os }}-build-testnet-cli
- name: hacky python fix
run: |
cd /usr/local/Frameworks/Python.framework/Versions/3.11/bin/
./pip3 install requests gitpython
- name: install dependencies
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl boost icu4c ccache miniupnpc
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache miniupnpc
- name: build server
env:
PKG_CONFIG_PATH: "/usr/local/opt/openssl@3/lib/pkgconfig"
OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3"
ZANO_BOOST_ROOT: "/opt/homebrew/opt/boost"
ZANO_BOOST_LIBS_PATH: "/opt/homebrew/opt/boost/lib"
CMAKE_OSX_SYSROOT: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk"
run: |
${{env.CCACHE_SETTINGS}}
export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/opt/icu4c/lib
./utils/build/testnet_mac_osx_cli.sh
- name: Move Tarball
run: cd build/release && mv lethean-macos-cli-*.tar.bz2 ../../
- uses: actions/upload-artifact@v3
with:
name: lethean-macos-cli
Expand Down Expand Up @@ -115,36 +125,21 @@ jobs:
restore-keys: ccache-${{ runner.os }}-build-testnet-cli
- name: Eat the Choco
run: |
choco install openssl --version 1.1.1.1500 -y
choco install ccache -y
choco install zip -y
- name: install msvc toolset
uses: ilammy/msvc-dev-cmd@v1
- name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
boost_version: 1.80.0
platform_version: 2022
toolset: msvc
link: static
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: hacky python fix
shell: cmd
working-directory: C:/hostedtoolcache/windows/Python/3.11.1/x86/
run: |
curl https://bootstrap.pypa.io/get-pip.py -o C:/hostedtoolcache/windows/Python/3.11.1/x86/get-pip.py
C:/hostedtoolcache/windows/Python/3.11.1/x86/python C:/hostedtoolcache/windows/Python/3.11.1/x86/get-pip.py
C:/hostedtoolcache/windows/Python/3.11.1/x86/Scripts/pip.exe install requests gitpython
- name: build server
env:
QT_PREFIX_PATH: C:\ProgramData\chocolatey\lib\Qt5.11.2\5.11.2
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
LOCAL_BOOST_PATH: ${{ steps.install-boost.outputs.BOOST_ROOT }}
OPENSSL_ROOT_DIR: "C:\\Program Files\\OpenSSL-Win64"
run: |
refreshenv
${{env.CCACHE_SETTINGS}}
.\utils\build\testnet_windows_cli.bat
./utils/build/testnet_windows_cli.bat
- uses: actions/upload-artifact@v3
with:
name: lethean-windows-cli
Expand Down
25 changes: 25 additions & 0 deletions .idea/jsonSchemas.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 39 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
cmake_minimum_required(VERSION 2.8.6)

list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake")
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")

include(HunterGate)
include(Hunter/HunterCacheServers)
set(HUNTER_CONFIGURATION_TYPES Release CACHE STRING "Build type of Hunter packages")
set(HUNTER_JOBS_NUMBER 6 CACHE STRING "Number of parallel builds used by Hunter")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.24.15.tar.gz"
SHA1 "8010d63d5ae611c564889d5fe12d3cb7a45703ac"
LOCAL
)

PROJECT(Lethean)

Expand Down Expand Up @@ -43,7 +53,8 @@ set(VERSION "1.0")
# cmake_policy(SET CMP0020 OLD)
# endif()

include(ConfigOpenSSL)
hunter_add_package(OpenSSL)
find_package(OpenSSL REQUIRED)

if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
add_definitions(-DMOBILE_WALLET_BUILD)
Expand All @@ -62,22 +73,29 @@ endif()

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# build types
if (UNIX AND NOT APPLE)
# single configurations, defaults to Release
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
else()
# multi configurations for MSVC and XCode
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_CONFIGURATION_TYPES "Release")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
else()
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
endif()

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
if (NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
endif()
# build types
#if (UNIX AND NOT APPLE)
# # single configurations, defaults to Release
# if (NOT CMAKE_BUILD_TYPE)
# set(CMAKE_BUILD_TYPE "Release")
# endif()
#else()
# # multi configurations for MSVC and XCode
# if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
# set(CMAKE_CONFIGURATION_TYPES "Release")
# elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
# set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
# else()
# set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
# endif()
#endif()
message("Generated with config types: ${CMAKE_CONFIGURATION_TYPES}, and built type: ${CMAKE_BUILD_TYPE}")

enable_testing()
Expand Down Expand Up @@ -220,6 +238,8 @@ else()
endif()
endif()

hunter_add_package(ICU)
find_package(ICU CONFIG REQUIRED)

if(MSVC)
set(Boost_USE_STATIC_LIBS ON)
Expand All @@ -244,11 +264,10 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(Boost_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}/${CMAKE_ANDROID_ARCH_ABI}/")
set(Boost_LIBRARIES "${Boost_LIBRARY_DIRS}libboost_system.a;${Boost_LIBRARY_DIRS}libboost_filesystem.a;${Boost_LIBRARY_DIRS}libboost_thread.a;${Boost_LIBRARY_DIRS}libboost_timer.a;${Boost_LIBRARY_DIRS}libboost_date_time.a;${Boost_LIBRARY_DIRS}libboost_chrono.a;${Boost_LIBRARY_DIRS}libboost_regex.a;${Boost_LIBRARY_DIRS}libboost_serialization.a;${Boost_LIBRARY_DIRS}libboost_atomic.a;${Boost_LIBRARY_DIRS}libboost_program_options.a")
else()
find_package(Boost 1.70 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale)
hunter_add_package(Boost COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale log)
find_package(Boost 1.80 CONFIG REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale)
endif()



message(STATUS "Boost: ${Boost_VERSION} from ${Boost_LIBRARY_DIRS}")


Expand Down
34 changes: 26 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ endif

cmake = cmake $(cmake_gen)

cmake_debug = $(cmake) -D CMAKE_BUILD_TYPE=Debug -D MUTE_ERRORS=FALSE
cmake_release = $(cmake) -D CMAKE_BUILD_TYPE=Release
cmake_debug = -D CMAKE_BUILD_TYPE=Debug -D MUTE_ERRORS=FALSE
cmake_release = -D CMAKE_BUILD_TYPE=Release

cmake_gui = -D BUILD_GUI=ON
cmake_testnet = -D TESTNET=ON
Expand All @@ -28,7 +28,7 @@ build = build
dir_debug = $(build)/debug
dir_release = $(build)/release

all: release
all: help

release:
$(eval command += $(cmake_release))
Expand All @@ -51,9 +51,9 @@ static-release:
$(eval command += $(cmake_release) $(cmake_static))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)

static-release-testnet:
$(eval command += $(cmake_release) $(cmake_static) $(cmake_testnet))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
static-release-testnet: ## Compile static CLI binaries
cmake -H. -B$(dir_release) $(cmake_release) $(cmake_static) $(cmake_testnet)
cmake --build $(dir_release) --

#
# GUI
Expand Down Expand Up @@ -96,10 +96,28 @@ test-debug:
clean:
rm -rf build

macos-gui:
bash ./utils/build_script_mac_osx.sh
macos-gui-testnet:
bash ./utils/build/testnet_mac_osx_gui.sh

linux-gui-testnet: ## Build Linux GUI packaged archive
bash ./utils/build/testnet_linux_gui.sh

macos-cli-testnet: ## Build Macos CLI packaged archive
bash ./utils/build/testnet_mac_osx_cli.sh

linux-cli-testnet: ## Build Linux CLI packaged archive
bash ./utils/build/testnet_linux_cli.sh

windows-cli-testnet: ## Build Windows CLI packaged archive
./utils/build/testnet_windows_cli.sh


help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m make %-30s\033[0m %s\n", $$1, $$2}'


tags:
ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest

.PHONY: all release debug static static-release gui gui-release gui-static gui-release-static gui-debug test test-release test-debug clean tags macos-gui
.PHONY: linux-cli-testnet macos-cli-testnet macos-gui-testnet linux-gui-testnet windows-cli-testnet help
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (APPLE AND NOT IOS)
message(STATUS "Using OpenSSL found at ${OPENSSL_ROOT_DIR}")
endif()
endif()

hunter_add_package(OpenSSL)
find_package(OpenSSL REQUIRED)
message(STATUS "Using OpenSSL include dir at ${OPENSSL_INCLUDE_DIR}")
include_directories(${OPENSSL_INCLUDE_DIR})
Expand Down
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions cmake/Hunter/HunterCacheServers-passwords.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Cable: CMake Bootstrap Library.
# Copyright 2018 Pawel Bylica.
# Licensed under the Apache License, Version 2.0. See the LICENSE file.

# Hunter passwords file used by HunterCacheServers.cmake.
# Do not include directly.

hunter_upload_password(
# REPO_OWNER + REPO = https://github.com/letheanVPN/hunter-cache
REPO_OWNER letheanVPN
REPO hunter-cache

# USERNAME = https://github.com/snider
USERNAME snider

# PASSWORD = GitHub token saved as a secure environment variable
PASSWORD "$ENV{HUNTER_CACHE_TOKEN}"
)
27 changes: 27 additions & 0 deletions cmake/Hunter/HunterCacheServers.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Cable: CMake Bootstrap Library.
# Copyright 2018 Pawel Bylica.
# Licensed under the Apache License, Version 2.0. See the LICENSE file.

# This module, when included, sets default values for params related to
# Hunter cache servers, including upload options.

# Default Hunter cache servers.
set(HUNTER_CACHE_SERVERS
"https://github.com/letheanVPN/hunter-cache"
CACHE STRING "Hunter cache servers")

# Default path to Hunter passwords file containing information how to access
# Ethereum's cache server.
set(HUNTER_PASSWORDS_PATH
${CMAKE_CURRENT_LIST_DIR}/HunterCacheServers-passwords.cmake
CACHE STRING "Hunter passwords file")

# In CI builds upload the binaries if the HUNTER_CACHE_TOKEN was decrypted
# (only for branches and internal PRs).
if(NOT "$ENV{HUNTER_CACHE_TOKEN}" STREQUAL "")
set(run_upload YES)
else()
set(run_upload NO)
endif()
option(HUNTER_RUN_UPLOAD "Upload binaries to the Hunter cache server" ${run_upload})
unset(run_upload)
1 change: 1 addition & 0 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hunter_config(Boost VERSION 1.81.0 CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON)
Loading