1
0
Fork 0
forked from lthn/blockchain

Compare commits

...
Sign in to create a new pull request.

56 commits

Author SHA1 Message Date
Snider
1674deb771
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-05 13:27:26 +01:00
Snider
1f3c167427
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-05 13:27:04 +01:00
Snider
6bc491e7e2
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-05 13:26:24 +01:00
Snider
7bdc12bcff
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-05 13:26:10 +01:00
Snider
f93ab75384 Update action.yml 2025-10-05 13:23:39 +01:00
Snider
9507316f69 Update Dockerfile 2025-10-05 13:21:01 +01:00
Snider
9fe542bdd1 merge prep 2025-10-05 13:05:51 +01:00
Snider
6a8cd52802 Add new seed node and improve build scripts
Added a new hardcoded seed node (34.13.212.174) for both mainnet and testnet in net_node.inl. Updated Makefile to separate dependency installation into a new 'build-deps' target and improved configure messaging. CMakeLists.txt now prints the CMake version being used. Also commented out a connection close call after handshake for further review.
2025-10-05 12:45:46 +01:00
Snider
391f9a5a63 Update address prefix macros and enable connection close
Uncommented the call to close the connection after handshake in net_node.inl to ensure proper connection handling.
2025-10-03 20:23:19 +01:00
Snider
d75019350e Add docker-compose and update lthn-chain Dockerfile
Introduces a docker-compose.yml for the lethean-chain service with build arguments and volume mapping. Updates the lthn-chain Dockerfile to expose required ports and modifies the entrypoint to include data directory and additional flags.
2025-10-02 19:22:10 +01:00
Snider
d258daca4c Update build-windows-intel.yml 2025-10-02 14:05:05 +01:00
Snider
34e3224b72 Update build-windows-intel.yml 2025-10-02 13:52:13 +01:00
Snider
e2b3ed9825 Update build-windows-intel.yml 2025-10-02 13:42:00 +01:00
Snider
764fae7977 Update build-windows-intel.yml 2025-10-02 13:24:17 +01:00
Snider
bf59665902 Update build-windows-intel.yml 2025-10-02 13:23:33 +01:00
Snider
34835fdbc7 Update build-windows-intel.yml 2025-10-02 13:02:22 +01:00
Snider
031856ec0a Update build-windows-intel.yml 2025-10-02 12:49:43 +01:00
Snider
26fe9eb243 Update Makefile 2025-10-02 12:43:22 +01:00
Snider
426214c749 Update build-windows-intel.yml 2025-10-02 12:34:52 +01:00
Snider
1ce5ba1d92 Update build-windows-intel.yml 2025-10-02 12:26:02 +01:00
Snider
30f17eed8f Update MSVC toolset and comment out CPack config options
Set the MSVC toolset to 14.3 in the Windows workflow. Commented out several CPack configuration options in CPackConfig.cmake, including install prefixes and package generator settings for all platforms, likely to disable or defer packaging configuration.
2025-10-02 12:21:46 +01:00
Snider
e47280554d Update build-windows-intel.yml 2025-10-02 12:16:11 +01:00
Snider
f4b33fce19 Update build-windows-intel.yml 2025-10-02 12:04:50 +01:00
Snider
aed34e103d Update build-windows-intel.yml 2025-10-02 12:01:59 +01:00
Snider
bcb5f366e5 Update MSVC setup and set build type to Release
Adds TheMrMilchmann/setup-msvc-dev action to the Windows workflow with toolset 17.11.5 and x64 architecture. Also sets build_type to Release in the MSVC 194 x86_64 CMake profile.
2025-10-02 11:57:28 +01:00
Snider
747853297e Fix Windows build by clearing CFLAGS/CXXFLAGS in Makefile
Adds logic to the Makefile to clear CFLAGS and CXXFLAGS when running Conan on Windows, addressing issues caused by problematic environment variables. This ensures consistent build behavior across platforms.
2025-10-02 11:40:00 +01:00
Snider
299cdf9521 Update Makefile 2025-10-02 01:13:29 +01:00
Snider
ec7951afd5 Update Docker build env and MSVC C++ standard
Set DOCKER_BUILD_SUMMARY and DOCKER_BUILD_RECORD_UPLOAD to false in the GitHub Actions workflow to control Docker build output. Update MSVC profile to use C++17 instead of C++14 for improved language features and compatibility.
2025-10-02 00:59:47 +01:00
Snider
9290ec794f Update build process and Dockerfile dependencies
Refactored Makefile to use $(BUILD_FOLDER) and updated Conan and CMake commands for improved flexibility. Dockerfile now installs additional mkdocs plugins and uses 'make build' instead of 'make release' for building, aligning with updated Makefile targets.
2025-10-02 00:49:42 +01:00
Snider
32e31bd11d Update Makefile 2025-10-02 00:31:50 +01:00
Snider
e83edb7661 Refactor Docker build workflow and update build configs
Simplifies the GitHub Actions Docker build workflow by removing matrix builds and standardizing steps. Updates the MSVC CMake profile to use C++14 instead of C++17. Removes an unused make configure step from the Dockerfile.
2025-10-02 00:27:45 +01:00
Snider
973baa12c0 Update CI workflows and Makefile for improved builds
Refactors the Docker build workflow to use a matrix for multi-arch builds, updates build arguments, and improves Docker image tagging. Disables Conan package caching on Linux ARM64 and macOS Intel workflows. Changes the Windows build to use the 'msvc-194-x86_64' target and updates artifact paths accordingly. Enhances the Makefile to pass additional CMake variables and run cpack after building.
2025-10-02 00:08:44 +01:00
Snider
370ec64a53 Disable Conan package caching in CI workflows
Set cache_packages to false in build workflows for Linux, macOS ARM64, and Windows Intel. This change ensures Conan does not use cached packages during CI builds, which may help avoid issues with stale or incompatible dependencies.
2025-10-01 23:57:05 +01:00
Snider
eadf6ebfec Refactor CI workflows and build process
Enable Conan package caching and remove redundant doc build steps from all platform workflows. Update Makefile to ensure docs are built as part of the release target. Clean up MSVC runtime variable logic in conanfile.py and adjust Docker workflow runner and build args.
2025-10-01 23:52:43 +01:00
Snider
eba315040c Update build-docker.yml 2025-10-01 23:35:46 +01:00
Snider
c8b2735cff Refactor Docker build and Makefile for improved CI/CD
Streamlines Docker build workflow by introducing a builder target and registry-based build cache in GitHub Actions. Refactors the Makefile to improve static/dynamic build flag handling, adds MSVC support, and separates configure/build steps. Updates Dockerfile to use new Makefile targets, simplifies build context handling, and fixes artifact copying. Removes redundant Docker build targets from the Makefile and enhances Conan MSVC runtime configuration.
2025-10-01 23:33:44 +01:00
Snider
1f90b3350e Update Makefile 2025-10-01 22:34:03 +01:00
Snider
9389b67880 Add STATIC build option and update CI workflows
Introduces a STATIC flag to the Makefile for controlling static builds, passing the appropriate Conan and CMake options. Updates the Windows CI workflow to use STATIC=1 for release builds and adjusts Docker build arguments for consistency.
2025-10-01 22:28:07 +01:00
Snider
87605db373 Update Docker build workflow and CPack config
Refactored the Docker build workflow to use a single job with multi-platform support and removed the manifest creation step. Cleaned up the macOS build workflow by removing unnecessary Homebrew installs. Updated CPackConfig.cmake to set the install prefix by default and fixed the documentation install destination to use PROJECT_NAME.
2025-10-01 21:55:16 +01:00
Snider
235b0cb41b Add documentation build steps to CI workflows
Introduces a reusable GitHub Action for building documentation and updates all platform build workflows to install documentation dependencies and run 'make docs'. This ensures documentation is built and available as part of the CI process across Linux, macOS, and Windows. Also updates the docs workflow to adjust pip dependencies.
2025-10-01 21:10:21 +01:00
Snider
c70b383ce6 Update build-docker.yml 2025-10-01 20:50:30 +01:00
Snider
d11cee2229 Update build-docker.yml 2025-10-01 20:45:28 +01:00
Snider
56bb2a1abf Update build-docker.yml 2025-10-01 20:29:12 +01:00
Snider
f9f249be28 Update build-docker.yml 2025-10-01 20:26:45 +01:00
Snider
38d6a183d4 Update build-docker.yml 2025-10-01 20:25:45 +01:00
Snider
79034cbbbf Update build-docker.yml 2025-10-01 20:20:24 +01:00
Snider
6987a33f83 Add multi-arch Docker build and manifest to CI workflow
Refactors the build-docker GitHub Actions workflow to build and push Docker images for both amd64 and arm64 architectures using a matrix strategy. Adds a manifest job to create and push a multi-arch manifest for the lthn/chain image, supporting both 'testnet' and 'latest' tags based on input.
2025-10-01 20:19:06 +01:00
Snider
0089a308fd Update conanfile.py 2025-10-01 18:26:40 +01:00
Snider
34a5d6bea1 Update CMake toolchain file path in Makefile
Changed the CMake toolchain file path in the 'configure' target to use 'build/release/generators/conan_toolchain.cmake' instead of 'build/release/conan_toolchain.cmake' to match the new Conan output structure.
2025-10-01 18:23:43 +01:00
Snider
f5b66b4fd9 Update artifact tag suffix and build folder name
Appends 'alpha' to artifact tag suffix for pull requests in the GitHub Action and changes the build folder name from 'build/Release' to 'build/release' in the Makefile for consistency.
2025-10-01 18:19:49 +01:00
Snider
ba3296cec6 Customize build folder layout based on compiler
Updated the layout method to set different build and generator folder paths depending on whether the compiler is MSVC or not. This improves compatibility with multi-configuration generators on MSVC and single-configuration generators on other platforms.
2025-10-01 18:15:27 +01:00
Snider
89c6833845 Switch to conanfile.py, update build scripts and genesis data
Replaces conanfile.txt with conanfile.py for improved Conan package management. Updates Makefile and CMakeLists.txt to align with new Conan workflow and build folder structure. Increases premine amount in default.cmake and updates genesis transaction data. Comments out a hardcoded seed node in net_node.inl.
2025-10-01 18:04:44 +01:00
Snider
edbbf2888b config updates 2025-10-01 14:20:02 +01:00
Snider
336de95f46 Update _on-push.yml 2025-10-01 13:58:57 +01:00
Snider
0fad340a06 Update _on-pr-fast.yml 2025-10-01 13:58:23 +01:00
Snider
cf14549cee Update build process and genesis data for static builds
Refactors Makefile and Dockerfile to support static builds via a STATIC variable, simplifying static build targets. Updates genesis transaction data and public key in generated files. Improves GitHub Actions artifact upload by refining tag and prerelease logic.
2025-10-01 13:57:08 +01:00
23 changed files with 239 additions and 133 deletions

22
.github/actions/make-docs/action.yml vendored Normal file
View file

@ -0,0 +1,22 @@
# .github/actions/make-docs/action.yml
name: 'Build Documentation'
description: 'Archives and uploads signed binaries to a GitHub release'
runs:
using: "composite"
steps:
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date -u '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: ~/.cache
restore-keys: |
mkdocs-material-
- if: runner.os == 'Linux'
run: |
sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev pngquant
- run: pip install mkdocs-git-revision-date-localized-plugin cairosvg mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin mkdocs-material[imaging]

View file

@ -6,7 +6,7 @@ inputs:
required: true
description: 'The chain network name to use in filenames, mainnet or testnet'
assets:
description: "A \\n separated string list of filenames to archive; if asset is a abs path, it's respected"
description: "A EOL separated string list of filenames to archive; if asset is a abs path, it's respected"
required: false
asset-type:
required: true
@ -37,6 +37,20 @@ runs:
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
if [ "${{ github.event_name }}" == "pull_request" ]; then
TAG_SUFFIX="-${{ github.event.number }}alpha"
PRERELEASE=true
elif [ "${{ inputs.chain-network }}" != "mainnet" ]; then
TAG_SUFFIX="-beta"
PRERELEASE=true
else
TAG_SUFFIX=""
PRERELEASE=false
fi
TAG_NAME="${VERSION}${TAG_SUFFIX}+${{ github.run_number }}"
echo "tag_name=${TAG_NAME}" >> "$GITHUB_OUTPUT"
echo "prerelease=${PRERELEASE}" >> "$GITHUB_OUTPUT"
# Format the output to be a multi-line string.
# This is the correct way to pass a multi-line string in GITHUB_OUTPUT.
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@ -70,7 +84,7 @@ runs:
- name: Make Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.asset.outputs.version }}${{ inputs.chain-network == 'mainnet' && '' || '-pre' }}+${{ github.run_number }}
prerelease: ${{ contains(inputs.chain-network, 'testnet') }}
tag_name: ${{ steps.asset.outputs.tag_name }}
prerelease: ${{ steps.asset.outputs.prerelease }}
files: ${{ inputs.asset-directory }}/lethean-*
target_commitish: ${{ github.sha }}

View file

@ -12,6 +12,7 @@ on:
branches:
- dev
- main
- dev-*
paths-ignore:
- '**.md'

View file

@ -18,7 +18,7 @@ on:
jobs:
build:
name: "lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout Project
uses: actions/checkout@v4.2.2
@ -39,6 +39,9 @@ jobs:
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
with:
file: utils/docker/images/lthn-chain/Dockerfile
context: ${{ github.workspace }}
@ -46,7 +49,6 @@ jobs:
build-args: |
BUILD_TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
THREADS=2
BUILD_TARGET=gcc-linux-x86_64
BUILD_LOCAL=1
tags: lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}

View file

@ -27,8 +27,9 @@ jobs:
with:
key: ${{ github.ref }}
path: .cache
- run: sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev pngquant
- run: pip install mkdocs-git-revision-date-localized-plugin cairosvg mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin mkdocs-material[imaging]
- run: pip install mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin mkdocs-material[imaging]
- name: Build Offline Version
run: make docs

View file

@ -22,7 +22,7 @@ jobs:
submodules: recursive
- name: install dependencies
run: sudo apt-get install -y autotools-dev git build-essential
run: sudo apt-get install -y autotools-dev git build-essential libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev pngquant
- name: Cache SDK Folder
uses: actions/cache@v4
@ -30,6 +30,13 @@ jobs:
path: ${{ github.workspace }}/build/sdk
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Install Conan
uses: conan-io/setup-conan@v1
with:

View file

@ -30,6 +30,11 @@ jobs:
path: ${{ github.workspace }}/build/sdk
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Install Conan
uses: conan-io/setup-conan@v1
with:

View file

@ -29,6 +29,12 @@ jobs:
path: ${{ github.workspace }}/build/sdk
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Install Conan
uses: conan-io/setup-conan@v1
with:

View file

@ -28,6 +28,11 @@ jobs:
path: ${{ github.workspace }}/build/sdk
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Install Conan
uses: conan-io/setup-conan@v1
with:

View file

@ -13,7 +13,7 @@ on:
jobs:
msvc-194:
name: msvc-194-x86_64
runs-on: windows-2022
runs-on: windows-latest
steps:
- name: Checkout Project
uses: actions/checkout@v4.2.2
@ -27,6 +27,11 @@ jobs:
path: ${{ github.workspace }}/build/sdk
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Install Conan
uses: conan-io/setup-conan@v1
with:

View file

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.16)
message(STATUS "Using CMake version: ${CMAKE_VERSION}")
set(DISABLE_TOR TRUE CACHE BOOL "Disable TOR library(and related tor-connect submodule)")
@ -86,7 +87,7 @@ endif()
set(USE_PCH FALSE CACHE BOOL "Use shared precompiled headers")
set(DISABLE_TOR FALSE CACHE BOOL "Disable TOR library(and related tor-connect submodule)")
set(TESTNET FALSE CACHE BOOL "Compile for testnet")
set(TESTNET 0 CACHE BOOL "Build TESTNET")
set(BUILD_GUI FALSE CACHE BOOL "Build qt-daemon")
set(USE_BITCOIN_SECP256K1_FOR_ECDSA FALSE CACHE BOOL "Use bitcoin-secp256k1 library for validating ECDSA(instead of OpenSSL)")
if(NOT USE_BITCOIN_SECP256K1_FOR_ECDSA)

View file

@ -12,8 +12,10 @@
# Default to “unknown” will be overwritten below.
CPU_CORES := 1
TESTNET:= 0
STATIC:= 0
BUILD_TYPE ?=Release
BUILD_VERSION:=6.0.1
BUILD_FOLDER:=build/release
# -----------------------------------------------------------------
# Unixlike systems (Linux, macOS, *BSD, etc.)
@ -69,7 +71,7 @@ endif
# -----------------------------------------------------------------
CPU_CORES := $(or $(CPU_CORES),1)
CPU_CORES := $(shell expr $(CPU_CORES) + 0 2>/dev/null || echo 1)
CONAN_CPU_COUNT=$(CPU_CORES)
#CONAN_CPU_COUNT=$(CPU_CORES)
PROFILES := $(patsubst cmake/profiles/%,%,$(wildcard cmake/profiles/*))
@ -77,28 +79,37 @@ SORTED_PROFILES := $(sort $(PROFILES))
CONAN_CACHE := $(CURDIR)/build/sdk
DEFAULT_CONAN_PROFILE := $(CONAN_CACHE)/profiles/default
CC_DOCKER_FILE?=utils/docker/images/lthn-chain/Dockerfile
# Detect if we are on Windows
ifeq ($(OS), Windows_NT)
# If so, define a prefix to clear the problematic env vars
FIX_ENV := CFLAGS="" CXXFLAGS=""
else
# Otherwise, the prefix is empty
FIX_ENV :=
endif
all: help
release: conan-profile-detect
@echo "Building profile: release $(TESTNET)"
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/release --build=missing -s build_type=$(BUILD_TYPE)
cmake -S . -B build/release -DCMAKE_TOOLCHAIN_FILE=build/release/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
cmake --build build/release --config=$(BUILD_TYPE) --parallel=$(CPU_CORES)
(cd build/release && cpack)
release: docs build
(cd $(BUILD_FOLDER) && cpack)
build: configure
cmake --build $(BUILD_FOLDER) --config=$(BUILD_TYPE) --parallel=$(CPU_CORES)
debug: conan-profile-detect
@echo "Building profile: debug"
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/debug --build=missing -s build_type=Debug
$(FIX_ENV) CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/debug --build=missing -s build_type=Debug
cmake -S . -B build/debug -DCMAKE_TOOLCHAIN_FILE=build/debug/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -DTESTNET=$(TESTNET)
cmake --build build/debug --config=Debug --parallel=$(CPU_CORES)
static: static-release
static-release: conan-profile-detect
@echo "Building profile: release-static"
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/release-static --build=missing -s build_type=$(BUILD_TYPE)
cmake -S . -B build/release-static -DCMAKE_TOOLCHAIN_FILE=build/release-static/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -D STATIC=ON -DTESTNET=$(TESTNET)
cmake --build build/release-static --config=$(BUILD_TYPE) --parallel=$(CPU_CORES)
build-deps: conan-profile-detect
@echo "Build Dependencies: $(BUILD_TYPE) testnet=$(TESTNET)"
$(FIX_ENV) CONAN_HOME=$(CONAN_CACHE) conan install . --build=missing -s build_type=$(BUILD_TYPE)
configure: build-deps
@echo "Running Configure: $(BUILD_TYPE) testnet=$(TESTNET)"
cmake -S . -B $(BUILD_FOLDER) -DCMAKE_TOOLCHAIN_FILE=$(BUILD_FOLDER)/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
conan-profile-detect:
@if [ ! -f "$(DEFAULT_CONAN_PROFILE)" ]; then \
@ -110,9 +121,10 @@ conan-profile-detect:
# Rule for each profile
$(PROFILES): conan-profile-detect
@echo "Building profile: $@"
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/$@ -pr:b=$(DEFAULT_CONAN_PROFILE) -pr:h=cmake/profiles/$@ --build=missing -s build_type=$(BUILD_TYPE)
cmake -S . -B build/$@ -DCMAKE_TOOLCHAIN_FILE=build/$@/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DTESTNET=$(TESTNET)
cmake --build build/$@ --config=$(BUILD_TYPE) --parallel=$(CPU_CORES)
CFLAGS="" CXXFLAGS="" CONAN_HOME=$(CONAN_CACHE) conan install . -pr:h=cmake/profiles/$@ --build=missing -s build_type=$(BUILD_TYPE)
cmake -S . -B $(BUILD_FOLDER) -DCMAKE_TOOLCHAIN_FILE=$(BUILD_FOLDER)/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
cmake --build $(BUILD_FOLDER) --config=$(BUILD_TYPE) --parallel=$(CPU_CORES)
(cd $(BUILD_FOLDER) && cpack)
help:
@echo "Available targets:"
@ -147,10 +159,6 @@ test-debug:
cmake --build build/test-debug --config=Debug --parallel=$(CPU_CORES)
$(MAKE) test
configure:
@echo "Running Config: release"
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/release --build=missing -s build_type=$(BUILD_TYPE)
cmake -S . -B build/release -DCMAKE_TOOLCHAIN_FILE=build/release/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
docs: configure
@echo "Building Documentation"
@ -160,29 +168,6 @@ docs-dev: configure
@echo "Building Documentation"
cmake --build build/release --target=serve_docs --config=Release
docker-chain-node:
@echo "Building docker image: lthn/chain"
docker buildx build -f $(CC_DOCKER_FILE) -t lthn/chain $(CURDIR)
docker-cc-linux-amd64:
docker buildx build -f $(CC_DOCKER_FILE) --target build-artifacts --output type=local,dest=build/cc-linux-amd64 --platform linux/amd64 $(CURDIR)
docker-cc-linux-armv7:
docker buildx build -f $(CC_DOCKER_FILE) --target build-artifacts --output type=local,dest=build/cc-linux-armv7 --platform linux/arm/v7 $(CURDIR)
docker-cc-linux-arm64v8:
docker buildx build -f $(CC_DOCKER_FILE) --target build-artifacts --output type=local,dest=build/cc-linux-arm64v8 --platform linux/arm64/v8 $(CURDIR)
docker-cc-linux-ppc64le:
docker buildx build -f $(CC_DOCKER_FILE) --target build-artifacts --output type=local,dest=build/cc-linux-ppc64le --platform linux/ppc64le $(CURDIR)
docker-cc-linux-riscv64:
docker buildx build -f $(CC_DOCKER_FILE) --target build-artifacts --output type=local,dest=build/cc-linux-riscv64 --platform linux/riscv64 $(CURDIR)
docker-cc-linux-s390x:
docker buildx build -f $(CC_DOCKER_FILE) --target build-artifacts --output type=local,dest=build/cc-linux-s390x --platform linux/s390x $(CURDIR)
clean:
rm -rf build

View file

@ -8,36 +8,36 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CPACK_PACKAGE_CONTACT "${package_contact}")
set(CPACK_PACKAGE_HOMEPAGE_URL "${package_website}")
# set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local") # Linux/macOS default
# if(WIN32)
# set(CPACK_PACKAGING_INSTALL_PREFIX "C:/Program Files/${PROJECT_NAME}")
# endif()
#set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local") # Linux/macOS default
#if(WIN32)
# set(CPACK_PACKAGING_INSTALL_PREFIX "C:/Program Files/${PROJECT_NAME}")
#endif()
if(APPLE)
if("${package_macos_installer}" STREQUAL "DMG")
set(CPACK_GENERATOR "DragNDrop")
# set(CPACK_GENERATOR "DragNDrop")
# set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/resources/dmg_background.png")
set(CPACK_DMG_VOLUME_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
message(STATUS "Registered CPACK_GENERATOR: DragNDrop")
# set(CPACK_DMG_VOLUME_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
# message(STATUS "Registered CPACK_GENERATOR: DragNDrop")
else ()
set(CPACK_GENERATOR "productbuild")
set(CPACK_PRODUCTBUILD_IDENTIFIER "${package_macos_pkg_productbuild_identifier}")
# set(CPACK_GENERATOR "productbuild")
# set(CPACK_PRODUCTBUILD_IDENTIFIER "${package_macos_pkg_productbuild_identifier}")
# set(CPACK_PRODUCTBUILD_SIGNING_IDENTITY "Developer ID Installer: Your Company (TEAMID)")
message(STATUS "Registered CPACK_GENERATOR: productbuild")
# message(STATUS "Registered CPACK_GENERATOR: productbuild")
endif ()
elseif(WIN32)
set(CPACK_GENERATOR "WIX")
message(STATUS "Registered CPACK_GENERATOR: WIX")
# set(CPACK_GENERATOR "WIX")
# message(STATUS "Registered CPACK_GENERATOR: WIX")
# set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/resources/windows_icon.ico")
# set(CPACK_WIX_LICENSE_RTF "${CMAKE_SOURCE_DIR}/LICENSE.rtf")
# set(CPACK_WIX_UPGRADE_GUID "D3F5A9C1-4B2E-4F5A-9C71-123456789ABC") # change once per major version
else()
set(CPACK_GENERATOR "DEB")
message(STATUS "Registered CPACK_GENERATOR: deb")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${package_contact}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.28)")
set(CPACK_DEBIAN_PACKAGE_SECTION "utils")
set(CPACK_DEBIAN_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
# set(CPACK_GENERATOR "DEB")
# message(STATUS "Registered CPACK_GENERATOR: deb")
# set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${package_contact}")
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.28)")
# set(CPACK_DEBIAN_PACKAGE_SECTION "utils")
# set(CPACK_DEBIAN_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
# postinstall script (e.g., to register a systemd service)
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_SOURCE_DIR}/scripts/postinstall.sh")
@ -59,7 +59,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}/packages")
install(FILES README.md LICENSE.txt
DESTINATION "share/doc/${CPACK_PACKAGE_NAME}"
DESTINATION "share/doc/${PROJECT_NAME}"
)
set(_arch "${CMAKE_SYSTEM_PROCESSOR}")

View file

@ -5,6 +5,4 @@ compiler.cppstd=17
compiler.runtime=static
compiler.version=194
os=Windows
[conf]
tools.cmake.cmaketoolchain:user_presets=False
build_type=Release

48
conanfile.py Normal file
View file

@ -0,0 +1,48 @@
import os
from conan import ConanFile
from conan.tools.cmake import cmake_layout, CMakeDeps, CMakeToolchain, CMake
class BlockchainConan(ConanFile):
name = "blockchain"
version = "6.0.1"
settings = "os", "compiler", "build_type", "arch"
options = {
"static": [True, False],
"testnet": [True, False]
}
default_options = {
"static": False,
"testnet": False
}
requires = [
"zlib/1.3.1",
"boost/1.85.0",
"openssl/3.2.0",
"miniupnpc/2.2.5",
"jwt-cpp/0.7.1"
]
def generate(self):
tc = CMakeToolchain(self)
tc.user_presets_path = False
tc.variables["STATIC"] = self.options.static
tc.variables["TESTNET"] = self.options.testnet
# tc.preprocessor_definitions["TESTNET"] = None
# tc.variables["BUILD_VERSION"] = self.options.build_version
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def layout(self):
self.folders.generators = os.path.join("build", str(self.settings.build_type).lower(), "generators")
self.folders.build = os.path.join("build", str(self.settings.build_type).lower())
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

View file

@ -1,10 +0,0 @@
[requires]
zlib/1.3.1
boost/1.85.0
openssl/3.2.0
miniupnpc/2.2.5
jwt-cpp/0.7.1
[generators]
CMakeDeps
CMakeToolchain

27
docker-compose.yml Normal file
View file

@ -0,0 +1,27 @@
version: '3.8'
services:
lethean-chain:
image: lthn/chain:testnet
build:
tags:
- lthn/chain:testnet
dockerfile: utils/docker/images/lthn-chain/Dockerfile
context: .
target: chain-service
args:
- BUILD_THREADS=1
- BUILD_TESTNET=1
- BUILD_STATIC=0
- BUILD_BRANCH=dev
- BUILD_LOCAL=1
- BUILD_REPO=https://github.com/letheanVPN/blockchain.git
- BUILD_FOLDER=build/release
- BUILD_TYPE=Release
ports:
- "36941:36941"
- "36942:36942"
volumes:
- lethean_data:/data
volumes:
lethean_data:

View file

@ -34,7 +34,7 @@
#define CURRENCY_TX_MAX_ALLOWED_OUTS 2000
#define CURRENCY_TX_MIN_ALLOWED_OUTS 2 // effective starting HF4 Zarcanum
#define CURRENCY_PUBLIC_ADDRESS_BASE58_PREFIX @address_prefix@ // addresses start with 'Zx'
#define CURRENCY_PUBLIC_INTEG_ADDRESS_BASE58_PREFIX 0x3678 // integrated addresses start with 'iZ'
#define CURRENCY_PUBLIC_INTEG_ADDRESS_BASE58_PREFIX @address_prefix_integrated@ // integrated addresses start with 'iZ'
#define CURRENCY_PUBLIC_INTEG_ADDRESS_V2_BASE58_PREFIX @address_prefix_integrated@ // integrated addresses start with 'iZ' (new format)
#define CURRENCY_PUBLIC_AUDITABLE_ADDRESS_BASE58_PREFIX @address_prefix_auditable@ // auditable addresses start with 'aZx'
#define CURRENCY_PUBLIC_AUDITABLE_INTEG_ADDRESS_BASE58_PREFIX @address_prefix_auditable_integrated@ // auditable integrated addresses start with 'aiZX'

View file

@ -1,6 +1,6 @@
# Tokenomics
set(coin 1000000000000 CACHE STRING "COIN" )
set(premine_amount 4000000000000000000 CACHE STRING "PREMINE_AMOUNT" )
set(premine_amount 10000000000000000000 CACHE STRING "PREMINE_AMOUNT" )
set(tx_default_fee 10000000000 CACHE STRING "TX_DEFAULT_FEE" )
set(tx_minimum_fee 10000000000 CACHE STRING "TX_MINIMUM_FEE" )
set(currency_block_reward 1000000000000 CACHE STRING "CURRENCY_BLOCK_REWARD" )

View file

@ -1 +0,0 @@
01010000018080a0cfc8e0c8e38a0103858421a2d287027bdde3db5e385b0c728f598ad1647c8e17036d3ef63f61bb98000516f971f914382e875df5655f591c8df7b126d95f5e8331613ba3f5c797f541839c136b49742074616b657320616476616e74616765206f6620746865206e6174757265206f6620696e666f726d6174696f6e206265696e67206561737920746f2073707265616420627574206861726420746f20737469666c652e202d205361746f736869204e616b616d6f746f15000b02660d0e0a0000

View file

@ -0,0 +1 @@
01010000018080a0cfc8e0c8e38a01037313cc261a42a1a002c472cbe67c7873e4f9cf44a59bda3fdd8651d615d4e3a00005166f7fbc7dfa2809974084b92e8930353b7e93f8759979ff037984a1837fb3948a136b49742074616b657320616476616e74616765206f6620746865206e6174757265206f6620696e666f726d6174696f6e206265696e67206561737920746f2073707265616420627574206861726420746f20737469666c652e202d205361746f736869204e616b616d6f746f15000b02bcdd0e0a0000

View file

@ -434,8 +434,8 @@ namespace nodetool
{
#ifndef TESTNET
//TODO:
ADD_HARDCODED_SEED_NODE(std::string("0.0.0.0:") + std::to_string(P2P_DEFAULT_PORT));
ADD_HARDCODED_SEED_NODE("116.202.82.115", P2P_DEFAULT_PORT);
ADD_HARDCODED_SEED_NODE("116.202.82.115", P2P_DEFAULT_PORT); // Hetzner
ADD_HARDCODED_SEED_NODE("34.13.212.174", P2P_DEFAULT_PORT); // Google
//ADD_HARDCODED_SEED_NODE("94.130.137.230", P2P_DEFAULT_PORT);
//ADD_HARDCODED_SEED_NODE("95.217.42.247", P2P_DEFAULT_PORT);
//ADD_HARDCODED_SEED_NODE("94.130.160.115", P2P_DEFAULT_PORT);
@ -445,7 +445,8 @@ namespace nodetool
//ADD_HARDCODED_SEED_NODE("144.76.183.143", P2P_DEFAULT_PORT);
#else
// TESTNET
ADD_HARDCODED_SEED_NODE("116.202.82.115", P2P_DEFAULT_PORT);
ADD_HARDCODED_SEED_NODE("116.202.82.115", P2P_DEFAULT_PORT); // Hetzner
ADD_HARDCODED_SEED_NODE("34.13.212.174", P2P_DEFAULT_PORT); // Google
//ADD_HARDCODED_SEED_NODE("94.130.137.230", P2P_DEFAULT_PORT);
//ADD_HARDCODED_SEED_NODE("95.217.42.247", P2P_DEFAULT_PORT);
//ADD_HARDCODED_SEED_NODE("94.130.160.115", P2P_DEFAULT_PORT);
@ -705,7 +706,7 @@ namespace nodetool
}else
{
LOG_PRINT_L0(" COMMAND_HANDSHAKE(AND CLOSE) INVOKED OK");
//m_net_server.get_config_object().close(context_.m_connection_id);
// m_net_server.get_config_object().close(context_.m_connection_id);
}
}, P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT);

View file

@ -1,22 +1,15 @@
# use --target=builder to return a docker image able to compile the software, probbly used with -v .:/code
# use --target=builder to return a docker image able to compile the software, probably used with -v .:/code
FROM ubuntu:24.04 AS builder
LABEL authors="snider"
ARG THREADS=1
ARG BUILD_BRANCH=dev
ARG BUILD_LOCAL=1
ARG BUILD_REPO=https://github.com/letheanVPN/blockchain.git
ARG BUILD_TARGET=gcc-linux-x86_64
ARG BUILD_FOLDER=build/release
ARG BUILD_TYPE=Release
ARG BUILD_THREADS=1
ARG BUILD_TESTNET=1
ARG USE_CUSTOM_PROFILE=0
ARG BUILD_STATIC=0
ARG BUILD_LOCAL=1
ENV CONAN_HOME=/root/sdk
ARG BUILD_REPO=https://github.com/letheanVPN/blockchain.git
ARG BUILD_BRANCH=dev
# CONAN: disables the generation of color escape characters.
ENV NO_COLOR=1
ENV BUILD_TARGET=${BUILD_TARGET}
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt -y upgrade
@ -26,39 +19,33 @@ RUN apt install -y build-essential pkgconf \
g++ llvm clang lld cmake python-is-python3 \
git python3 python3-pip python3-dev xz-utils gperf
RUN pip3 install conan --break-system-packages
RUN pip3 install conan mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin mkdocs-material[imaging] --break-system-packages
WORKDIR /
# Copy the build context.
COPY . /tmp/local-src
RUN if [ "$BUILD_LOCAL" = "1" ]; then \
mv /tmp/local-src /code; \
else \
rm -rf /tmp/local-src; \
COPY . /code
VOLUME /code/build/sdk
RUN if [ "$BUILD_LOCAL" = "0" ]; then \
rm -rf /code; \
git clone --recursive --branch ${BUILD_BRANCH} ${BUILD_REPO} code; \
fi
WORKDIR /code
RUN conan profile detect --name=default --force
FROM builder AS build
ARG BUILD_THREADS=1
ARG BUILD_STATIC=0
ARG BUILD_FOLDER=build/release
ARG BUILD_TYPE=Release
ARG BUILD_TESTNET=1
#RUN conan install . --output-folder=${BUILD_FOLDER} --build=missing -s build_type=${BUILD_TYPE} -pr:h=/code/cmake/profiles/$BUILD_TARGET
RUN set -eux; \
BCMD="conan install . \
--output-folder=${BUILD_FOLDER} \
--build=missing \
-s build_type=${BUILD_TYPE}"; \
if [ "${USE_CUSTOM_PROFILE}" = "1" ]; then \
BCMD="$BCMD -pr:h=/code/cmake/profiles/${BUILD_TARGET}"; \
fi; \
echo "Running: $BCMD"; \
eval $BCMD;
RUN cmake -S /code -B ${BUILD_FOLDER} -DCMAKE_TOOLCHAIN_FILE=${BUILD_FOLDER}/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DTESTNET=${BUILD_TESTNET}
RUN cmake --build ${BUILD_FOLDER} --config=${BUILD_TYPE} --parallel=${THREADS}
RUN make build CPU_CORES=${BUILD_THREADS} TESTNET=${BUILD_TESTNET} STATIC=${BUILD_STATIC}
#RUN cmake --build ${BUILD_FOLDER} --config=${BUILD_TYPE} --parallel=${THREADS}
# minor cmd-fu; TESTNEt and MAINNET, in docker context, use MAIINNET binaries names.
# do i like removing `-testnet`, no, but i dislike working around multiple names for ever more, so...
@ -69,17 +56,18 @@ RUN if [ "$BUILD_TESTNET" = "1" ]; then \
done; \
fi
# use --target=build-cache to return just the cache files
FROM scratch AS build-cache
COPY --from=builder ${CONAN_HOME} /
# use --target=build-artifacts to return the binaries
FROM scratch AS build-artifacts
COPY --from=builder /code/build/release/src/lethean-* /
COPY --from=build /code/build/release/src/lethean-* /
# use --target=chain-service to return a working chain node
FROM ubuntu:24.04 AS chain-service
COPY --from=build-artifacts --chmod=+x / /bin
EXPOSE 36941
EXPOSE 36942
RUN lethean-chain-node --help
ENTRYPOINT ["lethean-chain-node", "--data-dir", "/data", "--disable-upnp", "--disable-debug-p2p-requests"]