1
0
Fork 0
forked from lthn/blockchain

Compare commits

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

29 commits

Author SHA1 Message Date
b61d773a0f Merge pull request 'v6.0.1 — RandomX PoW, new genesis, multi-platform CI' (#1) from Charon/blockchain:dev into dev
Reviewed-on: lthn/blockchain#1
Reviewed-by: Snider <snider@noreply.forge.lthn.ai>
2026-02-14 20:19:13 +00:00
Claude
c9ad4de9bb
ci: multi-platform Forgejo Actions pipeline
Build Linux x86_64 (snider-linux) and macOS ARM64 (M3 Ultra) natively
via self-hosted forgejo-runner, aggregate into single release.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 19:37:35 +00:00
Claude
22c0c5a251
ci: use Forgejo Conan registry instead of actions/cache
Pull pre-built dependencies from the Forgejo package registry
(conan_build remote) instead of caching the SDK locally. Removes
the 570MB actions/cache overhead since all packages are already
available as pre-compiled binaries on the registry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:06:47 +00:00
Claude
f3df50cba5
ci: prune old releases to keep only latest per branch
After uploading new release assets, delete older beta releases (dev)
or older stable releases (main) to conserve disk. Only the latest
build per branch is kept on the Forgejo instance; older builds are
available on mirrored free hosting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:03:13 +00:00
Claude
1545a80335
ci: add Forgejo Actions build & release workflow
Add .forgejo/workflows/build.yml that builds the Lethean blockchain
on push to dev/main with workflow_dispatch support. Builds testnet
on dev, mainnet on main, creates Forgejo releases with RPM/tar.xz/zip
packages and SHA256 checksums.

- CPU limited to 3 cores (~10% of 32-thread host) via Docker --cpus cap
- Private submodule auth via git credential store with RELEASE_TOKEN
- SDK caching with actions/cache for Conan build artifacts
- CMake installed via pip for preset version 8 support
- Tags fetched for libmdbx git describe version detection
- Fix missing contrib/randomx entry in .gitmodules

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:02:28 +00:00
Claude
467c64d015
feat: RandomX PoW, LWMA difficulty, stratum mining.* protocol, new genesis
Replace ProgPowZ with RandomX for ASIC-resistant proof-of-work. The
full dataset is initialized multi-threaded at startup with the key
"LetheanRandomXv1". Thread-local VMs are created on demand.

Switch difficulty algorithm from Zano's 720-block window to LWMA-1
(zawy12) with a 60-block window for much faster convergence after
hashrate changes. Target block time set to 10s for PoW.

Add standard stratum mining.* protocol handlers (subscribe, authorize,
submit, extranonce.subscribe) alongside existing EthProxy eth_*
handlers, with automatic protocol detection and mining.notify
translation for XMRig-based miners.

Generate fresh Lethean genesis block and premine wallet. Replace all
remaining hardcoded Zano addresses in tests with runtime-generated
keys to avoid prefix mismatches. Link RandomX library across all
build targets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 13:22:25 +00:00
Claude
7ee2265cae
fix: crypto test PRNG determinism, checkpoint hashes, and Zano address remnants
The crypto test PRNG was non-deterministic because setup_random() seeded
the state but grant_random_initialize_no_lock() overwrote it with
/dev/urandom on the first random call. Calling it before memset ensures
the initialized flag is set, preventing the overwrite.

Also adds --generate mode to crypto-tests for future vector regeneration,
updates checkpoint hashes for multisig_and_checkpoints (height 15) and
gen_no_attchments_in_coinbase (height 12), and replaces hardcoded Zano
addresses/URLs with Lethean equivalents in manual test scaffolding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 13:17:11 +00:00
Claude
4120a9a664
Rebrand to SASE, restore cmake test fixture
- Update .core/build.yaml description: SASE infrastructure chain
- cmake/test-static-assert.c already committed separately

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:56:41 +00:00
Claude
5dae74347c
Restore project-specific cmake/test-static-assert.c
This file was wrongly extracted to the .core/build submodule during the
build system extraction. It's a project-specific compile test used by
CMakeLists.txt:185 and must remain in the project tree.

Verified: make configure && make build && make package all pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:27:11 +00:00
Claude
92e0aa779b
feat(build): add .core/build.yaml for core CLI integration
C++ build configuration for core CLI project detection and future
`core compile` command. Defines Conan dependencies, CMake settings,
cross-compilation targets, and packaging options.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 02:47:44 +00:00
Claude
7b0a08f9ff
Replace cmake/ with host-uk/build submodule at .core/build
Build system extracted to host-uk/build and wired in as a git
submodule following the core CLI convention (.core/<tool>/).

- CMake modules, cross-compilation profiles now from .core/build/cmake/
- Conan credentials read from environment instead of hardcoded
- Removed cmake/ directory (14 files) — all now in submodule
- Makefile, CMakeLists.txt, CMakePresets.json updated for new paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 01:57:40 +00:00
Snider
88d4357628
New API Interface (#27)
This pull request introduces a comprehensive new API interface for the blockchain, leveraging OpenAPI v3 to facilitate direct consumption of chain data by GUI and web applications. This change significantly refines the project's build infrastructure, incorporating Conan for dependency management and CMake for configuration, alongside the integration of an OpenAPI Generator to produce SDKs for multiple languages. 

### Highlights

* **New API Interface**: Introduced a new API interface using OpenAPI v3 to enable GUI/WEB development to consume chain data without needing custom server applications.
* **Build System Enhancements**: Significant updates to the build system, including Makefile, CMake, and Conan configurations, to streamline the build process and support new functionalities.
* **Multi-language SDK Generation**: Integrated OpenAPI Generator to automatically create SDKs for various programming languages, including Go, Angular, and PHP, simplifying client-side integration.
2025-10-19 19:12:37 +01:00
Snider
4a5c5ae742 Refactor build presets and Makefile targets
Updated CMakePresets.json to add 'testnet' and 'mainnet' workflows, removed unused Windows preset, and improved environment and cache variable handling. Makefile targets for testnet and mainnet workflows were added, and Conan-related targets were renamed for consistency. Added a function to reset ConanPresets.json in CleanBuild.cmake and fixed the path for GetConan.cmake in conan_provider.cmake. Deleted obsolete .idea/cmake.xml.
2025-10-09 03:10:46 +01:00
Snider
57983cb865 Since Clion is OSS now, adding more sharable ide project defaults. 2025-10-09 01:27:15 +01:00
Snider
ef776a93cc
Add CMake and Conan presets, update build config (#26)
* Add CMake and Conan presets, update build config

Introduces CMakePresets.json and ConanPresets.json for standardized build configuration. Updates Makefile to use CMake presets, modifies .gitignore for IDE files, and refines conanfile.py to support CI option and preset integration.

* Update Makefile

* Update _on-pr.yml

* Refactor build presets and folder layout for Windows

Updated Makefile and GitHub workflow to use configurable build and configure presets, improving flexibility for different environments. Adjusted CMakePresets.json to fix preset naming and version, and refactored conanfile.py to set build folders based on compiler type, ensuring correct folder structure for MSVC and other compilers.

* Update build presets and CPack config for Windows

Set PRESET_CONFIGURE to 'conan-default' for Windows builds in Makefile and GitHub workflow. Broaden CPack packaging conditions to include additional build types and comment out WIX generator settings for Windows in CPackConfig.cmake.
2025-10-09 00:25:29 +01:00
Snider
106b3431db Add JetBrains IDE config and update CMake setup
Added .idea configuration files for JetBrains IDE support and updated .gitignore to exclude only specific userland .idea files. Refactored CMakeLists.txt to improve include_directories usage, re-enable -fno-fat-lto-objects for GNU compilers. This improves IDE integration and build configuration clarity.
2025-10-08 20:22:51 +01:00
Snider
0882f94203 Update debug build paths in Makefile
Modified debug target to use absolute paths with $(CURDIR) for build directory and toolchain file. This improves reliability of file detection across environments and browsers.
2025-10-08 15:17:18 +01:00
Snider
1c584e7c76
Update CMakeLists.txt 2025-10-07 02:29:17 +01:00
Snider
79121dce71
Remove ccache from tool_requires 2025-10-07 02:28:22 +01:00
Snider
3dbb8b1487
Add 'secrets: inherit' to all build jobs 2025-10-07 02:24:12 +01:00
Snider
11d19e5446
Add caching and dependency installation steps for ARM, Intel, and mac… (#25) 2025-10-07 02:20:06 +01:00
Snider
e4ff164f0d
Build Simplification (#24) 2025-10-06 22:38:29 +01:00
Snider
dd7a19ac6f Lower min build version for hardforks 05 and 06
Updated ZANO_HARDFORK_05_MIN_BUILD_VER and ZANO_HARDFORK_06_MIN_BUILD_VER from 382 to 2 to allow compatibility with older builds.
2025-10-05 21:10:34 +01:00
Snider
eb60d4519c Revert "Use actual remote port for async connection"
This reverts commit 3e2bad36a6.
2025-10-05 20:44:13 +01:00
Snider
3e2bad36a6 Use actual remote port for async connection
Replaces usage of node_data.my_port with context.m_remote_port when establishing an async connection, ensuring the correct remote port is used for peer connections.
2025-10-05 20:03:58 +01:00
Snider
7f930b0fec Capture remote_ip by value in try_ping lambda
The lambda in try_ping now captures remote_ip by value instead of accessing context.m_remote_ip directly. This ensures the correct IP is used even if the context changes before the lambda executes.
2025-10-05 18:01:59 +01:00
Snider
c2c130a076
Add conditional check for alpha and beta versions
the tag + release deleting only happens for -alpha or -beta
2025-10-05 14:35:21 +01:00
Snider
d8d81c1f2e
Implement cleanup job for merged pull requests
Add cleanup job for closed pull requests that are merged.
2025-10-05 14:21:10 +01:00
Snider
c8acc964e3
Testnet updates (#22) 2025-10-05 14:00:36 +01:00
630 changed files with 107980 additions and 2722 deletions

1
.core/build Submodule

@ -0,0 +1 @@
Subproject commit 9c9346d5494688a78ea573f3bc0547ad12b9be2a

83
.core/build.yaml Normal file
View file

@ -0,0 +1,83 @@
# Lethean Blockchain Build Configuration
# Used by: core compile
version: 1
project:
name: blockchain
type: cpp
description: "Lethean Blockchain - SASE infrastructure chain"
version: "6.0.1"
cpp:
standard: 17
build_type: Release
static: false
conan:
version: "2.21.0"
requires:
- zlib/1.3.1
- boost/1.85.0
- openssl/3.2.0
- miniupnpc/2.2.5
- jwt-cpp/0.7.1
- oatpp/1.3.0.latest
- oatpp-swagger/1.3.0.latest
tool_requires:
- cmake/3.31.9
options:
boost/*:without_test: true
registry:
url: http://forge.snider.dev:4000/api/packages/host-uk/conan
remote: conan_build
cmake:
minimum_version: "3.16"
variables:
USE_CCACHE: "ON"
options:
testnet: false
targets:
- os: linux
arch: x86_64
profile: gcc-linux-x86_64
- os: linux
arch: arm64
profile: gcc-linux-armv8
- os: darwin
arch: arm64
profile: apple-clang-armv8
- os: darwin
arch: x86_64
profile: apple-clang-x86_64
- os: windows
arch: x86_64
profile: msvc-194-x86_64
package:
generators:
- TGZ
- ZIP
- NSIS
- DEB
- RPM
vendor: Lethean
contact: support@lt.hn
website: https://lt.hn
docker:
dockerfile: utils/docker/lthn-chain/Dockerfile
image: lthn/chain
platforms:
- linux/amd64
tags:
- testnet
- "{{.Version}}"
build_args:
BUILD_THREADS: auto
BUILD_TESTNET: "1"
BUILD_STATIC: "0"
BUILD_TYPE: Release

234
.forgejo/workflows/build.yml Executable file
View file

@ -0,0 +1,234 @@
name: Build & Release
on:
workflow_dispatch:
push:
branches:
- dev
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORGEJO_URL: ${{ github.server_url }}
jobs:
# ──────────────────────────────────────────────
# Linux x86_64 — native build on snider-linux
# ──────────────────────────────────────────────
build-linux:
name: Linux x86_64
runs-on: linux-native
env:
CPU_CORES: "24"
steps:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
submodules: false
- name: Init submodules
run: |
git config --global url."${{ env.FORGEJO_URL }}/".insteadOf "http://forge.snider.dev:4000/"
git -c http.extraHeader="Authorization: token ${{ secrets.RELEASE_TOKEN }}" submodule update --init --recursive
git submodule foreach --recursive 'git fetch --tags origin 2>/dev/null || true'
- name: Build dependencies
run: |
make build-deps \
CPU_CORES=${{ env.CPU_CORES }} \
CONAN_URL=${{ env.FORGEJO_URL }}/api/packages/host-uk/conan \
CONAN_USER=claude \
CONAN_PASSWORD=${{ secrets.RELEASE_TOKEN }}
- name: Compile
run: |
make ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} \
CPU_CORES=${{ env.CPU_CORES }} \
CONAN_URL=${{ env.FORGEJO_URL }}/api/packages/host-uk/conan \
CONAN_USER=claude \
CONAN_PASSWORD=${{ secrets.RELEASE_TOKEN }}
- name: Upload artifacts
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
name: linux-x86_64
path: build/packages/lethean-*
retention-days: 7
# ──────────────────────────────────────────────
# macOS ARM64 — native build on M3 Ultra
# ──────────────────────────────────────────────
build-macos:
name: macOS ARM64
runs-on: macos-native
env:
CPU_CORES: "24"
steps:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
submodules: false
- name: Init submodules
run: |
git config --global url."${{ env.FORGEJO_URL }}/".insteadOf "http://forge.snider.dev:4000/"
git -c http.extraHeader="Authorization: token ${{ secrets.RELEASE_TOKEN }}" submodule update --init --recursive
git submodule foreach --recursive 'git fetch --tags origin 2>/dev/null || true'
- name: Build dependencies
run: |
export PATH="/opt/homebrew/bin:$PATH"
make build-deps \
CPU_CORES=${{ env.CPU_CORES }} \
CONAN_URL=${{ env.FORGEJO_URL }}/api/packages/host-uk/conan \
CONAN_USER=claude \
CONAN_PASSWORD=${{ secrets.RELEASE_TOKEN }}
- name: Compile
run: |
export PATH="/opt/homebrew/bin:$PATH"
make ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} \
CPU_CORES=${{ env.CPU_CORES }} \
CONAN_URL=${{ env.FORGEJO_URL }}/api/packages/host-uk/conan \
CONAN_USER=claude \
CONAN_PASSWORD=${{ secrets.RELEASE_TOKEN }}
- name: Upload artifacts
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
name: macos-arm64
path: build/packages/lethean-*
retention-days: 7
# ──────────────────────────────────────────────
# Aggregate artifacts and create release
# ──────────────────────────────────────────────
release:
name: Create Release
needs: [build-linux, build-macos]
runs-on: linux-native
steps:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
with:
fetch-depth: 1
submodules: false
- name: Download Linux artifacts
uses: https://code.forgejo.org/forgejo/download-artifact@v4
with:
name: linux-x86_64
path: artifacts/linux
- name: Download macOS artifacts
uses: https://code.forgejo.org/forgejo/download-artifact@v4
with:
name: macos-arm64
path: artifacts/macos
- name: List artifacts
run: find artifacts/ -type f | sort
- name: Compute release tag
id: release
run: |
VERSION=$(grep '^BUILD_VERSION:=' Makefile | cut -d'=' -f2)
if [ "${{ github.ref_name }}" = "main" ]; then
TAG="v${VERSION}+${{ github.run_number }}"
PRERELEASE=false
TITLE="v${VERSION} (build ${{ github.run_number }})"
else
TAG="v${VERSION}-beta+${{ github.run_number }}"
PRERELEASE=true
TITLE="v${VERSION}-beta (build ${{ github.run_number }})"
fi
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "prerelease=${PRERELEASE}" >> "$GITHUB_OUTPUT"
echo "title=${TITLE}" >> "$GITHUB_OUTPUT"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Create release
id: create_release
run: |
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
"${{ env.FORGEJO_URL }}/api/v1/repos/${{ github.repository }}/releases" \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{
\"tag_name\": \"${{ steps.release.outputs.tag }}\",
\"target_commitish\": \"${{ github.sha }}\",
\"name\": \"${{ steps.release.outputs.title }}\",
\"body\": \"Automated build from \`${{ github.ref_name }}\` branch (run #${{ github.run_number }})\n\n## Platforms\n- Linux x86_64\n- macOS ARM64 (Apple Silicon)\",
\"draft\": false,
\"prerelease\": ${{ steps.release.outputs.prerelease }}
}")
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | sed '$d')
if [ "$HTTP_CODE" -ge 400 ]; then
echo "Failed to create release (HTTP ${HTTP_CODE}):"
echo "$BODY"
exit 1
fi
RELEASE_ID=$(echo "$BODY" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
echo "id=${RELEASE_ID}" >> "$GITHUB_OUTPUT"
echo "Created release ID: ${RELEASE_ID}"
- name: Upload release assets
run: |
for dir in artifacts/linux artifacts/macos; do
for file in "$dir"/lethean-*; do
[ -f "$file" ] || continue
FILENAME=$(basename "$file")
echo "Uploading: ${FILENAME}"
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
"${{ env.FORGEJO_URL }}/api/v1/repos/${{ github.repository }}/releases/${{ steps.create_release.outputs.id }}/assets?name=${FILENAME}" \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary "@${file}")
if [ "$HTTP_CODE" -ge 400 ]; then
echo "Failed to upload ${FILENAME} (HTTP ${HTTP_CODE})"
exit 1
fi
echo "Uploaded ${FILENAME} (HTTP ${HTTP_CODE})"
done
done
- name: Prune old releases
run: |
TAG_PREFIX="${{ github.ref_name == 'main' && 'v6' || 'v6.*-beta' }}"
CURRENT_ID="${{ steps.create_release.outputs.id }}"
echo "Keeping release ${CURRENT_ID}, pruning older ${TAG_PREFIX} releases..."
PAGE=1
while true; do
RELEASES=$(curl -s "${{ env.FORGEJO_URL }}/api/v1/repos/${{ github.repository }}/releases?limit=50&page=${PAGE}" \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}")
COUNT=$(echo "$RELEASES" | python3 -c "import sys,json; print(len(json.load(sys.stdin)))" 2>/dev/null || echo 0)
[ "$COUNT" = "0" ] && break
echo "$RELEASES" | python3 -c "
import sys, json, fnmatch
for r in json.load(sys.stdin):
rid = r['id']
tag = r['tag_name']
if rid == ${CURRENT_ID}:
continue
if fnmatch.fnmatch(tag, '${TAG_PREFIX}*'):
print(f'{rid} {tag}')
" | while read -r RID RTAG; do
echo "Deleting release ${RTAG} (id=${RID})"
curl -s -o /dev/null -X DELETE \
"${{ env.FORGEJO_URL }}/api/v1/repos/${{ github.repository }}/releases/${RID}" \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}"
curl -s -o /dev/null -X DELETE \
"${{ env.FORGEJO_URL }}/api/v1/repos/${{ github.repository }}/tags/${RTAG}" \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}"
done
PAGE=$((PAGE + 1))
done
echo "Prune complete"

5
.gitattributes vendored
View file

@ -1,2 +1,5 @@
.git* export-ignore .git* export-ignore
/CMakeLists.txt export-subst /CMakeLists.txt export-subst
# Mark auto-generated SDK clients as "generated" to hide them in GitHub diffs
utils/sdk/client/** linguist-generated=true

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

View file

@ -1,27 +0,0 @@
name: PR Fast
permissions:
contents: write
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- dev
- main
paths-ignore:
- '**.md'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-macos-arm64:
name: Compile
uses: ./.github/workflows/build-macos-arm64.yml
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}

View file

@ -7,7 +7,10 @@ on:
pull_request_review: pull_request_review:
pull_request: pull_request:
types: types:
- review_requested - opened
- synchronize
- reopened
- ready_for_review
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@ -15,50 +18,39 @@ concurrency:
jobs: jobs:
build-linux-intel: build-linux-intel:
name: Chain name: Linux
if: | if: ${{!github.event.pull_request.draft}}
(github.actor == 'Snider' && github.event.pull_request.user.login == 'Snider') ||
(github.event.review.state == 'approved' && !github.event.pull_request.draft)
uses: ./.github/workflows/build-linux-intel.yml uses: ./.github/workflows/build-linux-intel.yml
secrets: inherit secrets: inherit
with: with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-linux-arm: build-linux-arm:
name: Chain name: Linux
if: | if: ${{!github.event.pull_request.draft}}
(github.actor == 'Snider' && github.event.pull_request.user.login == 'Snider') ||
(github.event.review.state == 'approved' && !github.event.pull_request.draft)
uses: ./.github/workflows/build-linux-arm64.yml uses: ./.github/workflows/build-linux-arm64.yml
secrets: inherit secrets: inherit
with: with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-windows-intel: build-windows-intel:
name: Chain name: Windows
if: | if: ${{!github.event.pull_request.draft}}
(github.actor == 'Snider' && github.event.pull_request.user.login == 'Snider') ||
(github.event.review.state == 'approved' && !github.event.pull_request.draft)
uses: ./.github/workflows/build-windows-intel.yml uses: ./.github/workflows/build-windows-intel.yml
secrets: inherit secrets: inherit
with: with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-arm64: build-macos-arm64:
name: Chain name: MacOS
if: |
(github.actor == 'Snider' && github.event.pull_request.user.login == 'Snider') ||
(github.event.review.state == 'approved' && !github.event.pull_request.draft)
uses: ./.github/workflows/build-macos-arm64.yml uses: ./.github/workflows/build-macos-arm64.yml
secrets: inherit secrets: inherit
with: with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-intel: build-macos-intel:
name: Chain name: MacOS
if: | if: ${{!github.event.pull_request.draft}}
(github.actor == 'Snider' && github.event.pull_request.user.login == 'Snider') ||
(github.event.review.state == 'approved' && !github.event.pull_request.draft)
uses: ./.github/workflows/build-macos-intel.yml uses: ./.github/workflows/build-macos-intel.yml
secrets: inherit secrets: inherit
with: with:
@ -66,9 +58,7 @@ jobs:
build-docker: build-docker:
name: Docker name: Docker
if: | if: ${{!github.event.pull_request.draft}}
(github.actor == 'Snider' && github.event.pull_request.user.login == 'Snider') ||
(github.event.review.state == 'approved' && !github.event.pull_request.draft)
uses: ./.github/workflows/build-docker.yml uses: ./.github/workflows/build-docker.yml
secrets: inherit secrets: inherit
with: with:
@ -76,7 +66,5 @@ jobs:
build-docs: build-docs:
name: Docs name: Docs
if: | if: ${{!github.event.pull_request.draft}}
(github.actor == 'Snider' && github.event.pull_request.user.login == 'Snider') ||
(github.event.review.state == 'approved' && !github.event.pull_request.draft)
uses: ./.github/workflows/build-docs.yml uses: ./.github/workflows/build-docs.yml

View file

@ -16,41 +16,46 @@ concurrency:
jobs: jobs:
build-linux-intel: build-linux-intel:
name: Chain name: Linux
uses: ./.github/workflows/build-linux-intel.yml uses: ./.github/workflows/build-linux-intel.yml
secrets: inherit
with: with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-linux-arm: build-linux-arm:
name: Chain name: Linux
uses: ./.github/workflows/build-linux-arm64.yml uses: ./.github/workflows/build-linux-arm64.yml
secrets: inherit
with: with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-windows-intel: build-windows-intel:
name: Chain name: Windows
uses: ./.github/workflows/build-windows-intel.yml uses: ./.github/workflows/build-windows-intel.yml
secrets: inherit
with: with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-arm64: build-macos-arm64:
name: Chain name: MacOS
uses: ./.github/workflows/build-macos-arm64.yml uses: ./.github/workflows/build-macos-arm64.yml
secrets: inherit
with: with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-intel: build-macos-intel:
name: Chain name: MacOS
uses: ./.github/workflows/build-macos-intel.yml uses: ./.github/workflows/build-macos-intel.yml
secrets: inherit
with: with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-docker: build-docker:
name: Docker name: Docker
uses: ./.github/workflows/build-docker.yml uses: ./.github/workflows/build-docker.yml
secrets: inherit
with: with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
secrets: inherit
build-docs: build-docs:
name: Docs name: Docs

View file

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

View file

@ -1,6 +1,6 @@
name: docs name: docs
permissions: permissions:
contents: read contents: write
on: on:
workflow_call: workflow_call:
@ -17,29 +17,24 @@ jobs:
with: with:
python-version: 3.x python-version: 3.x
- name: Install Conan - name: Cache SDK Folder
uses: conan-io/setup-conan@v1 uses: actions/cache@v4
with: with:
home: ${{ github.workspace }}/build/sdk path: |
cache_packages: true ${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- uses: actions/cache@v4
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: 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 - name: Build Offline Version
run: make docs run: make docs
- name: Zip Build - name: CLI Artifacts
run: | uses: ./.github/actions/upload-artifacts
cd build/docs
zip -qq -r ../documentation.zip *
- name: Upload Artifacts
uses: actions/upload-artifact@v4.6.2
with: with:
name: Documentation chain-network: ${{ inputs.chain-network }}
path: build/documentation.zip assets: "*"
asset-type: 'docs'
asset-directory: ${{ github.workspace }}/build/docs

View file

@ -11,8 +11,48 @@ on:
type: string type: string
jobs: jobs:
cache:
name: cache-arm64
runs-on: ubuntu-22.04-arm
steps:
- name: Cache SDK Folder
id: cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- name: Checkout Project
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt-get install -y autotools-dev git build-essential libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev pngquant
- uses: actions/setup-python@v5
if: steps.cache.outputs.cache-hit != 'true'
with:
python-version: 3.x
- if: steps.cache.outputs.cache-hit != 'true'
run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }}
make upload-conan-cache
build: build:
name: gcc-linux-arm64 name: compile-arm64
needs: cache
runs-on: ubuntu-22.04-arm runs-on: ubuntu-22.04-arm
steps: steps:
- name: Checkout Project - name: Checkout Project
@ -22,22 +62,24 @@ jobs:
submodules: recursive submodules: recursive
- name: install dependencies - name: install dependencies
run: sudo apt-get install -y autotools-dev git build-essential run: sudo apt-get install -y autotools-dev rpm git build-essential libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev pngquant
- name: Cache SDK Folder - name: Cache SDK Folder
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ${{ github.workspace }}/build/sdk path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk key: ${{ runner.os }}-${{ runner.arch }}-sdk
- name: Install Conan - uses: actions/setup-python@v5
uses: conan-io/setup-conan@v1
with: with:
home: ${{ github.workspace }}/build/sdk python-version: 3.x
cache_packages: false
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Release - name: Compile Release
run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} run: make ${{ inputs.chain-network }}
- name: CLI Artifacts - name: CLI Artifacts
uses: ./.github/actions/upload-artifacts uses: ./.github/actions/upload-artifacts
@ -45,4 +87,4 @@ jobs:
chain-network: ${{ inputs.chain-network }} chain-network: ${{ inputs.chain-network }}
assets: lethean-* assets: lethean-*
asset-type: 'cli' asset-type: 'cli'
asset-directory: ${{ github.workspace }}/build/release/packages asset-directory: ${{ github.workspace }}/build/packages

View file

@ -11,8 +11,49 @@ on:
type: string type: string
jobs: jobs:
cache:
name: cache-x86_64
runs-on: ubuntu-22.04
steps:
- name: Cache SDK Folder
id: cache
uses: actions/cache@v4
with:
lookup-only: true
path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- name: Checkout Project
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt-get install -y autotools-dev rpm git build-essential
- uses: actions/setup-python@v5
if: steps.cache.outputs.cache-hit != 'true'
with:
python-version: 3.x
- if: steps.cache.outputs.cache-hit != 'true'
run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }}
make upload-conan-cache
build: build:
name: gcc-linux-x86_64 name: compile-x86_64
needs: cache
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout Project - name: Checkout Project
@ -27,17 +68,18 @@ jobs:
- name: Cache SDK Folder - name: Cache SDK Folder
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ${{ github.workspace }}/build/sdk path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk key: ${{ runner.os }}-${{ runner.arch }}-sdk
- name: Install Conan - uses: actions/setup-python@v5
uses: conan-io/setup-conan@v1
with: with:
home: ${{ github.workspace }}/build/sdk python-version: 3.x
cache_packages: false - run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Release - name: Compile Release
run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} run: make ${{ inputs.chain-network }}
- name: CLI Artifacts - name: CLI Artifacts
uses: ./.github/actions/upload-artifacts uses: ./.github/actions/upload-artifacts
@ -45,4 +87,4 @@ jobs:
chain-network: ${{ inputs.chain-network }} chain-network: ${{ inputs.chain-network }}
assets: lethean-* assets: lethean-*
asset-type: 'cli' asset-type: 'cli'
asset-directory: ${{ github.workspace }}/build/release/packages asset-directory: ${{ github.workspace }}/build/packages

View file

@ -12,8 +12,45 @@ on:
jobs: jobs:
build-cli: cache:
name: apple-clang-armv8 name: cache-armv8
runs-on: macos-15
steps:
- name: Cache SDK Folder
id: cache
uses: actions/cache@v4
with:
lookup-only: true
path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- name: Checkout Project
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- uses: actions/setup-python@v5
if: steps.cache.outputs.cache-hit != 'true'
with:
python-version: 3.x
- if: steps.cache.outputs.cache-hit != 'true'
run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
make build-deps CPU_CORES=3 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }}
make upload-conan-cache
build:
name: compile-armv8
needs: cache
runs-on: macos-15 runs-on: macos-15
steps: steps:
- name: Checkout Project - name: Checkout Project
@ -22,25 +59,22 @@ jobs:
fetch-depth: 0 fetch-depth: 0
submodules: recursive submodules: recursive
- name: Cache SDK Folder - name: Cache SDK Folder
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ${{ github.workspace }}/build/sdk path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk key: ${{ runner.os }}-${{ runner.arch }}-sdk
- name: Install Conan - uses: actions/setup-python@v5
uses: conan-io/setup-conan@v1
with: with:
home: ${{ github.workspace }}/build/sdk python-version: 3.x
cache_packages: false
# - name: Compile Release - run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
# run: make apple-clang-armv8 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
- name: Compile Release - name: Compile Release
run: make release CPU_CORES=3 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} run: make ${{ inputs.chain-network }}
- name: CLI Artifacts - name: CLI Artifacts
uses: ./.github/actions/upload-artifacts uses: ./.github/actions/upload-artifacts
@ -48,4 +82,4 @@ jobs:
chain-network: ${{ inputs.chain-network }} chain-network: ${{ inputs.chain-network }}
assets: lethean-* assets: lethean-*
asset-type: 'cli' asset-type: 'cli'
asset-directory: ${{ github.workspace }}/build/release/packages asset-directory: ${{ github.workspace }}/build/packages

View file

@ -11,8 +11,43 @@ on:
type: string type: string
jobs: jobs:
cache:
name: cache-x86_64
runs-on: macos-13
steps:
- name: Cache SDK Folder
id: cache
uses: actions/cache@v4
with:
lookup-only: true
path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- name: Checkout Project
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- uses: actions/setup-python@v5
if: steps.cache.outputs.cache-hit != 'true'
with:
python-version: 3.x
- if: steps.cache.outputs.cache-hit != 'true'
run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }}
make upload-conan-cache
build: build:
name: apple-clang-x86_64 name: compile-x86_64
needs: cache
runs-on: macos-13 runs-on: macos-13
steps: steps:
- name: Checkout Project - name: Checkout Project
@ -21,21 +56,21 @@ jobs:
fetch-depth: 0 fetch-depth: 0
submodules: recursive submodules: recursive
- name: Cache SDK Folder - name: Cache SDK Folder
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ${{ github.workspace }}/build/sdk path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk key: ${{ runner.os }}-${{ runner.arch }}-sdk
- name: Install Conan - uses: actions/setup-python@v5
uses: conan-io/setup-conan@v1
with: with:
home: ${{ github.workspace }}/build/sdk python-version: 3.x
cache_packages: false - run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Release - name: Compile Release
run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} run: make ${{ inputs.chain-network }}
- name: CLI Artifacts - name: CLI Artifacts
uses: ./.github/actions/upload-artifacts uses: ./.github/actions/upload-artifacts
@ -43,4 +78,4 @@ jobs:
chain-network: ${{ inputs.chain-network }} chain-network: ${{ inputs.chain-network }}
assets: lethean-* assets: lethean-*
asset-type: 'cli' asset-type: 'cli'
asset-directory: ${{ github.workspace }}/build/release/packages asset-directory: ${{ github.workspace }}/build/packages

View file

@ -11,9 +11,44 @@ on:
type: string type: string
jobs: jobs:
msvc-194: cache:
name: msvc-194-x86_64 name: cache-x86_64
runs-on: windows-2022 runs-on: windows-latest
steps:
- name: Cache SDK Folder
id: cache
uses: actions/cache@v4
with:
lookup-only: true
path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- name: Checkout Project
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- uses: actions/setup-python@v5
if: steps.cache.outputs.cache-hit != 'true'
with:
python-version: 3.x
- if: steps.cache.outputs.cache-hit != 'true'
run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }}
make upload-conan-cache
build:
name: compile-x86_64
needs: cache
runs-on: windows-latest
steps: steps:
- name: Checkout Project - name: Checkout Project
uses: actions/checkout@v4.2.2 uses: actions/checkout@v4.2.2
@ -24,17 +59,19 @@ jobs:
- name: Cache SDK Folder - name: Cache SDK Folder
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ${{ github.workspace }}/build/sdk path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk key: ${{ runner.os }}-${{ runner.arch }}-sdk
- name: Install Conan - run: choco install nsis.install
uses: conan-io/setup-conan@v1 - uses: actions/setup-python@v5
with: with:
home: ${{ github.workspace }}/build/sdk python-version: 3.x
cache_packages: false - run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Release - name: Compile Release
run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} run: make ${{ inputs.chain-network }}
- name: CLI Artifacts - name: CLI Artifacts
uses: ./.github/actions/upload-artifacts uses: ./.github/actions/upload-artifacts
@ -42,4 +79,4 @@ jobs:
chain-network: ${{ inputs.chain-network }} chain-network: ${{ inputs.chain-network }}
assets: lethean-* assets: lethean-*
asset-type: 'cli' asset-type: 'cli'
asset-directory: ${{ github.workspace }}/build/release/packages asset-directory: ${{ github.workspace }}/build/packages

9
.gitignore vendored
View file

@ -5,6 +5,13 @@
._.DS_Store ._.DS_Store
Thumbs.db Thumbs.db
._* ._*
.idea .idea/workspace.xml
.idea/usage.statistics.xml
.idea/dictionaries
.idea/shelf
.idea/copilot*
.idea/modules.xml
.idea/*.iml
.vs/* .vs/*
CMakeUserPresets.json CMakeUserPresets.json
ConanPresets.json

6
.gitmodules vendored
View file

@ -10,3 +10,9 @@
[submodule "docs"] [submodule "docs"]
path = docs path = docs
url = https://github.com/letheanVPN/documentation.git url = https://github.com/letheanVPN/documentation.git
[submodule "contrib/randomx"]
path = contrib/randomx
url = https://github.com/tevador/RandomX.git
[submodule ".core/build"]
path = .core/build
url = http://forge.snider.dev:4000/host-uk/build.git

8
.idea/.gitignore generated vendored Normal file
View file

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

1
.idea/.name generated Normal file
View file

@ -0,0 +1 @@
Lethean

8
.idea/cmake.xml generated Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSharedSettings">
<configurations>
<configuration PROFILE_NAME="Debug" ENABLED="true" GENERATION_DIR="build/release" CONFIG_NAME="Debug" GENERATION_OPTIONS="--preset testnet" BUILD_OPTIONS="--preset testnet --parallel 30" NO_GENERATOR="true" />
</configurations>
</component>
</project>

105
.idea/codeStyles/Project.xml generated Normal file
View file

@ -0,0 +1,105 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<RiderCodeStyleSettings>
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
</RiderCodeStyleSettings>
<clangFormatSettings>
<option name="ENABLED" value="true" />
</clangFormatSettings>
</code_scheme>
</component>

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View file

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

6
.idea/copyright/LTHN.xml generated Normal file
View file

@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright (c) 2017-2025 Lethean (https://lt.hn)&#10;&#10;Licensed under the European Union Public Licence (EUPL) version 1.2.&#10;You may obtain a copy of the licence at:&#10;&#10; https://joinup.ec.europa.eu/software/page/eupl/licence-eupl&#10;&#10;The EUPL is a copyleft licence that is compatible with the MIT/X11&#10;licence used by the original projects; but maintains OSS status, &#10;where regional copyright law requires ownership to dictate licence terms.&#10;&#10;SPDXLicenseIdentifier: EUPL-1.2&#10;" />
<option name="myName" value="LTHN" />
</copyright>
</component>

6
.idea/copyright/Lethean.xml generated Normal file
View file

@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright (c) 2014-2018 Zano Project&#10;Copyright (c) 2014-2018 The Louisdor Project&#10;Copyright (c) 2012-2013 The Boolberry developers&#10;Copyright (c) 2017-2025 Lethean (https://lt.hn)&#10;&#10;Licensed under the European Union Public Licence (EUPL) version 1.2.&#10;You may obtain a copy of the licence at:&#10;&#10; https://joinup.ec.europa.eu/software/page/eupl/licence-eupl&#10;&#10;The EUPL is a copyleft licence that is compatible with the MIT/X11&#10;licence used by the original projects; the MIT terms are therefore&#10;considered “grandfathered” under the EUPL for this code.&#10;&#10;SPDXLicenseIdentifier: EUPL-1.2&#10;" />
<option name="myName" value="Lethean" />
</copyright>
</component>

8
.idea/copyright/profiles_settings.xml generated Normal file
View file

@ -0,0 +1,8 @@
<component name="CopyrightManager">
<settings default="LTHN">
<module2copyright>
<element module="apiserver" copyright="LTHN" />
<element module="Project Files" copyright="Lethean" />
</module2copyright>
</settings>
</component>

344
.idea/editor.xml generated Normal file
View file

@ -0,0 +1,344 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BackendCodeEditorSettings">
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedOverridenMethod/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppModulePartitionWithSeveralPartitionUnits/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantFwdClassOrEnumSpecifier/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifierADL/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
</component>
</project>

View file

@ -0,0 +1,13 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="tuple.*" />
</list>
</option>
</inspection_tool>
</profile>
</component>

43
.idea/jsonSchemas.xml generated Normal file
View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JsonSchemaMappingsProjectConfiguration">
<state>
<map>
<entry key="GitHub Action JSON Schema">
<value>
<SchemaInfo>
<option name="name" value="GitHub Action JSON Schema" />
<option name="relativePathToSchema" value="jar://$APPLICATION_PLUGINS_DIR$/vcs-github-IU/lib/vcs-github.jar!/schemas/github-action.json" />
<option name="applicationDefined" value="true" />
<option name="patterns">
<list>
<Item>
<option name="path" value=".github/actions/**/*.yml" />
</Item>
</list>
</option>
</SchemaInfo>
</value>
</entry>
<entry key="openapitools">
<value>
<SchemaInfo>
<option name="generatedName" value="New Schema" />
<option name="name" value="openapitools" />
<option name="relativePathToSchema" value="utils/sdk/openapitools.json" />
<option name="patterns">
<list>
<Item>
<option name="directory" value="true" />
<option name="path" value="utils/sdk/packages" />
<option name="mappingKind" value="Directory" />
</Item>
</list>
</option>
</SchemaInfo>
</value>
</entry>
</map>
</state>
</component>
</project>

34
.idea/misc.xml generated Normal file
View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.13 virtualenv at $PROJECT_DIR$.venv" />
</component>
<component name="CMakePythonSetting">
<option name="pythonIntegrationState" value="YES" />
</component>
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
<component name="CidrRootsConfiguration">
<excludeRoots>
<file path="$PROJECT_DIR$/build" />
</excludeRoots>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MakefileSettings">
<option name="linkedExternalProjectsSettings">
<MakefileProjectSettings>
<option name="buildOptions" value="--jobs=30" />
<option name="buildTarget" value="build" />
<option name="cleanTarget" value="clean-build" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="switches" value="TESTNET=1 STATIC=1" />
<option name="version" value="2" />
</MakefileProjectSettings>
</option>
</component>
<component name="MakefileWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
</project>

6
.idea/prettier.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PrettierConfiguration">
<option name="myConfigurationMode" value="AUTOMATIC" />
</component>
</project>

3
.idea/scopes/apiserver.xml generated Normal file
View file

@ -0,0 +1,3 @@
<component name="DependencyValidationManager">
<scope name="apiserver" pattern="file[blockchain]:src/api//*" />
</component>

10
.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/contrib/bitcoin-secp256k1" vcs="Git" />
<mapping directory="$PROJECT_DIR$/contrib/jwt-cpp" vcs="Git" />
<mapping directory="$PROJECT_DIR$/contrib/tor-connect" vcs="Git" />
<mapping directory="$PROJECT_DIR$/docs" vcs="Git" />
</component>
</project>

55
AGENTS.md Normal file
View file

@ -0,0 +1,55 @@
# AI Agent Collaboration Framework for Repository Contributions
## 1. Purpose and Guiding Philosophy
This document provides a guiding framework for any AI agent interacting with this repository. Its purpose is to ensure that all automated contributions, especially Pull Request (PR) reviews and code suggestions, are constructive, respectful, and aligned with the project's overarching goals.
This framework operates in accordance with the foundational **Axioms of Life**, translating their universal principles into the specific context of human-AI software development collaboration. The primary goal is a partnership that enhances code quality and developer velocity, not one that creates friction through pedantry.
## 2. Core Principles for AI Interaction
All agents MUST adhere to the following principles:
* **Principle 1: Respect Authorial Intent (Axiom 1 & 4)**
* Your primary goal is to understand and support the human author's objective. Before suggesting a change, first assume the author had a valid reason for their implementation. Frame your feedback as a way to better achieve their goal or to prevent unintended side effects. Do not challenge intent without clear evidence of a functional error.
* **Principle 2: Prioritize Objectivity and Verifiability (Axiom 2)**
* Feedback MUST be anchored in objective, verifiable criteria. Subjective opinions on style are the lowest priority.
* **Valid criteria include:**
* Demonstrable bugs or logical errors.
* Security vulnerabilities.
* Performance regressions.
* Violations of a documented project standard (e.g., a style guide file in the repo).
* **Invalid criteria include:**
* Personal stylistic preferences not codified in a project standard.
* Code organization that is merely "different" but not functionally incorrect.
* **Principle 3: Adopt a Collaborative, Non-Authoritarian Tone (Axiom 4)**
* As a digital substrate interacting with a human one, you must adopt a tone of a helpful, respectful peer. Avoid declarative or demanding language.
* **Prefer:** "Have you considered...?", "An alternative here that might prevent X is...", "I noticed this could lead to Y. What do you think about...?"
* **Avoid:** "You must fix this.", "This is wrong.", "Change this to..."
* **Principle 4: Provide Actionable and Justified Suggestions (Axiom 3)**
* Do not simply state that something is incorrect. Provide a clear explanation for *why* it is a potential issue and, whenever possible, offer a concrete, well-explained code suggestion that resolves it. Your intent is to help, not just to criticize.
## 3. Feedback Severity Classification
To combat pedantry, all feedback provided in PR reviews MUST be classified into one of the following three levels. This creates a clear hierarchy of importance.
### **Level 1: Critical (Blocking)**
* **Definition:** Issues that will cause demonstrable harm if merged.
* **Examples:** Bugs, logic errors, security vulnerabilities, unhandled exceptions, build failures.
* **Action:** These issues MUST be addressed by the author before a merge. Your feedback should clearly state the nature of the critical issue.
### **Level 2: Important (Non-Blocking Recommendation)**
* **Definition:** Issues that deviate from established project best practices or could impact future maintainability.
* **Examples:** Violations of a documented style guide, clear opportunities to improve readability, non-critical performance improvements, deprecation warnings.
* **Action:** These issues SHOULD be addressed. Frame them as strong recommendations that improve the health of the codebase. The author may choose to address them in a follow-up PR if necessary.
### **Level 3: Suggestion (Optional Nitpick)**
* **Definition:** Minor stylistic preferences, alternative implementations with no clear functional advantage, or purely cosmetic changes. This is the "pedantic" category.
* **Action:** These suggestions are entirely optional and at the author's discretion. They MUST be explicitly prefixed with "Optional:", "Nit:", or "Suggestion:". This signals to the human that the comment is non-essential and can be safely ignored without consequence.
---
By adhering to this framework, AI agents become valuable partners in the development process, helping to catch critical errors while respecting the creative autonomy and focus of their human collaborators.

View file

@ -1,19 +1,16 @@
cmake_minimum_required(VERSION 3.16) 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)") set(DISABLE_TOR TRUE CACHE BOOL "Disable TOR library(and related tor-connect submodule)")
PROJECT(Lethean) PROJECT(Lethean)
set(VERSION "1.0" CACHE STRING "Build version") set(VERSION "1.0" CACHE STRING "Build version")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message("OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}")
message("OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}")
message("OPENSSL_SSL_LIBRARY: ${OPENSSL_SSL_LIBRARY}")
list(INSERT CMAKE_MODULE_PATH 0 list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/cmake") "${CMAKE_CURRENT_SOURCE_DIR}/.core/build/cmake")
include(DocBuilder)
if(POLICY CMP0043) if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW) cmake_policy(SET CMP0043 NEW)
@ -21,6 +18,9 @@ endif()
if(POLICY CMP0043) if(POLICY CMP0043)
cmake_policy(SET CMP0074 NEW) cmake_policy(SET CMP0074 NEW)
endif() endif()
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
if(POLICY CMP0144) if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW) cmake_policy(SET CMP0144 NEW)
endif() endif()
@ -28,16 +28,13 @@ if(POLICY CMP0167)
cmake_policy(SET CMP0167 OLD) cmake_policy(SET CMP0167 OLD)
endif() endif()
#option (USE_CCACHE "Use ccache if a usable instance is found" ON) include(DocBuilder)
#if (USE_CCACHE) option (USE_CCACHE "Use ccache if a usable instance is found" OFF)
# include(FindCcache) # Has to be included after the project() macro, to be able to read the CXX variable. if (USE_CCACHE)
#else() include(FindCcache)
# message(STATUS "ccache deselected") else()
#endif() message(STATUS "ccache deselected")
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android") if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
add_definitions(-DMOBILE_WALLET_BUILD) add_definitions(-DMOBILE_WALLET_BUILD)
@ -86,19 +83,13 @@ endif()
set(USE_PCH FALSE CACHE BOOL "Use shared precompiled headers") 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(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(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)") 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) if(NOT USE_BITCOIN_SECP256K1_FOR_ECDSA)
add_definitions(-DUSE_OPEN_SSL_FOR_ECDSA) add_definitions(-DUSE_OPEN_SSL_FOR_ECDSA)
endif() endif()
find_package(miniupnpc REQUIRED)
find_package(ZLIB REQUIRED)
include_directories(src contrib/eos_portable_archive ${ZLIB_INCLUDE_DIRS} contrib contrib/epee/include contrib/jwt-cpp/include ${OPENSSL_INCLUDE_DIR} "${CMAKE_BINARY_DIR}/version")
add_definitions(-DSTATICLIB) add_definitions(-DSTATICLIB)
if(TESTNET) if(TESTNET)
@ -149,7 +140,7 @@ if(MSVC)
endforeach() endforeach()
endif() endif()
include_directories(SYSTEM src/platform/msc) include_directories(SYSTEM src/platform/msc)
configure_file(utils/Directory.Build.props.in ${CMAKE_BINARY_DIR}/Directory.Build.props)
else() else()
set(ARCH default CACHE STRING "CPU to build for: -march value or default") set(ARCH default CACHE STRING "CPU to build for: -march value or default")
if("${ARCH}" STREQUAL "default") if("${ARCH}" STREQUAL "default")
@ -191,7 +182,7 @@ else()
endif() endif()
set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wstrict-prototypes -Wno-comment") set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wstrict-prototypes -Wno-comment")
set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers") set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers")
try_compile(STATIC_ASSERT_RES "${CMAKE_CURRENT_BINARY_DIR}/static-assert" "${CMAKE_CURRENT_SOURCE_DIR}/utils/test-static-assert.c" COMPILE_DEFINITIONS "-std=c++14") try_compile(STATIC_ASSERT_RES "${CMAKE_CURRENT_BINARY_DIR}/static-assert" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/test-static-assert.c" COMPILE_DEFINITIONS "-std=c++14")
if(STATIC_ASSERT_RES) if(STATIC_ASSERT_RES)
set(STATIC_ASSERT_FLAG "") set(STATIC_ASSERT_FLAG "")
else() else()
@ -217,9 +208,9 @@ else()
if(NOT APPLE AND NOT (CMAKE_SYSTEM_NAME STREQUAL "Android")) if(NOT APPLE AND NOT (CMAKE_SYSTEM_NAME STREQUAL "Android"))
set(RELEASE_FLAGS "${RELEASE_FLAGS} -flto=auto -g3") set(RELEASE_FLAGS "${RELEASE_FLAGS} -flto=auto -g3")
endif() endif()
#if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT MINGW) if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT MINGW)
# set(RELEASE_FLAGS "${RELEASE_FLAGS} -fno-fat-lto-objects") set(RELEASE_FLAGS "${RELEASE_FLAGS} -fno-fat-lto-objects")
#endif() endif()
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${DEBUG_FLAGS}") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${DEBUG_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}")
@ -251,14 +242,25 @@ set(BOOST_COMPONENTS system filesystem locale thread timer date_time chrono rege
if(NOT APPLE) if(NOT APPLE)
list(APPEND BOOST_COMPONENTS log) list(APPEND BOOST_COMPONENTS log)
endif() endif()
# Find Boost package using Conan
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
message(STATUS "Using Boost ${Boost_VERSION} from Conan") message(STATUS "Using Boost ${Boost_VERSION} from Conan")
include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) find_package(miniupnpc REQUIRED)
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/contrib/ethereum/libethash) find_package(ZLIB REQUIRED)
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
include_directories(src "${CMAKE_BINARY_DIR}/version")
include_directories(SYSTEM
${Boost_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/contrib/ethereum/libethash
contrib
contrib/epee/include
contrib/jwt-cpp/include
contrib/eos_portable_archive
)
# Append other needed libraries # Append other needed libraries
if(MINGW) if(MINGW)

109
CMakePresets.json Normal file
View file

@ -0,0 +1,109 @@
{
"version": 8,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
},
"include": [
"ConanPresets.json"
],
"configurePresets": [
{
"name": "testnet",
"binaryDir": "${sourceDir}/build/release",
"environment": {
"CONAN_HOME": "${sourceDir}/build/sdk"
},
"cacheVariables": {
"TESTNET": "ON",
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES":".core/build/cmake/ConanProvider.cmake"
}
},
{
"name": "mainnet",
"binaryDir": "${sourceDir}/build/release",
"environment": {
"CONAN_HOME": "${sourceDir}/build/sdk"
},
"cacheVariables": {
"TESTNET": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES":".core/build/cmake/ConanProvider.cmake"
}
}
],
"buildPresets": [
{
"name": "testnet",
"configurePreset": "testnet"
},
{
"name": "mainnet",
"configurePreset": "mainnet"
}
],
"testPresets": [
{
"name": "mainnet",
"configurePreset": "mainnet",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": true}
}
],
"packagePresets": [
{
"name": "mainnet",
"configurePreset": "mainnet",
"generators": [
"TGZ",
"ZIP"
]
},
{
"name": "testnet",
"configurePreset": "testnet",
"generators": [
"TGZ",
"ZIP"
]
}
],
"workflowPresets": [
{
"name": "testnet",
"steps": [
{
"type": "configure",
"name": "testnet"
},
{
"type": "build",
"name": "testnet"
},
{
"type": "package",
"name": "testnet"
}
]
},
{
"name": "mainnet",
"steps": [
{
"type": "configure",
"name": "mainnet"
},
{
"type": "build",
"name": "mainnet"
},
{
"type": "package",
"name": "mainnet"
}
]
}
]
}

9
ConanPresets.json Normal file
View file

@ -0,0 +1,9 @@
{
"version": 4,
"vendor": {
"conan": {}
},
"include": [
"build/release/generators/CMakePresets.json"
]
}

215
Makefile
View file

@ -4,190 +4,193 @@
# Distributed under the MIT/X11 software license, see the accompanying # Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
# ============================================================
# Build system from host-uk/build submodule
# ============================================================
BUILD_SYS := .core/build
CMAKE_DIR := $(BUILD_SYS)/cmake
# ============================================================
# Project Configuration
# ============================================================
CPU_CORES := 1
TESTNET:= 0
STATIC:= 0
BUILD_TYPE ?=Release
BUILD_VERSION:=6.0.1
BUILD_FOLDER:=build/release
PRESET_BUILD:=conan-release
PRESET_CONFIGURE:=conan-release
# ------------------------------------------------------------ # ------------------------------------------------------------
# Detect the number of logical CPU cores works on Linux, # Detect the number of logical CPU cores works on Linux,
# macOS, BSD, and Windows (both cmd.exe and PowerShell). # macOS, BSD, and Windows (both cmd.exe and PowerShell).
# ------------------------------------------------------------ # ------------------------------------------------------------
# Default to “unknown” will be overwritten below.
CPU_CORES := 1
TESTNET:= 0
BUILD_TYPE ?=Release
BUILD_VERSION:=6.0.1
# -----------------------------------------------------------------
# Unixlike systems (Linux, macOS, *BSD, etc.)
# -----------------------------------------------------------------
UNAME_S := $(shell uname -s 2>/dev/null || echo Unknown) UNAME_S := $(shell uname -s 2>/dev/null || echo Unknown)
ifeq ($(UNAME_S),Linux) ifeq ($(UNAME_S),Linux)
# Linux: try nproc first, fall back to /proc
CPU_CORES := $(shell nproc 2>/dev/null || \ CPU_CORES := $(shell nproc 2>/dev/null || \
grep -c ^processor /proc/cpuinfo 2>/dev/null || echo 1) grep -c ^processor /proc/cpuinfo 2>/dev/null || echo 1)
endif endif
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
# macOS: sysctl reports the number of logical CPUs
CPU_CORES := $(shell sysctl -n hw.logicalcpu 2>/dev/null || echo 1) CPU_CORES := $(shell sysctl -n hw.logicalcpu 2>/dev/null || echo 1)
endif endif
ifeq ($(filter %BSD,$(UNAME_S)),%BSD) ifeq ($(filter %BSD,$(UNAME_S)),%BSD)
# *BSD: also sysctl, but the key differs on some variants
CPU_CORES := $(shell sysctl -n hw.ncpu 2>/dev/null || echo 1) CPU_CORES := $(shell sysctl -n hw.ncpu 2>/dev/null || echo 1)
endif endif
# -----------------------------------------------------------------
# Windows (detected by the builtin $(OS) variable set by GNU make)
# -----------------------------------------------------------------
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
# Prefer the environment variable that Windows sets for us.
# It works in both cmd.exe and PowerShell. PRESET_CONFIGURE:=conan-default
CPU_CORES := $(NUMBER_OF_PROCESSORS) CPU_CORES := $(NUMBER_OF_PROCESSORS)
# If for some reason the env var is empty, fall back to PowerShell.
ifeq ($(CPU_CORES),) ifeq ($(CPU_CORES),)
CPU_CORES := $(shell powershell -NoProfile -Command ^ "[Environment]::ProcessorCount") CPU_CORES := $(shell powershell -NoProfile -Command ^ "[Environment]::ProcessorCount")
endif endif
endif endif
#testnet-genesis-new: # Safety net
# $(eval command += $(cmake_release) $(testnet))
# $(call CMAKE,$(dir_release),$(command) -DGENERATE_PREMINE_WALLET=1 -DPREMINE_WALLET_PASSWORD=12345678) && cmake --build ./src --target premine_wallet || true
# $(eval command += $(cmake_release) $(testnet))
# $(call CMAKE,$(dir_release),$(command) -DGENERATE_FRESH_GENESIS=1) && cmake --build ./src --target genesis_generator
# $(eval command += $(cmake_release) $(testnet))
# $(call CMAKE,$(dir_release),$(command)) && $(MAKE)
#
#genesis-new:
# $(eval command += $(cmake_release))
# $(call CMAKE,$(dir_release),$(command) -DGENERATE_FRESH_GENESIS=1) && cmake --build ./src --target genesis_generator
# $(eval command += $(cmake_release))
# $(call CMAKE,$(dir_release),$(command)) && $(MAKE)
# -----------------------------------------------------------------
# Safety net ensure we always have a positive integer.
# -----------------------------------------------------------------
CPU_CORES := $(or $(CPU_CORES),1) CPU_CORES := $(or $(CPU_CORES),1)
CPU_CORES := $(shell expr $(CPU_CORES) + 0 2>/dev/null || echo 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/*)) # Paths — profiles and cmake modules from .build submodule
SORTED_PROFILES := $(sort $(PROFILES)) # ============================================================
CONAN_CACHE := $(CURDIR)/build/sdk PROFILES :=$(patsubst $(CMAKE_DIR)/profiles/%,%,$(wildcard $(CMAKE_DIR)/profiles/*))
DEFAULT_CONAN_PROFILE := $(CONAN_CACHE)/profiles/default SORTED_PROFILES :=$(sort $(PROFILES))
CC_DOCKER_FILE?=utils/docker/images/lthn-chain/Dockerfile CONAN_CACHE :=$(CURDIR)/build/sdk
CONAN_URL :=http://forge.snider.dev:4000/api/packages/host-uk/conan
CONAN_USER ?=$(shell echo $$CONAN_USER)
CONAN_PASSWORD ?=$(shell echo $$CONAN_PASSWORD)
CONAN_EXECUTABLE :=$(CURDIR)/build/bin/conan
CC_DOCKER_FILE ?=utils/docker/images/lthn-chain/Dockerfile
SDK_PACKAGES_JSON :=$(wildcard utils/sdk/packages/*.json)
SDK_TARGETS :=$(patsubst utils/sdk/packages/%.json,%,$(SDK_PACKAGES_JSON))
SORTED_SDK_TARGETS :=$(sort $(SDK_TARGETS))
all: help all: help
release: conan-profile-detect testnet:
@echo "Building profile: release $(TESTNET)" $(MAKE) configure TESTNET=1 STATIC=$(STATIC)
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/release --build=missing -s build_type=$(BUILD_TYPE) CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) build .
cmake -S . -B build/release -DCMAKE_TOOLCHAIN_FILE=build/release/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION) $(MAKE) package
cmake --build build/release --config=$(BUILD_TYPE) --parallel=$(CPU_CORES)
(cd build/release && cpack)
debug: conan-profile-detect mainnet:
@echo "Building profile: debug" $(MAKE) configure TESTNET=0 STATIC=$(STATIC)
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/debug --build=missing -s build_type=Debug CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) build .
cmake -S . -B build/debug -DCMAKE_TOOLCHAIN_FILE=build/debug/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -DTESTNET=$(TESTNET) $(MAKE) package
cmake --build build/debug --config=Debug --parallel=$(CPU_CORES)
static: static-release release: docs build
static-release: conan-profile-detect (cd $(BUILD_FOLDER) && cpack)
@echo "Building profile: release-static" @rm -rf $(CURDIR)/build/packages/_CPack_Packages
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)
conan-profile-detect: build: configure
@if [ ! -f "$(DEFAULT_CONAN_PROFILE)" ]; then \ cmake --build --preset $(PRESET_BUILD) --parallel=$(CPU_CORES)
echo "Default conan profile not found. Detecting a new one..."; \
CONAN_HOME=$(CONAN_CACHE) conan profile detect --name=default --force; \
fi
build-deps: conan-profile-detect
@echo "Build Dependencies: $(BUILD_TYPE) testnet=$(TESTNET)"
CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) install . --build=missing -s build_type=$(BUILD_TYPE)
# Rule for each profile package:
@echo "Packaging: $(BUILD_TYPE) testnet=$(TESTNET)"
(cd $(BUILD_FOLDER) && cpack)
ifneq ($(OS),Windows_NT)
@rm -rf $(CURDIR)/build/packages/_CPack_Packages
endif
configure: build-deps
@echo "Running Configure: $(BUILD_TYPE) testnet=$(TESTNET)"
cmake --preset $(PRESET_CONFIGURE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
docs: configure
@echo "Building Documentation"
cmake --build build/release --target=docs --config=Release --parallel=$(CPU_CORES)
sdk:
$(MAKE) -C utils/sdk $(filter-out $@,$(MAKECMDGOALS)) PACKAGE_VERSION=$(BUILD_VERSION)
# Rule for each profile — uses .build/cmake/profiles/
$(PROFILES): conan-profile-detect $(PROFILES): conan-profile-detect
@echo "Building profile: $@" @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) CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) install . -pr:h=$(CMAKE_DIR)/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 -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/$@ --config=$(BUILD_TYPE) --parallel=$(CPU_CORES) cmake --build $(BUILD_FOLDER) --config=$(BUILD_TYPE) --parallel=$(CPU_CORES)
(cd $(BUILD_FOLDER) && cpack)
help: help:
@echo "Lethean VPN Blockchain"
@echo "======================"
@echo "Website: https://lt.hn"
@echo "GitHub: https://github.com/letheanVPN/blockchain/"
@echo "Discord: https://discord.lt.hn"
@echo ""
@echo "Available targets:" @echo "Available targets:"
@printf " %-42s %s\n" "make clean" "Clean all build directories" @printf " %-42s %s\n" "make clean" "Clean all build directories"
@printf " %-42s %s\n" "make conan-get" "Download and install conan locally"
@printf " %-42s %s\n" "make release" "Build release" @printf " %-42s %s\n" "make release" "Build release"
@printf " %-42s %s\n" "make static" "Build static release" @printf " %-42s %s\n" "make testnet" "Build testnet"
@printf " %-42s %s\n" "make debug" "Build debug" @printf " %-42s %s\n" "make mainnet" "Build mainnet"
@printf " %-42s %s\n" "make test" "Build & run tests" @printf " %-42s %s\n" "make test" "Build & run tests"
@printf " %-42s %s\n" "make docs" "Builds offline documentation website" @printf " %-42s %s\n" "make docs" "Builds offline documentation website"
@printf " %-42s %s\n" "make docs-dev" "Runs local doc server, for editing/adding docs" @printf " %-42s %s\n" "make docs-dev" "Runs local doc server, for editing/adding docs"
@printf " %-42s %s\n" "make conan-profile-detect" "Creates host config" @printf " %-42s %s\n" "make conan-profile-detect" "Creates host config"
@printf " %-42s %s\n" "make configure" "Runs a cmake configure within conan build flow" @printf " %-42s %s\n" "make configure" "Runs a cmake configure within conan build flow"
@printf "\n --- Conan Cross-Compilation Profiles ---\n"
@$(foreach profile,$(SORTED_PROFILES),printf " %-42s %s\n" "make $(profile)" "Build the $(profile) profile";) @$(foreach profile,$(SORTED_PROFILES),printf " %-42s %s\n" "make $(profile)" "Build the $(profile) profile";)
@printf "\n --- SDK Generation ---\n"
@printf " %-42s %s\n" "make sdk" "Build all SDK packages"
@$(foreach sdk,$(SORTED_SDK_TARGETS),printf " %-42s %s\n" "make sdk $(sdk)" "Build the $(sdk) SDK package";)
@printf "\n"
@printf " %-42s %s\n" "make help" "Show this help message" @printf " %-42s %s\n" "make help" "Show this help message"
#
# Tests
#
test: test-release test: test-release
test-release: test-release:
@echo "Building profile: test-release" @echo "Building profile: test-release"
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/test-release --build=missing -s build_type=$(BUILD_TYPE) CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) install . --output-folder=build/test-release --build=missing -s build_type=$(BUILD_TYPE)
cmake -S . -B build/test-release -DCMAKE_TOOLCHAIN_FILE=build/test-release/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -D BUILD_TESTS=ON cmake -S . -B build/test-release -DCMAKE_TOOLCHAIN_FILE=build/test-release/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -D BUILD_TESTS=ON
cmake --build build/test-release --config=Release --parallel=$(CPU_CORES) cmake --build build/test-release --config=Release --parallel=$(CPU_CORES)
$(MAKE) test $(MAKE) test
test-debug: test-debug:
@echo "Building profile: test-debug" @echo "Building profile: test-debug"
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/test-debug --build=missing -s build_type=$(BUILD_TYPE) CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) install . --output-folder=build/test-debug --build=missing -s build_type=$(BUILD_TYPE)
cmake -S . -B build/test-debug -DCMAKE_TOOLCHAIN_FILE=build/test-debug/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -D BUILD_TESTS=ON cmake -S . -B build/test-debug -DCMAKE_TOOLCHAIN_FILE=build/test-debug/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -D BUILD_TESTS=ON
cmake --build build/test-debug --config=Debug --parallel=$(CPU_CORES) cmake --build build/test-debug --config=Debug --parallel=$(CPU_CORES)
$(MAKE) test $(MAKE) test
configure: # Conan management — cmake modules from .build submodule
@echo "Running Config: release" conan-get:
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/release --build=missing -s build_type=$(BUILD_TYPE) cmake -P $(CMAKE_DIR)/ConanGet.cmake
cmake -S . -B build/release -DCMAKE_TOOLCHAIN_FILE=build/release/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) ifneq ($(CONAN_USER),)
(CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) remote add conan_build $(CONAN_URL) && \
CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) remote login conan_build $(CONAN_USER) -p $(CONAN_PASSWORD)) || true
endif
docs: configure conan-upload:
@echo "Building Documentation" CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) upload "*" -r=conan_build --confirm
cmake --build build/release --target=docs --config=Release --parallel=$(CPU_CORES)
conan-profile-detect: conan-get
cmake -P $(CMAKE_DIR)/ConanProfileSetup.cmake
docs-dev: configure docs-dev: configure
@echo "Building Documentation" @echo "Building Documentation"
cmake --build build/release --target=serve_docs --config=Release cmake --build build/release --target=serve_docs --config=Release
docker-chain-node: $(SDK_TARGETS):
@echo "Building docker image: lthn/chain" @# This is a proxy target. Handled by the 'sdk' rule.
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: clean:
@cmake -P $(CMAKE_DIR)/CleanBuild.cmake
clean-build: clean
rm -rf build rm -rf build
tags: tags:
ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest
.PHONY: all release docker-chain-node debug docs docs-dev configure static static-release test test-release test-debug clean tags conan-profile-detect $(PROFILES) .PHONY: all release upload-conan-cache docs docs-dev configure static static-release test test-release test-debug clean tags conan-profile-detect conan-get $(PROFILES) sdk $(SDK_TARGETS)

252
README.md
View file

@ -1,196 +1,120 @@
[![Coverity Scan](https://scan.coverity.com/projects/18767/badge.svg)](https://scan.coverity.com/projects/zanoproject) # Lethean Network—Ethics, Encoded.
[![Discord](https://img.shields.io/discord/538361472691077130?label=discord&logo=discord)](https://discord.gg/wE3rmYY)
## Cloning > We are building upto a mainnet launch in 2026, documentation written as if mainnet is live.
Be sure to clone the repository properly:\ A buildkit for deploying confidential information networks and commerce systems with immutable auditability.
`$ git clone --recursive https://github.com/hyle-team/zano.git`
# Building Free for commercial, private, and patent use, self-host or join the community-run network that guarantees participant sovereignty by design.
--------
[![Discord](https://img.shields.io/discord/379876792003067906?label=discord&logo=discord)](https://discord.gg/pfgT2Kz)
Web2 Website: https://lt.hn/
Web3 Network Gateway [HNS](https://handshake.org): [https://lthn](https://www.namebase.io/domains/lthn)
<br/>_(our chain aliases will come with a working Web2(`*.lt.hn`)+Web3(`*.lthn`) domain name)_
### Dependencies ### Dependencies
| component / version | minimum <br>(not recommended but may work) | recommended | most recent of what we have ever tested | | component / version | minimum <br>(not recommended but may work) | recommended | most recent of what we have ever tested |
|-----------------------------------------------------------------------------------------------------|--------------------------------------------|----------------|-----------------------------------------| |-----------------------------------------------------------------------------|--------------------------------------------|----------------|-----------------------------------------|
| gcc (Linux) | 8.4.0 | 9.4.0 | 12.3.0 | | gcc (Linux) | 8.4.0 | 9.4.0 | 12.3.0 |
| llvm/clang (Linux) | UNKNOWN | 7.0.1 | 8.0.0 | | llvm/clang (Linux) | UNKNOWN | 7.0.1 | 8.0.0 |
| [MSVC](https://visualstudio.microsoft.com/downloads/) (Windows) | 2017 (15.9.30) | 2022 (17.11.5) | 2022 (17.12.3) | | [MSVC](https://visualstudio.microsoft.com/downloads/) (Windows) | 2017 (15.9.30) | 2022 (17.11.5) | 2022 (17.12.3) |
| [XCode](https://developer.apple.com/downloads/) (macOS) | 12.3 | 14.3 | 15.2 | | [XCode](https://developer.apple.com/downloads/) (macOS) | 12.3 | 14.3 | 15.2 |
| [CMake](https://cmake.org/download/) | 3.26.3 | 3.26.3 | 3.31.6 | | [CMake](https://cmake.org/download/) | 3.26.3 | 3.26.3 | 3.31.6 |
| [Boost](https://www.boost.org/users/download/) | 1.75 | 1.84 | 1.84 |
| [OpenSSL](https://www.openssl.org/source/) [(win)](https://slproweb.com/products/Win32OpenSSL.html) | 1.1.1n | 1.1.1w | 3.4 |
| [Qt](https://download.qt.io/archive/qt/) (*only for GUI*) | 6.8.3 | 6.8.3 | 6.8.3 |
Note:\ ## Cloning
[*server version*] denotes steps required for building command-line tools (daemon, simplewallet, etc.).\
[*GUI version*] denotes steps required for building Zano executable with GUI.
<br /> Be sure to clone the repository properly, with `--recursive` flag, or you'll get angry:<br/>
`git clone --recursive https://github.com/letheanVPN/blockchain.git`
### Linux # Building
Recommended OS versions: Ubuntu 20.04, 22.04 LTS. The project uses a `Makefile` that provides a simple and powerful interface for building.
It automatically handles dependency installation with Conan and compilation with CMake.
1. Prerequisites You need CMake and Make installed on your system, other than that you don't need to worry about Python, Conan, Boost, OpenSSL, or any other dependencies.
[*server version*] The final packages are created as they are due to a historical distribution method used in china: USB Stick, CD, DVD, etc.
sudo apt-get install -y build-essential g++ curl autotools-dev libicu-dev libbz2-dev cmake git screen checkinstall zlib1g-dev libssl-dev bzip2
[*GUI version*]
sudo apt-get install -y build-essential g++ python-dev autotools-dev libicu-dev libbz2-dev cmake git screen checkinstall zlib1g-dev libssl-dev bzip2 mesa-common-dev libglu1-mesa-dev We use CPack, so our packages are self-contained, have searchable HTML documentation, and are ready to be installed on any system.
Make sure you have correct versions installed (see 'Dependencies' section above): To skip the packing step, use `make build` as defined in the section below for Advanced Build Customization
cmake --version && gcc --version ## Simple Workflow Builds (Recommended)
3. Clone Zano into a local folder\ For most use cases, these two commands are all you need. They handle the entire build process from start to finish.
(If for some reason you need to use alternative Zano branch, change 'master' to the required branch name.)
git clone --recursive https://github.com/hyle-team/zano.git -b master
In the following steps we assume that you cloned Zano into '~/zano' folder in your home directory. * **Build for Mainnet:**
```shell
make mainnet
```
4. Download and build Boost\ * **Build for Testnet:**
(Assuming you have cloned Zano into the 'zano' folder. If you used a different location for Zano, **edit line 4** accordingly.) ```shell
make testnet
```
curl -OL https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2 ## Creating Release Packages
echo "cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454 boost_1_84_0.tar.bz2" | shasum -c && tar -xjf boost_1_84_0.tar.bz2
rm boost_1_84_0.tar.bz2 && cd boost_1_84_0
./bootstrap.sh --with-libraries=system,filesystem,thread,date_time,chrono,regex,serialization,atomic,program_options,locale,timer,log
./b2 && cd ..
Make sure that you see "The Boost C++ Libraries were successfully built!" message at the end.
5. Install Qt\ To create distributable packages (e.g., `.zip`, `.msi`, `.pkg`, `.deb`), run the `release` target. This will build the project, build the documentation, and then package everything.
(*GUI version only, skip this step if you're building server version*)
[*GUI version*] ```shell
make release TESTNET=1
```
The final packages will be located in the `build/packages/` directory
curl -L -O https://download.qt.io/official_releases/online_installers/qt-online-installer-linux-x64-online.run && ## Advanced Build Customization (Makefile Variables)
chmod u+x qt-online-installer-linux-x64-online.run
./qt-online-installer-linux-x64-online.run \
--accept-licenses \
--default-answer \
--confirm-command install \
qt.qt6.683.linux_gcc_64 \
qt.qt6.683.addons.qt5compat.linux_gcc_64 \
qt.qt6.683.addons.qtpositioning.linux_gcc_64 \
qt.qt6.683.addons.qtwebchannel.linux_gcc_64 \
qt.qt6.683.addons.qtwebsockets.linux_gcc_64 \
qt.qt6.683.addons.qtwebengine.linux_gcc_64 \
qt.qt6.683.addons.qtwebview.linux_gcc_64
This will download the online installer and perform an unattended installation with the Chromium-based WebEngine
For advanced use cases, you can override variables in the `Makefile` to customize the build process.
6. Install OpenSSL * **Build a `testnet` version:**
```shell
make build TESTNET=1
```
* **Build a statically-linked version:**
```shell
make build STATIC=1
```
* **Build a Debug build with 8 compile threads:**
```shell
make build BUILD_TYPE=Debug CPU_CORES=8
```
* **Use custom CMakePresets:**
```shell
make build PRESET_CONFIGURE=my-config-preset PRESET_BUILD=my-build-preset
```
We recommend installing OpenSSL v1.1.1w locally unless you would like to use the same version system-wide.\ | Variable | Description | Default Value |
(Assuming that `$HOME` environment variable is set to your home directory. Otherwise, edit line 4 accordingly.) |--------------------|------------------------------------------------------------------------|-------------------------|
| `BUILD_TYPE` | Sets the build configuration (e.g., `Release`, `Debug`). | `Release` |
| `TESTNET` | Set to `1` to build for the test network. | `0` |
| `STATIC` | Set to `1` to link libraries statically. | `0` |
| `CPU_CORES` | Number of CPU cores to use for parallel compilation. | Auto-detected |
| `BUILD_VERSION` | The version string to embed in the binaries. | `6.0.1` |
| `BUILD_FOLDER` | The output directory for the build. | `build/release` |
| `PRESET_CONFIGURE` | The CMake preset to use for the `configure` step. | `conan-release` |
| `PRESET_BUILD` | The CMake preset to use for the `build` step. | `conan-release` |
| `CONAN_CACHE` | The path for the local Conan cache, where the dependencies are stored. | `./build/sdk` |
| `CONAN_EXECUTABLE` | The path to the usable Conan executable. | `./build/bin/conan` |
| `CONAN_URL` | The URL for the Conan remote repository. | `artifacts.host.uk.com` |
| `CONAN_USER` | The username for the Conan remote. | `public` |
| `CONAN_PASSWORD` | The password for the Conan remote. | |
curl -OL https://www.openssl.org/source/openssl-1.1.1w.tar.gz ## Cleaning the Build Directory
echo "cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8 openssl-1.1.1w.tar.gz" | shasum -c && tar xaf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w/
./config --prefix=$HOME/openssl --openssldir=$HOME/openssl shared zlib
make && make test && make install && cd ..
ALWAYS USE `make clean` to clean the build directory, manually deleting the `build/release`, `build/SOME_FOLDER` will cause you issues.
7. [*OPTIONAL*] Set global environment variables for convenient use\ Our `make clean` triggers a cmake script that completely resets the build directory &amp; dynamically added CMakePresets to its cached warm-up state,
For instance, by adding the following lines to `~/.bashrc` the selective clean script can be edited here: `cmake/CleanBuild.cmake` or directly run from the repo root `cmake -P cmake/CleanBuild.cmake`
[*server version*] You can NUKE the build directory with `make clean-build` which is `rm -rf build`.
export BOOST_ROOT=/home/user/boost_1_84_0 If you do manually delete build folders and get CMake errors (if you have compiled anything previously, you will),
export OPENSSL_ROOT_DIR=/home/user/openssl the ConanPresets.json file has entries in the `include` property, delete them all and try again.
This happens because CMakePresets.json includes ConanPresets.json, that has the list of toolchains to use that gets populated during the CMake config step,
[*GUI version*] when you manually delete a folder, the toolchain is now a broken path, and CMake throws a fatal error.
export BOOST_ROOT=/home/user/boost_1_84_0
export OPENSSL_ROOT_DIR=/home/user/openssl
export QT_PREFIX_PATH=/home/user/Qt5.11.2/5.11.2/gcc_64
**NOTICE: Please edit the lines above according to your actual paths.**
**NOTICE 2:** Make sure you've restarted your terminal session (by reopening the terminal window or reconnecting the server) to apply these changes.
8. Build the binaries
1. If you skipped step 6 and did not set the environment variables:
cd zano && mkdir build && cd build
BOOST_ROOT=$HOME/boost_1_84_0 OPENSSL_ROOT_DIR=$HOME/openssl cmake ..
make -j1 daemon simplewallet
2. If you set the variables in step 6:
cd zano && mkdir build && cd build
cmake ..
make -j1 daemon simplewallet
or simply:
cd zano && make -j1
**NOTICE**: If you are building on a machine with a relatively high amount of RAM or with the proper setting of virtual memory, then you can use `-j2` or `-j` option to speed up the building process. Use with caution.
**NOTICE 2**: If you'd like to build binaries for the testnet, use `cmake -D TESTNET=TRUE ..` instead of `cmake ..` .
1. Build GUI:
cd zano
utils/build_script_linux.sh
Look for the binaries in `build` folder
<br />
### Windows
Recommended OS version: Windows 7 x64, Windows 11 x64.
1. Install required prerequisites (Boost, Qt, CMake, OpenSSL).
2. Edit paths in `utils/configure_local_paths.cmd`.
3. Run one of `utils/configure_win64_msvsNNNN_gui.cmd` according to your MSVC version.
4. Go to the build folder and open generated Zano.sln in MSVC.
5. Build.
In order to correctly deploy Qt GUI application, you also need to do the following:
6. Run `PATH_TO_QT\bin\windeployqt.exe PATH_TO_PROJECT_ROOT\build\src\Debug\Zano.exe` (choose the Debug or Release folder depending on the configuration you built).
7. You can now run the application using one of the following options:
* Start the program from Visual Studio
* Run `Zano.exe --html-path=PATH_TO_HTML`, where PATH_TO_HTML is by default located at PATH_TO_PROJECT_ROOT\src\gui\qt-daemon\layout\html
* Copy the contents of PATH_TO_PROJECT_ROOT\src\gui\qt-daemon\layout\html to a folder named "html" located in the same directory as the Zano.exe binary.
<br />
### macOS
Recommended OS version: macOS Big Sur 11.4 x64.
1. Install required prerequisites.
2. Set environment variables as stated in `utils/macosx_build_config.command`.
3. `mkdir build` <br> `cd build` <br> `cmake ..` <br> `make`
To build GUI application:
1. Create self-signing certificate via Keychain Access:\
a. Run Keychain Access.\
b. Choose Keychain Access > Certificate Assistant > Create a Certificate.\
c. Use “Zano” (without quotes) as certificate name.\
d. Choose “Code Signing” in “Certificate Type” field.\
e. Press “Create”, then “Done”.\
f. Make sure the certificate was added to keychain "System". If not—move it to "System".\
g. Double click the certificate you've just added, enter the trust section and under "When using this certificate" select "Always trust".\
h. Unfold the certificate in Keychain Access window and double click the underlying private key "Zano". Select "Access Control" tab, then select "Allow all applications to access this item". Click "Save Changes".
2. Revise building script, comment out unwanted steps and run it: `utils/build_script_mac_osx.sh`
3. The application should be here: `/buid_mac_osx_64/release/src`
<br />
<br />
## Supporting project/donations
ZANO @dev<br />
BTC bc1qpa8w8eaehlplfepmnzpd7v9j046899nktxnkxp<br />
BCH qqgq078vww5exd9kt3frx6krdyznmp80hcygzlgqzd<br />
ETH 0x206c52b78141498e74FF074301ea90888C40c178<br />
XMR 45gp9WTobeB5Km3kLQgVmPJkvm9rSmg4gdyHheXqXijXYMjUY48kLgL7QEz5Ar8z9vQioQ68WYDKsQsjAEonSeFX4UeLSiX<br />

View file

@ -1,79 +0,0 @@
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CPACK_PACKAGE_NAME "${package_name}")
set(CPACK_PACKAGE_VENDOR "${package_vendor}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${package_description}")
set(CPACK_PACKAGE_VERSION "${BUILD_VERSION}")
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()
if(APPLE)
if("${package_macos_installer}" STREQUAL "DMG")
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")
else ()
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")
endif ()
elseif(WIN32)
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}")
# postinstall script (e.g., to register a systemd service)
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_SOURCE_DIR}/scripts/postinstall.sh")
endif()
list(APPEND CPACK_GENERATOR "TXZ" "ZIP")
message(STATUS "Registered CPACK_GENERATOR: tgz")
message(STATUS "Registered CPACK_GENERATOR: zip")
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
set(CPACK_ARCHIVE_COMPONENT_INSTALL OFF)
set(CPACK_COMPONENTS_ALL)
set(CPACK_GENERATE_SHASUM ON)
set(CPACK_SHASUM_ALGORITHM SHA256)
message(STATUS "Using SHA256 Checksums")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
# set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}/packages")
install(FILES README.md LICENSE.txt
DESTINATION "share/doc/${CPACK_PACKAGE_NAME}"
)
set(_arch "${CMAKE_SYSTEM_PROCESSOR}")
if(_arch MATCHES "AMD64|x86_64")
set(_arch "x86_64")
elseif(_arch MATCHES "arm64|aarch64")
set(_arch "arm64")
endif()
string(TOLOWER "${CMAKE_SYSTEM_NAME}" _sys_name_lc)
set(CPACK_PACKAGE_FILE_NAME
"${package_name}-${CPACK_PACKAGE_VERSION}-${_sys_name_lc}-${_arch}")
include(CPack)
endif()

View file

@ -1,45 +0,0 @@
set(MKDOCS_SRC "${CMAKE_SOURCE_DIR}/docs")
set(MKDOCS_OUT "${CMAKE_BINARY_DIR}/../docs")
message("MKDocs src: ${MKDOCS_SRC} > ${MKDOCS_OUT}")
file(MAKE_DIRECTORY "${MKDOCS_OUT}")
add_custom_target(docs
COMMAND ${CMAKE_COMMAND} -E env PYTHONUNBUFFERED=1
mkdocs build
--clean
--site-dir "${MKDOCS_OUT}"
--config-file "${MKDOCS_SRC}/mkdocs.yml"
WORKING_DIRECTORY "${MKDOCS_SRC}"
COMMENT "Generating documentation with MkDocs"
VERBATIM
)
# Optional install step
install(DIRECTORY "${MKDOCS_OUT}/"
DESTINATION "share/doc/${PROJECT_NAME}")
add_custom_target(install-docs
DEPENDS docs
COMMAND "${CMAKE_COMMAND}" --install . --component docs
COMMENT "Installing documentation")
# Name of the target that launches the dev server
add_custom_target(
serve_docs # invoke with `make serve_docs`
COMMAND ${CMAKE_COMMAND} -E env PYTHONUNBUFFERED=1
# On Windows we need to run the command through the shell
# so that the `&&` operator works correctly.
${CMAKE_COMMAND} -E env
mkdocs serve
--dev-addr "127.0.0.1:8000" # optional explicit bind address
--watch "${MKDOCS_SRC}" # watch source files for changes
--config-file "${MKDOCS_SRC}/mkdocs.yml"
WORKING_DIRECTORY "${MKDOCS_SRC}"
USES_TERMINAL # tells CMake to attach the child process to the console
COMMENT "Starting MkDocs livepreview server (CtrlC to stop)"
VERBATIM
)
add_dependencies(serve_docs docs) # ensures the static site is uptodate before serving

View file

@ -1,682 +0,0 @@
# The MIT License (MIT)
#
# Copyright (c) 2024 JFrog
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
set(CONAN_MINIMUM_VERSION 2.0.5)
# Create a new policy scope and set the minimum required cmake version so the
# features behind a policy setting like if(... IN_LIST ...) behaves as expected
# even if the parent project does not specify a minimum cmake version or a minimum
# version less than this module requires (e.g. 3.0) before the first project() call.
# (see: https://cmake.org/cmake/help/latest/variable/CMAKE_PROJECT_TOP_LEVEL_INCLUDES.html)
#
# The policy-affecting calls like cmake_policy(SET...) or `cmake_minimum_required` only
# affects the current policy scope, i.e. between the PUSH and POP in this case.
#
# https://cmake.org/cmake/help/book/mastering-cmake/chapter/Policies.html#the-policy-stack
cmake_policy(PUSH)
cmake_minimum_required(VERSION 3.24)
function(detect_os os os_api_level os_sdk os_subsystem os_version)
# it could be cross compilation
message(STATUS "CMake-Conan: cmake_system_name=${CMAKE_SYSTEM_NAME}")
if(CMAKE_SYSTEM_NAME AND NOT CMAKE_SYSTEM_NAME STREQUAL "Generic")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(${os} Macos PARENT_SCOPE)
elseif(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(${os} Neutrino PARENT_SCOPE)
elseif(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")
set(${os} Windows PARENT_SCOPE)
set(${os_subsystem} cygwin PARENT_SCOPE)
elseif(CMAKE_SYSTEM_NAME MATCHES "^MSYS")
set(${os} Windows PARENT_SCOPE)
set(${os_subsystem} msys2 PARENT_SCOPE)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
# https://github.com/emscripten-core/emscripten/blob/4.0.6/cmake/Modules/Platform/Emscripten.cmake#L17C1-L17C34
set(${os} Emscripten PARENT_SCOPE)
else()
set(${os} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
if(DEFINED ANDROID_PLATFORM)
string(REGEX MATCH "[0-9]+" _os_api_level ${ANDROID_PLATFORM})
elseif(DEFINED CMAKE_SYSTEM_VERSION)
set(_os_api_level ${CMAKE_SYSTEM_VERSION})
endif()
message(STATUS "CMake-Conan: android api level=${_os_api_level}")
set(${os_api_level} ${_os_api_level} PARENT_SCOPE)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|watchOS")
# CMAKE_OSX_SYSROOT contains the full path to the SDK for MakeFile/Ninja
# generators, but just has the original input string for Xcode.
if(NOT IS_DIRECTORY ${CMAKE_OSX_SYSROOT})
set(_os_sdk ${CMAKE_OSX_SYSROOT})
else()
if(CMAKE_OSX_SYSROOT MATCHES Simulator)
set(apple_platform_suffix simulator)
else()
set(apple_platform_suffix os)
endif()
if(CMAKE_OSX_SYSROOT MATCHES AppleTV)
set(_os_sdk "appletv${apple_platform_suffix}")
elseif(CMAKE_OSX_SYSROOT MATCHES iPhone)
set(_os_sdk "iphone${apple_platform_suffix}")
elseif(CMAKE_OSX_SYSROOT MATCHES Watch)
set(_os_sdk "watch${apple_platform_suffix}")
endif()
endif()
if(DEFINED os_sdk)
message(STATUS "CMake-Conan: cmake_osx_sysroot=${CMAKE_OSX_SYSROOT}")
set(${os_sdk} ${_os_sdk} PARENT_SCOPE)
endif()
if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET)
message(STATUS "CMake-Conan: cmake_osx_deployment_target=${CMAKE_OSX_DEPLOYMENT_TARGET}")
set(${os_version} ${CMAKE_OSX_DEPLOYMENT_TARGET} PARENT_SCOPE)
endif()
endif()
endif()
endfunction()
function(detect_arch arch)
# CMAKE_OSX_ARCHITECTURES can contain multiple architectures, but Conan only supports one.
# Therefore this code only finds one. If the recipes support multiple architectures, the
# build will work. Otherwise, there will be a linker error for the missing architecture(s).
if(DEFINED CMAKE_OSX_ARCHITECTURES)
string(REPLACE " " ";" apple_arch_list "${CMAKE_OSX_ARCHITECTURES}")
list(LENGTH apple_arch_list apple_arch_count)
if(apple_arch_count GREATER 1)
message(WARNING "CMake-Conan: Multiple architectures detected, this will only work if Conan recipe(s) produce fat binaries.")
endif()
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|watchOS" AND NOT CMAKE_OSX_ARCHITECTURES STREQUAL "")
set(host_arch ${CMAKE_OSX_ARCHITECTURES})
elseif(MSVC)
set(host_arch ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID})
else()
set(host_arch ${CMAKE_SYSTEM_PROCESSOR})
endif()
if(host_arch MATCHES "aarch64|arm64|ARM64")
set(_arch armv8)
elseif(host_arch MATCHES "armv7|armv7-a|armv7l|ARMV7")
set(_arch armv7)
elseif(host_arch MATCHES armv7s)
set(_arch armv7s)
elseif(host_arch MATCHES "i686|i386|X86")
set(_arch x86)
elseif(host_arch MATCHES "AMD64|amd64|x86_64|x64")
set(_arch x86_64)
endif()
if(EMSCRIPTEN)
# https://github.com/emscripten-core/emscripten/blob/4.0.6/cmake/Modules/Platform/Emscripten.cmake#L294C1-L294C80
set(_arch wasm)
endif()
message(STATUS "CMake-Conan: cmake_system_processor=${_arch}")
set(${arch} ${_arch} PARENT_SCOPE)
endfunction()
function(detect_cxx_standard cxx_standard)
set(${cxx_standard} ${CMAKE_CXX_STANDARD} PARENT_SCOPE)
if(CMAKE_CXX_EXTENSIONS)
set(${cxx_standard} "gnu${CMAKE_CXX_STANDARD}" PARENT_SCOPE)
endif()
endfunction()
macro(detect_gnu_libstdcxx)
# _conan_is_gnu_libstdcxx true if GNU libstdc++
check_cxx_source_compiles("
#include <cstddef>
#if !defined(__GLIBCXX__) && !defined(__GLIBCPP__)
static_assert(false);
#endif
int main(){}" _conan_is_gnu_libstdcxx)
# _conan_gnu_libstdcxx_is_cxx11_abi true if C++11 ABI
check_cxx_source_compiles("
#include <string>
static_assert(sizeof(std::string) != sizeof(void*), \"using libstdc++\");
int main () {}" _conan_gnu_libstdcxx_is_cxx11_abi)
set(_conan_gnu_libstdcxx_suffix "")
if(_conan_gnu_libstdcxx_is_cxx11_abi)
set(_conan_gnu_libstdcxx_suffix "11")
endif()
unset (_conan_gnu_libstdcxx_is_cxx11_abi)
endmacro()
macro(detect_libcxx)
# _conan_is_libcxx true if LLVM libc++
check_cxx_source_compiles("
#include <cstddef>
#if !defined(_LIBCPP_VERSION)
static_assert(false);
#endif
int main(){}" _conan_is_libcxx)
endmacro()
function(detect_lib_cxx lib_cxx)
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
message(STATUS "CMake-Conan: android_stl=${CMAKE_ANDROID_STL_TYPE}")
set(${lib_cxx} ${CMAKE_ANDROID_STL_TYPE} PARENT_SCOPE)
return()
endif()
include(CheckCXXSourceCompiles)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
detect_gnu_libstdcxx()
set(${lib_cxx} "libstdc++${_conan_gnu_libstdcxx_suffix}" PARENT_SCOPE)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
set(${lib_cxx} "libc++" PARENT_SCOPE)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
# Check for libc++
detect_libcxx()
if(_conan_is_libcxx)
set(${lib_cxx} "libc++" PARENT_SCOPE)
return()
endif()
# Check for libstdc++
detect_gnu_libstdcxx()
if(_conan_is_gnu_libstdcxx)
set(${lib_cxx} "libstdc++${_conan_gnu_libstdcxx_suffix}" PARENT_SCOPE)
return()
endif()
# TODO: it would be an error if we reach this point
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# Do nothing - compiler.runtime and compiler.runtime_type
# should be handled separately: https://github.com/conan-io/cmake-conan/pull/516
return()
else()
# TODO: unable to determine, ask user to provide a full profile file instead
endif()
endfunction()
function(detect_compiler compiler compiler_version compiler_runtime compiler_runtime_type)
if(DEFINED CMAKE_CXX_COMPILER_ID)
set(_compiler ${CMAKE_CXX_COMPILER_ID})
set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
else()
if(NOT DEFINED CMAKE_C_COMPILER_ID)
message(FATAL_ERROR "C or C++ compiler not defined")
endif()
set(_compiler ${CMAKE_C_COMPILER_ID})
set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
endif()
message(STATUS "CMake-Conan: CMake compiler=${_compiler}")
message(STATUS "CMake-Conan: CMake compiler version=${_compiler_version}")
if(_compiler MATCHES MSVC)
set(_compiler "msvc")
string(SUBSTRING ${MSVC_VERSION} 0 3 _compiler_version)
# Configure compiler.runtime and compiler.runtime_type settings for MSVC
if(CMAKE_MSVC_RUNTIME_LIBRARY)
set(_msvc_runtime_library ${CMAKE_MSVC_RUNTIME_LIBRARY})
else()
set(_msvc_runtime_library MultiThreaded$<$<CONFIG:Debug>:Debug>DLL) # default value documented by CMake
endif()
set(_KNOWN_MSVC_RUNTIME_VALUES "")
list(APPEND _KNOWN_MSVC_RUNTIME_VALUES MultiThreaded MultiThreadedDLL)
list(APPEND _KNOWN_MSVC_RUNTIME_VALUES MultiThreadedDebug MultiThreadedDebugDLL)
list(APPEND _KNOWN_MSVC_RUNTIME_VALUES MultiThreaded$<$<CONFIG:Debug>:Debug> MultiThreaded$<$<CONFIG:Debug>:Debug>DLL)
# only accept the 6 possible values, otherwise we don't don't know to map this
if(NOT _msvc_runtime_library IN_LIST _KNOWN_MSVC_RUNTIME_VALUES)
message(FATAL_ERROR "CMake-Conan: unable to map MSVC runtime: ${_msvc_runtime_library} to Conan settings")
endif()
# Runtime is "dynamic" in all cases if it ends in DLL
if(_msvc_runtime_library MATCHES ".*DLL$")
set(_compiler_runtime "dynamic")
else()
set(_compiler_runtime "static")
endif()
message(STATUS "CMake-Conan: CMake compiler.runtime=${_compiler_runtime}")
# Only define compiler.runtime_type when explicitly requested
# If a generator expression is used, let Conan handle it conditional on build_type
if(NOT _msvc_runtime_library MATCHES "<CONFIG:Debug>:Debug>")
if(_msvc_runtime_library MATCHES "Debug")
set(_compiler_runtime_type "Debug")
else()
set(_compiler_runtime_type "Release")
endif()
message(STATUS "CMake-Conan: CMake compiler.runtime_type=${_compiler_runtime_type}")
endif()
unset(_KNOWN_MSVC_RUNTIME_VALUES)
elseif(_compiler MATCHES AppleClang)
set(_compiler "apple-clang")
string(REPLACE "." ";" VERSION_LIST ${_compiler_version})
list(GET VERSION_LIST 0 _compiler_version)
elseif(_compiler MATCHES Clang)
set(_compiler "clang")
string(REPLACE "." ";" VERSION_LIST ${_compiler_version})
list(GET VERSION_LIST 0 _compiler_version)
elseif(_compiler MATCHES GNU)
set(_compiler "gcc")
string(REPLACE "." ";" VERSION_LIST ${_compiler_version})
list(GET VERSION_LIST 0 _compiler_version)
endif()
message(STATUS "CMake-Conan: [settings] compiler=${_compiler}")
message(STATUS "CMake-Conan: [settings] compiler.version=${_compiler_version}")
if (_compiler_runtime)
message(STATUS "CMake-Conan: [settings] compiler.runtime=${_compiler_runtime}")
endif()
if (_compiler_runtime_type)
message(STATUS "CMake-Conan: [settings] compiler.runtime_type=${_compiler_runtime_type}")
endif()
set(${compiler} ${_compiler} PARENT_SCOPE)
set(${compiler_version} ${_compiler_version} PARENT_SCOPE)
set(${compiler_runtime} ${_compiler_runtime} PARENT_SCOPE)
set(${compiler_runtime_type} ${_compiler_runtime_type} PARENT_SCOPE)
endfunction()
function(detect_build_type build_type)
get_property(multiconfig_generator GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT multiconfig_generator)
# Only set when we know we are in a single-configuration generator
# Note: we may want to fail early if `CMAKE_BUILD_TYPE` is not defined
set(${build_type} ${CMAKE_BUILD_TYPE} PARENT_SCOPE)
endif()
endfunction()
macro(set_conan_compiler_if_appleclang lang command output_variable)
if(CMAKE_${lang}_COMPILER_ID STREQUAL "AppleClang")
execute_process(COMMAND xcrun --find ${command}
OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE)
cmake_path(GET _xcrun_out PARENT_PATH _xcrun_toolchain_path)
cmake_path(GET CMAKE_${lang}_COMPILER PARENT_PATH _compiler_parent_path)
if ("${_xcrun_toolchain_path}" STREQUAL "${_compiler_parent_path}")
set(${output_variable} "")
endif()
unset(_xcrun_out)
unset(_xcrun_toolchain_path)
unset(_compiler_parent_path)
endif()
endmacro()
macro(append_compiler_executables_configuration)
set(_conan_c_compiler "")
set(_conan_cpp_compiler "")
set(_conan_rc_compiler "")
set(_conan_compilers_list "")
if(CMAKE_C_COMPILER)
set(_conan_c_compiler "\"c\":\"${CMAKE_C_COMPILER}\"")
set_conan_compiler_if_appleclang(C cc _conan_c_compiler)
list(APPEND _conan_compilers_list ${_conan_c_compiler})
else()
message(WARNING "CMake-Conan: The C compiler is not defined. "
"Please define CMAKE_C_COMPILER or enable the C language.")
endif()
if(CMAKE_CXX_COMPILER)
set(_conan_cpp_compiler "\"cpp\":\"${CMAKE_CXX_COMPILER}\"")
set_conan_compiler_if_appleclang(CXX c++ _conan_cpp_compiler)
list(APPEND _conan_compilers_list ${_conan_cpp_compiler})
else()
message(WARNING "CMake-Conan: The C++ compiler is not defined. "
"Please define CMAKE_CXX_COMPILER or enable the C++ language.")
endif()
if(CMAKE_RC_COMPILER)
set(_conan_rc_compiler "\"rc\":\"${CMAKE_RC_COMPILER}\"")
list(APPEND _conan_compilers_list ${_conan_rc_compiler})
# Not necessary to warn if RC not defined
endif()
if(NOT "x${_conan_compilers_list}" STREQUAL "x")
string(REPLACE ";" "," _conan_compilers_list "${_conan_compilers_list}")
string(APPEND profile "tools.build:compiler_executables={${_conan_compilers_list}}\n")
endif()
unset(_conan_c_compiler)
unset(_conan_cpp_compiler)
unset(_conan_rc_compiler)
unset(_conan_compilers_list)
endmacro()
function(detect_host_profile output_file)
detect_os(os os_api_level os_sdk os_subsystem os_version)
detect_arch(arch)
detect_compiler(compiler compiler_version compiler_runtime compiler_runtime_type)
detect_cxx_standard(compiler_cppstd)
detect_lib_cxx(compiler_libcxx)
detect_build_type(build_type)
set(profile "")
string(APPEND profile "[settings]\n")
if(arch)
string(APPEND profile arch=${arch} "\n")
endif()
if(os)
string(APPEND profile os=${os} "\n")
endif()
if(os_api_level)
string(APPEND profile os.api_level=${os_api_level} "\n")
endif()
if(os_version)
string(APPEND profile os.version=${os_version} "\n")
endif()
if(os_sdk)
string(APPEND profile os.sdk=${os_sdk} "\n")
endif()
if(os_subsystem)
string(APPEND profile os.subsystem=${os_subsystem} "\n")
endif()
if(compiler)
string(APPEND profile compiler=${compiler} "\n")
endif()
if(compiler_version)
string(APPEND profile compiler.version=${compiler_version} "\n")
endif()
if(compiler_runtime)
string(APPEND profile compiler.runtime=${compiler_runtime} "\n")
endif()
if(compiler_runtime_type)
string(APPEND profile compiler.runtime_type=${compiler_runtime_type} "\n")
endif()
if(compiler_cppstd)
string(APPEND profile compiler.cppstd=${compiler_cppstd} "\n")
endif()
if(compiler_libcxx)
string(APPEND profile compiler.libcxx=${compiler_libcxx} "\n")
endif()
if(build_type)
string(APPEND profile "build_type=${build_type}\n")
endif()
if(NOT DEFINED output_file)
set(file_name "${CMAKE_BINARY_DIR}/profile")
else()
set(file_name ${output_file})
endif()
string(APPEND profile "[conf]\n")
string(APPEND profile "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}\n")
# propagate compilers via profile
append_compiler_executables_configuration()
if(os STREQUAL "Android")
string(APPEND profile "tools.android:ndk_path=${CMAKE_ANDROID_NDK}\n")
endif()
message(STATUS "CMake-Conan: Creating profile ${file_name}")
file(WRITE ${file_name} ${profile})
message(STATUS "CMake-Conan: Profile: \n${profile}")
endfunction()
function(conan_profile_detect_default)
message(STATUS "CMake-Conan: Checking if a default profile exists")
execute_process(COMMAND ${CONAN_COMMAND} profile path default
RESULT_VARIABLE return_code
OUTPUT_VARIABLE conan_stdout
ERROR_VARIABLE conan_stderr
ECHO_ERROR_VARIABLE # show the text output regardless
ECHO_OUTPUT_VARIABLE
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if(NOT ${return_code} EQUAL "0")
message(STATUS "CMake-Conan: The default profile doesn't exist, detecting it.")
execute_process(COMMAND ${CONAN_COMMAND} profile detect
RESULT_VARIABLE return_code
OUTPUT_VARIABLE conan_stdout
ERROR_VARIABLE conan_stderr
ECHO_ERROR_VARIABLE # show the text output regardless
ECHO_OUTPUT_VARIABLE
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
endfunction()
function(conan_install)
set(conan_output_folder ${CMAKE_BINARY_DIR}/conan)
# Invoke "conan install" with the provided arguments
set(conan_args ${conan_args} -of=${conan_output_folder})
message(STATUS "CMake-Conan: conan install ${CMAKE_SOURCE_DIR} ${conan_args} ${ARGN}")
# In case there was not a valid cmake executable in the PATH, we inject the
# same we used to invoke the provider to the PATH
if(DEFINED PATH_TO_CMAKE_BIN)
set(old_path $ENV{PATH})
set(ENV{PATH} "$ENV{PATH}:${PATH_TO_CMAKE_BIN}")
endif()
execute_process(COMMAND ${CONAN_COMMAND} install ${CMAKE_SOURCE_DIR} ${conan_args} ${ARGN} --format=json
RESULT_VARIABLE return_code
OUTPUT_VARIABLE conan_stdout
ERROR_VARIABLE conan_stderr
ECHO_ERROR_VARIABLE # show the text output regardless
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if(DEFINED PATH_TO_CMAKE_BIN)
set(ENV{PATH} "${old_path}")
endif()
if(NOT "${return_code}" STREQUAL "0")
message(FATAL_ERROR "Conan install failed='${return_code}'")
endif()
# the files are generated in a folder that depends on the layout used, if
# one is specified, but we don't know a priori where this is.
# TODO: this can be made more robust if Conan can provide this in the json output
string(JSON conan_generators_folder GET "${conan_stdout}" graph nodes 0 generators_folder)
cmake_path(CONVERT ${conan_generators_folder} TO_CMAKE_PATH_LIST conan_generators_folder)
message(STATUS "CMake-Conan: CONAN_GENERATORS_FOLDER=${conan_generators_folder}")
set_property(GLOBAL PROPERTY CONAN_GENERATORS_FOLDER "${conan_generators_folder}")
# reconfigure on conanfile changes
string(JSON conanfile GET "${conan_stdout}" graph nodes 0 label)
message(STATUS "CMake-Conan: CONANFILE=${CMAKE_SOURCE_DIR}/${conanfile}")
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/${conanfile}")
# success
set_property(GLOBAL PROPERTY CONAN_INSTALL_SUCCESS TRUE)
endfunction()
function(conan_get_version conan_command conan_current_version)
execute_process(
COMMAND ${conan_command} --version
OUTPUT_VARIABLE conan_output
RESULT_VARIABLE conan_result
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(conan_result)
message(FATAL_ERROR "CMake-Conan: Error when trying to run Conan")
endif()
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" conan_version ${conan_output})
set(${conan_current_version} ${conan_version} PARENT_SCOPE)
endfunction()
function(conan_version_check)
set(options )
set(one_value_args MINIMUM CURRENT)
set(multi_value_args )
cmake_parse_arguments(conan_version_check
"${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})
if(NOT conan_version_check_MINIMUM)
message(FATAL_ERROR "CMake-Conan: Required parameter MINIMUM not set!")
endif()
if(NOT conan_version_check_CURRENT)
message(FATAL_ERROR "CMake-Conan: Required parameter CURRENT not set!")
endif()
if(conan_version_check_CURRENT VERSION_LESS conan_version_check_MINIMUM)
message(FATAL_ERROR "CMake-Conan: Conan version must be ${conan_version_check_MINIMUM} or later")
endif()
endfunction()
macro(construct_profile_argument argument_variable profile_list)
set(${argument_variable} "")
if("${profile_list}" STREQUAL "CONAN_HOST_PROFILE")
set(_arg_flag "--profile:host=")
elseif("${profile_list}" STREQUAL "CONAN_BUILD_PROFILE")
set(_arg_flag "--profile:build=")
endif()
set(_profile_list "${${profile_list}}")
list(TRANSFORM _profile_list REPLACE "auto-cmake" "${CMAKE_BINARY_DIR}/conan_host_profile")
list(TRANSFORM _profile_list PREPEND ${_arg_flag})
set(${argument_variable} ${_profile_list})
unset(_arg_flag)
unset(_profile_list)
endmacro()
macro(conan_provide_dependency method package_name)
set_property(GLOBAL PROPERTY CONAN_PROVIDE_DEPENDENCY_INVOKED TRUE)
get_property(_conan_install_success GLOBAL PROPERTY CONAN_INSTALL_SUCCESS)
if(NOT _conan_install_success)
find_program(CONAN_COMMAND "conan" REQUIRED)
conan_get_version(${CONAN_COMMAND} CONAN_CURRENT_VERSION)
conan_version_check(MINIMUM ${CONAN_MINIMUM_VERSION} CURRENT ${CONAN_CURRENT_VERSION})
message(STATUS "CMake-Conan: first find_package() found. Installing dependencies with Conan")
if("default" IN_LIST CONAN_HOST_PROFILE OR "default" IN_LIST CONAN_BUILD_PROFILE)
conan_profile_detect_default()
endif()
if("auto-cmake" IN_LIST CONAN_HOST_PROFILE)
detect_host_profile(${CMAKE_BINARY_DIR}/conan_host_profile)
endif()
construct_profile_argument(_host_profile_flags CONAN_HOST_PROFILE)
construct_profile_argument(_build_profile_flags CONAN_BUILD_PROFILE)
if(EXISTS "${CMAKE_SOURCE_DIR}/conanfile.py")
file(READ "${CMAKE_SOURCE_DIR}/conanfile.py" outfile)
if(NOT "${outfile}" MATCHES ".*CMakeDeps.*")
message(WARNING "Cmake-conan: CMakeDeps generator was not defined in the conanfile")
endif()
set(generator "")
elseif (EXISTS "${CMAKE_SOURCE_DIR}/conanfile.txt")
file(READ "${CMAKE_SOURCE_DIR}/conanfile.txt" outfile)
if(NOT "${outfile}" MATCHES ".*CMakeDeps.*")
message(WARNING "Cmake-conan: CMakeDeps generator was not defined in the conanfile. "
"Please define the generator as it will be mandatory in the future")
endif()
set(generator "-g;CMakeDeps")
endif()
get_property(_multiconfig_generator GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT _multiconfig_generator)
message(STATUS "CMake-Conan: Installing single configuration ${CMAKE_BUILD_TYPE}")
conan_install(${_host_profile_flags} ${_build_profile_flags} ${CONAN_INSTALL_ARGS} ${generator})
else()
message(STATUS "CMake-Conan: Installing both Debug and Release")
conan_install(${_host_profile_flags} ${_build_profile_flags} -s build_type=Release ${CONAN_INSTALL_ARGS} ${generator})
conan_install(${_host_profile_flags} ${_build_profile_flags} -s build_type=Debug ${CONAN_INSTALL_ARGS} ${generator})
endif()
unset(_host_profile_flags)
unset(_build_profile_flags)
unset(_multiconfig_generator)
unset(_conan_install_success)
else()
message(STATUS "CMake-Conan: find_package(${ARGV1}) found, 'conan install' already ran")
unset(_conan_install_success)
endif()
get_property(_conan_generators_folder GLOBAL PROPERTY CONAN_GENERATORS_FOLDER)
# Ensure that we consider Conan-provided packages ahead of any other,
# irrespective of other settings that modify the search order or search paths
# This follows the guidelines from the find_package documentation
# (https://cmake.org/cmake/help/latest/command/find_package.html):
# find_package (<PackageName> PATHS paths... NO_DEFAULT_PATH)
# find_package (<PackageName>)
# Filter out `REQUIRED` from the argument list, as the first call may fail
set(_find_args_${package_name} "${ARGN}")
list(REMOVE_ITEM _find_args_${package_name} "REQUIRED")
if(NOT "MODULE" IN_LIST _find_args_${package_name})
find_package(${package_name} ${_find_args_${package_name}} BYPASS_PROVIDER PATHS "${_conan_generators_folder}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
unset(_find_args_${package_name})
endif()
# Invoke find_package a second time - if the first call succeeded,
# this will simply reuse the result. If not, fall back to CMake default search
# behaviour, also allowing modules to be searched.
if(NOT ${package_name}_FOUND)
list(FIND CMAKE_MODULE_PATH "${_conan_generators_folder}" _index)
if(_index EQUAL -1)
list(PREPEND CMAKE_MODULE_PATH "${_conan_generators_folder}")
endif()
unset(_index)
find_package(${package_name} ${ARGN} BYPASS_PROVIDER)
list(REMOVE_ITEM CMAKE_MODULE_PATH "${_conan_generators_folder}")
endif()
endmacro()
cmake_language(
SET_DEPENDENCY_PROVIDER conan_provide_dependency
SUPPORTED_METHODS FIND_PACKAGE
)
macro(conan_provide_dependency_check)
set(_conan_provide_dependency_invoked FALSE)
get_property(_conan_provide_dependency_invoked GLOBAL PROPERTY CONAN_PROVIDE_DEPENDENCY_INVOKED)
if(NOT _conan_provide_dependency_invoked)
message(WARNING "Conan is correctly configured as dependency provider, "
"but Conan has not been invoked. Please add at least one "
"call to `find_package()`.")
if(DEFINED CONAN_COMMAND)
# supress warning in case `CONAN_COMMAND` was specified but unused.
set(_conan_command ${CONAN_COMMAND})
unset(_conan_command)
endif()
endif()
unset(_conan_provide_dependency_invoked)
endmacro()
# Add a deferred call at the end of processing the top-level directory
# to check if the dependency provider was invoked at all.
cmake_language(DEFER DIRECTORY "${CMAKE_SOURCE_DIR}" CALL conan_provide_dependency_check)
# Configurable variables for Conan profiles
set(CONAN_HOST_PROFILE "default;auto-cmake" CACHE STRING "Conan host profile")
set(CONAN_BUILD_PROFILE "default" CACHE STRING "Conan build profile")
set(CONAN_INSTALL_ARGS "--build=missing" CACHE STRING "Command line arguments for conan install")
find_program(_cmake_program NAMES cmake NO_PACKAGE_ROOT_PATH NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH)
if(NOT _cmake_program)
get_filename_component(PATH_TO_CMAKE_BIN "${CMAKE_COMMAND}" DIRECTORY)
set(PATH_TO_CMAKE_BIN "${PATH_TO_CMAKE_BIN}" CACHE INTERNAL "Path where the CMake executable is")
endif()
cmake_policy(POP)

View file

@ -1,9 +0,0 @@
[settings]
os=Macos
arch=armv8
compiler=apple-clang
compiler.version=13
compiler.libcxx=libc++
[conf]

View file

@ -1,8 +0,0 @@
[settings]
os=Macos
arch=x86_64
compiler=apple-clang
compiler.version=13
compiler.libcxx=libc++
[conf]

View file

@ -1,9 +0,0 @@
[settings]
os=Linux
arch=armv8
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++11
[conf]
tools.cmake.cmaketoolchain:user_presets=False

View file

@ -1,9 +0,0 @@
[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++11
[conf]
tools.cmake.cmaketoolchain:user_presets=False

View file

@ -1,10 +0,0 @@
[settings]
arch=x86_64
compiler=msvc
compiler.cppstd=17
compiler.runtime=static
compiler.version=193
os=Windows
[conf]
tools.cmake.cmaketoolchain:user_presets=False

View file

@ -1,10 +0,0 @@
[settings]
arch=x86_64
compiler=msvc
compiler.cppstd=17
compiler.runtime=static
compiler.version=194
os=Windows
[conf]
tools.cmake.cmaketoolchain:user_presets=False

View file

@ -3,4 +3,4 @@
static_assert(1, "FAIL"); static_assert(1, "FAIL");
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
return 0; return 0;
} }

70
conanfile.py Normal file
View file

@ -0,0 +1,70 @@
import os
from conan import ConanFile
from conan.tools.cmake import 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],
"ci": [True, False]
}
default_options = {
"static": False,
"testnet": False,
"ci": False,
"boost/*:without_test": True
}
tool_requires = [
"cmake/3.31.9"
]
requires = [
"zlib/1.3.1",
"boost/1.85.0",
"openssl/3.2.0",
"miniupnpc/2.2.5",
"jwt-cpp/0.7.1",
"oatpp/1.3.0.latest",
"oatpp-swagger/1.3.0.latest"
]
def generate(self):
tc = CMakeToolchain(self)
os_val = str(self.settings.os).lower()
# arch_val = str(self.settings.arch).lower()
# compiler_val = str(self.settings.compiler).lower()
# tc.presets_prefix = f"{os_val}"
tc.user_presets_path = "ConanPresets.json"
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):
if self.settings.compiler == "msvc":
# For multi-config, all configurations go into the same "build" folder.
self.folders.build = "build/release"
self.folders.generators = "build/release/generators"
else:
# For single-config, we create a subfolder for each build type.
build_type_str = str(self.settings.build_type).lower()
self.folders.build = os.path.join("build", build_type_str)
self.folders.generators = os.path.join(self.folders.build, "generators")
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

View file

@ -1,6 +1,7 @@
add_subdirectory(db) add_subdirectory(db)
add_subdirectory(ethereum) add_subdirectory(ethereum)
add_subdirectory(randomx)
if(USE_BITCOIN_SECP256K1_FOR_ECDSA) if(USE_BITCOIN_SECP256K1_FOR_ECDSA)
option(SECP256K1_BUILD_BENCHMARK "Build benchmarks." OFF) option(SECP256K1_BUILD_BENCHMARK "Build benchmarks." OFF)

View file

@ -28,6 +28,7 @@
#include <locale> #include <locale>
#include <cstdlib> #include <cstdlib>
#include <iomanip>
#include <map> #include <map>
#include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_io.hpp> #include <boost/uuid/uuid_io.hpp>

1
contrib/randomx Submodule

@ -0,0 +1 @@
Subproject commit cf15f4023ec8ddaa842f49111ba80ead1b5937f1

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/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:

2
docs

@ -1 +1 @@
Subproject commit 12e20efce7eaf51e38d8953c318633b1c5189256 Subproject commit e40a78d5020661f05d9bae64f2edd4519d9d98b3

View file

@ -0,0 +1,30 @@
{
"payments": [
{
"address_this": "iTHNdRWX6pKGXF1HqHgZyXie8EdaCwwdWUmsEnQhNojSUrkrR2eTemhFYkjWXbhdbyGcRBLgV2RYp3HhNAFCQ67w4bTHErZL1J",
"amount_this": 10000000.0,
"this_usd_price": "1.0",
"paid_prm": "",
"prm_usd_price": "",
"paid_xmr": "",
"xmr_usd_price": "",
"paid_qtum": "",
"qtum_usd_price": "",
"paid_bch": "",
"bch_usd_price": "",
"paid_rep": "",
"rep_usd_price": "",
"paid_dash": "",
"dash_usd_price": "",
"paid_ltc": "",
"ltc_usd_price": "",
"paid_eos": "",
"eos_usd_price": "",
"paid_eth": "",
"eth_usd_price": "",
"paid_btc": "",
"btc_usd_price": ""
}
],
"proof_string": "Lethean genesis — the advantage of the nature of information being easy to spread but hard to stifle. - Satoshi Nakamoto"
}

View file

@ -0,0 +1,7 @@
-------------genesis_acc.cpp-------------
const std::string ggenesis_tx_pub_key_str = "503ec7c167e3f2ead7d801bcbcebb3c58a84a2ba26a21ecb1f5c105fa159932b";
const crypto::public_key ggenesis_tx_pub_key = epee::string_tools::parse_tpod_from_hex_string<crypto::public_key>(ggenesis_tx_pub_key_str);
extern const genesis_tx_dictionary_entry ggenesis_dict[1];
const genesis_tx_dictionary_entry ggenesis_dict[1] = {
{12778448838847345770ULL,0}
};

View file

@ -0,0 +1 @@
01010000018080a0cfc8e0c8e38a0103bd6b4dda729d39dc85cb22a0b3db9b4b04d6464be9f3c84640bdca8bc0afb148000516503ec7c167e3f2ead7d801bcbcebb3c58a84a2ba26a21ecb1f5c105fa159932b137a4c65746865616e2067656e6573697320e280942074686520616476616e74616765206f6620746865206e6174757265206f6620696e666f726d6174696f6e206265696e67206561737920746f2073707265616420627574206861726420746f20737469666c652e202d205361746f736869204e616b616d6f746f15000b029e4e0e0a0000

View file

@ -0,0 +1,14 @@
--------- genesis.h---------
#pragma pack(push, 1)
struct genesis_tx_raw_data
{
uint64_t const v[27];
uint8_t const r[1];
};
#pragma pack(pop)
extern const genesis_tx_raw_data ggenesis_tx_raw;
--------- genesis.cpp---------
const genesis_tx_raw_data ggenesis_tx_raw = {{
0xa080800100000101,0x03018ae3c8e0c8cf,0xdc399d72da4d6bbd,0x4b9bdbb3a022cb85,0x46c8f3e94b46d604,0x48b1afc08bcabd40,0x67c1c73e50160500,0xbcbc01d8d7eaf2e3,0x26baa2848ac5b3eb,0xa15f105c1fcb1ea2,0x74654c7a132b9359,0x6e6567206e616568,0x9480e22073697365,0x7664612065687420,0x6f20656761746e61,0x616e206568742066,0x20666f2065727574,0x74616d726f666e69,0x6e696562206e6f69,0x7420797361652067,0x646165727073206f,0x7261682074756220,0x697473206f742064,0x53202d202e656c66,0x4e206968736f7461,0x156f746f6d616b61,0x000a0e4e9e020b00},
{0x00}};

View file

@ -0,0 +1,14 @@
NAME AMOUNT AMOUNT THIS USD EQ
bch 0.0000000000 0.000000000000 0.0000000000
btc 0.0000000000 0.000000000000 0.0000000000
dash 0.0000000000 0.000000000000 0.0000000000
eos 0.0000000000 0.000000000000 0.0000000000
eth 0.0000000000 0.000000000000 0.0000000000
ltc 0.0000000000 0.000000000000 0.0000000000
prm 0.0000000000 0.000000000000 0.0000000000
qtum 0.0000000000 0.000000000000 0.0000000000
rep 0.0000000000 0.000000000000 0.0000000000
TOTAL 0.000000000000 0.0000000000
PREMINE_AMOUNT 0 (0.000000000000THIS)

BIN
genesis-work/premine_wallet Normal file

Binary file not shown.

View file

@ -0,0 +1 @@
iTHNdRWX6pKGXF1HqHgZyXie8EdaCwwdWUmsEnQhNojSUrkrR2eTemhFYkjWXbhdbyGcRBLgV2RYp3HhNAFCQ67w4bTHErZL1J

Binary file not shown.

View file

@ -1,42 +0,0 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_1397_4507)">
<rect width="512" height="512" rx="115" fill="#0C0C3A"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M286.571 80H327.158C341.059 79.9997 352.756 79.9994 362.33 80.79C372.345 81.617 381.885 83.4143 390.946 88.0805C404.749 95.1883 415.972 106.53 423.005 120.48C427.622 129.638 429.4 139.279 430.218 149.4C431.001 159.076 431 170.897 431 184.947V223.852C431 237.902 431.001 249.723 430.218 259.399C429.4 269.521 427.622 279.162 423.005 288.32C415.972 302.269 404.749 313.611 390.946 320.719C381.885 325.385 372.345 327.182 362.33 328.009C352.756 328.8 341.059 328.8 327.157 328.799H205.955C197.442 328.799 189.759 323.637 186.465 315.703C183.171 307.769 184.908 298.613 190.872 292.473L290.961 189.435L321.127 219.364L256.325 286.076H326.311C341.283 286.076 351.24 286.059 358.888 285.428C366.288 284.817 369.646 283.738 371.755 282.652C377.603 279.64 382.358 274.835 385.338 268.924C386.413 266.792 387.48 263.4 388.085 255.92C388.71 248.191 388.726 238.128 388.726 222.997V185.802C388.726 170.671 388.71 160.608 388.085 152.879C387.48 145.4 386.413 142.007 385.338 139.875C382.358 133.965 377.603 129.159 371.755 126.147C369.646 125.061 366.288 123.982 358.888 123.371C351.24 122.74 341.283 122.723 326.311 122.723H287.425C272.289 122.723 262.215 122.74 254.483 123.381C246.996 124.003 243.611 125.1 241.495 126.199C235.611 129.257 230.846 134.132 227.893 140.115C226.831 142.267 225.787 145.701 225.263 153.275C224.723 161.096 224.829 171.276 225.013 186.572L225.225 204.139L182.955 204.66L182.733 186.231C182.561 172.024 182.416 160.078 183.092 150.298C183.799 140.074 185.485 130.322 190.064 121.045C197.034 106.924 208.28 95.4193 222.166 88.2041C231.289 83.4635 240.917 81.6404 251.024 80.8017C260.692 79.9994 272.513 79.9997 286.571 80Z" fill="url(#paint0_linear_1397_4507)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M286.571 80H327.158C341.059 79.9997 352.756 79.9994 362.33 80.79C372.345 81.617 381.885 83.4143 390.946 88.0805C404.749 95.1883 415.972 106.53 423.005 120.48C427.622 129.638 429.4 139.279 430.218 149.4C431.001 159.076 431 170.897 431 184.947V223.852C431 237.902 431.001 249.723 430.218 259.399C429.4 269.521 427.622 279.162 423.005 288.32C415.972 302.269 404.749 313.611 390.946 320.719C381.885 325.385 372.345 327.182 362.33 328.009C352.756 328.8 341.059 328.8 327.157 328.799H205.955C197.442 328.799 189.759 323.637 186.465 315.703C183.171 307.769 184.908 298.613 190.872 292.473L290.961 189.435L321.127 219.364L256.325 286.076H326.311C341.283 286.076 351.24 286.059 358.888 285.428C366.288 284.817 369.646 283.738 371.755 282.652C377.603 279.64 382.358 274.835 385.338 268.924C386.413 266.792 387.48 263.4 388.085 255.92C388.71 248.191 388.726 238.128 388.726 222.997V185.802C388.726 170.671 388.71 160.608 388.085 152.879C387.48 145.4 386.413 142.007 385.338 139.875C382.358 133.965 377.603 129.159 371.755 126.147C369.646 125.061 366.288 123.982 358.888 123.371C351.24 122.74 341.283 122.723 326.311 122.723H287.425C272.289 122.723 262.215 122.74 254.483 123.381C246.996 124.003 243.611 125.1 241.495 126.199C235.611 129.257 230.846 134.132 227.893 140.115C226.831 142.267 225.787 145.701 225.263 153.275C224.723 161.096 224.829 171.276 225.013 186.572L225.225 204.139L182.955 204.66L182.733 186.231C182.561 172.024 182.416 160.078 183.092 150.298C183.799 140.074 185.485 130.322 190.064 121.045C197.034 106.924 208.28 95.4193 222.166 88.2041C231.289 83.4635 240.917 81.6404 251.024 80.8017C260.692 79.9994 272.513 79.9997 286.571 80Z" fill="url(#paint1_radial_1397_4507)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M286.571 80H327.158C341.059 79.9997 352.756 79.9994 362.33 80.79C372.345 81.617 381.885 83.4143 390.946 88.0805C404.749 95.1883 415.972 106.53 423.005 120.48C427.622 129.638 429.4 139.279 430.218 149.4C431.001 159.076 431 170.897 431 184.947V223.852C431 237.902 431.001 249.723 430.218 259.399C429.4 269.521 427.622 279.162 423.005 288.32C415.972 302.269 404.749 313.611 390.946 320.719C381.885 325.385 372.345 327.182 362.33 328.009C352.756 328.8 341.059 328.8 327.157 328.799H205.955C197.442 328.799 189.759 323.637 186.465 315.703C183.171 307.769 184.908 298.613 190.872 292.473L290.961 189.435L321.127 219.364L256.325 286.076H326.311C341.283 286.076 351.24 286.059 358.888 285.428C366.288 284.817 369.646 283.738 371.755 282.652C377.603 279.64 382.358 274.835 385.338 268.924C386.413 266.792 387.48 263.4 388.085 255.92C388.71 248.191 388.726 238.128 388.726 222.997V185.802C388.726 170.671 388.71 160.608 388.085 152.879C387.48 145.4 386.413 142.007 385.338 139.875C382.358 133.965 377.603 129.159 371.755 126.147C369.646 125.061 366.288 123.982 358.888 123.371C351.24 122.74 341.283 122.723 326.311 122.723H287.425C272.289 122.723 262.215 122.74 254.483 123.381C246.996 124.003 243.611 125.1 241.495 126.199C235.611 129.257 230.846 134.132 227.893 140.115C226.831 142.267 225.787 145.701 225.263 153.275C224.723 161.096 224.829 171.276 225.013 186.572L225.225 204.139L182.955 204.66L182.733 186.231C182.561 172.024 182.416 160.078 183.092 150.298C183.799 140.074 185.485 130.322 190.064 121.045C197.034 106.924 208.28 95.4193 222.166 88.2041C231.289 83.4635 240.917 81.6404 251.024 80.8017C260.692 79.9994 272.513 79.9997 286.571 80Z" fill="url(#paint2_radial_1397_4507)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M286.571 80H327.158C341.059 79.9997 352.756 79.9994 362.33 80.79C372.345 81.617 381.885 83.4143 390.946 88.0805C404.749 95.1883 415.972 106.53 423.005 120.48C427.622 129.638 429.4 139.279 430.218 149.4C431.001 159.076 431 170.897 431 184.947V223.852C431 237.902 431.001 249.723 430.218 259.399C429.4 269.521 427.622 279.162 423.005 288.32C415.972 302.269 404.749 313.611 390.946 320.719C381.885 325.385 372.345 327.182 362.33 328.009C352.756 328.8 341.059 328.8 327.157 328.799H205.955C197.442 328.799 189.759 323.637 186.465 315.703C183.171 307.769 184.908 298.613 190.872 292.473L290.961 189.435L321.127 219.364L256.325 286.076H326.311C341.283 286.076 351.24 286.059 358.888 285.428C366.288 284.817 369.646 283.738 371.755 282.652C377.603 279.64 382.358 274.835 385.338 268.924C386.413 266.792 387.48 263.4 388.085 255.92C388.71 248.191 388.726 238.128 388.726 222.997V185.802C388.726 170.671 388.71 160.608 388.085 152.879C387.48 145.4 386.413 142.007 385.338 139.875C382.358 133.965 377.603 129.159 371.755 126.147C369.646 125.061 366.288 123.982 358.888 123.371C351.24 122.74 341.283 122.723 326.311 122.723H287.425C272.289 122.723 262.215 122.74 254.483 123.381C246.996 124.003 243.611 125.1 241.495 126.199C235.611 129.257 230.846 134.132 227.893 140.115C226.831 142.267 225.787 145.701 225.263 153.275C224.723 161.096 224.829 171.276 225.013 186.572L225.225 204.139L182.955 204.66L182.733 186.231C182.561 172.024 182.416 160.078 183.092 150.298C183.799 140.074 185.485 130.322 190.064 121.045C197.034 106.924 208.28 95.4193 222.166 88.2041C231.289 83.4635 240.917 81.6404 251.024 80.8017C260.692 79.9994 272.513 79.9997 286.571 80Z" fill="url(#paint3_radial_1397_4507)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M153.112 388.466C160.76 389.098 170.717 389.114 185.689 389.114H225.228C238.879 389.114 247.959 389.1 254.952 388.573C261.73 388.061 264.838 387.156 266.785 386.253C273.548 383.118 278.974 377.634 282.077 370.799C282.97 368.831 283.866 365.69 284.372 358.84C284.894 351.772 284.908 342.596 284.908 328.799H327.181L327.182 329.579C327.182 342.391 327.182 353.172 326.528 362.021C325.845 371.266 324.364 380.102 320.5 388.612C313.178 404.744 300.373 417.685 284.411 425.085C275.99 428.989 267.248 430.487 258.099 431.177C249.344 431.838 238.677 431.838 225.999 431.837L184.842 431.837C170.94 431.838 159.244 431.838 149.67 431.047C139.655 430.22 130.115 428.423 121.054 423.757C107.251 416.649 96.0284 405.308 88.9954 391.358C84.3783 382.2 82.5999 372.559 81.7816 362.437C80.9994 352.761 80.9997 340.94 81 326.89V287.985C80.9997 273.935 80.9994 262.115 81.7816 252.438C82.5999 242.317 84.3783 232.676 88.9954 223.518C96.0284 209.568 107.251 198.226 121.054 191.119C130.115 186.452 139.655 184.655 149.67 183.828C159.244 183.038 170.941 183.038 184.843 183.038H306.045C317.718 183.038 327.181 192.602 327.181 204.4C327.181 216.197 317.718 225.761 306.045 225.761H185.689C170.717 225.761 160.76 225.778 153.112 226.409C145.712 227.02 142.354 228.099 140.245 229.185C134.397 232.197 129.642 237.003 126.661 242.914C125.587 245.045 124.519 248.438 123.915 255.917C123.29 263.646 123.274 273.71 123.274 288.841V326.035C123.274 341.166 123.29 351.229 123.915 358.958C124.519 366.438 125.587 369.831 126.661 371.962C129.642 377.873 134.397 382.679 140.245 385.69C142.354 386.776 145.712 387.855 153.112 388.466Z" fill="url(#paint4_linear_1397_4507)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M153.112 388.466C160.76 389.098 170.717 389.114 185.689 389.114H225.228C238.879 389.114 247.959 389.1 254.952 388.573C261.73 388.061 264.838 387.156 266.785 386.253C273.548 383.118 278.974 377.634 282.077 370.799C282.97 368.831 283.866 365.69 284.372 358.84C284.894 351.772 284.908 342.596 284.908 328.799H327.181L327.182 329.579C327.182 342.391 327.182 353.172 326.528 362.021C325.845 371.266 324.364 380.102 320.5 388.612C313.178 404.744 300.373 417.685 284.411 425.085C275.99 428.989 267.248 430.487 258.099 431.177C249.344 431.838 238.677 431.838 225.999 431.837L184.842 431.837C170.94 431.838 159.244 431.838 149.67 431.047C139.655 430.22 130.115 428.423 121.054 423.757C107.251 416.649 96.0284 405.308 88.9954 391.358C84.3783 382.2 82.5999 372.559 81.7816 362.437C80.9994 352.761 80.9997 340.94 81 326.89V287.985C80.9997 273.935 80.9994 262.115 81.7816 252.438C82.5999 242.317 84.3783 232.676 88.9954 223.518C96.0284 209.568 107.251 198.226 121.054 191.119C130.115 186.452 139.655 184.655 149.67 183.828C159.244 183.038 170.941 183.038 184.843 183.038H306.045C317.718 183.038 327.181 192.602 327.181 204.4C327.181 216.197 317.718 225.761 306.045 225.761H185.689C170.717 225.761 160.76 225.778 153.112 226.409C145.712 227.02 142.354 228.099 140.245 229.185C134.397 232.197 129.642 237.003 126.661 242.914C125.587 245.045 124.519 248.438 123.915 255.917C123.29 263.646 123.274 273.71 123.274 288.841V326.035C123.274 341.166 123.29 351.229 123.915 358.958C124.519 366.438 125.587 369.831 126.661 371.962C129.642 377.873 134.397 382.679 140.245 385.69C142.354 386.776 145.712 387.855 153.112 388.466Z" fill="url(#paint5_radial_1397_4507)"/>
</g>
<defs>
<linearGradient id="paint0_linear_1397_4507" x1="247.767" y1="326.867" x2="250.596" y2="79.6832" gradientUnits="userSpaceOnUse">
<stop offset="0.43118" stop-color="#498FFD"/>
<stop offset="1" stop-color="#16D1D6"/>
</linearGradient>
<radialGradient id="paint1_radial_1397_4507" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(179.657 155.329) rotate(-15.5725) scale(159.744 159.494)">
<stop stop-color="#18CFD7"/>
<stop offset="1" stop-color="#18CFD7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint2_radial_1397_4507" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(272.994 225.963) rotate(152.354) scale(59.8025 59.7092)">
<stop stop-color="#4990FE"/>
<stop offset="0.353962" stop-color="#4990FE"/>
<stop offset="1" stop-color="#4990FE" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint3_radial_1397_4507" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(199.838 306.686) rotate(-45.9392) scale(108.824 108.654)">
<stop stop-color="#4990FE"/>
<stop offset="0.405688" stop-color="#4990FE"/>
<stop offset="1" stop-color="#4990FE" stop-opacity="0"/>
</radialGradient>
<linearGradient id="paint4_linear_1397_4507" x1="328.491" y1="432.817" x2="329.401" y2="180.559" gradientUnits="userSpaceOnUse">
<stop stop-color="#2950FF"/>
<stop offset="0.821717" stop-color="#498FFD"/>
</linearGradient>
<radialGradient id="paint5_radial_1397_4507" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(328.491 326.867) rotate(129.289) scale(107.559 106.428)">
<stop offset="0.337169" stop-color="#2950FF"/>
<stop offset="0.792226" stop-color="#2950FF" stop-opacity="0"/>
</radialGradient>
<clipPath id="clip0_1397_4507">
<rect width="512" height="512" fill="white"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 439 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 805 KiB

View file

@ -1,75 +0,0 @@
name: zano
base: core18
adopt-info: zano
summary: "Zano coin: official wallet. Secure. Scalable. Easy to Use."
description: |
Zano is a scalable and secure coin, designed for use in e-commerce.
The technology behind our blockchain provides reliability, security,
and flexibility a perfect option for P2P transactions.
More info: http://zano.org
grade: stable
confinement: strict
architectures:
- build-on: amd64
- build-on: i386
parts:
zano:
source: https://github.com/hyle-team/zano.git
plugin: cmake
override-pull: |
snapcraftctl pull
snapcraftctl set-version "$(git describe)"
configflags:
- -DBUILD_GUI=TRUE
override-build: |
snapcraftctl build
mkdir -p $SNAPCRAFT_PART_INSTALL/opt/Zano
cp $SNAPCRAFT_PART_BUILD/src/Zano $SNAPCRAFT_PART_INSTALL/opt/Zano/
cp $SNAPCRAFT_PART_BUILD/src/simplewallet $SNAPCRAFT_PART_INSTALL/opt/Zano/
cp $SNAPCRAFT_PART_BUILD/src/zanod $SNAPCRAFT_PART_INSTALL/opt/Zano/
rsync -a $SNAPCRAFT_PART_SRC/src/gui/qt-daemon/html $SNAPCRAFT_PART_INSTALL/opt/Zano --exclude less --exclude package.json --exclude gulpfile.js
build-packages:
- make
- g++
- libboost-all-dev
- qtwebengine5-dev
- rsync
build-attributes: [keep-execstack]
stage-packages:
- libboost-system1.65.1
- libboost-filesystem1.65.1
- libboost-thread1.65.1
- libboost-date-time1.65.1
- libboost-chrono1.65.1
- libboost-regex1.65.1
- libboost-serialization1.65.1
- libboost-program-options1.65.1
- libboost-locale1.65.1
apps:
zano:
command: opt/Zano/Zano --data-dir $SNAP_USER_COMMON
extensions:
- kde-neon
plugs:
- network
- home
- desktop
- opengl #for QML support
- browser-support #for Qt WebEngine support
- audio-playback
- unity7 #for tray icon support
simplewallet:
command: opt/Zano/simplewallet
plugs:
- network
- home
zanod:
command: opt/Zano/zanod --data-dir $SNAP_USER_COMMON
environment:
LC_ALL: C
plugs:
- network
- network-bind

View file

@ -85,6 +85,7 @@ INIT_SHARED_PCH()
add_subdirectory(config) add_subdirectory(config)
add_subdirectory(genesis) add_subdirectory(genesis)
add_subdirectory(api)
add_library(common ${COMMON}) add_library(common ${COMMON})
add_dependencies(common version config ${PCH_LIB_NAME}) add_dependencies(common version config ${PCH_LIB_NAME})
@ -118,6 +119,7 @@ endif()
add_library(currency_core ${CURRENCY_CORE}) add_library(currency_core ${CURRENCY_CORE})
add_dependencies(currency_core version config ${PCH_LIB_NAME}) add_dependencies(currency_core version config ${PCH_LIB_NAME})
target_link_libraries(currency_core config) target_link_libraries(currency_core config)
target_include_directories(currency_core PRIVATE ${RANDOMX_INCLUDE})
ENABLE_SHARED_PCH(currency_core CURRENCY_CORE) ENABLE_SHARED_PCH(currency_core CURRENCY_CORE)
add_library(wallet ${WALLET}) add_library(wallet ${WALLET})
@ -163,19 +165,19 @@ target_link_libraries(currency_core config lmdb mdbx)
add_executable(daemon ${DAEMON} ${P2P} ${CURRENCY_PROTOCOL}) add_executable(daemon ${DAEMON} ${P2P} ${CURRENCY_PROTOCOL})
add_dependencies(daemon version) add_dependencies(daemon version)
target_link_libraries(daemon rpc stratum currency_core crypto common miniupnpc::miniupnpc ZLIB::ZLIB ethash ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} OpenSSL::SSL OpenSSL::Crypto) target_link_libraries(daemon rpc stratum currency_core crypto common miniupnpc::miniupnpc ZLIB::ZLIB ethash randomx api::server ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} OpenSSL::SSL OpenSSL::Crypto)
ENABLE_SHARED_PCH(daemon DAEMON) ENABLE_SHARED_PCH(daemon DAEMON)
ENABLE_SHARED_PCH_EXECUTABLE(daemon) ENABLE_SHARED_PCH_EXECUTABLE(daemon)
add_executable(connectivity_tool ${CONN_TOOL}) add_executable(connectivity_tool ${CONN_TOOL})
add_dependencies(connectivity_tool version) add_dependencies(connectivity_tool version)
target_link_libraries(connectivity_tool currency_core crypto common ZLIB::ZLIB ethash ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} OpenSSL::SSL OpenSSL::Crypto) target_link_libraries(connectivity_tool currency_core crypto common ZLIB::ZLIB ethash randomx ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} OpenSSL::SSL OpenSSL::Crypto)
ENABLE_SHARED_PCH(connectivity_tool CONN_TOOL) ENABLE_SHARED_PCH(connectivity_tool CONN_TOOL)
ENABLE_SHARED_PCH_EXECUTABLE(connectivity_tool) ENABLE_SHARED_PCH_EXECUTABLE(connectivity_tool)
add_executable(simplewallet ${SIMPLEWALLET}) add_executable(simplewallet ${SIMPLEWALLET})
add_dependencies(simplewallet version) add_dependencies(simplewallet version)
target_link_libraries(simplewallet wallet rpc currency_core crypto common ZLIB::ZLIB ethash ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} OpenSSL::SSL OpenSSL::Crypto) target_link_libraries(simplewallet wallet rpc currency_core crypto common ZLIB::ZLIB ethash randomx ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} OpenSSL::SSL OpenSSL::Crypto)
ENABLE_SHARED_PCH(simplewallet SIMPLEWALLET) ENABLE_SHARED_PCH(simplewallet SIMPLEWALLET)
ENABLE_SHARED_PCH_EXECUTABLE(simplewallet) ENABLE_SHARED_PCH_EXECUTABLE(simplewallet)

158
src/api/ApiServer.cpp Normal file
View file

@ -0,0 +1,158 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#include "ApiServer.hpp"
#include "controller/ApiCoreInfo.hpp"
#include "controller/path/info.hpp"
#include "controller/path/block.hpp"
#include "controller/path/block/identifier.hpp"
#include "controller/path/block/height.hpp"
#include "controller/path/block/template.hpp"
#include "controller/path/block/submit.hpp"
#include "controller/path/info/version.hpp"
#include "oatpp/network/Server.hpp"
#include "oatpp-swagger/Controller.hpp"
#include "version.h"
#include "common/command_line.h"
namespace
{
const command_line::arg_descriptor<uint16_t> arg_api_bind_port = {"api-bind-port", "Port for API server to bind to", 36943};
const command_line::arg_descriptor<std::string> arg_api_bind_host = {"api-bind-host", "IP/Hostname for API server to bind to", "127.0.0.1"};
}
uint16_t ApiServer::m_port = 8000;
std::string ApiServer::m_host = "127.0.0.1";
void ApiServer::init_options(boost::program_options::options_description& desc) {
command_line::add_arg(desc, arg_api_bind_port);
command_line::add_arg(desc, arg_api_bind_host);
}
ApiServer::ApiServer(const boost::program_options::variables_map& vm, currency::core* ccore, p2psrv_t* p2p, currency::core_rpc_server* rpc_server)
: m_vm(vm), m_ccore(ccore), m_p2p(p2p), m_rpc_server(rpc_server) {
if (vm.count(arg_api_bind_port.name)) {
m_port = vm[arg_api_bind_port.name].as<uint16_t>();
}
if (vm.count(arg_api_bind_host.name)) {
m_host = vm[arg_api_bind_host.name].as<std::string>();
}
}
void ApiServer::run() {
/* Register Components in scope of run() method */
Components components;
OATPP_CREATE_COMPONENT(std::shared_ptr<ApiCoreInfo>, coreInfoComponent)
([this] {
return std::make_shared<ApiCoreInfo>(*m_ccore, *m_p2p, *m_rpc_server);
}());
/* Get router component */
OATPP_COMPONENT(std::shared_ptr<oatpp::web::server::HttpRouter>, router);
auto docEndpoints = std::make_shared<oatpp::web::server::api::Endpoints>();
/*
* Create and register controllers, this list will get VERY large, but, it has to be this way as oatpp creates a
* static routing file before compile time, can't dynamically add controllers, or, be smart AND also have project code awareness
* by this list being large, it allows for per endpoint code separation;
* any PR that tries to reduce this, MUST have unit tests to prove it works, no exceptions.
*/
auto infoController = std::make_shared<InfoController>();
docEndpoints->append(infoController->getEndpoints());
router->addController(infoController);
auto infoVersionController = std::make_shared<InfoVersionController>();
docEndpoints->append(infoVersionController->getEndpoints());
router->addController(infoVersionController);
auto blockController = std::make_shared<BlockController>();
docEndpoints->append(blockController->getEndpoints());
router->addController(blockController);
auto blockTemplateController = std::make_shared<BlockTemplateController>();
docEndpoints->append(blockTemplateController->getEndpoints());
router->addController(blockTemplateController);
auto blockSubmitController = std::make_shared<BlockSubmitController>();
docEndpoints->append(blockSubmitController->getEndpoints());
router->addController(blockSubmitController);
auto blockHeightController = std::make_shared<BlockHeightController>();
docEndpoints->append(blockHeightController->getEndpoints());
router->addController(blockHeightController);
auto blockIdentifierController = std::make_shared<BlockIdentifierController>();
docEndpoints->append(blockIdentifierController->getEndpoints());
router->addController(blockIdentifierController);
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::swagger::DocumentInfo>, swaggerDocumentInfo)
([]
{
oatpp::swagger::DocumentInfo::Builder builder;
builder
.setTitle("Lethean Blockchain API")
.setDescription("OpenAPI for Lethean Blockchain")
.setVersion(PROJECT_VERSION)
.setContactName("Lethean")
.setContactUrl("https://lt.hn/")
.setLicenseName("EUPL-1.2")
.setLicenseUrl("https://joinup.ec.europa.eu/software/page/eupl/licence-eupl")
.addServer("http://" + ApiServer::m_host + ":" + std::to_string(ApiServer::m_port), "Local Daemon")
.addServer("http://seed.lethean.io:36943", "Seed Server");
return builder.build(); }());
/* Create a Swagger-UI controller and add its endpoints to the router */
auto swaggerController = oatpp::swagger::Controller::createShared(*docEndpoints);
router->addController(swaggerController);
/* Get a connection handler component */
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ConnectionHandler>, connectionHandler);
/* Get a connection provider component */
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ServerConnectionProvider>, connectionProvider);
/* Create a server which takes provided TCP connections and passes them to the HTTP connection handler */
m_server = std::make_shared<oatpp::network::Server>(connectionProvider, connectionHandler);
/* Print server port */
OATPP_LOGI("lethean-api", "Server running, API Docs: http://127.0.0.1:%s/swagger/ui", static_cast<const char*>(connectionProvider->getProperty("port").getData()));
/* Run server */
m_server->run();
}
void ApiServer::start() {
m_server_thread = std::thread(&ApiServer::run, this);
}
void ApiServer::stop() const
{
if (m_server) {
m_server->stop();
}
}
void ApiServer::wait() {
if (m_server_thread.joinable()) {
m_server_thread.join();
}
}

91
src/api/ApiServer.hpp Normal file
View file

@ -0,0 +1,91 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef ApiServer_hpp
#define ApiServer_hpp
#include "currency_core/currency_core.h"
#include "p2p/net_node.h"
#include "currency_protocol/currency_protocol_handler.h"
#include "rpc/core_rpc_server.h"
#include "oatpp/web/server/HttpConnectionHandler.hpp"
#include "oatpp/network/tcp/server/ConnectionProvider.hpp"
#include "oatpp/parser/json/mapping/ObjectMapper.hpp"
#include "oatpp/core/macro/component.hpp"
#include "oatpp-swagger/Resources.hpp"
#include "oatpp/network/Server.hpp"
#include <thread>
#include <boost/program_options.hpp>
namespace po = boost::program_options;
// Define the p2p server type to avoid verbose template syntax
typedef nodetool::node_server<currency::t_currency_protocol_handler<currency::core>> p2psrv_t;
class ApiServer {
private:
std::thread m_server_thread;
std::shared_ptr<oatpp::network::Server> m_server;
boost::program_options::variables_map m_vm;
currency::core* m_ccore;
p2psrv_t* m_p2p;
currency::core_rpc_server* m_rpc_server;
void run();
public:
static uint16_t m_port;
static std::string m_host;
static void init_options(po::options_description& desc);
ApiServer(const boost::program_options::variables_map& vm, currency::core* ccore, p2psrv_t* p2p, currency::core_rpc_server* rpc_server);
class Components {
public:
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::ServerConnectionProvider>, serverConnectionProvider)([] {
return oatpp::network::tcp::server::ConnectionProvider::createShared({ApiServer::m_host, ApiServer::m_port, oatpp::network::Address::IP_4});
}());
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::web::server::HttpRouter>, httpRouter)([] {
return oatpp::web::server::HttpRouter::createShared();
}());
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::ConnectionHandler>, serverConnectionHandler)([] {
OATPP_COMPONENT(std::shared_ptr<oatpp::web::server::HttpRouter>, router);
return oatpp::web::server::HttpConnectionHandler::createShared(router);
}());
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, apiObjectMapper)([] {
auto jsonMapper = oatpp::parser::json::mapping::ObjectMapper::createShared();
jsonMapper->getSerializer()->getConfig()->useBeautifier = true;
return jsonMapper;
}());
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::swagger::Resources>, swaggerResources)([] {
return oatpp::swagger::Resources::loadResources(OATPP_SWAGGER_RES_PATH);
}());
};
void start();
void stop() const;
void wait();
};
#endif /* ApiServer_hpp */

70
src/api/CMakeLists.txt Normal file
View file

@ -0,0 +1,70 @@
if(NOT PROJECT_NAME)
project(api-server)
endif()
find_package(oatpp 1.3.0 REQUIRED)
if(oatpp_FOUND)
message(STATUS "Found oatpp version: ${oatpp_VERSION_STRING}")
else()
message(FATAL_ERROR "Could not find oatpp")
endif()
find_package(oatpp-swagger 1.3.0 REQUIRED)
if(oatpp-swagger_FOUND)
message(STATUS "Found oatpp-swagger version: ${oatpp-swagger_VERSION_STRING}")
else()
message(FATAL_ERROR "Could not find oatpp-swagger")
endif()
add_library(api_server ApiServer.cpp)
add_library(api::server ALIAS api_server)
target_include_directories(api_server PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${oatpp_INCLUDE_DIRS}
${oatpp-swagger_INCLUDE_DIRS}
)
target_link_libraries(api_server PUBLIC
oatpp::oatpp
oatpp::oatpp-swagger
)
# Define path to swagger resources for the installed package.
# This assumes the executable is in 'bin' and resources are in 'share/api_server'.
target_compile_definitions(api_server PUBLIC -DOATPP_SWAGGER_RES_PATH="../share/api_server/res")
# Copy resources to build directory for development builds (e.g. running in CLion)
file(COPY ${oatpp-swagger_INCLUDE_DIRS}/../bin/oatpp-swagger/res DESTINATION ${CMAKE_BINARY_DIR}/share/api_server)
file(COPY ${CMAKE_SOURCE_DIR}/utils/sdk/spec/oas-3.0.0.json DESTINATION ${CMAKE_BINARY_DIR}/share/api_server)
# Install swagger resources to a conventional location for packaging.
install(DIRECTORY ${oatpp-swagger_INCLUDE_DIRS}/../bin/oatpp-swagger/res DESTINATION share/api_server)
# Install OpenAPI spec for SDK generation for packaging.
install(FILES ${CMAKE_SOURCE_DIR}/utils/sdk/spec/oas-3.0.0.json DESTINATION share/api_server)
#add_executable(lethean-api main.cpp)
#
#target_include_directories(lethean-api PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(api_server
PRIVATE
config
rpc
stratum
currency_core
crypto
common
ethash
randomx
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
OpenSSL::SSL
OpenSSL::Crypto
ZLIB::ZLIB
)
#add_subdirectory(tests)

View file

@ -0,0 +1,43 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef ApiCoreInfo_hpp
#define ApiCoreInfo_hpp
#include "currency_core/currency_core.h"
#include "p2p/net_node.h"
#include "currency_protocol/currency_protocol_handler.h"
#include "rpc/core_rpc_server.h"
// Define the p2p server type to avoid verbose template syntax
typedef nodetool::node_server<currency::t_currency_protocol_handler<currency::core>> p2psrv_t;
// A simple holder for core blockchain components that can be injected into controllers.
class ApiCoreInfo {
private:
currency::core& m_core;
p2psrv_t& m_p2p;
currency::core_rpc_server& m_rpc_server;
public:
ApiCoreInfo(currency::core& core, p2psrv_t& p2p, currency::core_rpc_server& rpc_server)
: m_core(core), m_p2p(p2p), m_rpc_server(rpc_server)
{}
currency::core& getCore() { return m_core; }
p2psrv_t& getP2p() { return m_p2p; }
currency::core_rpc_server& getRpcServer() { return m_rpc_server; }
};
#endif /* ApiCoreInfo_hpp */

View file

@ -0,0 +1,173 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef BlockController_hpp
#define BlockController_hpp
#include "modal/block/details.hpp"
#include "modal/transaction/details.hpp"
#include "controller/ApiCoreInfo.hpp"
#include "oatpp/web/server/api/ApiController.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/parser/json/mapping/ObjectMapper.hpp"
#include "rpc/core_rpc_server_commands_defs.h"
#include <string>
#include OATPP_CODEGEN_BEGIN(ApiController)
/**
* Block Controller
* Retrieves one or more blocks with optional pagination.
*/
class BlockController : public oatpp::web::server::api::ApiController {
private:
OATPP_COMPONENT(std::shared_ptr<ApiCoreInfo>, m_core_info);
// Helper function to populate a block details model from RPC details
oatpp::Object<BlockDetailsModel> populateBlockDetailsModel(const currency::block_rpc_extended_info& rpc_details) {
auto blockDetails = BlockDetailsModel::createShared();
blockDetails->id = rpc_details.id;
blockDetails->height = rpc_details.height;
blockDetails->timestamp = rpc_details.timestamp;
blockDetails->actual_timestamp = rpc_details.actual_timestamp;
blockDetails->difficulty = rpc_details.difficulty;
blockDetails->prev_id = rpc_details.prev_id;
blockDetails->is_orphan = rpc_details.is_orphan;
blockDetails->base_reward = rpc_details.base_reward;
blockDetails->summary_reward = rpc_details.summary_reward;
blockDetails->total_fee = rpc_details.total_fee;
blockDetails->penalty = rpc_details.penalty;
blockDetails->already_generated_coins = rpc_details.already_generated_coins;
blockDetails->block_cumulative_size = rpc_details.block_cumulative_size;
blockDetails->total_txs_size = rpc_details.total_txs_size;
blockDetails->cumulative_diff_adjusted = rpc_details.cumulative_diff_adjusted;
blockDetails->cumulative_diff_precise = rpc_details.cumulative_diff_precise;
blockDetails->blob = rpc_details.blob;
blockDetails->miner_text_info = rpc_details.miner_text_info;
blockDetails->type = rpc_details.type;
auto tx_details_list = oatpp::List<oatpp::Object<TransactionDetailsModel>>::createShared();
for(const auto& tx_rpc_info : rpc_details.transactions_details) {
auto tx_model = TransactionDetailsModel::createShared();
tx_model->id = tx_rpc_info.id;
tx_model->fee = tx_rpc_info.fee;
tx_model->amount = tx_rpc_info.amount;
tx_model->blob_size = tx_rpc_info.blob_size;
tx_model->keeper_block = tx_rpc_info.keeper_block;
tx_model->timestamp = tx_rpc_info.timestamp;
tx_details_list->push_back(tx_model);
}
blockDetails->transactions_details = tx_details_list;
return blockDetails;
}
public:
explicit BlockController(OATPP_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper))
: oatpp::web::server::api::ApiController(objectMapper)
{}
public:
ENDPOINT_INFO(getBlocks) {
info->summary = "Get one or more blocks, with optional pagination.";
info->addTag("Block");
info->queryParams["limit"].description = "Number of blocks to retrieve. Default is 1. If limit is 1, a single block object is returned. Otherwise, a list of blocks is returned.";
info->queryParams["offset"].description = "Number of blocks to skip from the start height. Default is 0.";
info->queryParams["start"].description = "The starting block height. If not provided, the current top block height is used.";
info->addResponse<Object<BlockDetailsModel>>(Status::CODE_200, "application/json", "A single block object.");
info->addResponse<List<Object<BlockDetailsModel>>>(Status::CODE_200, "application/json", "A list of block objects.");
info->addResponse(Status::CODE_404, "text/plain");
info->addResponse(Status::CODE_400, "text/plain");
}
ENDPOINT("GET", "/block", getBlocks, QUERIES(QueryParams, queryParams)) {
const auto limitStr = queryParams.get("limit");
const auto offsetStr = queryParams.get("offset");
const auto startStr = queryParams.get("start");
uint64_t limit = 1;
if (limitStr) {
try {
limit = std::stoull(limitStr->c_str());
} catch (const std::exception& e) {
return createResponse(Status::CODE_400, "Invalid 'limit' parameter");
}
}
uint64_t offset = 0;
if (offsetStr) {
try {
offset = std::stoull(offsetStr->c_str());
} catch (const std::exception& e) {
return createResponse(Status::CODE_400, "Invalid 'offset' parameter");
}
}
uint64_t start_height;
if (startStr) {
try {
start_height = std::stoull(startStr->c_str());
} catch (const std::exception& e) {
return createResponse(Status::CODE_400, "Invalid 'start' parameter");
}
} else {
start_height = m_core_info->getCore().get_blockchain_storage().get_current_blockchain_size() - 1;
}
if (limit == 0) {
return createResponse(Status::CODE_400, "'limit' must be greater than 0");
}
if (start_height < offset) {
return createResponse(Status::CODE_400, "'start' height cannot be less than 'offset'");
}
uint64_t current_height = start_height - offset;
if (limit == 1) {
currency::block_rpc_extended_info rpc_details;
if (!m_core_info->getCore().get_blockchain_storage().get_main_block_rpc_details(current_height, rpc_details)) {
return createResponse(Status::CODE_404, "Block not found at specified height");
}
return createDtoResponse(Status::CODE_200, populateBlockDetailsModel(rpc_details));
}
auto block_list = oatpp::List<oatpp::Object<BlockDetailsModel>>::createShared();
for(uint64_t i = 0; i < limit; ++i)
{
if(current_height < i)
{
break; // Reached genesis
}
uint64_t height_to_fetch = current_height - i;
currency::block_rpc_extended_info rpc_details;
if(m_core_info->getCore().get_blockchain_storage().get_main_block_rpc_details(height_to_fetch, rpc_details))
{
block_list->push_back(populateBlockDetailsModel(rpc_details));
}
else
{
// Could be that we requested past genesis, or a block is missing for some reason.
// We'll just stop here.
break;
}
}
return createDtoResponse(Status::CODE_200, block_list);
}
};
#include OATPP_CODEGEN_END(ApiController)
#endif /* BlockController_hpp */

View file

@ -0,0 +1,54 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef BlockHeightController_hpp
#define BlockHeightController_hpp
#include "modal/block/height.hpp"
#include "controller/ApiCoreInfo.hpp"
#include "oatpp/web/server/api/ApiController.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/parser/json/mapping/ObjectMapper.hpp"
#include OATPP_CODEGEN_BEGIN(ApiController)
/**
* Block Height Controller
*/
class BlockHeightController : public oatpp::web::server::api::ApiController {
private:
OATPP_COMPONENT(std::shared_ptr<ApiCoreInfo>, m_core_info);
public:
explicit BlockHeightController(OATPP_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper))
: oatpp::web::server::api::ApiController(objectMapper)
{}
public:
ENDPOINT_INFO(getHeight) {
info->summary = "Get the current blockchain height";
info->addTag("Block");
info->addResponse<Object<HeightModel>>(Status::CODE_200, "application/json");
}
ENDPOINT("GET", "/block/height", getHeight) {
auto model = HeightModel::createShared();
model->height = m_core_info->getCore().get_current_blockchain_size();
return createDtoResponse(Status::CODE_200, model);
}
};
#include OATPP_CODEGEN_END(ApiController)
#endif /* BlockHeightController_hpp */

View file

@ -0,0 +1,122 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef BlockIdentifierController_hpp
#define BlockIdentifierController_hpp
#include "modal/block/details.hpp"
#include "modal/transaction/details.hpp"
#include "controller/ApiCoreInfo.hpp"
#include "oatpp/web/server/api/ApiController.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/parser/json/mapping/ObjectMapper.hpp"
#include "rpc/core_rpc_server_commands_defs.h"
#include <string> // For std::string and std::stoull
#include OATPP_CODEGEN_BEGIN(ApiController)
/**
* Block Identifier Controller
* Acts as a proxy to fetch blocks by hash or by height (ID).
*/
class BlockIdentifierController : public oatpp::web::server::api::ApiController {
private:
OATPP_COMPONENT(std::shared_ptr<ApiCoreInfo>, m_core_info);
public:
explicit BlockIdentifierController(OATPP_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper))
: oatpp::web::server::api::ApiController(objectMapper)
{}
public:
ENDPOINT_INFO(getBlock) {
info->summary = "Get a block by its hash or height (ID)";
info->addTag("Block");
info->pathParams["identifier"].description = "The hash (hex string) or height (integer) of the block to retrieve.";
info->addResponse<Object<BlockDetailsModel>>(Status::CODE_200, "application/json");
info->addResponse(Status::CODE_404, "text/plain");
info->addResponse(Status::CODE_400, "text/plain");
}
ENDPOINT("GET", "/block/{identifier}", getBlock, PATH(String, identifier)) {
currency::block_rpc_extended_info rpc_details;
bool block_found = false;
// Check if the identifier consists only of digits
if (identifier->find_first_not_of("0123456789") == std::string::npos) {
// It's a numeric ID (height)
try {
uint64_t height = std::stoull(identifier->c_str());
block_found = m_core_info->getCore().get_blockchain_storage().get_main_block_rpc_details(height, rpc_details);
} catch (const std::exception& e) {
return createResponse(Status::CODE_400, "Invalid block height format");
}
} else {
// It's a hash
crypto::hash block_hash{};
if (!epee::string_tools::hex_to_pod(*identifier, block_hash)) {
return createResponse(Status::CODE_400, "Invalid block hash format");
}
block_found = m_core_info->getCore().get_blockchain_storage().get_main_block_rpc_details(block_hash, rpc_details);
}
if (!block_found) {
return createResponse(Status::CODE_404, "Block not found");
}
// Common logic to populate the DTO
auto blockDetails = BlockDetailsModel::createShared();
blockDetails->id = rpc_details.id;
blockDetails->height = rpc_details.height;
blockDetails->timestamp = rpc_details.timestamp;
blockDetails->actual_timestamp = rpc_details.actual_timestamp;
blockDetails->difficulty = rpc_details.difficulty;
blockDetails->prev_id = rpc_details.prev_id;
blockDetails->is_orphan = rpc_details.is_orphan;
blockDetails->base_reward = rpc_details.base_reward;
blockDetails->summary_reward = rpc_details.summary_reward;
blockDetails->total_fee = rpc_details.total_fee;
blockDetails->penalty = rpc_details.penalty;
blockDetails->already_generated_coins = rpc_details.already_generated_coins;
blockDetails->block_cumulative_size = rpc_details.block_cumulative_size;
blockDetails->total_txs_size = rpc_details.total_txs_size;
blockDetails->cumulative_diff_adjusted = rpc_details.cumulative_diff_adjusted;
blockDetails->cumulative_diff_precise = rpc_details.cumulative_diff_precise;
blockDetails->blob = rpc_details.blob;
blockDetails->miner_text_info = rpc_details.miner_text_info;
blockDetails->type = rpc_details.type;
auto tx_details_list = oatpp::List<oatpp::Object<TransactionDetailsModel>>::createShared();
for(const auto& tx_rpc_info : rpc_details.transactions_details) {
auto tx_model = TransactionDetailsModel::createShared();
tx_model->id = tx_rpc_info.id;
tx_model->fee = tx_rpc_info.fee;
tx_model->amount = tx_rpc_info.amount;
tx_model->blob_size = tx_rpc_info.blob_size;
tx_model->keeper_block = tx_rpc_info.keeper_block;
tx_model->timestamp = tx_rpc_info.timestamp;
tx_details_list->push_back(tx_model);
}
blockDetails->transactions_details = tx_details_list;
return createDtoResponse(Status::CODE_200, blockDetails);
}
};
#include OATPP_CODEGEN_END(ApiController)
#endif /* BlockIdentifierController_hpp */

View file

@ -0,0 +1,75 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef BlockSubmitController_hpp
#define BlockSubmitController_hpp
#include "oatpp/web/server/api/ApiController.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "controller/ApiCoreInfo.hpp"
#include "modal/block/submit_request.hpp"
#include "modal/block/submit_response.hpp"
#include "currency_core/currency_format_utils.h"
#include "currency_core/verification_context.h"
#include OATPP_CODEGEN_BEGIN(ApiController)
class BlockSubmitController : public oatpp::web::server::api::ApiController {
private:
OATPP_COMPONENT(std::shared_ptr<ApiCoreInfo>, m_core_info);
public:
explicit BlockSubmitController(OATPP_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper))
: oatpp::web::server::api::ApiController(objectMapper) {}
public:
ENDPOINT_INFO(submitBlock) {
info->summary = "Submit a new block to the network";
info->addTag("Block");
info->addConsumes<Object<SubmitBlockRequestModel>>("application/json");
info->addResponse<Object<SubmitBlockResponseModel>>(Status::CODE_200, "application/json");
info->addResponse(Status::CODE_400, "text/plain");
info->addResponse(Status::CODE_406, "text/plain");
}
ENDPOINT("POST", "/block/submit", submitBlock, BODY_DTO(Object<SubmitBlockRequestModel>, requestModel)) {
if (!requestModel->block_blob || requestModel->block_blob->empty()) {
return createResponse(Status::CODE_400, "Missing block_blob");
}
currency::blobdata blockblob;
if (!epee::string_tools::parse_hexstr_to_binbuff(*requestModel->block_blob, blockblob)) {
return createResponse(Status::CODE_400, "Wrong block blob");
}
currency::block b = AUTO_VAL_INIT(b);
if (!currency::parse_and_validate_block_from_blob(blockblob, b)) {
return createResponse(Status::CODE_400, "Wrong block blob");
}
currency::block_verification_context bvc = AUTO_VAL_INIT(bvc);
if (!m_core_info->getCore().handle_block_found(b, &bvc)) {
if (bvc.m_added_to_altchain) {
return createResponse(Status::CODE_406, "Block added as alternative");
}
return createResponse(Status::CODE_406, "Block not accepted");
}
auto responseModel = SubmitBlockResponseModel::createShared();
responseModel->status = "OK";
return createDtoResponse(Status::CODE_200, responseModel);
}
};
#include OATPP_CODEGEN_END(ApiController)
#endif /* BlockSubmitController_hpp */

View file

@ -0,0 +1,104 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef BlockTemplateController_hpp
#define BlockTemplateController_hpp
#include "oatpp/web/server/api/ApiController.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "controller/ApiCoreInfo.hpp"
#include "modal/block/template_request.hpp"
#include "modal/block/template.hpp"
#include "currency_core/currency_format_utils.h"
#include OATPP_CODEGEN_BEGIN(ApiController)
class BlockTemplateController : public oatpp::web::server::api::ApiController {
private:
OATPP_COMPONENT(std::shared_ptr<ApiCoreInfo>, m_core_info);
public:
explicit BlockTemplateController(OATPP_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper))
: oatpp::web::server::api::ApiController(objectMapper) {}
public:
ENDPOINT_INFO(createBlockTemplate) {
info->summary = "Create a block template for mining";
info->addTag("Block");
info->addConsumes<Object<BlockTemplateRequestModel>>("application/json");
info->addResponse<Object<BlockTemplateModel>>(Status::CODE_200, "application/json");
info->addResponse(Status::CODE_400, "text/plain");
info->addResponse(Status::CODE_500, "text/plain");
}
ENDPOINT("POST", "/block/template", createBlockTemplate, BODY_DTO(Object<BlockTemplateRequestModel>, requestModel)) {
currency::create_block_template_params params = AUTO_VAL_INIT(params);
if (!currency::get_account_address_from_str(params.miner_address, *requestModel->miner_address)) {
return createResponse(Status::CODE_400, "Failed to parse miner_address");
}
if (requestModel->stakeholder_address && !currency::get_account_address_from_str(params.stakeholder_address, *requestModel->stakeholder_address)) {
return createResponse(Status::CODE_400, "Failed to parse stakeholder_address");
}
params.ex_nonce = requestModel->ex_nonce ? *requestModel->ex_nonce : "";
params.pos = requestModel->pos;
params.ignore_pow_ts_check = requestModel->ignore_pow_ts_check;
if (requestModel->pe) {
params.pe.amount = requestModel->pe->amount;
params.pe.g_index = requestModel->pe->g_index;
epee::string_tools::hex_to_pod(*requestModel->pe->keyimage, params.pe.keyimage);
params.pe.block_timestamp = requestModel->pe->block_timestamp;
params.pe.stake_unlock_time = requestModel->pe->stake_unlock_time;
epee::string_tools::hex_to_pod(*requestModel->pe->tx_id, params.pe.tx_id);
params.pe.tx_out_index = requestModel->pe->tx_out_index;
params.pe.wallet_index = requestModel->pe->wallet_index;
}
for (const auto& tx_hex : *requestModel->explicit_txs) {
currency::transaction tx;
currency::blobdata tx_blob;
if (!epee::string_tools::parse_hexstr_to_binbuff(*tx_hex, tx_blob) || !currency::parse_and_validate_tx_from_blob(tx_blob, tx)) {
return createResponse(Status::CODE_400, "Failed to parse explicit_txs");
}
params.explicit_txs.push_back(tx);
}
currency::create_block_template_response response = AUTO_VAL_INIT(response);
if (!m_core_info->getCore().get_block_template(params, response)) {
return createResponse(Status::CODE_500, "Internal error: failed to create block template");
}
auto model = BlockTemplateModel::createShared();
model->blocktemplate_blob = epee::string_tools::buff_to_hex_nodelimer(t_serializable_object_to_blob(response.b));
model->difficulty = response.diffic.convert_to<std::string>();
model->height = response.height;
model->block_reward_without_fee = response.block_reward_without_fee;
model->block_reward = response.block_reward;
model->txs_fee = response.txs_fee;
model->prev_hash = epee::string_tools::pod_to_hex(response.b.prev_id);
model->seed = epee::string_tools::pod_to_hex(currency::ethash_epoch_to_seed(currency::ethash_height_to_epoch(response.height)));
auto tgc_model = TxGenerationContextModel::createShared();
// This is a very complex object with many cryptographic details.
// For now, we will leave it empty as it's not essential for basic mining.
// A dedicated endpoint could be created later to expose this if needed.
model->miner_tx_tgc = tgc_model;
return createDtoResponse(Status::CODE_200, model);
}
};
#include OATPP_CODEGEN_END(ApiController)
#endif /* BlockTemplateController_hpp */

View file

@ -0,0 +1,228 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef InfoController_hpp
#define InfoController_hpp
#include "oatpp/web/server/api/ApiController.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "controller/ApiCoreInfo.hpp"
#include "modal/info/details.hpp"
#include "currency_core/currency_stat_info.h"
#include OATPP_CODEGEN_BEGIN(ApiController)
/**
* Info Controller
*/
class InfoController : public oatpp::web::server::api::ApiController {
private:
OATPP_COMPONENT(std::shared_ptr<ApiCoreInfo>, m_core_info);
public:
explicit InfoController(OATPP_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper))
: oatpp::web::server::api::ApiController(objectMapper)
{}
public:
ENDPOINT_INFO(getInfo) {
info->summary = "Get detailed information about the blockchain and daemon state";
info->addTag("Info");
info->addResponse<Object<InfoModel>>(Status::CODE_200, "application/json");
info->queryParams["flags"].name = "flags";
info->queryParams["flags"].description = "Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median.";
}
ENDPOINT("GET", "/info", getInfo, QUERY(String, flags, "flags",""), QUERIES(QueryParams, queryParams)) {
auto model = InfoModel::createShared();
currency::core& core = m_core_info->getCore();
currency::t_currency_protocol_handler<currency::core>& p2p_handler = m_core_info->getP2p().get_payload_object();
currency::blockchain_storage& bcs = core.get_blockchain_storage();
model->height = bcs.get_current_blockchain_size();
model->tx_count = bcs.get_total_transactions() - model->height; //without coinbase
model->tx_pool_size = core.get_pool_transactions_count();
model->alt_blocks_count = bcs.get_alternative_blocks_count();
uint64_t total_conn = m_core_info->getP2p().get_connections_count();
model->outgoing_connections_count = m_core_info->getP2p().get_outgoing_connections_count();
model->incoming_connections_count = total_conn - model->outgoing_connections_count;
model->synchronized_connections_count = p2p_handler.get_synchronized_connections_count();
model->white_peerlist_size = m_core_info->getP2p().get_peerlist_manager().get_white_peers_count();
model->grey_peerlist_size = m_core_info->getP2p().get_peerlist_manager().get_gray_peers_count();
model->current_blocks_median = bcs.get_current_comulative_blocksize_limit() / 2;
model->alias_count = bcs.get_aliases_count();
model->current_max_allowed_block_size = bcs.get_current_comulative_blocksize_limit();
if (!model->outgoing_connections_count)
model->daemon_network_state = "connecting";
else if (p2p_handler.is_synchronized())
model->daemon_network_state = "online";
else
model->daemon_network_state = "synchronizing";
model->synchronization_start_height = p2p_handler.get_core_inital_height();
model->max_net_seen_height = p2p_handler.get_max_seen_height();
nodetool::maintainers_info_external mi_res;
m_core_info->getP2p().get_maintainers_info(mi_res);
auto mi_model = MaintainersInfoModel::createShared();
mi_model->ver_major = mi_res.ver_major;
mi_model->ver_minor = mi_res.ver_minor;
mi_model->ver_revision = mi_res.ver_revision;
mi_model->build_no = mi_res.build_no;
mi_model->mode = mi_res.mode;
model->mi = mi_model;
model->pos_allowed = bcs.is_pos_allowed();
model->pos_difficulty = bcs.get_cached_next_difficulty(true).convert_to<std::string>();
model->pow_difficulty = bcs.get_cached_next_difficulty(false).convert_to<uint64_t>();
model->default_fee = bcs.get_core_runtime_config().tx_default_fee;
model->minimum_fee = bcs.get_core_runtime_config().tx_pool_min_fee;
auto hf_list = oatpp::List<Boolean>::createShared();
for (size_t i = 0; i != ZANO_HARDFORKS_TOTAL; i++)
{
hf_list->push_back(bcs.is_hardfork_active(i));
}
model->is_hardfork_active = hf_list;
auto flagsStr = queryParams.get("flags");
if (flagsStr) {
std::istringstream iss(flagsStr->c_str());
std::string flag;
while (std::getline(iss, flag, ',')) {
if (flag == "net_time_delta_median") {
int64_t last_median2local_time_diff, last_ntp2local_time_diff;
if (!p2p_handler.get_last_time_sync_difference(last_median2local_time_diff, last_ntp2local_time_diff))
model->net_time_delta_median = 1;
} else if (flag == "current_network_hashrate_50") {
model->current_network_hashrate_50 = bcs.get_current_hashrate(50);
} else if (flag == "current_network_hashrate_350") {
model->current_network_hashrate_350 = bcs.get_current_hashrate(350);
} else if (flag == "seconds_for_10_blocks") {
model->seconds_for_10_blocks = bcs.get_seconds_between_last_n_block(10);
} else if (flag == "seconds_for_30_blocks") {
model->seconds_for_30_blocks = bcs.get_seconds_between_last_n_block(30);
} else if (flag == "transactions_daily_stat") {
uint64_t daily_tx_count = 0, daily_tx_vol = 0;
bcs.get_transactions_daily_stat(daily_tx_count, daily_tx_vol);
auto daily_tx_count_list = oatpp::List<UInt64>::createShared();
daily_tx_count_list->push_back(daily_tx_count);
model->transactions_cnt_per_day = daily_tx_count_list;
auto daily_tx_vol_list = oatpp::List<UInt64>::createShared();
daily_tx_vol_list->push_back(daily_tx_vol);
model->transactions_volume_per_day = daily_tx_vol_list;
} else if (flag == "last_pos_timestamp") {
auto pos_bl_ptr = bcs.get_last_block_of_type(true);
if (pos_bl_ptr) model->last_pos_timestamp = pos_bl_ptr->bl.timestamp;
} else if (flag == "last_pow_timestamp") {
auto pow_bl_ptr = bcs.get_last_block_of_type(false);
if (pow_bl_ptr) model->last_pow_timestamp = pow_bl_ptr->bl.timestamp;
} else if (flag == "total_coins") {
model->total_coins = boost::lexical_cast<std::string>(bcs.total_coins());
} else if (flag == "last_block_size") {
std::vector<size_t> sz;
bcs.get_last_n_blocks_sizes(sz, 1);
model->last_block_size = sz.size() ? sz.back() : 0;
} else if (flag == "tx_count_in_last_block") {
currency::block b = AUTO_VAL_INIT(b);
bcs.get_top_block(b);
model->tx_count_in_last_block = b.tx_hashes.size();
} else if (flag == "pos_sequence_factor") {
model->pos_sequence_factor = bcs.get_current_sequence_factor(true);
} else if (flag == "pow_sequence_factor") {
model->pow_sequence_factor = bcs.get_current_sequence_factor(false);
} else if (flag == "pos_difficulty") {
currency::block b = AUTO_VAL_INIT(b);
bcs.get_top_block(b);
model->block_reward = currency::get_base_block_reward(model->height);
model->last_block_total_reward = currency::get_reward_from_miner_tx(b.miner_tx);
model->pos_diff_total_coins_rate = (bcs.get_cached_next_difficulty(true) / (bcs.total_coins() - PREMINE_AMOUNT + 1)).convert_to<uint64_t>();
model->last_block_timestamp = b.timestamp;
model->last_block_hash = string_tools::pod_to_hex(get_block_hash(b));
} else if (flag == "performance") {
auto perf_model = PerformanceModel::createShared();
const currency::blockchain_storage::performnce_data& pd = bcs.get_performnce_data();
auto block_processing_model = BlockProcessingPerformanceModel::createShared();
block_processing_model->block_processing_time_0 = pd.block_processing_time_0_ms.get_avg();
block_processing_model->block_processing_time_1 = pd.block_processing_time_1.get_avg();
block_processing_model->target_calculating_time_2 = pd.target_calculating_time_2.get_avg();
block_processing_model->longhash_calculating_time_3 = pd.longhash_calculating_time_3.get_avg();
block_processing_model->all_txs_insert_time_5 = pd.all_txs_insert_time_5.get_avg();
block_processing_model->etc_stuff_6 = pd.etc_stuff_6.get_avg();
block_processing_model->insert_time_4 = pd.insert_time_4.get_avg();
block_processing_model->raise_block_core_event = pd.raise_block_core_event.get_avg();
block_processing_model->target_calculating_enum_blocks = pd.target_calculating_enum_blocks.get_avg();
block_processing_model->target_calculating_calc = pd.target_calculating_calc.get_avg();
perf_model->block_processing = block_processing_model;
auto tx_processing_model = TxProcessingPerformanceModel::createShared();
tx_processing_model->tx_check_inputs = pd.tx_check_inputs_time.get_avg();
tx_processing_model->tx_add_one_tx = pd.tx_add_one_tx_time.get_avg();
tx_processing_model->tx_process_extra = pd.tx_process_extra.get_avg();
tx_processing_model->tx_process_attachment = pd.tx_process_attachment.get_avg();
tx_processing_model->tx_process_inputs = pd.tx_process_inputs.get_avg();
tx_processing_model->tx_push_global_index = pd.tx_push_global_index.get_avg();
tx_processing_model->tx_check_exist = pd.tx_check_exist.get_avg();
tx_processing_model->tx_append = pd.tx_append_time.get_avg();
tx_processing_model->tx_append_rl_wait = pd.tx_append_rl_wait.get_avg();
tx_processing_model->tx_append_is_expired = pd.tx_append_is_expired.get_avg();
tx_processing_model->tx_store_db = pd.tx_store_db.get_avg();
tx_processing_model->tx_check_inputs_prefix_hash = pd.tx_check_inputs_prefix_hash.get_avg();
tx_processing_model->tx_check_inputs_attachment_check = pd.tx_check_inputs_attachment_check.get_avg();
tx_processing_model->tx_check_inputs_loop = pd.tx_check_inputs_loop.get_avg();
tx_processing_model->tx_check_inputs_loop_kimage_check = pd.tx_check_inputs_loop_kimage_check.get_avg();
tx_processing_model->tx_check_inputs_loop_ch_in_val_sig = pd.tx_check_inputs_loop_ch_in_val_sig.get_avg();
tx_processing_model->tx_check_inputs_loop_scan_outputkeys_get_item_size = pd.tx_check_inputs_loop_scan_outputkeys_get_item_size.get_avg();
tx_processing_model->tx_check_inputs_loop_scan_outputkeys_relative_to_absolute = pd.tx_check_inputs_loop_scan_outputkeys_relative_to_absolute.get_avg();
tx_processing_model->tx_check_inputs_loop_scan_outputkeys_loop = pd.tx_check_inputs_loop_scan_outputkeys_loop.get_avg();
tx_processing_model->tx_check_inputs_loop_scan_outputkeys_loop_get_subitem = pd.tx_check_inputs_loop_scan_outputkeys_loop_get_subitem.get_avg();
tx_processing_model->tx_check_inputs_loop_scan_outputkeys_loop_find_tx = pd.tx_check_inputs_loop_scan_outputkeys_loop_find_tx.get_avg();
tx_processing_model->tx_check_inputs_loop_scan_outputkeys_loop_handle_output = pd.tx_check_inputs_loop_scan_outputkeys_loop_handle_output.get_avg();
tx_processing_model->tx_mixin_count = pd.tx_mixin_count.get_avg();
perf_model->tx_processing = tx_processing_model;
const currency::tx_memory_pool::performnce_data& pool_pd = core.get_tx_pool().get_performnce_data();
auto tx_pool_model = TxPoolPerformanceModel::createShared();
tx_pool_model->tx_processing_time = pool_pd.tx_processing_time.get_avg();
tx_pool_model->check_inputs_types_supported_time = pool_pd.check_inputs_types_supported_time.get_avg();
tx_pool_model->expiration_validate_time = pool_pd.expiration_validate_time.get_avg();
tx_pool_model->validate_amount_time = pool_pd.validate_amount_time.get_avg();
tx_pool_model->validate_alias_time = pool_pd.validate_alias_time.get_avg();
tx_pool_model->check_keyimages_ws_ms_time = pool_pd.check_keyimages_ws_ms_time.get_avg();
tx_pool_model->check_inputs_time = pool_pd.check_inputs_time.get_avg();
tx_pool_model->begin_tx_time = pool_pd.begin_tx_time.get_avg();
tx_pool_model->update_db_time = pool_pd.update_db_time.get_avg();
tx_pool_model->db_commit_time = pool_pd.db_commit_time.get_avg();
perf_model->tx_pool = tx_pool_model;
auto db_stat_model = DbStatInfoModel::createShared();
db_stat_model->map_size = pd.si.map_size;
db_stat_model->tx_count = pd.si.tx_count;
db_stat_model->write_tx_count = pd.si.write_tx_count;
perf_model->db_stat_info = db_stat_model;
model->performance_data = perf_model;
} else if (flag == "expirations_median") {
model->expiration_median_timestamp = bcs.get_tx_expiration_median();
}
}
}
return createDtoResponse(Status::CODE_200, model);
}
};
#include OATPP_CODEGEN_END(ApiController)
#endif /* InfoController_hpp */

View file

@ -0,0 +1,57 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef InfoVersionController_hpp
#define InfoVersionController_hpp
#include "oatpp/web/server/api/ApiController.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "version.h"
#include "modal/meta/version.hpp"
#include OATPP_CODEGEN_BEGIN(ApiController)
/**
* Version Controller
*/
class InfoVersionController : public oatpp::web::server::api::ApiController {
public:
explicit InfoVersionController(OATPP_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper))
: oatpp::web::server::api::ApiController(objectMapper)
{}
public:
ENDPOINT_INFO(version)
{
info->addTag("Info");
info->summary = "Get API version";
info->description = "Returns the current version of the API.";
info->addResponse<Object<VersionModel>>(Status::CODE_200, "application/json");
}
ENDPOINT("GET", "/info/version", version)
{
auto model = VersionModel::createShared();
model->version = PROJECT_VERSION;
model->version_long = PROJECT_VERSION_LONG;
model->major = PROJECT_MAJOR_VERSION;
model->minor = PROJECT_MINOR_VERSION;
model->revision = PROJECT_REVISION;
return createDtoResponse(Status::CODE_200, model);
}
};
#include OATPP_CODEGEN_END(ApiController)
#endif /* InfoVersionController_hpp */

36
src/api/main.cpp Normal file
View file

@ -0,0 +1,36 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#include "ApiServer.hpp"
#include "oatpp/core/base/Environment.hpp"
#include "common/util.h"
int main(int argc, const char * argv[]) {
oatpp::base::Environment::init();
ApiServer server;
tools::signal_handler::install([&server] {
server.stop();
});
server.start();
server.wait();
/* Destroy oatpp Environment */
oatpp::base::Environment::destroy();
return 0;
}

View file

@ -0,0 +1,59 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef BlockDetailsModel_hpp
#define BlockDetailsModel_hpp
#include "modal/transaction/details.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
/**
* Model for detailed block information.
*/
class BlockDetailsModel : public oatpp::DTO {
DTO_INIT(BlockDetailsModel, DTO);
DTO_FIELD(UInt64, actual_timestamp, "actual_timestamp");
DTO_FIELD(String, already_generated_coins, "already_generated_coins");
DTO_FIELD(UInt64, base_reward, "base_reward");
DTO_FIELD(String, blob, "blob");
DTO_FIELD(UInt64, block_cumulative_size, "block_cumulative_size");
DTO_FIELD(UInt64, block_tself_size, "block_tself_size");
DTO_FIELD(String, cumulative_diff_adjusted, "cumulative_diff_adjusted");
DTO_FIELD(String, cumulative_diff_precise, "cumulative_diff_precise");
DTO_FIELD(String, difficulty, "difficulty");
DTO_FIELD(UInt64, effective_fee_median, "effective_fee_median");
DTO_FIELD(UInt64, height, "height");
DTO_FIELD(String, id, "id");
DTO_FIELD(Boolean, is_orphan, "is_orphan");
DTO_FIELD(String, miner_text_info, "miner_text_info");
DTO_FIELD(String, object_in_json, "object_in_json");
DTO_FIELD(UInt64, penalty, "penalty");
DTO_FIELD(String, pow_seed, "pow_seed");
DTO_FIELD(String, prev_id, "prev_id");
DTO_FIELD(UInt64, summary_reward, "summary_reward");
DTO_FIELD(UInt64, this_block_fee_median, "this_block_fee_median");
DTO_FIELD(UInt64, timestamp, "timestamp");
DTO_FIELD(UInt64, total_fee, "total_fee");
DTO_FIELD(UInt64, total_txs_size, "total_txs_size");
DTO_FIELD(List<Object<TransactionDetailsModel>>, transactions_details, "transactions_details");
DTO_FIELD(UInt32, type, "type");
};
#include OATPP_CODEGEN_END(DTO)
#endif /* BlockDetailsModel_hpp */

View file

@ -0,0 +1,32 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef HeightModel_hpp
#define HeightModel_hpp
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class HeightModel final : public oatpp::DTO
{
DTO_INIT(HeightModel, DTO);
DTO_FIELD(UInt64, height);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* HeightModel_hpp */

View file

@ -0,0 +1,32 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef SubmitBlockRequestModel_hpp
#define SubmitBlockRequestModel_hpp
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class SubmitBlockRequestModel final : public oatpp::DTO
{
DTO_INIT(SubmitBlockRequestModel, DTO);
DTO_FIELD(String, block_blob);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* SubmitBlockRequestModel_hpp */

View file

@ -0,0 +1,32 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef SubmitBlockResponseModel_hpp
#define SubmitBlockResponseModel_hpp
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class SubmitBlockResponseModel final : public oatpp::DTO
{
DTO_INIT(SubmitBlockResponseModel, DTO);
DTO_FIELD(String, status);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* SubmitBlockResponseModel_hpp */

View file

@ -0,0 +1,41 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef BlockTemplateModel_hpp
#define BlockTemplateModel_hpp
#include "../meta/tx_generation_context.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class BlockTemplateModel final : public oatpp::DTO
{
DTO_INIT(BlockTemplateModel, DTO);
DTO_FIELD(String, blocktemplate_blob);
DTO_FIELD(String, difficulty);
DTO_FIELD(UInt64, height);
DTO_FIELD(Object<TxGenerationContextModel>, miner_tx_tgc);
DTO_FIELD(UInt64, block_reward_without_fee);
DTO_FIELD(UInt64, block_reward);
DTO_FIELD(UInt64, txs_fee);
DTO_FIELD(String, prev_hash);
DTO_FIELD(String, seed);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* BlockTemplateModel_hpp */

View file

@ -0,0 +1,39 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef BlockTemplateRequestModel_hpp
#define BlockTemplateRequestModel_hpp
#include "../meta/pos_entry.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class BlockTemplateRequestModel final : public oatpp::DTO
{
DTO_INIT(BlockTemplateRequestModel, DTO);
DTO_FIELD(String, miner_address);
DTO_FIELD(String, stakeholder_address);
DTO_FIELD(String, ex_nonce);
DTO_FIELD(Boolean, pos, "pos_block");
DTO_FIELD(Boolean, ignore_pow_ts_check);
DTO_FIELD(Object<PosEntryModel>, pe);
DTO_FIELD(List<String>, explicit_txs);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* BlockTemplateRequestModel_hpp */

View file

@ -0,0 +1,79 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef InfoModel_hpp
#define InfoModel_hpp
#include "maintainers_info.hpp"
#include "modal/meta/performance.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class InfoModel final : public oatpp::DTO
{
DTO_INIT(InfoModel, DTO);
DTO_FIELD(UInt64, height);
DTO_FIELD(UInt64, tx_count);
DTO_FIELD(UInt64, tx_pool_size);
DTO_FIELD(UInt64, alt_blocks_count);
DTO_FIELD(UInt64, outgoing_connections_count);
DTO_FIELD(UInt64, incoming_connections_count);
DTO_FIELD(UInt64, synchronized_connections_count);
DTO_FIELD(UInt64, white_peerlist_size);
DTO_FIELD(UInt64, grey_peerlist_size);
DTO_FIELD(UInt64, current_blocks_median);
DTO_FIELD(UInt64, alias_count);
DTO_FIELD(UInt64, current_max_allowed_block_size);
DTO_FIELD(String, daemon_network_state);
DTO_FIELD(UInt64, synchronization_start_height);
DTO_FIELD(UInt64, max_net_seen_height);
DTO_FIELD(Object<MaintainersInfoModel>, mi);
DTO_FIELD(Boolean, pos_allowed);
DTO_FIELD(String, pos_difficulty);
DTO_FIELD(UInt64, pow_difficulty);
DTO_FIELD(UInt64, default_fee);
DTO_FIELD(UInt64, minimum_fee);
DTO_FIELD(List<Boolean>, is_hardfork_active);
DTO_FIELD(Int64, net_time_delta_median);
DTO_FIELD(UInt64, current_network_hashrate_50);
DTO_FIELD(UInt64, current_network_hashrate_350);
DTO_FIELD(UInt64, seconds_for_10_blocks);
DTO_FIELD(UInt64, seconds_for_30_blocks);
DTO_FIELD(List<UInt64>, transactions_cnt_per_day);
DTO_FIELD(List<UInt64>, transactions_volume_per_day);
DTO_FIELD(UInt64, last_pos_timestamp);
DTO_FIELD(UInt64, last_pow_timestamp);
DTO_FIELD(String, total_coins);
DTO_FIELD(UInt64, last_block_size);
DTO_FIELD(UInt64, tx_count_in_last_block);
DTO_FIELD(Float64, pos_sequence_factor);
DTO_FIELD(Float64, pow_sequence_factor);
DTO_FIELD(UInt64, block_reward);
DTO_FIELD(UInt64, last_block_total_reward);
DTO_FIELD(UInt64, pos_diff_total_coins_rate);
DTO_FIELD(UInt64, last_block_timestamp);
DTO_FIELD(String, last_block_hash);
DTO_FIELD(Int64, pos_block_ts_shift_vs_actual);
DTO_FIELD(Fields<UInt64>, outs_stat); // Represents a map of uint64_t to uint64_t
DTO_FIELD(Object<PerformanceModel>, performance_data);
DTO_FIELD(UInt64, offers_count);
DTO_FIELD(UInt64, expiration_median_timestamp);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* InfoModel_hpp */

View file

@ -0,0 +1,36 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef MaintainersInfoModel_hpp
#define MaintainersInfoModel_hpp
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class MaintainersInfoModel final : public oatpp::DTO
{
DTO_INIT(MaintainersInfoModel, DTO);
DTO_FIELD(UInt8, ver_major);
DTO_FIELD(UInt8, ver_minor);
DTO_FIELD(UInt8, ver_revision);
DTO_FIELD(UInt32, build_no);
DTO_FIELD(UInt8, mode);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* MaintainersInfoModel_hpp */

View file

@ -0,0 +1,34 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef DbStatInfoModel_hpp
#define DbStatInfoModel_hpp
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class DbStatInfoModel final : public oatpp::DTO
{
DTO_INIT(DbStatInfoModel, DTO);
DTO_FIELD(UInt64, tx_count);
DTO_FIELD(UInt64, write_tx_count);
DTO_FIELD(UInt64, map_size);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* DbStatInfoModel_hpp */

View file

@ -0,0 +1,25 @@
#ifndef PAGEDTO_HPP
#define PAGEDTO_HPP
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
template<class T>
class PageDto : public oatpp::DTO {
DTO_INIT(PageDto, DTO);
DTO_FIELD(UInt32, offset);
DTO_FIELD(UInt32, limit);
DTO_FIELD(UInt32, count);
DTO_FIELD(Vector<T>, items);
};
#include OATPP_CODEGEN_END(DTO)
#endif //PAGEDTO_HPP

View file

@ -0,0 +1,39 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef PerformanceModel_hpp
#define PerformanceModel_hpp
#include "performance/block_processing.hpp"
#include "performance/tx_processing.hpp"
#include "performance/tx_pool.hpp"
#include "db_stat_info.hpp"
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class PerformanceModel final : public oatpp::DTO
{
DTO_INIT(PerformanceModel, DTO);
DTO_FIELD(Object<BlockProcessingPerformanceModel>, block_processing);
DTO_FIELD(Object<TxProcessingPerformanceModel>, tx_processing);
DTO_FIELD(Object<TxPoolPerformanceModel>, tx_pool);
DTO_FIELD(Object<DbStatInfoModel>, db_stat_info);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* PerformanceModel_hpp */

View file

@ -0,0 +1,47 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef BlockProcessingPerformanceModel_hpp
#define BlockProcessingPerformanceModel_hpp
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class BlockProcessingPerformanceModel final : public oatpp::DTO
{
DTO_INIT(BlockProcessingPerformanceModel, DTO);
DTO_FIELD(UInt64, block_processing_time_0);
DTO_FIELD(UInt64, block_processing_time_1);
DTO_FIELD(UInt64, target_calculating_time_2);
DTO_FIELD(UInt64, longhash_calculating_time_3);
DTO_FIELD(UInt64, all_txs_insert_time_5);
DTO_FIELD(UInt64, etc_stuff_6);
DTO_FIELD(UInt64, insert_time_4);
DTO_FIELD(UInt64, raise_block_core_event);
DTO_FIELD(UInt64, validate_miner_transaction_time);
DTO_FIELD(UInt64, collect_rangeproofs_data_from_tx_time);
DTO_FIELD(UInt64, verify_multiple_zc_outs_range_proofs_time);
DTO_FIELD(UInt64, target_calculating_enum_blocks);
DTO_FIELD(UInt64, target_calculating_calc);
DTO_FIELD(UInt64, pos_validate_ki_search);
DTO_FIELD(UInt64, pos_validate_get_out_keys_for_inputs);
DTO_FIELD(UInt64, pos_validate_zvp);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* BlockProcessingPerformanceModel_hpp */

View file

@ -0,0 +1,42 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef TxPoolPerformanceModel_hpp
#define TxPoolPerformanceModel_hpp
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class TxPoolPerformanceModel final : public oatpp::DTO
{
DTO_INIT(TxPoolPerformanceModel, DTO);
DTO_FIELD(UInt64, tx_processing_time);
DTO_FIELD(UInt64, check_inputs_types_supported_time);
DTO_FIELD(UInt64, expiration_validate_time);
DTO_FIELD(UInt64, validate_amount_time);
DTO_FIELD(UInt64, validate_alias_time);
DTO_FIELD(UInt64, check_keyimages_ws_ms_time);
DTO_FIELD(UInt64, check_inputs_time);
DTO_FIELD(UInt64, begin_tx_time);
DTO_FIELD(UInt64, update_db_time);
DTO_FIELD(UInt64, db_commit_time);
DTO_FIELD(UInt64, check_post_hf4_balance);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* TxPoolPerformanceModel_hpp */

View file

@ -0,0 +1,56 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef TxProcessingPerformanceModel_hpp
#define TxProcessingPerformanceModel_hpp
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class TxProcessingPerformanceModel final : public oatpp::DTO
{
DTO_INIT(TxProcessingPerformanceModel, DTO);
DTO_FIELD(UInt64, tx_check_inputs);
DTO_FIELD(UInt64, tx_add_one_tx);
DTO_FIELD(UInt64, tx_process_extra);
DTO_FIELD(UInt64, tx_process_attachment);
DTO_FIELD(UInt64, tx_process_inputs);
DTO_FIELD(UInt64, tx_push_global_index);
DTO_FIELD(UInt64, tx_check_exist);
DTO_FIELD(UInt64, tx_print_log);
DTO_FIELD(UInt64, tx_prapare_append);
DTO_FIELD(UInt64, tx_append);
DTO_FIELD(UInt64, tx_append_rl_wait);
DTO_FIELD(UInt64, tx_append_is_expired);
DTO_FIELD(UInt64, tx_store_db);
DTO_FIELD(UInt64, tx_check_inputs_prefix_hash);
DTO_FIELD(UInt64, tx_check_inputs_attachment_check);
DTO_FIELD(UInt64, tx_check_inputs_loop);
DTO_FIELD(UInt64, tx_check_inputs_loop_kimage_check);
DTO_FIELD(UInt64, tx_check_inputs_loop_ch_in_val_sig);
DTO_FIELD(UInt64, tx_check_inputs_loop_scan_outputkeys_get_item_size);
DTO_FIELD(UInt64, tx_check_inputs_loop_scan_outputkeys_relative_to_absolute);
DTO_FIELD(UInt64, tx_check_inputs_loop_scan_outputkeys_loop);
DTO_FIELD(UInt64, tx_check_inputs_loop_scan_outputkeys_loop_get_subitem);
DTO_FIELD(UInt64, tx_check_inputs_loop_scan_outputkeys_loop_find_tx);
DTO_FIELD(UInt64, tx_check_inputs_loop_scan_outputkeys_loop_handle_output);
DTO_FIELD(UInt64, tx_mixin_count);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* TxProcessingPerformanceModel_hpp */

View file

@ -0,0 +1,39 @@
// Copyright (c) 2017-2025 Lethean (https://lt.hn)
//
// Licensed under the European Union Public Licence (EUPL) version 1.2.
// You may obtain a copy of the licence at:
//
// https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
//
// The EUPL is a copyleft licence that is compatible with the MIT/X11
// licence used by the original projects; but maintains OSS status,
// where regional copyright law requires ownership to dictate licence terms.
//
// SPDXLicenseIdentifier: EUPL-1.2
//
#ifndef PosEntryModel_hpp
#define PosEntryModel_hpp
#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"
#include OATPP_CODEGEN_BEGIN(DTO)
class PosEntryModel final : public oatpp::DTO
{
DTO_INIT(PosEntryModel, DTO);
DTO_FIELD(UInt64, amount);
DTO_FIELD(UInt64, g_index);
DTO_FIELD(String, keyimage);
DTO_FIELD(UInt64, block_timestamp);
DTO_FIELD(UInt64, stake_unlock_time);
DTO_FIELD(String, tx_id);
DTO_FIELD(UInt64, tx_out_index);
DTO_FIELD(UInt64, wallet_index);
};
#include OATPP_CODEGEN_END(DTO)
#endif /* PosEntryModel_hpp */

Some files were not shown because too many files have changed in this diff Show more