Compare commits

..

1069 commits
iTw3 ... dev

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
Some checks failed
Build & Release / Linux x86_64 (push) Has been cancelled
Build & Release / macOS ARM64 (push) Has been cancelled
Build & Release / Create Release (push) Has been cancelled
Reviewed-on: #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)
Some checks failed
Push Compile / Linux (push) Has been cancelled
Push Compile / Windows (push) Has been cancelled
Push Compile / MacOS (push) Has been cancelled
Push Compile / Docker (push) Has been cancelled
Push Compile / Docs (push) Has been cancelled
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
Snider
763d70bec2
Testnet 1 (#15) 2025-09-30 16:48:13 +01:00
llebubell
b02addf264
Centralised chain config (#4) 2025-09-25 16:38:18 +01:00
Snider
bf22a89733
Dev 12 documentation overhaul (#13)
Introduces a 'docs' submodule for project documentation and integrates MkDocs build steps via CMake and Makefile.
2025-09-25 16:04:33 +01:00
Snider
2f1011e27c
Final Build Foundations (#11) 2025-09-25 00:25:52 +01:00
Snider
7b0c286cef Update build workflows for macOS and Windows
Changed build commands and artifact directories in macOS and Windows GitHub Actions workflows to use new target names and paths. Removed 'connectivity_tool' from CLI artifacts.
2025-09-24 22:21:43 +01:00
Snider
b84b99287d Refactor build profiles and update CI workflows
Renamed and reorganized CMake build profiles for consistency, removing unused Android, iOS, and MinGW profiles. Updated GitHub Actions workflows and Makefile to use new profile names and increased build parallelism for faster builds.
2025-09-24 22:21:32 +01:00
Snider
a03d081287
Build Improvements (#10) 2025-09-24 21:01:35 +01:00
Snider
2eaa599066
GitHub Build Workflows (#7) 2025-08-30 17:46:00 +01:00
Snider
eafeb894f9
GitHub CLI Building (#5)
- Linux: https://github.com/letheanVPN/blockchain/actions/runs/17264025940
- MacOS-aarch64: https://github.com/letheanVPN/blockchain/actions/runs/17264025933
- MacOS-amd64: https://github.com/letheanVPN/blockchain/actions/runs/17264025928
- Windows: https://github.com/letheanVPN/blockchain/actions/runs/17265388073
2025-08-27 12:51:11 +01:00
sowle
db80165063
Merge branch 'release' 2025-08-15 15:53:44 +03:00
zano build machine
b9d85e1c09 === build number: 427 -> 428 === 2025-08-13 17:09:03 +03:00
sowle
5982abd525
Merge branch 'develop' into release 2025-08-13 17:02:57 +03:00
zano build machine
de5e0caebd === build number: 426 -> 427 === 2025-08-12 19:51:10 +03:00
sowle
91ced14b2d
ui update (PR 158) 2025-08-12 19:50:17 +03:00
zano build machine
d7d0ba0a41 === build number: 425 -> 426 === 2025-08-11 00:17:35 +03:00
sowle
c36355d489
Merge branch 'random_refactoring' into develop 2025-08-11 00:16:15 +03:00
sowle
11d4bbf1da
crypto: generate_system_random_bytes_* refactored: improved error handling, win32 version moved to BCrypt API, split into normal and _or_die funcs
Thanks to @gitToki for spotting the error handling issue!
2025-08-10 05:24:25 +03:00
sowle
15417edbce
Merge branch 'develop' into random_refactoring 2025-08-10 05:20:03 +03:00
sowle
b9b175c00f
ui update (PR 157) 2025-08-07 11:34:25 +03:00
cryptozoidberg
e3186aef40
Merge branch 'release' into develop 2025-08-01 13:52:15 +01:00
cryptozoidberg
feb5de6f20
Merge branch 'master' into release 2025-08-01 13:51:39 +01:00
cryptozoidberg
9aaa0f8cb8
XCode 16.4 fix 2025-08-01 13:51:11 +01:00
sowle
cc8ff1d5a3
minor fix (presumable, not worthy but anyway) 2025-08-01 04:26:08 +03:00
sowle
ff6cbe2548
Merge branch 'random_refactoring' into develop 2025-08-01 01:50:13 +03:00
sowle
3a9245f743
crypto::random refactoring and improvements (credits to @dimmarvel for spotting the thread safety issue) 2025-07-31 04:14:10 +03:00
crypto.sowle
8b57f3acab
priority_peers_list in p2p_manual_config.json updated (added missing backbone node) 2025-07-29 02:58:30 +03:00
sowle
96081db687
coretests: wallet_rpc_multiple_receivers -- work in progress 2025-07-26 02:26:08 +03:00
sowle
a93aefd507
ui update (PR 156) 2025-07-24 18:27:55 +03:00
sowle
4923f644c4
coretests: minor improvements for wallet_rpc_cold_signing 2025-07-24 18:18:44 +03:00
sowle
260228433c
=== build number: 424 -> 425 === 2025-07-24 18:07:42 +03:00
sowle
cbc7357fa7
Merge branch 'release' into develop 2025-07-24 18:06:27 +03:00
sowle
0c7d09d951
Merge remote-tracking branch 'origin/release' into release 2025-07-24 18:06:09 +03:00
sowle
d78911b344
Merge branch 'release' into develop
# Conflicts:
#	src/version.h.in
#	src/wallet/wallet_rpc_server.cpp
2025-07-24 18:04:36 +03:00
sowle
e10a711c36
Merge branch 'master' into release 2025-07-24 18:02:51 +03:00
sowle
6e6831c355
Merge branch 'release' 2025-07-24 17:39:58 +03:00
cryptozoidberg
8953e201d6
error handling improved in zlib 2025-07-24 17:56:31 +04:00
sowle
d9557d3bb1
clang compilation fix 2025-07-24 13:56:36 +03:00
sowle
334d26a4ac
=== build number: 423 -> 424 === 2025-07-24 05:38:14 +03:00
sowle
d6c6df78f4
Merge branch 'transfer_so' into release 2025-07-24 05:37:22 +03:00
sowle
035f233bc7
transfer_so implemented +minor code cleanup 2025-07-24 05:25:17 +03:00
sowle
cd16b5c743
=== build number: 422 -> 423 === 2025-07-23 19:21:02 +03:00
sowle
b57fa844ef
ui update (PR 154, 155) 2025-07-23 19:20:19 +03:00
sowle
4618c240f2
Merge branch 'release' into develop
# Conflicts:
#	src/version.h.in
#	src/wallet/wallet_rpc_server.cpp
2025-07-23 13:22:24 +03:00
sowle
3e71f078ca
gcc warnings fixed 2025-07-22 21:47:22 +03:00
sowle
7a463d8065
coretests adapted to temp changes 2025-07-22 21:34:04 +03:00
sowle
06573647b8
=== build number: 421 -> 422 === 2025-07-22 14:57:55 +03:00
sowle
06d6553473
tx_comment is temporary disabled 2025-07-22 14:57:02 +03:00
sowle
2c920287d3
=== build number: 420 -> 421 === 2025-07-22 05:10:00 +03:00
sowle
b0e00c0803
Merge branch 'ip_blacklisting' into release 2025-07-22 05:09:07 +03:00
cryptozoidberg
b0b30e20b2
sender/receiver disabled 2025-07-21 21:54:13 +04:00
sowle
1b8cfa0194
Merge branch 'release' into develop
# Conflicts:
#	src/version.h.in
2025-07-21 15:10:54 +03:00
sowle
0c48a01fbf
=== build number: 419 -> 420 === 2025-07-21 14:53:20 +03:00
sowle
60560ad18c
Merge branch 'ip_blacklisting' into release 2025-07-21 14:52:28 +03:00
cryptozoidberg
71cc7d1363
renamed field 2025-07-21 15:17:40 +04:00
cryptozoidberg
be3938a886
renamed to field 2025-07-21 15:17:12 +04:00
cryptozoidberg
e2bfde5bbc
Create p2p_manual_config.json 2025-07-21 14:44:16 +04:00
cryptozoidberg
6fed9dcac5
Create p2p_manual_config.json (full proxy) 2025-07-21 14:42:58 +04:00
sowle
68871b93ec
p2p minor improvements 2025-07-20 22:54:32 +03:00
cryptozoidberg
32194f88b1
p2p network manual configuration from config file 2025-07-20 18:41:27 +04:00
sowle
854c198415
reverted sanity check improvement 2025-07-20 02:34:45 +03:00
sowle
23cf10a4b8
Merge remote-tracking branch 'origin/release' into develop 2025-07-19 23:49:58 +03:00
Dmitry Matsiukhov
94c2e65dad
coretests: tx_coinbase_separate_sig_flag test added; (separate flag for PoW miner tx coinbase (#538))
* add tests for pow separate tx flag

* refactoring test, leave only poW validation
2025-07-19 15:49:10 +03:00
cryptozoidberg
0e1618c496
sanity check improved 2025-07-19 14:48:10 +04:00
dependabot[bot]
015c7ddbb4
Bump axios from 1.7.7 to 1.8.2 in /utils/JS (#528)
Bumps [axios](https://github.com/axios/axios) from 1.7.7 to 1.8.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.7.7...v1.8.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.8.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-19 09:42:00 +04:00
sowle
f8e298af86
Merge branch 'release' 2025-07-18 21:25:32 +03:00
Dmitry Matsiukhov
4695229f2a
fix warnings (#546)
* fix warnings

* refactoring
2025-07-18 20:17:02 +03:00
sowle
97b17221d9
=== build number: 418 -> 419 === 2025-07-18 13:39:01 +03:00
sowle
98f5880ae6
Merge branch 'release' into develop 2025-07-18 13:38:36 +03:00
sowle
6c318fc34b
minor fix to please clang 2025-07-17 21:05:08 +03:00
sowle
9e81e7228c
Merge branch 'release' into develop 2025-07-17 19:16:29 +03:00
sowle
556746c194
currency_protocol: there's no hop in this place anymore 2025-07-17 19:05:35 +03:00
sowle
ee883a690c
Merge branch 'release' into develop
# Conflicts:
#	src/wallet/wallet2.cpp
2025-07-17 15:39:00 +03:00
sowle
2edb2e6fe4
=== build number: 416 -> 417 === 2025-07-17 15:36:42 +03:00
Dmitry Matsiukhov
a3587a48e7
fix array entry deserialization and JSON parsing edge cases + tests (#545)
credits go to Lilith (>_>) of Cisco Talos (TALOS-2018-0637) and moneromooo-monero (DoS/RPC fixes PR#4438)
2025-07-17 15:14:41 +03:00
sowle
63cf4e5dd6
wallet2: removed redundant log 2025-07-17 13:07:22 +03:00
sowle
cac85721a2
wallet: minor improvements for balance() + coretest extended to cover more cases 2025-07-17 03:04:12 +03:00
sowle
8574cc0894
wallet: various balance() improvements 2025-07-16 20:30:17 +03:00
sowle
d241861d86
wallet: various minor improvements (balance, balance raw, unknown asset) 2025-07-16 17:30:38 +03:00
sowle
fed84de8b7
compilation fix 2025-07-15 23:59:20 +03:00
Dmitry Matsiukhov
a08772ea6a
coretests: tx_input_mixins test added (test that will combine spending old coins and new coins in one tx and use mixins as 15)
* try to write test for 2 input with nmix

* one of incorrect version

* add test for input old/new

* refactoring and add comments

* delete garbage

* fix from vector variant to unordered_map

* add comment

* using to typedef
2025-07-15 23:36:53 +03:00
sowle
8fb16d207f
Merge branch 'release' into develop
# Conflicts:
#	src/rpc/core_rpc_server.cpp
#	src/version.h.in
2025-07-15 22:22:36 +03:00
sowle
d711373824
Merge branch 'release' 2025-07-15 22:18:27 +03:00
sowle
eed7d9e3af
=== build number: 411 -> 416 === 2025-07-15 22:18:09 +03:00
sowle
ffd279f21f
Merge branch 'limitations_for_rpc' into release 2025-07-15 22:16:17 +03:00
sowle
8042f9a6a5
Merge branch 'master' into release 2025-07-15 22:15:46 +03:00
sowle
573028c764
minor improvements 2025-07-15 20:57:20 +03:00
cryptozoidberg
695bd88c11
made some of the api optional 2025-07-15 20:51:37 +03:00
cryptozoidberg
992ea22294
added warning for binding to 0.0.0.0 2025-07-15 21:37:50 +04:00
cryptozoidberg
9cce235931
renamed macro to proper name 2025-07-15 20:55:20 +04:00
cryptozoidberg
9fe3f812aa
limitations for rpc cals 2025-07-15 20:41:46 +04:00
cryptozoidberg
75ad8c7a69
made some of the api optional 2025-07-15 14:31:35 +04:00
sowle
6f8d727332
Revert "wallet: keep custom added assets while resetting history"
This reverts commit 5e0c84e735.
2025-07-14 20:30:12 +03:00
sowle
f287916372
=== build number: 414 -> 415 === 2025-07-11 21:46:56 +03:00
sowle
5e0c84e735
wallet: keep custom added assets while resetting history 2025-07-11 21:46:03 +03:00
sowle
0cd2ef8ccb
wallet: various minor improvements (balance, balance raw, unknown asset) 2025-07-11 21:45:24 +03:00
sowle
65241adc1c
ui update (PR 153) 2025-07-11 21:26:52 +03:00
sowle
6ad7dad01d
gcc warning fixed 2025-07-11 21:26:07 +03:00
sowle
51990c9d2d
an attempt 3 to fix gcc linking (prior to gcc 9, the std::filesystem library required explicit linking) 2025-07-11 21:25:48 +03:00
sowle
d56bf75bde
an attempt 2 to fil gcc linking (prior to gcc 9, the std::filesystem library required explicit linking) 2025-07-10 04:32:36 +03:00
sowle
94b9741976
an attempt to fil gcc linking (prior to gcc 9, the std::filesystem library required explicit linking) 2025-07-10 04:00:56 +03:00
sowle
87cd247eb5
wallet: clear_utxo_cold_sig_reservation() made available only for watch-only wallets 2025-07-09 19:10:33 +03:00
sowle
28606d07ef
=== build number: 413 -> 414 === 2025-07-09 17:33:17 +03:00
sowle
9589c952f8
ui updated (PR 152) 2025-07-09 17:32:49 +03:00
sowle
0554d7b8c4
wallet: clear_utxo_cold_sig_reservation() implemented + RPC clear_utxo_cold_sig_reservation added + coretest wallet_rpc_cold_signing improved to test this new RPC 2025-07-09 17:16:01 +03:00
sowle
db86b3fa15
simplewallet: --restore-ki-in-wo-wallet command-line option implemented 2025-07-09 14:42:18 +03:00
sowle
5ac8b20816
coretests: wallet_rpc_cold_signing test improved to cover key image recovery in a watch-only wallet using a full keys wallet 2025-07-09 14:41:22 +03:00
sowle
c241cb3f9b
wallet2: restore_key_images_in_wo_wallet() implemented 2025-07-09 14:40:24 +03:00
sowle
2f368cbf2c
fixed missing member serialization in tx_source_entry 2025-07-08 02:45:52 +03:00
sowle
04364afc53
coretests: wallet_rpc_cold_signing test improved to cover asset transferring along with native coins (exposes a bug) 2025-07-08 02:44:05 +03:00
sowle
035a441efe
wallet2: dump_transfers now prints asset id instead of key images +typo fixed 2025-07-08 02:42:42 +03:00
cryptozoidberg
e232c827a6
example of using zano wallet jwt auth 2025-07-04 19:42:08 +04:00
Dmitry Matsiukhov
c637e16848
unit_tests: added a test for pod array file container, fixed clear() (#535)
* add test for pod array file container

* add tests for pod, clear and is open

* header update

---------

Co-authored-by: sowle <crypto.sowle@gmail.com>
2025-07-04 00:41:53 +02:00
sowle
dfbda0a77f
minor improvements for wallet/simplewallet (logs, comments, error handling) 2025-07-03 16:13:44 +02:00
sowle
d5890e3c7f
pod_array_file_container::clear() implemented 2025-07-03 15:17:12 +02:00
Dmitry Matsiukhov
187a830f58
fixed input password bug (#536) 2025-07-03 11:55:40 +02:00
cryptozoidberg
6a4d6e1fc6
fixed #483, thanks to @gurglespuge for reporting it and proposing fix 2025-07-01 23:37:53 +04:00
cryptozoidberg
430d31ba5e
added --no-white-list option for offline working 2025-07-01 20:37:30 +04:00
cryptozoidberg
05ea60a70c
made seed request non-synchronized 2025-06-30 15:40:11 +04:00
cryptozoidberg
22b49d93a8
Update LICENSE (fixed #534)
Thanks to @Alrighttt to pointing that out
2025-06-28 16:02:19 +04:00
Dmitry Matsiukhov
5340c6db32
coretests: test for miner tx with non-empty extra_nonce before and after HF4 (#532)
* try check extra nonce in miner_tx

* update c1

* write extra nonces, create pow pos block, checkers for exnonce, bug with HF4

* success check pos block

* correct pos/pos extra nonce validation for hf3+

* clean code, separate to methods, add template test, pos/pow extra nonce check in block

* delete logs

* back normal naming

* fix review comments
2025-06-27 20:16:24 +02:00
cryptozoidberg
a0c1c8b4df
fixed typo 2025-06-25 16:46:37 +04:00
cryptozoidberg
2b3360f66a
added more logs 2025-06-25 16:41:52 +04:00
Dmitry Matsiukhov
ffa94febc6
coretests: block_choice_rule_bigger_fee test added (#530)
* add bigger fee block choice test

* fix block_validation

* remove c1, add check_top_block callback

* added more checks

* update test case

* delete: cmake fix for linux

* part of fixs

* add new check

* delete unused declareted

* add comments

* fix comment

* fix comments
2025-06-23 20:54:52 +02:00
Dmitry Matsiukhov
f8600d9fe4
fix cmake for linux build (#531) 2025-06-23 18:38:55 +04:00
zano build machine
afd479fa62 === build number: 412 -> 413 === 2025-06-23 14:10:04 +03:00
sowle
aaf878419d
ui update (PR 151) 2025-06-23 13:03:26 +02:00
sowle
0c77467c7b
=== version bump: 2.1.7 -> 2.1.8 === 2025-06-20 01:36:09 +02:00
zano build machine
a3905348f1 === build number: 411 -> 412 === 2025-06-20 02:32:11 +03:00
sowle
c6614912b1
wallet: 1) tx_comment is only allowed in extra; 2) tx_comment temporary allowed only if destinations addresses are the same; 3) integrated address can be only the first if there are many 2025-06-20 01:31:42 +02:00
sowle
46eab64834
rename: encrypt_attachments() -> encrypt_payload_items() + test gen_wallet_decrypted_attachments -> gen_wallet_decrypted_payload_items improved (tx_comment put in extra) 2025-06-20 01:30:00 +02:00
sowle
1b0f64176d
wallet rpc: tx_comment is now put into tx's extra for consistency with wallet_manager's approach 2025-06-19 17:42:00 +02:00
sowle
430cbffd25
wallet rpc: WALLET_RPC_ERROR_CODE_GENERIC_ERROR (-9) added 2025-06-19 17:40:47 +02:00
sowle
ab01ce4fd6
ui update (PR 150) 2025-06-19 12:55:44 +02:00
sowle
2fb8f499e1
Merge remote-tracking branch 'origin/p2pdbgcmd' into develop 2025-06-19 12:53:34 +02:00
cryptozoidberg
2bab917700
fixed typo 2025-06-19 14:35:11 +04:00
cryptozoidberg
90a4a68eb5
added sanitize_utf8 to invoke() in plain_wallet 2025-06-18 22:45:28 +04:00
cryptozoidberg
166b683295
tiny format tweak 2025-06-17 17:06:35 +04:00
sowle
4f7345e475
Merge branch 'release' 2025-06-10 15:08:01 +02:00
sowle
79a3d416c1
Merge branch 'develop' into release 2025-06-10 15:07:25 +02:00
sowle
ecabd4a73a
functional tests: core_concurrency_test.cpp compilation fix 2025-06-09 11:51:08 +02:00
sowle
29d02c1816
Merge branch 'develop' into release 2025-06-09 05:48:54 +02:00
sowle
23f874f142
=== build number: 410 -> 411 === 2025-06-09 05:45:54 +02:00
sowle
48176b6a72
chaingen: "clear_tx_pool" now clears tx pool indeed 2025-06-09 05:44:49 +02:00
sowle
2bb1113b43
core: HF4 coinage rule is not checked while adding a tx to the pool, letting it being confirmed later 2025-06-09 05:43:39 +02:00
sowle
2a13a63eb7
coretests: tx_pool_validation_and_chain_switch improved 2025-06-09 05:39:57 +02:00
cryptozoidberg
7ac70737dc
fix that makes sure that daemon and wallet are 'on the same page' in terms of hardfork recognition 2025-06-07 16:17:54 +04:00
cryptozoidberg
9efce2ddb3
added check if console is available #510 2025-06-07 14:10:45 +04:00
cryptozoidberg
87fae9440c
bug that have been there for ages 2025-06-06 21:18:41 +04:00
zano build machine
79f4c3ef75 === build number: 409 -> 410 === 2025-06-06 03:24:10 +03:00
sowle
06af2ea879
ui update (PR 149) 2025-06-06 02:02:08 +02:00
sowle
1131d25725
ui update (PR 148) 2025-06-04 17:16:11 +02:00
sowle
cb3891ac0c
minor improvements 2025-06-04 16:48:53 +02:00
sowle
e0acea65b8
=== version bump: 2.1.6.408 -> 2.1.7.409 === 2025-06-03 01:59:16 +02:00
sowle
c6b1a84461
Merge branch 'master' into develop 2025-06-03 01:58:12 +02:00
sowle
c86a19de08
Merge branch 'mempool_blacklist_fix' 2025-06-03 01:56:32 +02:00
sowle
e725b784c1
version bump: 2.1.5.397 -> 2.1.6.399 2025-06-03 01:55:58 +02:00
sowle
f84ecf579e
improved condition in tx_memory_pool::is_transaction_ready_to_go() limited to >=HF4 to please old tests 2025-06-03 01:38:55 +02:00
sowle
7fb2fcc188
minor fix 2025-06-03 00:33:26 +02:00
sowle
411cda4ad4
improved condition in tx_memory_pool::is_transaction_ready_to_go() 2025-06-03 00:22:30 +02:00
sowle
7eb6986f4d
txpool fixed: txs with too small max_related_block_height will wait in the pool till the current height is okay + coretests tx_pool_validation_and_chain_switch added 2025-06-03 00:01:11 +02:00
cryptozoidberg
3d2ce52b8e
small performance tweak of fill_block_template and more logs related to pool txs blacklisting 2025-06-02 23:50:31 +04:00
sowle
7793efaeac
msvc: EHa exception mode enabled to catch both structured and standard C++ exceptions 2025-06-02 19:12:50 +02:00
zano build machine
25056b751e === build number: 407 -> 408 === 2025-05-30 16:03:48 +03:00
sowle
1c045d0732
ui update (PR 147) 2025-05-30 15:00:22 +02:00
sowle
c4c8d65798
fixed a rare issue with printing random control characters to the console, breaking it 2025-05-30 14:49:31 +02:00
sowle
be0b6ab35e
callstack_helper: fixed a potential issue in get_mod_info::operator() 2025-05-30 14:45:24 +02:00
Anton Mikhailov
99bcf712df
feat: install includes on android (#524) 2025-05-29 14:20:47 +04:00
sowle
8a91bccea3
an attempt to make all callstack-retrieval routines exception-safe 2025-05-28 01:15:28 +02:00
cryptozoidberg
686c137332
added wallet_transfer_info to transfer() RPC 2025-05-23 23:52:49 +04:00
sowle
e66b21085b
wallet2: keep tx_keys while resetting wallet's history 2025-05-23 05:35:06 +03:00
sowle
ffe5051d8b
wallet2 : store_watch_only fixed 2025-05-23 05:34:22 +03:00
sowle
0066e75c39
minor improvements (formatting, logging) 2025-05-23 05:33:32 +03:00
sowle
1bb0523b83
get_out_pub_key_from_tx_out_v() implemented 2025-05-23 05:32:33 +03:00
zano build machine
4d272c4edb === build number: 406 -> 407 === 2025-05-22 20:26:59 +03:00
sowle
296a6c6211
fixed a rare race condition in get_coinbase_hash_cached() 3 2025-05-22 16:58:34 +03:00
sowle
43bde5aa99
fixed a rare race condition in get_coinbase_hash_cached() 2 2025-05-22 15:50:18 +03:00
sowle
cebeebe730
fixed a rare race condition in get_coinbase_hash_cached() 2025-05-22 14:26:05 +03:00
zano build machine
91cd6148e8 === build number: 405 -> 406 === 2025-05-22 03:01:56 +03:00
sowle
ec35462267
forgotten line 2025-05-22 00:26:16 +03:00
cryptozoidberg
0b7a8a89bd
added error handling for custom seed generator 2025-05-21 20:16:08 +04:00
zano build machine
dd9fb6c8a7 === build number: 404 -> 405 === 2025-05-21 05:02:17 +03:00
sowle
54f5b2acc1
Merge branch 'get_coinbase_hash_cached_refactoring' into develop 2025-05-21 04:49:01 +03:00
sowle
d911673544
cache_base: typo fixed 2025-05-21 04:47:39 +03:00
sowle
cc9e39825c
cache_helper/cache_base fixed and improved 2025-05-21 04:33:24 +03:00
sowle
4be5761a90
epee::misc_utils::void_copy introduced 2025-05-21 04:32:16 +03:00
cryptozoidberg
bafae7b120
added get_integrated_address to daemon 2025-05-20 22:18:10 +04:00
sowle
d9c7a2ac08
get_coinbase_hash_cached refactored 2025-05-20 20:08:24 +03:00
sowle
d4cc1bd6ff
wallet2: cold-signing process adapted to post-HF4 realm 2025-05-15 05:40:54 +03:00
sowle
83234af5b6
coretests: wallet_rpc_cold_signing test added 2025-05-15 05:40:10 +03:00
sowle
92ea96a41d
coretests: set_playtime_test_wallet_options() minor refactoring 2025-05-15 05:39:34 +03:00
sowle
915d01fa7d
minor improvements 2025-05-15 05:38:13 +03:00
zano build machine
11ff5a8c62 === build number: 403 -> 404 === 2025-05-09 07:01:17 +03:00
sowle
6ff59d2392
Merge branch 'non_pruning_mode' into develop 2025-05-09 06:53:44 +03:00
sowle
3a5e37f34c
predownlod files updated to height 3150000 2025-05-09 02:14:44 +03:00
sowle
6ea2d90104
predownload files for non-pruning mode 2025-05-08 18:54:02 +03:00
zano build machine
078b03534d === build number: 402 -> 403 === 2025-05-08 04:39:19 +03:00
sowle
0cbe915ed5
ui update (PR #146) 2025-05-08 04:38:29 +03:00
sowle
7a0b4cdc82
conn_tool: minor improvement 2025-05-06 00:37:09 +03:00
sowle
22196f9de6
predownload files updated for non-pruning mode 2025-05-06 00:36:38 +03:00
cryptozoidberg
ef0a47c720
added force_rescan_tx_pool command to wallet rpc 2025-05-05 21:33:13 +04:00
sowle
c2bd27cb58
gcc compilation fix 2025-04-30 21:54:55 +03:00
sowle
c8d41b5e4a
non-pruning via special flag (WIP) 2025-04-30 05:46:25 +03:00
sowle
e5323d0c5a
non-pruning mode implemented using checkpoints 2025-04-30 03:55:13 +03:00
zano build machine
cc7188f450 === build number: 401 -> 402 === 2025-04-28 20:01:28 +03:00
sowle
59a55f7ebd
ui update (PR 145) 2025-04-28 19:59:17 +03:00
cryptozoidberg
13b73bcb33
reduced cache for m_db_blocks_index 2025-04-24 14:50:50 +04:00
zano build machine
90ed7ee409 === build number: 400 -> 401 === 2025-04-22 14:56:42 +03:00
sowle
36d14dbc99
conn_tool: get-anonymized-peers command-line option implemented 2025-04-18 15:09:16 +03:00
sowle
7606c69961
p2p: COMMAND_REQUEST_ANONYMIZED_PEERS (WIP) 2025-04-18 06:18:57 +03:00
sowle
f087117a33
tx_pool: allow incoming txs to register alias to address, that already has associated alias only for testnet (for a while) 2025-04-18 00:58:13 +03:00
cryptozoidberg
02da52eb0d
improve over all tx to json serialization 2025-04-17 22:07:36 +04:00
cryptozoidberg
a7a4505b79
attempt to fix seg fault on foreach_connection 2025-04-16 15:27:44 +04:00
cryptozoidberg
7f8dbb73db
added back zconf.h.included 2025-04-15 23:55:38 +04:00
cryptozoidberg
fe220afdde
fixed binary serialization of tx to json 2025-04-15 23:51:01 +04:00
zano build machine
83eefd205e === build number: 399 -> 400 === 2025-04-14 17:51:46 +03:00
sowle
15d2c1f725
ui update (PR 144) 2025-04-14 17:48:04 +03:00
sowle
afb9ddb42e
zlib: minor improvements for build/cmake
see also: https://github.com/madler/zlib/issues/781
see also: cacf7f1d4e/CMakeLists.txt (L69)
2025-04-13 19:06:52 +03:00
sowle
48725ea817
minor improvements 2025-04-11 15:51:19 +03:00
sowle
24600931ac
=== version bump: 2.1.5.398 -> 2.1.6.399 === 2025-04-11 02:09:31 +03:00
sowle
ed7597e6b9
tx pool: allow incoming txs to register alias to address, that already has associated alias 2025-04-11 02:07:50 +03:00
cryptozoidberg
7f7b99ed7e
added debug symbols to release builds on unix systems 2025-04-10 23:19:24 +04:00
cryptozoidberg
d4366d3f18
added some diagnostic logs for blockchain caching 2025-04-10 22:42:56 +04:00
zano build machine
cbb9a39bf1 === build number: 397 -> 398 === 2025-04-10 20:13:55 +03:00
sowle
cd5b0c22da
Merge branch 'transfership_refactoring' into develop 2025-04-10 20:12:25 +03:00
cyan
34b9e15301
deps: bump zlib to 1.3.1 (#519)
* Update Dockerfile (#514)

Fixed versions and hardcoded versions in dockerfile

* deps: bump zlib to 1.3.1

---------

Co-authored-by: sowle <crypto.sowle@gmail.com>
Co-authored-by: cryptozoidberg <crypto.zoidberg@gmail.com>
Co-authored-by: David Ed <40647185+Dedme@users.noreply.github.com>
2025-04-10 19:20:19 +03:00
sowle
3abfd90e2f
asset ownership transfer refactoring (WIP) 2025-04-10 03:47:02 +03:00
cryptozoidberg
71248cfd25
fix with resetting state to blocchain shortener 2025-04-10 00:35:59 +04:00
cryptozoidberg
e2406fc518
fixed is_in_long_refresh issue 2025-04-09 16:46:57 +04:00
sowle
f65578f5a5
simplewallet: fixed incorrect handling of daemon-address, daemon-host and daemon-port 2025-04-09 15:39:19 +03:00
cryptozoidberg
144d403c8b
fixed compilation issue 2025-04-09 12:25:05 +04:00
cryptozoidberg
5978ed27f2
fixed issue with deploy asset 2025-04-09 12:10:52 +04:00
sowle
affa0a91ac
Merge remote-tracking branch 'origin/tests_improvements' into develop 2025-04-08 23:20:13 +03:00
sowle
745932738e
coretests: get_tx_version_and_harfork_id_from_events refactoring 2025-04-07 04:47:55 +03:00
cryptozoidberg
d95b07fe0a
multiple improvements over mobile library safety 2025-04-04 12:42:56 +04:00
sowle
0ad804fbc0
Merge branch 'tx_pool_readdition' into develop 2025-04-03 23:32:57 +03:00
sowle
7736199189
minor improvement (log) 2025-04-03 23:32:21 +03:00
sowle
c7f0106bf0
experimental improvements for purge_transaction_from_blockchain() 2025-04-03 18:59:51 +03:00
sowle
df0171d989
coretests: set_use_assets_whitelisting(false) made default for wallets in coretests (2) 2025-04-03 18:27:43 +03:00
sowle
d1cade7bdb
minor improvements 2025-04-03 18:26:47 +03:00
cryptozoidberg
7d3bd99867
potential fix for preventing data race 2025-04-03 17:06:53 +04:00
cryptozoidberg
23f3593ae0
Update README.md 2025-04-01 23:26:22 +04:00
sowle
ff2bb36de4
construct_tx_handle_ado() won't treat opt_descriptor set as an error when >=HF5 anymore, because there's no such a requirement in the core 2025-04-01 18:15:34 +03:00
sowle
d3a2392cfa
coretests: set_use_assets_whitelisting(false) made default for wallets in coretests 2025-04-01 17:03:43 +03:00
cryptozoidberg
701625d2f0
added json-version for sendrawtransaction (cherry-picked) 2025-04-01 15:19:13 +03:00
sowle
68194dc60b
coretests: asset_operations_and_chain_switching added (finished) 2025-04-01 15:18:02 +03:00
sowle
2fd53a59cb
minor improvements (construct_tx, construct_tx_out) 2025-04-01 05:49:35 +03:00
sowle
fb0ba230ea
chaingen: improvements for fill_tx_sources, get_sources_total_amount to support assets more correctly 2025-04-01 05:48:22 +03:00
cryptozoidberg
2872515117
added missing closing tag 2025-03-31 16:14:46 +04:00
cryptozoidberg
bd05907dd8
fixed errors in compilation 2025-03-31 15:37:21 +04:00
cryptozoidberg
9115226f00
fixed tyoe 2025-03-31 15:23:39 +04:00
cryptozoidberg
857a7eabe2
added version to auto-doc 2025-03-31 15:22:14 +04:00
cryptozoidberg
048886c4e9
added ms to lock time report 2025-03-31 13:39:44 +04:00
cryptozoidberg
490198feee
Merge branch 'rpc_extension' into develop 2025-03-29 23:41:45 +04:00
cryptozoidberg
ace2b4dbf5
tests for rpc transfer ownership done 2025-03-29 23:39:36 +04:00
sowle
b48f23ab54
wallet: fixed clearing owner of other type in transfer_asset_ownership() 2025-03-29 12:55:43 +01:00
cryptozoidberg
938050df0f
multiple fixes for wallet rpc api on_asset_send_ext_signed_tx on_attach_asset_descriptor and on_transfer_asset_ownership 2025-03-29 00:14:47 +04:00
sowle
20ad8de9f5
marketplace API: added simple check for zero fee (or incorrect json, resulted in default zero fee) 2025-03-28 21:12:17 +01:00
cryptozoidberg
0662f9bbed
Merge branch 'develop' into rpc_extension 2025-03-28 18:09:38 +04:00
cryptozoidberg
60471f7f46
moved boost checker to right place(now for sure) 2025-03-28 15:27:46 +04:00
cryptozoidberg
8b910b9111
moved boost version checker to right place 2025-03-28 15:23:48 +04:00
cryptozoidberg
2241263925
added message with boost version output 2025-03-28 14:01:22 +04:00
cryptozoidberg
77100b462e
added boost version verification in source code 2025-03-28 13:55:14 +04:00
sowle
9a816a090d
coretests: asset_operations_and_chain_switching added (work is still in progress) 2025-03-27 03:46:05 +03:00
David Ed
d85b94df92
Update Dockerfile (#514)
Fixed versions and hardcoded versions in dockerfile
2025-03-26 15:59:12 +04:00
cryptozoidberg
b603d70be8
Merge branch 'release' into develop 2025-03-26 15:18:31 +04:00
cryptozoidberg
013b7f77ef
compression speed tweak in prewoanload 2025-03-24 22:23:09 +04:00
sowle
c2f0b1166c
Merge branch 'release' into develop 2025-03-24 20:01:42 +03:00
sowle
3095e0fbcb
Merge branch 'release' 2025-03-24 20:01:22 +03:00
sowle
3917d95019
=== version bump: 2.1.4.396 -> 2.1.5.397 === 2025-03-24 19:58:16 +03:00
cryptozoidberg
532f9a81dc
Merge branch 'release' 2025-03-24 14:49:10 +04:00
cryptozoidberg
39e36cf8c8
p2pstate reset 2025-03-24 08:52:40 +04:00
sowle
767f02a3ba
Merge branch 'release' 2025-03-24 07:37:34 +03:00
sowle
f0f54efe17
=== version bump: 2.1.3.395 -> 2.1.4.396 === 2025-03-24 07:07:18 +03:00
sowle
695fc1dd4e
predownload updated to height 3083770 2025-03-24 07:05:25 +03:00
cryptozoidberg
ef9a0ab5fd
added ip blacklisting on unexpected block id 2025-03-24 07:21:52 +04:00
sowle
5984b47ad9
=== version bump: 2.1.2.394 -> 2.1.3.395 === 2025-03-24 02:27:57 +03:00
cryptozoidberg
dc5b5f72a3
moved to v3 db 2025-03-24 03:09:29 +04:00
cryptozoidberg
be129f7a87
tests are work in progress 2025-03-24 02:36:54 +04:00
sowle
5f56d146c2
fixed an issue in pop_asset_info() with deregistering asset after HF5 during chain switching 2025-03-24 01:32:01 +03:00
cryptozoidberg
64e2e53629
test for RPC API COMMAND_ATTACH_ASSET_DESCRIPTOR (in work) 2025-03-22 14:38:57 +04:00
sowle
ec08952674
Merge branch 'release' into develop 2025-03-22 02:44:59 +03:00
sowle
4303f84152
Merge branch 'release' 2025-03-22 00:05:15 +03:00
sowle
616c56fa35
Merge branch 'db_hardfork_id' into release 2025-03-21 23:02:38 +03:00
sowle
cf3930e863
=== version bump: 2.1.1.392 -> 2.1.2.394 === 2025-03-21 23:01:56 +03:00
cryptozoidberg
78293c32d6
couple tweaks for hf5 transition 2025-03-21 21:38:40 +04:00
cryptozoidberg
89e70c74cd
RPC extended for ownership transfer and attachment to wallet 2025-03-21 18:09:27 +04:00
sowle
ead80ac4cb
improvements for the workaround for rear case when an old node is stuck in an altchain right after the hardfork 2025-03-21 14:24:14 +03:00
sowle
b0cbce935e
removed unicode chars from comment 2025-03-21 13:58:11 +03:00
sowle
bbc80a8a77
fixed compilation for gcc/clang 2025-03-20 22:28:10 +03:00
sowle
2e57faf822
implemented workaround for rear case when an old node is stuck in an altchain right after the hardfork 2025-03-20 20:33:34 +03:00
sowle
6be32747c7
minor improvements 2025-03-20 20:30:48 +03:00
sowle
56a265bd48
removed unicode chars from comment 2025-03-20 20:29:28 +03:00
cryptozoidberg
334a90bbe0
added comment 2025-03-20 19:05:18 +04:00
cryptozoidberg
1cc85850bb
merge from p2p_fix2 2025-03-20 19:03:58 +04:00
zano build machine
f136bff547 === build number: 392 -> 393 === 2025-03-20 17:08:25 +03:00
sowle
f08d2ff8af
ui update (PR 143) 2025-03-20 17:07:18 +03:00
Stёpa Dolgorukov
cb92f260e4
one more fix for launching Zano in Ubuntu: Edit AppImage wrapper (#512) 2025-03-20 15:02:39 +01:00
sowle
cd51fcc293
minor updates to currency config 2025-03-20 14:46:13 +03:00
cryptozoidberg
932414dc32
long refresh initially true as well 2025-03-20 15:00:25 +04:00
cryptozoidberg
db788333de
changed initial state of wallet as synchronizing 2025-03-20 14:59:07 +04:00
sowle
488c16138a
Merge branch 'release' into develop 2025-03-20 04:02:52 +03:00
sowle
9674bc9d7a
Merge branch 'master' into release 2025-03-20 04:00:57 +03:00
crypto.sowle
71336c1bc0
readme: added additional step for version check 2025-03-20 01:59:00 +01:00
crypto.sowle
4d5d32c7ed
readme: updated minimum cmake version 2025-03-20 01:40:07 +01:00
cryptozoidberg
357a59a1f7
fixed issue with has_arg missing argument 2025-03-19 18:32:44 +04:00
cryptozoidberg
3e2a39db2c
added proxy to daemon 2025-03-18 18:51:27 +04:00
cryptozoidberg
3a29780d8f
added diagnostic message 2025-03-15 13:35:17 +04:00
cryptozoidberg
ccfc0327e0
version up 2025-03-14 19:18:11 +04:00
cryptozoidberg
405d076ce2
another fix with utf8 sanitizing 2025-03-14 19:15:54 +04:00
cryptozoidberg
e07bba437b
version updated 2025-03-14 14:45:56 +04:00
cryptozoidberg
3ad96b5028
added sanitizing of utf8 in plain wallet, removed unnecessary rpc calls from get recent history 2025-03-14 14:44:27 +04:00
cryptozoidberg
09c3c2c156
increased version 2025-03-14 12:58:41 +04:00
cryptozoidberg
be59c78439
Merge branch 'master' into develop 2025-03-14 12:55:41 +04:00
cryptozoidberg
dfe5238f77
fixed critical issue with SSL support(failed re-connections) 2025-03-14 00:49:14 +04:00
cryptozoidberg
a54c00e823
changed order of warming up(to have most recent blocks as most recent cache) 2025-03-13 17:36:53 +04:00
cryptozoidberg
4715d69596
removed unused header 2025-03-13 16:51:30 +04:00
cryptozoidberg
926549e740
implemented warp-mode for zano daemon 2025-03-12 19:52:10 +04:00
Stёpa Dolgorukov
a588173605
Create .desktop file with name including version (#511) 2025-03-12 16:39:36 +04:00
cryptozoidberg
ec54dc72c9
added full warm up feature 2025-03-12 14:17:40 +04:00
sowle
01b5f89725
Merge branch 'small_amount_min_outs' into develop 2025-03-12 06:29:23 +01:00
sowle
b6efadad40
wallet: more needed_money fixes (primarily for escrow, mode separate tx and sweep bare outs) 2025-03-11 23:38:36 +01:00
cryptozoidberg
d40311da17
put levin return code to right place 2025-03-10 13:59:19 +04:00
cryptozoidberg
d93624bbf4
fixed bug with dummy server destructor being nasty 2025-03-10 13:56:48 +04:00
cryptozoidberg
6b152827af
more profiling logs + callback for the native lib 2025-03-09 14:59:21 +04:00
sowle
e15a7f804e
coretests: asset_operation_and_hardfork_checks fixed to reflect recent changes in balance calculation 2025-03-07 22:26:34 +01:00
sowle
dc81b4331f
fixed a rare bug when very small amounts are being transferred and there's not enough outputs in tx to satisfy min limit 2025-03-07 03:14:23 +01:00
sowle
fca1194f55
coretests: assets_transfer_with_smallest_amount implemented (exposes a bug) 2025-03-06 14:23:01 +01:00
sowle
79e3c6eaf1
chaingen, wallet: improved wallet transfers listing and balance checking when an asset is specified 2025-03-06 14:21:59 +01:00
cryptozoidberg
09ddda7dba
fixed ancient p2p bug 2025-03-05 14:51:11 +04:00
sowle
fbeb658ae0
Merge branch 'release' 2025-03-05 02:46:40 +01:00
sowle
c5c206ea13
Merge branch 'release' into develop 2025-03-05 02:46:06 +01:00
sowle
7ddbabc51e
cmake: set min boost version to 1.75 for all platforms (because of boost::pfr dependency) 2025-03-04 21:37:04 +01:00
cryptozoidberg
11437ac38f
Update Dockerfile 2025-03-04 15:06:59 +04:00
cryptozoidberg
a13eedf556
fix of currency protocol for long range splits 2025-02-28 19:11:37 +04:00
cryptozoidberg
bb92e52ae2
fix of JWT auth wrong expiration units 2025-02-26 14:56:47 +04:00
cryptozoidberg
ca46fca7b1
Added more comments on initi of the plain wallet 2025-02-26 01:20:46 +04:00
cryptozoidberg
5808e1a3d3
changed meta info format to json 2025-02-26 01:20:46 +04:00
sowle
1354eb0d47
Merge branch 'release' into develop 2025-02-25 18:21:03 +01:00
sowle
a448b62e9a
Merge branch 'master' into release 2025-02-25 18:20:35 +01:00
sowle
fe85ce27fb
Merge branch 'release' 2025-02-25 18:17:49 +01:00
cyan
936ff46f9c
add keys to open_wallet_response (#507) 2025-02-18 13:41:27 +04:00
sowle
571897a23b
Merge branch 'develop' into release 2025-02-16 22:59:04 +01:00
zano build machine
f0378d8be0 === build number: 381 -> 382 === 2025-02-17 00:57:26 +03:00
sowle
ede5df5afe
predownload files moved to CDN and updated to height 3030303 2025-02-16 22:56:43 +01:00
sowle
2bcc6075b7
HF5 height is set to 3076400 (mainnet) 2025-02-14 16:08:07 +01:00
Stёpa Dolgorukov
88060ee2a4
linux gui: Escape back slash in the value by the key "Exec" (#505) 2025-02-14 15:03:53 +01:00
sowle
38ae547f5c
send raw tx is disabled during the pre hardfork tx freeze period 2025-02-14 03:24:45 +01:00
sowle
8341f4f31f
minor improvements 2025-02-14 03:23:40 +01:00
sowle
141a8eac6a
chaingen: zarcanum_in_alt_chain_2 (forgotten changes) 2025-02-14 03:22:31 +01:00
sowle
672309ba5f
fixed an issue in alt block miner tx validation 2025-02-14 03:21:24 +01:00
sowle
d8f12cdcc8
chaingen: zarcanum_in_alt_chain_2 test added (highlights an issue in alt block validation) 2025-02-14 03:20:23 +01:00
sowle
cb74abddc5
coretests: chaingen: fill_tx_sources improved 2025-02-14 03:18:25 +01:00
sowle
4c860417f5
pre hardfork tx freeze period implemented (+HF6) 2025-02-14 03:17:33 +01:00
sowle
2006b71250
readme: added bzip2 and libssl-dev to prerequisites 2025-02-13 11:57:47 +01:00
sowle
664a971c46
readme: fixed a typo (credits to @dudebing99) 2025-02-13 11:54:05 +01:00
sowle
05f0458658
ui update (PR 142) 2025-02-12 16:50:10 +01:00
cryptozoidberg
6893535388
changed meta info format to json 2025-02-10 20:44:59 +04:00
zano build machine
b79e962e75 === build number: 380 -> 381 === 2025-02-07 00:11:32 +03:00
sowle
820569ff4e
ui update (PR 141) 2025-02-06 22:09:28 +01:00
zano build machine
c47dee5158 === build number: 379 -> 380 === 2025-02-05 10:02:52 +03:00
sowle
3bbdc9c140
ui update (PR 140) 2025-02-05 08:00:44 +01:00
sowle
337ce00b77
Merge branch 'develop' into release 2025-02-04 12:58:03 +01:00
sowle
a25baf8d94
=== version bump: 2.0.1.378 -> 2.1.0.379 === 2025-02-03 21:27:30 +01:00
sowle
a85445083f
testnet restart (currency formation version: 99 -> 100) 2025-02-03 21:24:32 +01:00
sowle
a0ddaea1a3
Merge branch 'txhfid' into develop 2025-02-03 21:09:01 +01:00
sowle
a101a676b0
minor compilation fix 2025-02-03 19:40:10 +01:00
sowle
ca9a8f95de
Merge branch 'develop' into txhfid 2025-02-03 18:29:45 +01:00
zano build machine
3cf39eec88 === build number: 377 -> 378 === 2025-01-31 19:30:36 +03:00
sowle
3d1f4a5336
now max_seed_height is always greater then or equal to current node's top block height 2025-01-31 17:30:02 +01:00
sowle
8fc70f4d6d
wallet: fixed a bug when a freshly created wallet's node is in then-become alt-chain (credits to @cryptozoidberg) 2025-01-31 17:28:28 +01:00
zano build machine
467fd4b6ba === build number: 376 -> 377 === 2025-01-30 17:40:03 +03:00
sowle
1cd3a95625
ui update (PR 139) 2025-01-30 15:35:53 +01:00
cryptozoidberg
4ad93162e8
https enabled in remote node 2025-01-30 14:50:51 +04:00
zano build machine
2628656537 === build number: 375 -> 376 === 2025-01-29 23:08:01 +03:00
sowle
d14ca4f53f
ui update PR 138 2025-01-29 21:07:07 +01:00
Stёpa Dolgorukov
dd64c805d7
coretests: Update "block_with_correct_prev_id_on_wrong_height" test (#499)
* Core tests: implement the test "block_with_correct_prev_id_on_wrong_height"

* Core tests: update "block_with_correct_prev_id_on_wrong_height" test
2025-01-29 11:24:18 +01:00
Stёpa Dolgorukov
072d53de9b
coretests: Fix MSVC C4146 warning in the test "get_xtype_from_string" (#503)
* Change macros for creating test names

* Add test for values of types int{16,32,64}_t

* Fix MSVC C4146 warning

---------

Co-authored-by: sowle <crypto.sowle@gmail.com>
2025-01-28 10:28:14 +01:00
zano build machine
a23ccd76fb === build number: 374 -> 375 === 2025-01-24 07:27:36 +03:00
sowle
38e6556a49
2nd iteration on diminishing CPU mining presence in mainnet builds 2025-01-24 04:41:55 +01:00
zano build machine
f6d363d313 === build number: 373 -> 374 === 2025-01-21 20:35:34 +03:00
sowle
e73eb4f59a
Merge remote-tracking branch 'origin/nocpumining' into develop 2025-01-21 18:30:58 +01:00
sowle
aab20167fb
ui update (PR 137) 2025-01-21 18:30:30 +01:00
Stёpa Dolgorukov
075ee3119b
coretests: Update "asset_operation_in_consolidated_tx" test (#501)
* coretests: Implement "asset_operation_in_consolidated_tx" test

* Define "construct_tx" overload with a generation context argument

* Update the test "asset_operation_in_consolidated_tx"

---------

Co-authored-by: crypto.sowle <crypto.sowle@gmail.com>
2025-01-21 03:33:11 +01:00
sowle
35f79d3780
zanod, simplewallet now return exit code 0 when '--version' or '--help' are given 2025-01-21 02:22:13 +01:00
sowle
ddd91d8fec
minor warning fix 2025-01-21 01:22:28 +01:00
Stёpa Dolgorukov
1087be7b0a
coretests: implement the tests "block_reward_in_main_chain_basic", "block_reward_in_alt_chain_basic" (#493)
* Core tests: implement tests "block_reward_in_main_chain_basic", "block_reward_in_alt_chain_basic"

* Use an automatic variable type deduction

* Call "assert_reward" callback before the callback "assert_balance"

* Update comments for the test "block_reward_in_alt_chain_basic"
2025-01-21 01:12:44 +01:00
Stёpa Dolgorukov
dcd7f62968
coretests: Fix an execution of the core test "fill_tx_rpc_inputs", rename callbacks (#498)
* Core tests: implement a test of the function "blockchain_storage::fill_tx_rpc_inputs"

* Fix test execution when compiling via gcc 8.4.0

* Rename callbacks in the test "fill_tx_rpc_inputs"
2025-01-20 04:21:27 +01:00
sowle
cf69c29e8d
Merge branch 'release' 2025-01-16 05:52:22 +01:00
sowle
7a5fb3ee25
Merge branch 'release' into develop 2025-01-16 05:50:07 +01:00
sowle
819fd97261
fixed more serious warnings for gcc 2025-01-16 05:49:58 +01:00
sowle
93c6c2a0b3
more compilation fixed for gcc 2025-01-16 05:40:28 +01:00
sowle
cc33fd8b9c
fixed more serious warnings for gcc 2025-01-16 04:24:00 +01:00
sowle
46f6e29efb
fixed gcc 13 compilation + some warnings 2025-01-16 04:23:04 +01:00
sowle
c9fe605ee8
Merge branch 'master' into release 2025-01-16 04:21:51 +01:00
sowle
e2a70189b3
OpenSSL 3.x support 2025-01-14 18:57:50 +01:00
cryptozoidberg
bd4d54e491
added docker sources for remote node 2025-01-09 20:26:02 +04:00
cryptozoidberg
aa24fc2126
Delete unused tests/data directory 2025-01-09 14:44:36 +04:00
sowle
4f1f2ba7e7
Merge branch 'master' into develop 2025-01-06 16:07:03 +01:00
zano build machine
81e77ba37b === build number: 372 -> 373 === 2025-01-06 18:06:45 +03:00
sowle
303e216b26
ui update (PR 136) 2025-01-06 16:05:47 +01:00
sowle
b58939cf27
readme: updated components' version 2025-01-05 04:24:01 +01:00
sowle
68649070cd
Merge branch 'master' into develop 2025-01-05 03:05:50 +01:00
dylan
31e17f91e2
docs: change boost upstream source (#495) 2025-01-05 03:03:31 +01:00
sowle
ad2b10116d
coretests: presumably all tests fixed: multisig_and_unlock_time, multisig_and_coinbase, pos_altblocks_validation@5, gen_wallet_alias_and_unconfirmed_txs@5, hard_fork_4_consolidated_txs@5, multisig_and_checkpoints@0 2024-12-30 15:37:14 +01:00
sowle
6ab3d46529
gcc compilation fix 2024-12-28 18:20:14 +01:00
sowle
23723ca05e
Merge branch 'develop' into txhfid 2024-12-28 15:21:21 +01:00
sowle
13b09ee914
coretests: fill_tx_rpc_inputs temporarily disabled 2024-12-28 15:17:32 +01:00
sowle
4197736fe2
coretests: gcc compilation fixed for fill_tx_rpc_inputs 2024-12-28 04:21:58 +01:00
sowle
059a71fd97
tx hf id: wallet adaptation 2024-12-28 04:20:50 +01:00
sowle
653b05298b
coretests: hard_fork_5_tx_version implemented 2024-12-28 00:27:16 +01:00
sowle
2e01f2291e
tests: fixes for performance_tests and functional_tests 2024-12-27 19:37:39 +01:00
sowle
8dd8a6ac1c
tx hf id: WIP 2024-12-27 07:27:43 +01:00
sowle
61a358b753
2nd attempt to calm down heuristic av by disabling cpu mining in mainnet build 2024-12-25 16:16:10 +01:00
sowle
cd2f044ad8
an attempt to calm down heuristic av by disabling cpu mining in mainnet build 2024-12-25 02:22:22 +01:00
sowle
8e2c70de93
Merge branch 'develop' into txhfid 2024-12-24 22:16:36 +01:00
zano build machine
484f362676 === build number: 371 -> 372 === 2024-12-24 23:49:18 +03:00
sowle
7b527483c2
wallet rpc: getbalance now returns brief utxo stat for each asset 2024-12-24 20:58:58 +01:00
Stёpa Dolgorukov
eda0472f1e
coretests: implemented a test for the function "blockchain_storage::fill_tx_rpc_inputs" (#486) 2024-12-13 23:10:34 +01:00
zano build machine
c0ca49c30a === build number: 370 -> 371 === 2024-12-11 15:58:01 +03:00
sowle
13ed32d67a
ui update (pr 135) 2024-12-11 13:56:20 +01:00
sowle
78f622ead1
bcs: get_block_reward_by_main_chain_height(), get_block_reward_by_hash() implemented; 2) core_rpc_server::fill_block_header_response() now correctly fills 'reward' 2024-12-10 21:27:34 +01:00
sowle
b9557dd70e
chaingen: run-single-test made more specific (exact match is now required) 2024-12-09 23:31:39 +01:00
Stёpa Dolgorukov
18c17e48b1
coretests: implemented test "input_refers_to_incompatible_by_type_output" (#480) 2024-12-09 17:34:28 +01:00
Stёpa Dolgorukov
9e3ece1818
coretests: implemented the test "block_with_correct_prev_id_on_wrong_height" (#479) 2024-12-09 17:32:41 +01:00
zano build machine
11b8933345 === build number: 369 -> 370 === 2024-12-09 17:53:08 +03:00
sowle
8cc4e99199
gui: is_remnotenode_mode_preconfigured() implemented 2024-12-09 15:52:07 +01:00
sowle
13f524defb
tx hardfork id: wip (basic structures, miner tx creation adapted, tests adapted almost all + hard_fork_5_tx_version) 2024-12-06 05:39:18 +01:00
cryptozoidberg
8a8e5c3011
moved docker to subfolder 2024-12-05 17:56:17 +04:00
zano build machine
8a7572d1b8 === build number: 368 -> 369 === 2024-12-04 18:27:52 +03:00
sowle
192ad1382c
get_connectivity_status: is_remote_node_mode flag implemented 2024-12-04 16:25:17 +01:00
sowle
504b4a2ad8
ui update, PR 134 2024-12-04 16:19:47 +01:00
sowle
e747b11d44
implemented https multiple attempts support in interruptible_http_client (using another approach, http_https_simple_client_wrapper introduced) 2024-12-04 02:49:28 +01:00
sowle
95dabbe63a
fixed url parse error for RPCs 2024-12-04 02:46:45 +01:00
zano build machine
1701b97f86 === build number: 367 -> 368 === 2024-12-03 05:07:03 +03:00
sowle
9cfa03d119
ui update 2024-12-03 03:06:02 +01:00
sowle
be44020b1c
win32: CloseHandle removed from console handler stop() to avoid exception on exit in dbg 2024-12-03 02:31:06 +01:00
sowle
2e73594378
predownload https test 2024-12-03 02:30:09 +01:00
sowle
b903d84cac
added https support to interruptible_http_client 2024-12-03 02:29:20 +01:00
cryptozoidberg
9763548fa8
add runtime check for buffer size 2024-11-27 15:34:34 +04:00
cryptozoidberg
6a7c29be51
Fix #482 suggested by @jeffro256 2024-11-26 21:51:23 +04:00
sowle
2817090c8a
Merge branch 'release' 2024-11-21 18:19:50 +01:00
sowle
fe67a2933a
Merge remote-tracking branch 'origin/develop' into release 2024-11-11 18:13:10 +01:00
zano build machine
d63feec2e1 === build number: 366 -> 367 === 2024-11-11 20:12:13 +03:00
sowle
524aa1c79b
Merge branch 'develop' into release 2024-11-11 04:09:40 +01:00
sowle
c8a55c08c7
predownload updated to height 2892700 2024-11-11 04:09:14 +01:00
sowle
c24d165627
Merge branch 'develop' into release 2024-11-11 01:21:05 +01:00
sowle
099f940751
=== set version to 2.0.1.366 === 2024-11-10 22:51:07 +01:00
sowle
2b249ef414
unit_tests: wallet_seed.basic_test fixed to reflect recent changes in password limitations 2024-11-10 22:18:01 +01:00
sowle
912392bee7
=== build number: 364 -> 365 === 2024-11-09 23:29:31 +01:00
sowle
85c2591cfc
account: fixed rare checksum oob issue 2024-11-09 19:47:46 +01:00
sowle
74ef510288
wallets_manager: wallet callback lifetime management fixed 2024-11-09 19:46:51 +01:00
sowle
d28a0e1b13
wallet: minor improvements (override keyword) 2 2024-11-09 19:44:28 +01:00
sowle
fead9075b6
wallet: minor improvements (override keyword) 2024-11-09 19:42:15 +01:00
Stёpa Dolgorukov
7b2388290c
unit_tests: Test the function "check_tx_inputs_keyimages_diff" on different type inputs in the "tx_pool_semantic_validation" test (#478) 2024-11-07 16:13:58 +01:00
zano build machine
41d87d3e27 === build number: 361 -> 362 === 2024-11-07 16:17:45 +03:00
sowle
fa35d54fbb
ui update 2024-11-07 14:00:56 +01:00
zano build machine
23cd004f36 === build number: 360 -> 361 === 2024-11-06 18:17:20 +03:00
sowle
45cd764e80
ui update 2024-11-06 15:49:58 +01:00
sowle
ea394e872a
minor improvements here and there 2024-11-06 14:33:50 +01:00
zano build machine
dca18f4963 === build number: 359 -> 360 === 2024-11-05 17:32:30 +03:00
sowle
b963acc6da
ui update 2024-11-05 15:06:05 +01:00
sowle
c7e17edbc7
simplewallet: minor fix for error text 2024-11-04 22:16:23 +01:00
sowle
f74445d7fd
implemented password validation for seed phrases generation 2024-11-04 22:15:18 +01:00
sowle
0dd79e77c4
removing backslash from allowed password symbols 2024-11-04 19:46:43 +01:00
Stёpa Dolgorukov
422c7f2a3a
unit_tests: implemented a test for the function "prepare_outputs_for_key_offsets" (#477) 2024-11-04 14:12:19 +01:00
cryptozoidberg
d0971413ca
added postponed wallet loop launch in plain wallet 2024-11-02 13:06:08 +04:00
sowle
753effce28
fixed usage of generate_zc_outs_range_proof() 2024-10-31 04:00:11 +01:00
sowle
5bdaf8eaed
removed a redundant param in generate_zc_outs_range_proof() 2024-10-31 03:39:09 +01:00
zano build machine
8be6f286f1 === build number: 358 -> 359 === 2024-10-30 21:16:10 +03:00
sowle
b3393af19a
ui update 2024-10-30 19:07:21 +01:00
sowle
d3632b2f04
wallet2 refactoring: the callback is a weak pointer now 2024-10-30 16:41:01 +01:00
sowle
0fe6631e50
improvements for assets ticket/full_name checking and for password validation 2024-10-30 14:10:24 +01:00
zano build machine
69284ae297 === build number: 357 -> 358 === 2024-10-30 12:41:17 +03:00
cryptozoidberg
10df225359
logs cleanup 2024-10-29 13:37:16 +04:00
cryptozoidberg
e4d9f1da59
added command for printing ip blacklist 2024-10-27 17:49:13 +04:00
zano build machine
a6538b5eca === build number: 356 -> 357 === 2024-10-27 11:01:46 +03:00
cryptozoidberg
647b5c80f6
fixes related to USE_OPEN_SSL_FOR_ECDSA 2024-10-26 15:36:31 +04:00
cryptozoidberg
b0efef8ef1
temporary disabled secp256k1 library 2024-10-26 14:28:27 +04:00
cryptozoidberg
13e67e23e1
very intial code for ECDSA from OpenSSL 2024-10-25 23:57:59 +04:00
cryptozoidberg
c0c39276c7
fixed BUILD_SHARED_LIBS overriding in bitcoin-secp256k1 2024-10-25 20:19:46 +04:00
Stёpa Dolgorukov
4e78beebeb
unit_tests: repair compilation on the G++ 12 compiler (#473) 2024-10-25 18:06:21 +02:00
cryptozoidberg
d88e1952a6
additional condition to handle ado tx 2024-10-25 15:26:45 +04:00
cryptozoidberg
26f2f7511a
added salt to asset generation 2024-10-25 13:43:50 +04:00
cryptozoidberg
8747abe3dd
updated read.me 2024-10-24 21:57:51 +04:00
sowle
f7e64b9164
don't populate cache in get_last_n_blocks_timestamps_median() if the resulted num of blocks isn't equal to window size 2024-10-24 14:44:15 +02:00
cryptozoidberg
a58c0810fb
added ephemenral field for ado in tx history api response 2024-10-24 16:36:11 +04:00
sowle
d625ec94a5
made ts check for pow block template optional 2024-10-24 14:10:14 +02:00
sowle
5ae9b2038e
coretests: several_asset_emit_burn_txs_in_pool test improved and enabled 2024-10-23 23:45:19 +02:00
sowle
6087a1bd40
cpu miner minor improvements (sounds nice) 2024-10-23 22:14:10 +02:00
sowle
2b15aad320
minor improvement for blockchain_storage::create_block_template() 2024-10-23 21:59:05 +02:00
sowle
c90344ea47
an attempt to fix incorrect PoW block template creation in case when there are lots of PoS blocks 2024-10-23 21:52:33 +02:00
cryptozoidberg
f08d8797a0
fixed http-forwarding issue 2024-10-23 20:05:03 +04:00
cryptozoidberg
a8a188b754
workaround fix for old android sdk with old boost(with missing pfr) v3 (shame on me) 2024-10-23 15:05:46 +04:00
cryptozoidberg
5387a7711c
workaround fix for old android sdk with old boost(with missing pfr) v2 2024-10-23 15:01:43 +04:00
cryptozoidberg
fd810d5e29
workaround fix for old android sdk with old boost(with missing pfr) 2024-10-23 14:47:17 +04:00
zano build machine
5e4fae1246 === build number: 355 -> 356 === 2024-10-23 13:22:54 +03:00
sowle
bd473960e4
testnet: hardforks heights reset 2024-10-23 12:22:32 +02:00
zano build machine
d3fc6b955f === build number: 354 -> 355 === 2024-10-23 12:27:24 +03:00
sowle
635cea55e0
testnet: P2P_DEFAULT_PORT calculation pattern changed 2024-10-23 11:26:34 +02:00
sowle
88fa0bca64
readme: Boost version updated 2024-10-23 11:04:12 +02:00
zano build machine
312444aa48 === build number: 353 -> 354 === 2024-10-23 04:41:18 +03:00
sowle
6d7923b7e3
hf5 min build number set to 354 2024-10-23 03:40:43 +02:00
sowle
109b187426
daemon_commands_handler fixed 2024-10-23 03:33:23 +02:00
sowle
fd1ddf5ffc
=== version bump: 2.0.2.352 -> 2.1.0.353 === 2024-10-23 02:01:20 +02:00
sowle
7d93211b9f
testnet relaunch (currency formation version: 98 -> 99) 2024-10-23 02:00:10 +02:00
cryptozoidberg
61ac4dd356
some clarity on opt_amount 2024-10-22 20:45:17 +04:00
cryptozoidberg
0c35b75a9d
Merge branch 'develop' into emmit_burn_refactoring 2024-10-22 20:42:10 +04:00
sowle
d23fa1911e
unit_tests: asset_id serializations test: WIP 2024-10-22 18:27:17 +02:00
cryptozoidberg
05d8c27577
cake wallet fixes in cmake 2024-10-22 20:07:03 +04:00
sowle
121067e36d
Merge branch 'develop' into emmit_burn_refactoring
# Conflicts:
#	src/wallet/wallet2.cpp
#	tests/unit_tests/multiassets_test.cpp
2024-10-22 15:58:29 +02:00
Stёpa Dolgorukov
8cc826f5b3
unit_tests: edit the "p2p_client_version.test0" (#471)
* Unit tests: implement the "p2p_client_version.test0"

* Unit tests: edit the "p2p_client_version.test_0"

* Change a default value for a commit identifier on a non empty expected value

* Format the source text

* Fix the test

* Comment on the cases where results differ on Windows, GNU/Linux
2024-10-22 14:48:29 +02:00
Stёpa Dolgorukov
0cd719474b
unit_tests: reimplement "get_or_calculate_asset_id" tests, fix "get_or_calculate_asset_id" due to serialization changes (#467) 2024-10-22 14:47:36 +02:00
Stёpa Dolgorukov
fbf0d413a8
Get rid of the compiler warning "not all control paths return a value" (#472) 2024-10-22 14:34:19 +02:00
cryptozoidberg
1968608018
fix for android 2024-10-22 14:46:28 +04:00
sowle
ac51ccbf8c
gcc compilation fixed 2024-10-21 20:51:27 +02:00
sowle
6a32f3f26d
readme: Boost minimum version bumped to 1.75 because of boost::pfr 2024-10-21 20:24:13 +02:00
sowle
9cd1121c75
Merge branch 'develop' into emmit_burn_refactoring 2024-10-21 20:21:03 +02:00
sowle
9b033842ab
Merge branch 'master' into develop 2024-10-21 20:20:25 +02:00
sowle
9d259f5455
unit_tests: get_or_calculate_asset_id_* made compilable (but still not runnable) 2024-10-21 20:19:49 +02:00
sowle
e9e7bbf0c5
some fixes in assets handling 2024-10-21 19:17:04 +02:00
cryptozoidberg
aeb313a72c
fixed bugs in ado transition 2024-10-21 19:51:31 +04:00
cryptozoidberg
fcb5513d68
Update README.md 2024-10-21 18:56:52 +04:00
sowle
42b5f32116
test code for wallet2::update_asset 2024-10-21 14:21:55 +02:00
sowle
b2b4342c14
Merge branch 'develop' into emmit_burn_refactoring
# Conflicts:
#	src/version.h.in
#	tests/core_tests/multiassets_test.cpp
2024-10-21 12:42:54 +02:00
sowle
ecc6cc4605
coretests: several_asset_emit_burn_txs_in_pool test added 2024-10-21 12:39:33 +02:00
sowle
3b1f08676e
warning fixed 2024-10-21 12:37:52 +02:00
cryptozoidberg
97b145f8b6
fixes in a coretests related to ado-operations 2024-10-20 23:08:44 +04:00
cryptozoidberg
2dd029fb5d
fixed multiassets_test.cpp 2024-10-20 15:57:47 +04:00
sowle
60423e71b8
boost serialization for crypto::scalar_vec_t and scalar_mat_t 2024-10-20 01:57:30 +02:00
cryptozoidberg
9dc293ec04
core and wallet fixed, coretests still broken 2024-10-19 22:53:43 +04:00
cryptozoidberg
f3618e6418
construc_tx compilation fixed 2024-10-19 21:33:42 +04:00
cryptozoidberg
844e5b823f
wallet2.cpp compilation fixed 2024-10-19 18:50:11 +04:00
cryptozoidberg
1fe0cd17ad
wallet2: implemented proper versioning in serialization asset_descriptor_* structs etc 2024-10-19 17:49:38 +04:00
sowle
0930090365
resurrected asset_owner_pub_key_v 2024-10-18 13:49:21 +02:00
sowle
2632446ee5
core: asset operation refactoring WIP 2024-10-18 03:15:33 +02:00
sowle
7345096a91
Merge branch 'release' into emmit_burn_refactoring
# Conflicts:
#	src/version.h.in
#	tests/functional_tests/crypto_tests_performance.h
2024-10-17 23:38:55 +02:00
cryptozoidberg
2ba22bc53b
fixed typos and minor changes in currency_format_utils.cpp 2024-10-18 01:15:47 +04:00
sowle
7205312837
asset ticker/tull_name regexp updated 2024-10-17 22:30:31 +02:00
cryptozoidberg
b5a44b1698
removed temporary code 2024-10-18 00:27:18 +04:00
cryptozoidberg
b2e9872645
implemented proper versioning in serialization asset_descriptor_* structs + serialization refactoring + boost serialization maps versioning self-vaidation 2024-10-18 00:26:30 +04:00
Stёpa Dolgorukov
40539c1f9d
coretests: edit the test "asset_current_and_total_supplies_comparative constraints" (#469)
* Coretests: implement the test "asset_current_and_total_supplies_comparative_constraints"

* Core tests: correct the test "asset_current_and_total_supplies_comparative_constraints"

* Add a return statement to the body end of the "asset_current_and_total_supplies_comparative_constraints::assert_asset_beta_registered" function
2024-10-17 17:58:48 +02:00
sowle
3c23d42ae4
minor refactoring around crypto::pod_to_hex (added generalized buff_to_hex + performance test) 2024-10-16 00:01:43 +02:00
sowle
5d429e1e76
Merge branch 'release' into develop
# Conflicts:
#	src/version.h.in
2024-10-15 17:39:11 +02:00
sowle
9186119620
=== build number: 349 -> 352 === 2024-10-15 17:35:13 +02:00
sowle
4af367fb5e
new limitations for asset ticker and full_name (wip) 2024-10-15 17:33:46 +02:00
cryptozoidberg
2c72622d7e
merge from develop 2024-10-15 17:57:50 +04:00
cryptozoidberg
ca51bd4886
fixing RPC API for burn 2024-10-15 17:54:50 +04:00
Stёpa Dolgorukov
b836742f66
coretests: improve of the test "tx_pool_semantic_validation" (#465)
* Coretests: implement the test "tx_pool_semantic_validation"

* Play the test "tx_pool_semantic_validation" on the HF 3

* Delete an extra space after the ":"

* Remove an extra adding of objects to the transaction

* Create the input objects of the specified type in the "unsupported input type" case

* Modify the function bodies "inputs_sum", "outputs_sum" to be short

* Remove adding output to the transaction in the cases "inputs amount overflow", "two entries of the same type in extra"

* Get rid of use the object "image" of the type key_image in the case "equal key images in inputs"
2024-10-15 02:30:05 +02:00
Stёpa Dolgorukov
c344739de9
unit_tests: implement the "p2p_client_version.test0" (#466) 2024-10-14 20:41:50 +02:00
sowle
4bb068f056
point_t::operator==() fixed and optimized + various tests 2024-10-12 03:05:07 +02:00
sowle
0a055e892c
Merge commit 'e58b20ae5b62745513b8451af1ae195c9c6a8e20' into release 2024-10-12 03:04:17 +02:00
zano build machine
d06ba31125 === build number: 350 -> 351 === 2024-10-12 04:02:03 +03:00
sowle
5d15ed1c15
point_t::operator==() fixed and optimized + various tests 2024-10-12 03:01:33 +02:00
sowle
b1c70ac2bb
=== version: 2.0.1 -> 2.0.2 === 2024-10-11 05:41:36 +02:00
zano build machine
52bd48dbc3 === build number: 349 -> 350 === 2024-10-10 23:47:36 +03:00
sowle
a307862320
Merge branch 'concise' into develop 2024-10-10 21:23:10 +02:00
sowle
bfa68e4b88
an attempt to fix gcc compilation 2024-10-10 20:45:43 +02:00
sowle
d92a54045b
Merge branch 'develop' into concise 2024-10-10 19:11:50 +02:00
sowle
e58b20ae5b
coretests: test asset_current_and_total_supplies_comparative_constraints was temporary disabled 2024-10-10 19:11:30 +02:00
sowle
986f7dc7d3
minor improvements 2024-10-10 15:20:42 +02:00
Stёpa Dolgorukov
cf8004050c
coretests: correct the test "asset_current_and_total_supplies_comparative_constraints" (#468)
* Coretests: implement the test "asset_current_and_total_supplies_comparative_constraints"

* Core tests: correct the test "asset_current_and_total_supplies_comparative_constraints"
2024-10-10 15:10:25 +02:00
sowle
02aeaa2078
wallet2 : transfer_flags_to_str updated to support recently added flags 2024-10-09 18:10:17 +02:00
sowle
93fdf0e677
functional tests: transactions flow test fixed 2024-10-09 17:48:41 +02:00
sowle
3a6e0c0f2f
Merge branch 'develop' into concise
# Conflicts:
#	src/wallet/wallet2.cpp
#	src/wallet/wallet2_base.h
2024-10-09 01:03:02 +02:00
Stёpa Dolgorukov
3daaad6d43
coretests: implemented test "asset_current_and_total_supplies_comparative_constraints" (#464) 2024-10-08 17:30:23 +02:00
sowle
4e750bf1b0
an attempt to make the merge less freaking crazy 2024-10-08 03:46:40 +02:00
cryptozoidberg
e77831f1f9
little tweak on wallet unconfirmed balance 2024-10-01 20:31:42 +04:00
cryptozoidberg
fc3922996d
added comments to JS code 2024-10-01 15:59:27 +04:00
cryptozoidberg
74b0e6d70f
added secp256k1_ecdsa example in JS/ethers 2024-10-01 15:53:33 +04:00
zano build machine
890b3155b8 === build number: 348 -> 349 === 2024-09-30 13:00:02 +03:00
cryptozoidberg
d992a8bdc3
merged lates UI 2024-09-30 13:57:21 +04:00
sowle
27e310bb84
gcc compilation fixes 2024-09-30 05:06:17 +02:00
cryptozoidberg
744522f3ca
minor changes relatd to secp256k1_ecdsa integration 2024-09-29 23:31:22 +04:00
sowle
53eefa044a
Merge branch 'develop' into release 2024-09-28 03:18:34 +02:00
zano build machine
2badfead11 === build number: 347 -> 348 === 2024-09-28 04:18:10 +03:00
Stёpa Dolgorukov
c1264169cc
Coretests: implement "tx_pool_semantic_validation" test (#462) 2024-09-28 03:17:36 +02:00
sowle
deb74ad9d0
predownload updated up to height 2829200 2024-09-28 03:15:38 +02:00
sowle
4438949480
Merge remote-tracking branch 'origin/develop' into release 2024-09-27 19:08:02 +02:00
zano build machine
ffb90714d6 === build number: 346 -> 347 === 2024-09-27 20:07:40 +03:00
sowle
dd85ad7fce
ui update (fixed wrong commit id) 2024-09-27 17:43:29 +02:00
sowle
d71d82b690
Merge branch 'develop' into release 2024-09-27 13:58:39 +02:00
sowle
48b3796f66
=== version: 2.0.0 -> 2.0.1 === 2024-09-27 13:58:25 +02:00
zano build machine
83b4dd9b36 === build number: 345 -> 346 === 2024-09-27 14:56:11 +03:00
sowle
39b4646e5d
mainwindow: removed redundant param for drop_secure_app_data() 2024-09-27 13:55:10 +02:00
zano build machine
0fafe09544 === build number: 344 -> 345 === 2024-09-25 23:17:33 +03:00
sowle
a9de7944dd
fixed an old error in stratum server when incorrect worker's name (!="miner") invalidates mining address that was already set in daemon 2024-09-25 21:05:02 +02:00
sowle
b8afa3f9c5
gcc warning fixed 2024-09-25 19:06:24 +02:00
zano build machine
565e950072 === build number: 343 -> 344 === 2024-09-25 19:42:09 +03:00
sowle
b1a136561d
testnet: set hardfork 5 height to 241750 2024-09-25 18:32:18 +02:00
zano build machine
f3eceda66b === build number: 342 -> 343 === 2024-09-25 06:25:36 +03:00
sowle
426ca5a22b
p2p: clients with outdated versions now rejected by p2p upon hf activation as well (+tied to hf min build number) 2024-09-25 04:13:41 +02:00
sowle
b77419afc7
runtime config: min build number introduced and tied to hardfork 2024-09-25 04:10:29 +02:00
sowle
8758f6dc79
utils: parse_client_version, parse_client_version_build_number() implemented + unit tests stub 2024-09-25 04:03:57 +02:00
sowle
e0c4a3ec42
epee: added support of "000" to string_to_num_fast 2024-09-25 04:02:47 +02:00
sowle
8c9582d0f7
coretests: eth_signed_asset_basics, eth_signed_asset_via_rpc made HF5-only 2024-09-24 16:00:25 +02:00
sowle
75e30c1372
fixed a warning 2024-09-24 15:59:43 +02:00
zano build machine
39201f3d4a === build number: 341 -> 342 === 2024-09-24 06:37:23 +03:00
sowle
b5e0b21f13
core: asset_operation_ownership_proof_eth is only allowed only since HF5 2024-09-24 05:36:40 +02:00
sowle
cf32e44926
reverted a minor forgotten change in COMMAND_RPC_SEND_RAW_TX 2024-09-24 02:57:54 +02:00
sowle
f17dba64ce
Merge branch 'secp256k1' into develop 2024-09-24 02:14:12 +02:00
sowle
82403dba51
coretests: eth_signed_asset_basics fixed and then greatly improved 2024-09-24 01:34:08 +02:00
sowle
2fc37934cf
removed forcefully nullifying asset_id in emit_asset() (it's up to the caller now) 2024-09-24 01:26:04 +02:00
sowle
f0891a36e8
minor improvements 2024-09-24 01:24:42 +02:00
sowle
d610c38c4e
fixed an error in construct_tx when asset update operation is ongoing with standard owner (non eth) 2024-09-23 20:35:22 +02:00
sowle
7b9c728de2
core: minor readability improvement in validate_asset_operation_against_current_blochain_state() 2024-09-23 20:34:17 +02:00
sowle
c117a76a04
upstream changes 2024-09-23 14:33:22 +02:00
sowle
08281059fb
Merge branch 'develop' into secp256k1
# Conflicts:
#	src/gui/qt-daemon/layout
#	src/simplewallet/simplewallet.cpp
#	src/version.h.in
#	tests/core_tests/chaingen_main.cpp
#	tests/core_tests/multiassets_test.cpp
#	tests/core_tests/multiassets_test.h
#	tests/unit_tests/multiassets_test.cpp
2024-09-23 14:24:00 +02:00
sowle
ef5c1f9c03
coretests: gcc compilation fixed 2024-09-23 06:15:23 +02:00
sowle
7c781ca0ff
chaingen: eth_signed_asset_via_rpc test added 2024-09-23 05:40:16 +02:00
sowle
e737bf5e02
chaingen: check_balance_via_wallet() various improvements 2024-09-23 05:39:40 +02:00
sowle
8ffbfbe60a
minor improvements 2024-09-23 05:38:47 +02:00
sowle
b66c0efc2b
wallet rpc: implemented support for third-party external asset operations signing + various 2024-09-23 05:37:36 +02:00
sowle
44b19dd070
wallet rpc: send_ext_signed_asset_tx call implemented 2024-09-23 05:34:55 +02:00
sowle
bb758a916a
wallet2: assets-related tx generation refactored 2024-09-23 05:29:57 +02:00
sowle
e414752976
refactored asset ownership handling in tx construction 2024-09-23 05:27:46 +02:00
sowle
3c9d6666cd
wallet2: various improvements 2024-09-23 05:25:24 +02:00
sowle
5f1defc5a1
core validation: additional condition validate_ado_ownership() 2024-09-23 05:19:58 +02:00
sowle
3d1ac6124e
core rpc: decrypt_tx_details call implmented 2024-09-23 05:17:00 +02:00
sowle
9d06106a78
fxed arguments order for cast_assign_a_to_b() 2024-09-23 05:15:28 +02:00
sowle
37e62ac079
various improvements 2024-09-23 05:13:26 +02:00
sowle
9d213b19b1
construct_miner_tx() doesn't clear result tx anymore, allowing to pass additional data in extra 2024-09-17 17:59:37 +02:00
Stёpa Dolgorukov
35427f8381
coretests: alt_chain_and_block_tx_fee_median test (#456)
* coretests: alt_chain_and_block_tx_fee_median test

* Run test "alt_chain_and_block_tx_fee_median" on run core tests

* Edit the test preamble
2024-09-16 22:13:49 +02:00
zano build machine
a8adcc07b7 === build number: 340 -> 341 === 2024-09-14 20:52:55 +03:00
cryptozoidberg
17aebd29b5
implemented custom seed option(experimental) 2024-09-14 21:46:52 +04:00
Stёpa Dolgorukov
9d10050325
coretests: asset_operation_in_consolidated_tx test added (#459)
* coretests: Implement "asset_operation_in_consolidated_tx" test
* Define "construct_tx" overload with a generation context argument

---------

Co-authored-by: crypto.sowle <crypto.sowle@gmail.com>
2024-09-12 22:29:09 +02:00
zano build machine
77d6939411 === build number: 339 -> 340 === 2024-09-12 17:05:49 +03:00
sowle
43602031b8
gui: show_notification slot added + minor improvements (logs) 2024-09-12 16:05:08 +02:00
zano build machine
41ef9caf40 === build number: 338 -> 339 === 2024-09-12 07:10:06 +03:00
sowle
d083f54edd
gui update 2024-09-12 06:09:23 +02:00
sowle
7fbfec3441
minor improvements (now unit_tests should be autoexecuted each commit) 2024-09-12 02:39:20 +02:00
sowle
ab73f0d19f
coretests: asset_operation_and_hardfork_checks test fixed 2024-09-11 22:36:54 +02:00
cryptozoidberg
8904cc20c4
fixed serialization test 2024-09-10 18:49:19 +04:00
cryptozoidberg
2a2987b17a
concise mode: last setings for production and tests 2024-09-09 18:26:16 +04:00
cryptozoidberg
1eeb9a4a81
wallet truncating fixed all core tests 2024-09-08 22:42:31 +04:00
Stёpa Dolgorukov
dc76fb9051
unit_tests: fixes for multiassets.get_or_calculate_asset_id_*
* Create multiassets test

* Correct an indentation

* Remove unnecessary assertions in cases of ASSET_DESCRIPTOR_OPERATION_UNDEFINED

* Correctly specify a string that represents the serialized object
2024-09-07 02:12:44 +02:00
Stёpa Dolgorukov
d74a04d6df
coretests: asset_operation_and_hardfork_checks test added
* Implement "asset_operation_and_hardfork_checks" test

* Run "asset_operation_and_hardfork_checks" test on core tests run
2024-09-06 13:57:14 +02:00
cryptozoidberg
9c2e2bb0f8
multiple fixes 2024-09-04 23:04:44 +04:00
Stёpa Dolgorukov
0d3e90f4a5
coretests: asset_operation_and_hardfork_checks test added 2024-09-02 21:26:39 +02:00
cryptozoidberg
ca09405491
core tests working 2024-09-02 21:44:41 +04:00
cryptozoidberg
77a928c78a
wallet compiled ok 2024-09-01 21:23:58 +04:00
cryptozoidberg
4b9a457e64
initial changes on wallet file size/memory consumption improvements 2024-08-31 22:38:23 +04:00
sowle
c82809a0b9
Merge branch 'develop' into secp256k1
# Conflicts:
#	src/wallet/wallet2.cpp
2024-08-28 19:33:26 +02:00
sowle
0b7a138abd
attempt to fix macos compilation 2024-08-27 19:50:05 +02:00
zano build machine
bc3077e429 === build number: 337 -> 338 === 2024-08-27 19:53:11 +03:00
sowle
62c02dab24
minor improvements 2024-08-27 18:52:34 +02:00
sowle
ee93fc00e6
updated ui 2024-08-27 18:48:10 +02:00
sowle
4d6291d7ff
rpc: find_outs_in_recent_blocks RPC implemented 2024-08-22 15:30:51 +02:00
sowle
47a1bd985d
unit_tests: fix for a gcc warning 2024-08-20 18:27:17 +02:00
Stёpa Dolgorukov
443386489c
unit tests: wallet_seed.{timestamp_from_word, word_from_timestamp} added + typo fixed (#450)
* Create wallet_seed.{timestamp_from_word, word_from_timestamp} tests
* Rename functions that convert a word to a timestamp, a timestamp to a word
* Make an implementation of the test in the source code shorter
2024-08-20 17:23:21 +02:00
Stёpa Dolgorukov
9e6faffb49
Create multiassets test (#449) 2024-08-19 12:13:56 +02:00
cryptozoidberg
fde28efdc5
latest fixes for cake wallet 2024-08-14 23:21:19 +04:00
sowle
0c90262e8a
conn_tool: fixed minor error 2024-08-13 21:05:48 +02:00
sowle
f0c7d57c41
LMDB: implemented experimental conversion from 4k pages to 16k pages (untested) 2024-08-13 21:04:51 +02:00
sowle
9f0fa8a390
wallet rpc: parameter renamed 2024-08-13 19:22:48 +02:00
sowle
88a1e96820
wallet rpc: split destinations by default (for users convenience) 2024-08-13 02:07:25 +02:00
sowle
2c06293f24
added additional check for incorrect asset operation type to get_or_calculate_asset_id() 2024-08-13 01:10:22 +02:00
sowle
bc552ff635
kv serialization for asset_descriptor_operation 2024-08-13 01:04:14 +02:00
sowle
faa95dd555
use boost::optional in asset_descriptor_base to avoid gcc compilation issues 2024-08-12 20:14:31 +02:00
sowle
19c818ed9b
minor improvements 2024-08-12 20:09:22 +02:00
sowle
b861d854a9
boost::shared_ptr ->std::shared_ptr 2024-08-12 20:04:18 +02:00
sowle
764e5a2adf
kv serialization support for std::shared_ptr 2024-08-12 19:41:55 +02:00
cryptozoidberg
e5f0fe6e76
attempt to fix broken compilation for android(and keep ios healthy with std::filesystrem) 2024-08-09 19:20:09 +04:00
cryptozoidberg
820d5a88ac
test data for new forkchoice rule generated(fork_choice_rule_test.fork_choice_rule_test_hf4) 2024-08-08 21:04:52 +04:00
cryptozoidberg
08e2f0fbf1
fixed space-failing of the seed phrase 2024-08-08 15:55:50 +04:00
cryptozoidberg
44d3317dd2
replacing conflicting namespace 2024-08-08 11:22:21 +04:00
cryptozoidberg
f48811ff44
attempt to fix filesystem crosscompiling 2024-08-08 10:04:44 +04:00
zano build machine
79fdecce32 === build number: 336 -> 337 === 2024-08-07 18:26:53 +03:00
cryptozoidberg
1cbb2eca1b
seed doctor implemented 2024-08-07 19:18:44 +04:00
cryptozoidberg
592fe81a47
fix for emmit api 2024-08-06 15:51:36 +04:00
sowle
389662b8c9
gcc compilation fix (2) 2024-08-02 16:14:23 +02:00
sowle
f8c54492f1
gcc compilation fix 2024-08-02 14:11:32 +02:00
sowle
e816cd969c
minor improvements 2024-08-02 12:36:08 +02:00
sowle
896eadd77b
coretests: eth_signed_asset_basics test added 2024-08-02 12:35:46 +02:00
sowle
27ecfad1d6
asset owner eth signer support for currency_format_utils and wallet2 2024-08-02 12:34:28 +02:00
sowle
fa4a2680f9
minor improvements for init_playtime_test_wallet_t() 2024-08-02 12:31:33 +02:00
sowle
e97b585659
crypto: eth_secret_key_to_public_key() implemented, other useful stuff for eth sig added 2024-08-02 12:00:35 +02:00
sowle
65af445ebb
Merge branch 'develop' into secp256k1 2024-08-02 11:56:53 +02:00
Stёpa Dolgorukov
a1a53012fb
Implement xtype_from_string tests for types int16_t, int32_t, int64_t (#447)
* Change macros for creating test names
* Add test for values of types int{16,32,64}_t

---------

Co-authored-by: sowle <crypto.sowle@gmail.com>
2024-08-01 23:10:19 +02:00
sowle
168281f862
coretests: tx_version_against_hardfork test added (not working yet due to few issues left intentionally) 2024-08-01 01:39:13 +02:00
zano build machine
132d2bf89f === build number: 335 -> 336 === 2024-07-26 14:02:37 +03:00
sowle
0a23950747
ui update 2024-07-26 13:01:34 +02:00
sowle
ef28b3ab71
Merge branch 'develop' into secp256k1 2024-07-26 12:10:57 +02:00
zano build machine
968051109a === build number: 334 -> 335 === 2024-07-26 13:04:43 +03:00
sowle
4365a76169
wallet: minor improvements 2024-07-26 04:53:32 +02:00
sowle
ac01843e27
wallet: sweep_below improved (fixed a couple of issues happening when there's a lot of small outs in the wallet) 2024-07-26 04:52:38 +02:00
sowle
449ac06070
simplewallet: balance and "balance raw" commands prioritize Zano native coins by showing it on the top row + minor improvements 2024-07-26 04:50:49 +02:00
sowle
fe98c140ac
wallet: minor refactoring for tx_too_big and other for clearness 2024-07-26 04:49:04 +02:00
sowle
712f66d3ee
set formal limit on tx input count to 256 (because of the asset surjection proof limits) 2024-07-26 02:22:21 +02:00
zano build machine
f0d82776b7 === build number: 333 -> 334 === 2024-07-25 15:51:12 +03:00
cryptozoidberg
12c5a0237b
fixed asset_emission_and_unconfirmed_balance 2024-07-24 23:49:00 +04:00
sowle
0bc14fa477
eth signature for CA: data structures + validate_ado_ownership() adaptation 2024-07-18 00:14:03 +02:00
sowle
ef73204960
added support for std::optional to src/serialization and boost serialization 2024-07-17 19:43:53 +02:00
cryptozoidberg
270bb925f5
updated documentation 2024-07-17 19:30:19 +04:00
sowle
3cb471c46c
Merge branch 'develop' into secp256k1 2024-07-15 21:41:12 +02:00
sowle
7c3d21e31f
coretests: minor fixes (gcc) 2024-07-13 00:31:49 +02:00
sowle
69a5d42d99
Merge branch 'release' 2024-07-12 13:57:57 +02:00
sowle
7d442b4c9a
coretests: gen_wallet_mine_pos_block adapted for HF4 2024-07-12 02:17:54 +02:00
sowle
b556f2ad86
minor improvements 2024-07-11 22:10:54 +02:00
sowle
567700635c
coretests: wallet_true_rpc_pos_mining test added 2024-07-11 22:10:37 +02:00
sowle
2582159a26
coretests: added ability to run "true" HTTP-RPC wallet tests via localhost connections 2024-07-11 22:09:55 +02:00
sowle
e17ede1649
rpc: set_ignore_connectivity_status() was ignored for some RPC, fixed 2024-07-11 22:04:42 +02:00
sowle
59ea01339d
Merge branch 'develop' into release 2024-07-11 21:34:59 +02:00
zano build machine
45eeb8c5f9 === build number: 332 -> 333 === 2024-07-11 22:34:29 +03:00
sowle
156c96fc42
minor bugfix in print_asset_info() 2024-07-11 21:32:18 +02:00
sowle
648f6954f4
wallet: allow to burn an asset up to zero 2024-07-11 21:21:22 +02:00
sowle
337e88254e
Merge branch 'develop' into release 2024-07-11 13:50:11 +02:00
zano build machine
c1d37852c5 === build number: 331 -> 332 === 2024-07-11 14:49:28 +03:00
sowle
55358fc420
ui update 2024-07-11 12:32:20 +02:00
sowle
bb439b0107
fixed a bug in transform_t_pod_array_to_hex_str_array() 2024-07-10 13:52:36 +02:00
sowle
1165101867
Merge branch 'develop' into release 2024-07-09 17:46:51 +02:00
zano build machine
ebd5815845 === build number: 330 -> 331 === 2024-07-09 18:46:08 +03:00
sowle
461f8b9b47
ui update 2024-07-09 17:45:44 +02:00
zano build machine
c50c5f42be === build number: 329 -> 330 === 2024-07-09 18:37:16 +03:00
sowle
8a8030c99b
Merge remote-tracking branch 'origin/dp_limits' into develop 2024-07-09 17:32:48 +02:00
zano build machine
f6400abaec === build number: 328 -> 329 === 2024-07-08 01:47:13 +03:00
sowle
f0aef9782a
Merge branch 'develop' into dp_limits 2024-07-07 22:34:31 +02:00
zano build machine
86e5af333f === build number: 327 -> 328 === 2024-07-07 23:33:39 +03:00
sowle
4ca10cfcb4
wallet: fixed a mistake in wallet2::finalize_transaction() fee check 2024-07-07 22:32:14 +02:00
zano build machine
c5d5311121 === build number: 327 -> 328 === 2024-07-07 22:40:54 +03:00
sowle
b844f2ddf8
simplewallet: asset_emit and asset_update now uses human-friendly amouts format + minor improvements 2024-07-07 20:40:33 +02:00
sowle
d3a4db9e37
set upper limit for the decimal point to to 18 in wallet2::deploy_new_asset() 2024-07-07 20:39:22 +02:00
zano build machine
1910715033 === build number: 326 -> 327 === 2024-07-07 21:37:23 +03:00
sowle
cdb9dd2f1f
unit tests: added a test for print_money_brief 2024-07-07 20:35:03 +02:00
sowle
e2998acc9d
print_fixed_decimal_point() and print_money_brief() fixed for too big decimal point values 2024-07-07 20:34:19 +02:00
sowle
bb6fa6f7bd
wallet: minor improvements over balance command 2024-07-07 20:33:06 +02:00
sowle
039b6674c4
coretests: asset_emission_and_unconfirmed_balance test added 2024-07-06 21:57:38 +02:00
sowle
e7ac63adb3
wallet2: minor improvement for wallet2::finalize_transaction() 2024-07-06 21:56:24 +02:00
sowle
4f33eb4078
minor improvements for fill_tx_rpc_payload_items() 2024-07-06 21:55:36 +02:00
sowle
11ba3489c3
Merge branch 'release' into develop 2024-07-06 21:55:04 +02:00
zano build machine
31ac5e4974 === build number: 325 -> 326 === 2024-07-06 18:16:52 +03:00
sowle
0eabc7b69e
fixed non-standard decimal point handlinig in wallets_manager::transfer() 2024-07-06 17:15:56 +02:00
sowle
b547e51719
Merge branch 'develop' into release 2024-07-05 18:01:49 +02:00
zano build machine
4d4e362c61 === build number: 324 -> 325 === 2024-07-05 19:01:13 +03:00
sowle
07c5256440
using of asset id clarified for docs 2024-07-05 18:00:22 +02:00
sowle
9973546472
wallet RPC: enforce null asset id in destinations for asset emit operation 2024-07-05 17:19:37 +02:00
cryptozoidberg
1ea5c1aa53
implemented burn assets API + fixed deploy asset API 2024-07-05 18:23:30 +04:00
sowle
e726ae9da6
Merge branch 'develop' into release 2024-07-04 20:14:27 +02:00
zano build machine
d0c65a04e7 === build number: 323 -> 324 === 2024-07-04 21:13:27 +03:00
sowle
3d69468cfd
wallet2: minor improvements for get_balance_str_raw() and get_asset_decimal_point() 2024-07-04 20:11:11 +02:00
zano build machine
a6808b4646 === build number: 322 -> 323 === 2024-07-03 05:37:56 +03:00
sowle
3154c7b72d
fixed select_indices_for_transfer() + several improvements to decimal_point=0 support 2024-07-03 01:40:40 +02:00
sowle
8aa1654a3f
=== build number: 321 -> 322 === 2024-07-02 20:59:07 +02:00
sowle
95e63b7b7e
wallet: minor improvement for get_transfers_str (aka list_outputs): mark locked transfers with * 2024-07-02 20:57:58 +02:00
sowle
28d841d114
wallet: fixed non-native coins error, incorrect mixin count and tx regeneration in sweep_below() 2024-07-02 20:57:00 +02:00
sowle
fe3a0ea39a
wallet: fixed incorrect decimal point for some log messages and not_enough_money error 2024-07-02 20:54:41 +02:00
sowle
3a3aed7469
simplewallet: fixed a bug with incorrect parsing of transfer amounts when the decimal point is non-standard + more verbose error messages 2024-07-02 20:51:47 +02:00
sowle
b6e84b460e
added decimal point support to currency::parse_amount() + minor refactoring 2024-07-02 20:49:51 +02:00
sowle
9150c31666
fixed wallet2::finalize_transaction() to correctly handle too big txs (and not to pass them to the daemon) 2024-07-02 17:22:07 +02:00
sowle
2b9caf2cb3
docs: some asset_descriptor fileds clarified a bit 2024-07-02 17:20:02 +02:00
sowle
fb22df4850
build: unused mdbx tools projects are excluded from the default MSVC build for convenience 2024-07-02 17:18:47 +02:00
sowle
d7cf27033c
forgotten include 2024-07-02 13:16:30 +02:00
sowle
f05d14a944
crypto: basic eth signature implementation + functional test 2024-07-02 13:15:48 +02:00
sowle
486fb05f73
updated submodule bitcoin-secp256k1 in attempt to fix gcc compilation issue 2024-07-01 21:35:27 +02:00
sowle
3b6fa728b7
added bitcoin-secp256k1 submodule at version 5.0 2024-07-01 14:14:00 +02:00
sowle
d94afc207c
Merge branch 'develop' into secp256k1 2024-07-01 13:58:37 +02:00
sowle
0e69e059fe
fixed incorrect end-of-object indentation in dump_as_json() and similar functions 2024-06-29 13:59:01 +02:00
sowle
4e20dad924
RPC API: added missing documentation examples 3 2024-06-28 19:51:28 +02:00
cryptozoidberg
05547c5c0d
added LICENSE file to root folder 2024-06-27 23:34:07 +04:00
zano build machine
41f9302fce === build number: 320 -> 321 === 2024-06-27 21:03:11 +03:00
sowle
b51b26cb14
ui update 2024-06-27 20:01:57 +02:00
sowle
c26d449630
RPC API: added missing documentation examples 2 2024-06-27 19:38:19 +02:00
sowle
d2b60b0090
RPC API: added missing documentation examples 2024-06-27 16:08:44 +02:00
sowle
21aae4496c
DOC_EXMP_AGGR added 2024-06-27 16:08:04 +02:00
sowle
8f25f0d460
bitcoin-secp256k1 submodule added + native crypto test 2024-06-26 21:15:44 +02:00
cryptozoidberg
7ff58b6b18
added missing documetation - 2 2024-06-26 22:29:58 +04:00
cryptozoidberg
e31e2730c9
added missing documetation 2024-06-26 22:02:03 +04:00
sowle
da5c484025
functional_tests/crypto_tests: all performance tests now have prefix "perf", all normal tests with "crypto" prefix will be run regularly since now 2024-06-26 17:30:55 +02:00
sowle
cee6e51cbb
unit_tests: tx_signatures_packing.1 fixed 2024-06-26 15:35:52 +02:00
sowle
d4d3ea1d23
unit_tests: p2p_client_version_test_1 fixed 2024-06-26 14:56:37 +02:00
cryptozoidberg
291d39383d
fixed description in simplewallet(reported by Gonbatfire) 2024-06-25 21:20:36 +04:00
sowle
c101a21010
warning fixed 2024-06-25 15:55:36 +02:00
sowle
5ab468be42
validate_tx_details_against_tx_generation_context implemented 2024-06-25 15:46:53 +02:00
sowle
5e8cfb9ee3
coretests: hard_fork_2_incorrect_alias_update fixed due to change in logic of wallet2::request_alias_update() 2024-06-25 14:41:36 +02:00
sowle
226c3653ac
minor improvements: CHECK_AND_ASSERT_EQ(), stream support for std::type_info 2024-06-24 23:28:47 +02:00
sowle
c21785add4
fix for #440 2024-06-24 12:16:42 +02:00
zano build machine
63c2a299a5 === build number: 319 -> 320 === 2024-06-22 21:37:45 +03:00
sowle
3882d024cb
simplewallet: display own assets with correct decimal point, get_asset_info() knows own assets, + minor fixes 2024-06-22 20:25:04 +02:00
sowle
6408ea007f
ui update 2024-06-22 19:55:14 +02:00
cryptozoidberg
c01e9a5862
added async call for 2-arguments slots 2024-06-19 14:45:53 +02:00
zano build machine
5f62c76a2f === build number: 318 -> 319 === 2024-06-19 00:55:44 +03:00
cryptozoidberg
af49225221
small tweak for bridge serialization 2024-06-17 22:13:07 +02:00
zano build machine
cb08646fc1 === build number: 317 -> 318 === 2024-06-17 01:42:12 +03:00
cryptozoidberg
2f535f011e
fixed get_assets_list api 2024-06-14 23:20:43 +02:00
cryptozoidberg
cdd435f042
added update alias api + coretest 2024-06-14 15:08:56 +02:00
cryptozoidberg
47e10e7209
added new api to update alias 2024-06-06 21:24:31 +02:00
cryptozoidberg
d622078ef9
added universal command that call rpc-api 2024-06-03 20:57:53 +04:00
cryptozoidberg
10c1f7f59a
added commands for transfer ownership over asset descripto 2024-06-02 21:12:06 +04:00
sowle
dd7d1d3109
greatly refactored alt block verification and improved it for post-HF4 era (now all updated tests should pass) 2024-06-01 22:06:21 +02:00
sowle
66fd58b8ee
coretests: many altchain tests adapted for post-HF4:
pos_altblocks_validation
  chain_switching_when_gindex_spent_in_both_chains
  alt_blocks_validation_and_same_new_amount_in_two_txs
  alt_blocks_with_the_same_txs
  chain_switching_when_out_spent_in_alt_chain_mixin
  chain_switching_when_out_spent_in_alt_chain_ref_id
2024-06-01 21:20:58 +02:00
sowle
7da72fcc89
chaingen: pos_block_builder adapted for HF4 and now can generate correct Zarcanum PoS blocks 2024-06-01 21:15:42 +02:00
sowle
66f2761f67
chaingen: find_global_index_for_output, generate_pos_block_with_given_coinstake adapted for HF4; decode_output_amount_and_asset_id, decode_native_output_amount_or_throw added 2024-06-01 21:12:26 +02:00
sowle
fdc8bf19e0
gcc compilation fix 2024-05-31 16:05:52 +02:00
sowle
c92ca6fb93
chaingen: --run-single-test now accepts specific HF, e.g.: --run-single-test=test_name@4 2024-05-31 15:51:42 +02:00
sowle
092e0f1e60
minor improvements, typos, log msgs 2024-05-31 15:49:55 +02:00
cryptozoidberg
d0bad4213a
fixed bug in rpc asset deploy function 2024-05-25 01:11:30 +04:00
sowle
0c1fe0cf80
Dockerfile brought up-to-date 2024-05-21 02:17:58 +02:00
sowle
cc79aa87b3
Merge branch 'release' 2024-05-16 20:35:43 +02:00
sowle
db1dedbb0a
Merge branch 'develop' into release 2024-05-16 14:47:15 +02:00
zano build machine
9795460468 === build number: 316 -> 317 === 2024-05-16 14:11:53 +03:00
sowle
155181d899
ui update 2024-05-16 13:04:45 +02:00
sowle
071e02f278
Merge branch 'develop' into release 2024-05-14 12:35:38 +02:00
zano build machine
4c2ac48337 === build number: 315 -> 316 === 2024-05-14 13:34:09 +03:00
sowle
b154d84330
ui update 2024-05-14 12:33:22 +02:00
sowle
05f4a4e482
Merge branch 'develop' into release 2024-05-14 11:37:18 +02:00
zano build machine
01a8fdda68 === build number: 314 -> 315 === 2024-05-14 12:36:49 +03:00
sowle
2abe23c5e6
ui update 2024-05-14 11:35:55 +02:00
sowle
b91d902791
Merge branch 'develop' into release 2024-05-13 15:47:01 +02:00
zano build machine
df6fa3f7c5 === build number: 313 -> 314 === 2024-05-13 16:45:05 +03:00
cryptozoidberg
10c451f3b7
Added PoS grinding attack fuse 2024-05-13 16:51:13 +04:00
sowle
5342440fd6
Merge branch 'develop' into release 2024-05-10 17:01:19 +02:00
zano build machine
7237867f15 === build number: 312 -> 313 === 2024-05-10 18:00:01 +03:00
sowle
88d94fde3f
ui update 2024-05-10 16:59:10 +02:00
sowle
348e263ebe
Merge branch 'develop' into release 2024-05-09 21:20:16 +02:00
zano build machine
e45dbb4f2c === build number: 311 -> 312 === 2024-05-09 16:43:31 +03:00
sowle
4bdfb47fc3
ui update 2024-05-09 15:42:49 +02:00
zano build machine
525132cf11 === build number: 310 -> 311 === 2024-05-08 22:44:29 +03:00
cryptozoidberg
6655a6feaf
attempt to fix file with wrong item in last m_last_zc_global_indexs 2024-05-08 23:43:52 +04:00
cryptozoidberg
7ff0463587
add wallet prefix to log 2024-05-08 22:07:43 +04:00
zano build machine
1609631431 === build number: 309 -> 310 === 2024-05-08 21:01:12 +03:00
cryptozoidberg
fe3c3d731b
added extra logs for wallet issue - 2 2024-05-08 21:59:30 +04:00
cryptozoidberg
14a0be050e
added extra logs for wallet issue 2024-05-08 21:54:30 +04:00
sowle
030dd348b4
Merge branch 'develop' into release 2024-05-08 01:46:10 +02:00
zano build machine
e809d821a1 === build number: 308 -> 309 === 2024-05-08 02:44:25 +03:00
cryptozoidberg
fd25b5a8e5
attempt to fix wallet exception on alt blocks 2024-05-08 01:04:07 +04:00
zano build machine
4c2553a482 === build number: 307 -> 308 === 2024-05-07 17:43:07 +03:00
sowle
c68f841fdb
ui update 2024-05-07 16:42:37 +02:00
zano build machine
b56a0fb90c === build number: 306 -> 307 === 2024-05-05 23:25:41 +03:00
sowle
c6488622eb
temporary fix for ZC outs validation in validate_alt_block_input() 2024-05-05 22:19:16 +02:00
zano build machine
e40d9df2ec === build number: 305 -> 306 === 2024-05-04 22:27:57 +03:00
zano build machine
455ece8cba === build number: 304 -> 305 === 2024-05-04 05:28:48 +03:00
sowle
d9633d5b06
get_block_reward simplified ver 2024-05-04 03:48:14 +02:00
sowle
d52cb725d1
updated macos deployment target: 10.13 -> 10.15 (required for std::filesystem) 2024-05-04 03:24:15 +02:00
sowle
f7aab6f332
coretests: restored forgotten multisig_n_participants_seq_signing test 2024-05-04 03:18:40 +02:00
sowle
b3c44598b0
minor improvements & code cleanup 2024-05-04 03:17:56 +02:00
sowle
702817e351
fixed a potential issue in check_ms_input() 2024-05-04 03:16:28 +02:00
sowle
81ac6cf333
removed redundant hardfork check from check_tx_inputs(), because it's already in validate_tx_for_hardfork_specific_terms() 2024-05-04 03:15:13 +02:00
sowle
e38dfc1472
coretests: hardfork_4_pop_tx_from_global_index test added to cover uncovered areas in pop_transaction_from_global_index() 2024-05-04 02:35:51 +02:00
sowle
5500e943dd
did some refactoring around validate_miner_transaction()
code simplified
fixed an issue with already_generated_coins not taking block size penalty into consideration
2024-05-04 02:33:05 +02:00
sowle
e57709a67f
prevalidate_miner_transaction() now checks HF condition for the given height instead of the top height 2024-05-04 02:24:11 +02:00
sowle
2e75597365
code clean-up and minor improvements 2024-05-04 02:21:34 +02:00
zano build machine
a12fd42a8e === build number: 303 -> 304 === 2024-05-04 03:13:22 +03:00
sowle
5e07e3c4e0
an attempt to fix linux build 2024-05-04 02:05:17 +02:00
sowle
2b1c1094a6
fix for m_db_per_block_gindex_incs container (was not populated properly due to a bug in append_per_block_increments_for_tx()) 2024-05-03 18:39:26 +02:00
cryptozoidberg
7a0ec043a1
fixed issue with multithreadin and jwt rpc 2024-05-03 20:08:22 +04:00
cryptozoidberg
423b99cc5e
fixes in UI for latest qt and latest UI commits 2024-05-02 19:12:35 +04:00
cryptozoidberg
a853f77c00
added Debug config, replace boost to std (due to deadlock in boost guts) 2024-05-01 19:20:44 +04:00
cryptozoidberg
1d153834d9 fixed m3 simulator build for ios 2024-04-30 20:29:11 +04:00
cryptozoidberg
d718d876fc
added address field to get_seed_phrase_info 2024-04-27 23:26:32 +04:00
sowle
db4b841f57
minor fixes and code cleanup 2024-04-25 19:13:57 +02:00
zano build machine
89e6555e2a === build number: 302 -> 303 === 2024-04-25 18:00:29 +03:00
sowle
3ab93654f5
ui update 2024-04-25 16:59:42 +02:00
sowle
7fdc82a630
minor code cleanup 2024-04-25 16:46:36 +02:00
cryptozoidberg
1196423f02
fixes over documentation autogen 2024-04-22 23:29:00 +04:00
sowle
6f4e1465bc
utils: macosx_bild_uploader: increased attempts count (i.e. timeout) 2024-04-22 17:50:41 +02:00
sowle
15e653a8ae
minor refactoring: get_base_block_reward() now requires only block height (for clarity) 2024-04-22 17:45:10 +02:00
cryptozoidberg
b102d0d3b9
fixed command line to common style 2024-04-22 18:48:20 +04:00
zano build machine
47dfdf1e0b === build number: 301 -> 302 === 2024-04-22 17:31:56 +03:00
sowle
08a753b4c9
ui update 2024-04-22 16:30:42 +02:00
sowle
63dadb37c6
compilation fix for blockchain_storage::get_assets() 2024-04-22 01:25:28 +02:00
sowle
9f8ce4cc09
daemon RPC documentation added 2024-04-21 04:41:43 +02:00
cryptozoidberg
2e2d3c26b4
Moved UI to latest commit 2024-04-20 00:10:55 +04:00
cryptozoidberg
ad66a6db30
added get_assets_list command to daemon API 2024-04-20 00:07:38 +04:00
zano build machine
eae8fde294 === build number: 300 -> 301 === 2024-04-16 17:26:21 +03:00
sowle
530acf4662
wallet2::has_bare_unspent_outputs() was fixed for the testnet 2024-04-11 17:14:43 +02:00
sowle
e52ff16733
wallet2: fixed height upper limit in decoy request for pre-HF4 PoS mining (effective mostly for the testnet) 2024-04-11 17:00:36 +02:00
cryptozoidberg
e3d1956ba3
implemented RPC API for assets deployment 2024-04-11 14:29:03 +02:00
cryptozoidberg
c54f3fc1d8
added seed to wallet generation api 2024-04-10 19:31:01 +02:00
sowle
4f74046e62
Merge branch 'master' into develop 2024-04-10 19:14:51 +02:00
sowle
82e52e951a
build version: 299 -> 300 2024-04-10 19:13:58 +02:00
sowle
d1f7f436f8
build version: 299 -> 300 2024-04-10 19:13:13 +02:00
cryptozoidberg
ed62452853
hardfork 5 2024-04-10 19:10:32 +02:00
sowle
a39a3ddd55
merge master into develop 2024-04-10 17:47:08 +02:00
cryptozoidberg
3cde8738c2
added example values to wallet_provision_info 2024-04-10 14:52:46 +02:00
cryptozoidberg
53a27a4306
documented wallet_provision_info 2024-04-10 14:51:33 +02:00
cryptozoidberg
ef16abb41a
extra line break added 2024-04-10 14:47:28 +02:00
sowle
d3f3bb07e0
restarted testnet (build version bumped up to 299) 2024-04-10 14:24:59 +02:00
cryptozoidberg
ac63489325
last fixes for uri 2024-04-10 14:19:48 +02:00
cryptozoidberg
cb1f62d4ff
fixedbug with crash on autodoc 2024-04-10 14:19:48 +02:00
sowle
75cb3bcaf8
more compilation fixes 2024-04-10 13:49:44 +02:00
sowle
30eba2dadf
fixed compilation (handle_http_request_map definition) 2024-04-10 13:33:37 +02:00
cryptozoidberg
18650cda63
moved code to common header 2024-04-10 13:19:36 +02:00
sowle
e8280f7e42
coretests: fixed compilation & warnings 2024-04-10 12:16:45 +02:00
cryptozoidberg
a91ded81b0
and fixed another compilation issUe 2024-04-09 23:09:22 +02:00
cryptozoidberg
cd88249598
fixed few compilation issies 2024-04-09 23:00:27 +02:00
cryptozoidberg
3a792e9a8e
added wallet API complete documentation 2024-04-09 22:52:56 +02:00
zano build machine
42fda5eaf7 === build number: 297 -> 298 === 2024-04-09 23:22:56 +03:00
sowle
56b6260348
warning fixed 2024-04-09 22:21:42 +02:00
sowle
65dfe90526
wallet2: fixed sweep_bare_outs(), added new overloading for prepare_tx_sources() 2024-04-09 21:44:44 +02:00
sowle
021fbb7d37
coretests: added test hardfork_4_wallet_sweep_bare_outs which exposes a bug in sweep_bare_outs() where it fails if there's not enough decoys 2024-04-09 21:43:13 +02:00
zano build machine
19eb7baaa2 === build number: 296 -> 297 === 2024-04-08 19:33:30 +03:00
sowle
7be8865755
wallet2: fixed add_to_last_zc_global_indexs() 2024-04-08 18:31:06 +02:00
zano build machine
b8cc8818ee === build number: 295 -> 296 === 2024-04-08 14:54:06 +03:00
sowle
eddc3091a7
ui update 2024-04-08 13:52:03 +02:00
cryptozoidberg
7f0b99c25e
another good iteration on auto documenting feature 2024-04-07 16:43:55 +02:00
cryptozoidberg
63d4bde2d9
removed seed phrase from open wallet response 2024-04-06 19:23:19 +02:00
cryptozoidberg
a2307d45fd
fixed broken compilation 2024-04-06 18:54:02 +02:00
cryptozoidberg
0e87eb69b5
Merge branch 'release2' into develop 2024-04-06 17:23:21 +02:00
cryptozoidberg
e422b42ba6
fixes in lang tools 2024-04-06 17:22:44 +02:00
cryptozoidberg
b4ab654f11
fixed wallet bug in calculating last available global index in zarcanum era 2024-04-06 17:21:03 +02:00
cryptozoidberg
d4b29a30b5
fixes for gcc 2024-04-05 17:22:05 +02:00
cryptozoidberg
0b62abbca0
test changes 2024-04-05 17:22:05 +02:00
sowle
a142d39fc9
coretests: hardfork_4_wallet_transfer_with_mandatory_mixins test fixed 2024-04-05 17:20:40 +02:00
sowle
fa67466d20
wallet2: fix an issue in prepare_tx_sources() where some transfers may be locked if there's was exception during preparing phase 2024-04-05 14:09:27 +02:00
sowle
92c6a9d51d
coretests: hardfork_4_wallet_transfer_with_mandatory_mixins test added, exposing a bug where a wallet cannot spend coins before a specific sync process was done 2024-04-05 13:56:24 +02:00
sowle
737d7353a4
wallet2: minor code clean-up 2024-04-05 12:01:38 +02:00
cryptozoidberg
2c181de6a3
fixed serialization for hex-encoded array of pod items 2024-04-04 23:41:53 +02:00
sowle
95368faccd
yet another attempt to fix macOS warnings and errors (CMAKE_OSX_DEPLOYMENT_TARGET: 10.12 -> 10.13) 2024-04-04 20:58:02 +02:00
sowle
ea7e99f7d3
yet another attempt to fix macOS warnings and errors 2024-04-04 19:03:55 +02:00
sowle
60e8fcdc47
an attempt to fix macOS compilation 2024-04-04 18:01:26 +02:00
sowle
3f1968837f
dependencies version updated 2024-04-04 16:54:04 +02:00
sowle
9cd8e88ab4
an attempt to fix macos compilation 2024-04-04 16:34:43 +02:00
zano build machine
59f38273e3 === build number: 294 -> 295 === 2024-04-03 19:33:19 +03:00
sowle
88a0d072b0
msvc compilation fix 2024-04-03 18:24:03 +02:00
sowle
b5879f7360
gcc warning fixed 2024-04-03 17:18:47 +02:00
sowle
1f3ae7b725
wallet RPC: get_bare_outs_stats, sweep_bare_outs implemented + minor improvements 2024-04-03 16:45:33 +02:00
sowle
ab12614d9b
Merge branch 'release2' into develop 2024-04-03 16:43:11 +02:00
sowle
d69a47a46d
wallet: removed unnecessary setting of mix_att to hf4_minimum_mixins in finalize_transaction() 2024-04-02 22:03:09 +02:00
sowle
6e036356df
wallet: sweeping of bare unspent outputs implemented 2024-04-02 22:00:53 +02:00
cryptozoidberg
635f52d499
fix for compilation on macos 2024-04-01 16:50:14 +02:00
sowle
097420a66f
wallet2: is_transfer_ready_to_go, is_transfer_able_to_go made const 2024-04-01 15:32:00 +02:00
zano build machine
aab28aea8c === build number: 293 -> 294 === 2024-04-01 15:15:20 +03:00
sowle
5053bc9a6d
ui update 2024-04-01 14:11:07 +02:00
sowle
09c42ed0b4
Merge branch 'master' into develop 2024-04-01 14:06:16 +02:00
sowle
23ac3572cf
Merge branch 'release2' 2024-03-29 21:16:40 +01:00
zano build machine
23d2b93506 === build number: 292 -> 293 === 2024-03-29 22:42:10 +03:00
sowle
f2d6351211
simplewallet: minor improvements 2024-03-29 20:34:03 +01:00
cryptozoidberg
1a15109f4b
Merge branch 'release2' into develop 2024-03-29 18:57:26 +01:00
cryptozoidberg
79b5def9ba
Merge branch 'release2' 2024-03-29 18:54:37 +01:00
cryptozoidberg
c552916266
fix for mobile android build 2024-03-29 18:54:04 +01:00
sowle
e928d03ec7
Merge branch 'release2' 2024-03-29 17:09:26 +01:00
zano build machine
c375d6fa10 === build number: 291 -> 292 === 2024-03-29 18:31:42 +03:00
sowle
16be157add
simplewallet: fixed typo + logs 2024-03-29 16:31:12 +01:00
zano build machine
950c80a108 === build number: 290 -> 291 === 2024-03-29 17:54:22 +03:00
sowle
01c60fa07e
simplewallet: --pos-mining-defrag CLI option added 2024-03-29 15:53:51 +01:00
sowle
a45e42e0a5
handle ethash epoch context allocation errors by triggering an immediate stop via the critical error handler 2024-03-29 14:31:00 +01:00
cryptozoidberg
b0c92e28dd
added more logs for generate_unique_reversed_distribution 2024-03-28 21:19:57 +01:00
cryptozoidberg
31abc2d1bd
Merge branch 'develop' into autodoc 2024-03-28 19:28:33 +01:00
cryptozoidberg
b646939113
merge from release2 2024-03-28 19:28:13 +01:00
cryptozoidberg
b00fb7671e
added few fixes to autodoc 2024-03-28 19:24:11 +01:00
cryptozoidberg
312d500a36
fixed problem with decoy selection algo 2024-03-28 19:22:38 +01:00
cryptozoidberg
beb84c200d
Merge branch 'develop' into autodoc 2024-03-28 13:51:37 +01:00
cryptozoidberg
b8c97e3f70
fixed broken build 2024-03-28 13:51:13 +01:00
sowle
4d6aa1a4f9
wallet: minor fixes (logging) 2024-03-28 13:32:26 +01:00
sowle
d933a22154
wallet: set_pos_utxo_count_limits_for_defragmentation_tx() added, coretests: packing_outputs_on_pos_minting_wallet, pos_minting_tx_packing fixed 2024-03-28 13:29:00 +01:00
cryptozoidberg
a2b28806b1
added struct documentation macro 2024-03-28 13:04:23 +01:00
cryptozoidberg
73b7123906
Merge branch 'develop' into autodoc 2024-03-28 12:50:51 +01:00
cryptozoidberg
cfb4e481b4
Implemented auto documentation 2024-03-28 12:49:43 +01:00
sowle
f4da18cc3f
Merge branch 'master' into develop
# Conflicts:
#	src/currency_core/tx_pool.cpp
2024-03-27 23:52:24 +01:00
sowle
9f845bb73b
Merge branch 'release2' 2024-03-27 23:46:54 +01:00
cryptozoidberg
98d124860c
fixed macos compilation - 2 2024-03-27 23:22:10 +01:00
zano build machine
6f35ced052 === build number: 289 -> 290 === 2024-03-28 01:08:01 +03:00
cryptozoidberg
ad281664c3
fixed macos compilation 2024-03-27 23:07:38 +01:00
zano build machine
9cf3c80fba === build number: 288 -> 289 === 2024-03-28 00:23:34 +03:00
sowle
dd04d6367b
coretests: multiassets_basic_test improved to reflect recent changes with tx pool validation 2024-03-27 22:18:06 +01:00
sowle
754a29a709
wallet: defragmentation tx generation is now disabled by default 2024-03-27 22:15:13 +01:00
sowle
df7b6a3674
tx pool: added ability to disable tx validation for tests 2024-03-27 22:13:43 +01:00
zano build machine
b72a0593c6 === build number: 287 -> 288 === 2024-03-27 22:53:47 +03:00
cryptozoidberg
f3820c32f2
added log message for COMMAND_RPC_GETBLOCKTEMPLATE 2024-03-27 20:06:20 +01:00
cryptozoidberg
d2ee1b3fa8
added COMMAND_RPC_REMOVE_TX_FROM_POOL 2024-03-27 19:10:26 +01:00
cryptozoidberg
320816fd99
added test for getblocktemplate 2024-03-27 19:10:26 +01:00
sowle
69e68807bf
coretests: minor forgotten change 2024-03-27 18:57:30 +01:00
sowle
80fd303081
compilation fixed for gcc (by using universal references for process_type_in_variant_container_*) 2024-03-27 18:53:05 +01:00
sowle
709d16eb75
tx pool: asset operations basic validation on tx add 2024-03-27 17:18:17 +01:00
sowle
3eb711fbf8
tx_pool: is_tx_blacklisted() 2024-03-27 17:08:19 +01:00
sowle
806eb326d1
(cherry picked) tx_pool: add post-HF4 txs are now being check for balance proof. Core test hard_fork_4_consolidated_txs changed accordingly 2024-03-27 15:59:57 +01:00
cryptozoidberg
e5afb6b0c6
in the middle of refactoring autodoc 2024-03-27 15:52:30 +01:00
cryptozoidberg
3d76415af2
merge from develop 2024-03-26 21:24:32 +01:00
cryptozoidberg
46a7c9662e
Merge branch 'release2' into develop 2024-03-26 21:16:28 +01:00
cryptozoidberg
d03f47a9c7
merge from develop 2024-03-26 21:14:16 +01:00
cryptozoidberg
582fe4c8b1
merge from release2 2024-03-26 21:11:42 +01:00
zano build machine
7d3e3ae358 === build number: 286 -> 287 === 2024-03-26 21:58:01 +03:00
sowle
e1d7ea6302
asset emission: 1) fixed simplewallet's emit_asset command; 2) wallet2:emit_asset() now fix destinations for asset emission ad-hoc (null_pkey); 3) typos corrected 2024-03-26 19:57:31 +01:00
sowle
c2fa968835
daemon: 1) print_asset_info command added; 2) print_tx greatly improved; 3) fill_tx_rpc_details() now fills blob and object_in_json fields and use base64 encoding 2024-03-26 19:55:34 +01:00
sowle
6740a0df28
tx pool: short tx listing improved 2024-03-26 19:52:30 +01:00
sowle
0015c8934d
KV_SERIALIZE_BLOB_AS_BASE64_STRING() implemented 2024-03-26 19:51:02 +01:00
cryptozoidberg
7f134072f6
minor changes in error messages(to avoid misleading) 2024-03-26 19:22:45 +01:00
cryptozoidberg
6311c2078f
fixed RANDOM_OUTPUTS_FOR_AMOUNTS_FLAGS_COINBASE and added RANDOM_OUTPUTS_FOR_AMOUNTS_FLAGS_POS_COINBASE for future use 2024-03-26 16:35:18 +01:00
zano build machine
cceeda0588 === build number: 285 -> 286 === 2024-03-26 14:05:22 +03:00
cryptozoidberg
9af876ccaa
decoy selection algo refactoring 2024-03-25 21:56:46 +01:00
sowle
360417c5fc
=== build number: 284 -> 285 === 2024-03-25 17:28:28 +01:00
sowle
d83ec66775
fixed a bug in prepare_tx_sources_for_defragmentation_tx() causing old dust outs to prevent staking 2024-03-25 17:21:02 +01:00
sowle
2eac22d626
utils: configuration scripts for msvc2022 2024-03-24 18:53:26 +01:00
cryptozoidberg
721b027000
merge from release2 2024-03-24 15:56:58 +01:00
cryptozoidberg
3fb4f16db9
fore get rid of WALLET_GLOBAL_OUTPUT_INDEX_UNDEFINED 2024-03-24 15:50:53 +01:00
cryptozoidberg
83968977a1
current fixes 2024-03-24 13:48:08 +01:00
cryptozoidberg
60bb74cbb0
more consistent documentation code is working now 2024-03-23 15:45:24 +01:00
sowle
37d260a519
Merge branch 'master' into develop 2024-03-23 01:34:02 +01:00
zano build machine
7c3e2cbc70 === build number: 283 -> 284 === 2024-03-23 03:32:49 +03:00
sowle
cd0a635535
Merge branch 'release2' 2024-03-23 01:31:54 +01:00
sowle
f7a98ed7d1
wallet2: scan_not_compliant_unconfirmed_txs 2024-03-23 00:34:03 +01:00
sowle
6c2b1becdf
Merge branch 'master' into develop 2024-03-22 23:21:26 +01:00
sowle
8ec5aebd3c
minor log improvement 2024-03-22 23:20:10 +01:00
cryptozoidberg
3acd7667bc
fix for uninitialized data on transaction details(including fee) in unconfirmed transactions 2024-03-22 18:44:31 +01:00
cryptozoidberg
256206af09
more code on autodoc descriptions 2024-03-22 13:54:46 +01:00
cryptozoidberg
5d004cde02
merge from master 2024-03-22 00:16:42 +01:00
sowle
35049c26f3
Merge branch 'master' into develop 2024-03-21 23:04:56 +01:00
zano build machine
63940b1d2f === build number: 282 -> 283 === 2024-03-22 01:02:38 +03:00
cryptozoidberg
09d08baecc
fixed consensus bug related to miners motivations to include transactions 2024-03-21 23:01:33 +01:00
cryptozoidberg
2283a77104
more work on json/descriptions improvements 2024-03-21 22:57:55 +01:00
sowle
3628f1e18d
Merge branch 'master' into develop
# Conflicts:
#	src/version.h.in
2024-03-21 20:33:10 +01:00
sowle
e11ee0fa07
tx_pool: remove HF4-incompatible txs on load 2024-03-21 19:52:18 +01:00
cryptozoidberg
919790e808
some temporary commits 2024-03-21 14:31:40 +01:00
zano build machine
8f68ef56e2 === build number: 280 -> 281 === 2024-03-21 13:44:13 +03:00
sowle
f13d3e7b35
Merge branch 'master' into develop 2024-03-21 11:43:53 +01:00
zano build machine
1f5c862168 === build number: 279 -> 280 === 2024-03-21 13:42:15 +03:00
sowle
6f6636103e
Merge branch 'master' into develop
# Conflicts:
#	src/version.h.in
2024-03-21 11:40:26 +01:00
cryptozoidberg
e51e56e825
Merge branch 'develop' into autodoc 2024-03-20 18:00:11 +01:00
cryptozoidberg
f15a8421f9
added call_wallet_rpc to avoid using of mw_select_wallet 2024-03-20 17:57:46 +01:00
cryptozoidberg
97c3460af8
autodoc inital code + cmake warningns + improvements over compilation performance 2024-03-20 14:45:29 +01:00
sowle
80e8392be0
code clean-up and logging improvements 2024-03-19 18:47:26 +01:00
zano build machine
5ba45867f7 === build number: 278 -> 279 === 2024-03-19 20:32:04 +03:00
sowle
1cffbaa9b8
ui update 2024-03-19 18:30:54 +01:00
cryptozoidberg
c03438ba23
fixed mw_get_wallets for simplewallet, fail-resistant whitelisti loading 2024-03-19 17:54:41 +01:00
cryptozoidberg
7a6883457b fix for MOBILE_WALLET_BUILD 2024-03-19 12:30:09 +00:00
sowle
1548ab662a
wallet2::get_current_tx_version() fixed 2024-03-19 01:40:45 +01:00
sowle
0455e81b4c
minor log improvement (take fee burning into account) 2024-03-19 01:35:36 +01:00
zano build machine
c14b5b6b21 === build number: 277 -> 278 === 2024-03-19 01:35:54 +03:00
zano build machine
30b6082ce5 === build number: 276 -> 277 === 2024-03-19 01:35:09 +03:00
cryptozoidberg
86e8446e42 Implemented JWT support in UI, multiple API improvements and fixes 2024-03-18 23:27:44 +01:00
zano build machine
2eb76a5fc8 === build number: 275 -> 276 === 2024-03-16 18:16:26 +03:00
sowle
7f851205a0
tx_pool: add post-HF4 txs are now being check for balance proof. Core test hard_fork_4_consolidated_txs changed accordingly 2024-03-16 14:57:25 +01:00
sowle
66cf29ccd3
coretests: hard_fork_2_alias_update_using_old_tx<> fixed 2024-03-15 19:58:44 +01:00
zano build machine
ad3b022fc1 === build number: 274 -> 275 === 2024-03-15 18:49:50 +03:00
cryptozoidberg
8c01aac391
Merge branch 'auth_impl' into develop 2024-03-15 16:47:54 +01:00
sowle
f538fc3a76
coretests: gen_crypted_attachments and fixed-hash tests 2024-03-14 22:04:38 +01:00
cryptozoidberg
ddbc8e2484
removed comment 2024-03-14 22:04:36 +01:00
cryptozoidberg
7e676e74e9
implemented JWT support in simplewallet 2024-03-14 21:55:22 +01:00
zano build machine
a8bfdc13ed === build number: 273 -> 274 === 2024-03-14 20:38:49 +03:00
sowle
724ce0ef1f
Merge branch 'release' into develop 2024-03-14 18:36:20 +01:00
sowle
d04abe0e48
fixed derivation hints for pre-HF4 consolidation txs 2024-03-14 18:28:47 +01:00
sowle
c5a55f1e85
coretests: hard_fork_4_consolidated_txs test finished, now it also checks derivation hints for normal and consolidated txs before and after HF4 2024-03-13 21:30:43 +01:00
sowle
41386a91c8
privacy improvement: one derivation hint per output (not per receiver as before) 2024-03-13 21:29:09 +01:00
sowle
b99bdb68df
wallet2: minor code cleanup 2024-03-13 21:26:39 +01:00
cryptozoidberg
bb3b893bd3
Merge branch 'develop' into auth_impl 2024-03-13 19:40:35 +01:00
cryptozoidberg
cf5e38e78f
implemented asset whitelisting RPC API 2024-03-13 18:36:53 +01:00
cryptozoidberg
21c1631825
auth basic r and d 2024-03-13 13:16:36 +01:00
zano build machine
2a33c5c7a0 === build number: 272 -> 273 === 2024-03-08 21:28:27 +03:00
cryptozoidberg
4ea976b887
latest UI 2024-03-06 19:10:42 +01:00
cryptozoidberg
1c1dc3d3e8
Merge branch 'master' into develop 2024-03-05 15:21:46 +01:00
sowle
82768a5538
Merge branch 'release' into develop 2024-02-26 18:13:45 +01:00
1340 changed files with 142807 additions and 90903 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

View file

@ -1,2 +1,8 @@
build
.github
.idea
docs
resources
snap
tests
CMakeUserPresets.json

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

2
.github/FUNDING.yml vendored
View file

@ -1,2 +0,0 @@
github: [letheanVPN]
open_collective: lthn

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

@ -0,0 +1,90 @@
# .github/actions/upload-artifacts/action.yml
name: 'Upload Artifacts'
description: 'Archives and uploads signed binaries to a GitHub release'
inputs:
chain-network:
required: true
description: 'The chain network name to use in filenames, mainnet or testnet'
assets:
description: "A EOL separated string list of filenames to archive; if asset is a abs path, it's respected"
required: false
asset-type:
required: true
description: 'The asset type: cli, gui, ANYTHING; used as a separator for different release packages for the same arch'
asset-directory:
required: true
description: "The directory where 7z's working dir will be set"
runs:
using: "composite"
steps:
- name: compute file name
id: asset
shell: bash
run: |
ARCH=${{ runner.arch }}
RUNNER_OS=${{ runner.os }}
LOWERCASE_ARCH=$(echo "$ARCH" | tr '[:upper:]' '[:lower:]')
TARGET_OS=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]')
FILENAME="${{ inputs.chain-network }}-${{ inputs.asset-type }}-${TARGET_OS}-${LOWERCASE_ARCH}"
echo "key=$FILENAME" >> $GITHUB_OUTPUT
VERSION=$(grep '^BUILD_VERSION:=' Makefile | cut -d'=' -f2)
# Check if a version was found
if [ -z "$VERSION" ]; then
echo "Error: BUILD_VERSION could not be found in the Makefile." >&2
exit 1
fi
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.
# This is the correct way to pass a multi-line string in GITHUB_OUTPUT.
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
# Iterate through each filename
echo "${{ inputs.assets }}" | while read -r file; do
if [[ -z "$file" ]]; then
continue
fi
# Check if the file is an absolute path
if [[ "$file" == /* ]] || [[ "$file" =~ ^[a-zA-Z]: ]]; then
FULL_PATH="$file"
else
# It's a relative path, so join it with the asset directory
if [[ "${{ runner.os }}" == "Windows" ]]; then
FULL_PATH="${{ inputs.asset-directory }}\\$file"
else
FULL_PATH="${{ inputs.asset-directory }}/$file"
fi
fi
echo "$FULL_PATH" >> "$GITHUB_OUTPUT"
done
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Upload Artifacts
uses: actions/upload-artifact@v4.6.2
with:
name: ${{ steps.asset.outputs.key }}
path: ${{ steps.asset.outputs.paths }}
- name: Make Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.asset.outputs.tag_name }}
prerelease: ${{ steps.asset.outputs.prerelease }}
files: ${{ inputs.asset-directory }}/*
target_commitish: ${{ github.sha }}

View file

@ -1,6 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

25
.github/workflows/_maint-cache.yml vendored Normal file
View file

@ -0,0 +1,25 @@
name: Clear all Github actions caches on sundays
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
# pull_request:
# types:
# - opened
# - synchronize
# - reopened
# branches:
# - dev
# - main
# paths-ignore:
# - '**.md'
jobs:
my-job:
name: Delete all caches
runs-on: ubuntu-24.04
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Clear caches
run: gh cache delete --all --repo ${{ github.repository }}

70
.github/workflows/_on-pr.yml vendored Normal file
View file

@ -0,0 +1,70 @@
name: PR
permissions:
contents: write
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
pull_request_review:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-linux-intel:
name: Linux
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-linux-intel.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-linux-arm:
name: Linux
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-linux-arm64.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-windows-intel:
name: Windows
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-windows-intel.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-arm64:
name: MacOS
uses: ./.github/workflows/build-macos-arm64.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-intel:
name: MacOS
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-macos-intel.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-docker:
name: Docker
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-docker.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-docs:
name: Docs
if: ${{!github.event.pull_request.draft}}
uses: ./.github/workflows/build-docs.yml

62
.github/workflows/_on-push.yml vendored Normal file
View file

@ -0,0 +1,62 @@
name: Push Compile
permissions:
contents: write
packages: write
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
branches:
- 'dev'
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux-intel:
name: Linux
uses: ./.github/workflows/build-linux-intel.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-linux-arm:
name: Linux
uses: ./.github/workflows/build-linux-arm64.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-windows-intel:
name: Windows
uses: ./.github/workflows/build-windows-intel.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-arm64:
name: MacOS
uses: ./.github/workflows/build-macos-arm64.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-intel:
name: MacOS
uses: ./.github/workflows/build-macos-intel.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-docker:
name: Docker
uses: ./.github/workflows/build-docker.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-docs:
name: Docs
uses: ./.github/workflows/build-docs.yml

83
.github/workflows/_on-release.yml vendored Normal file
View file

@ -0,0 +1,83 @@
name: Push Full Build
permissions:
contents: write
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
release:
types: [ published ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
determine-network:
runs-on: ubuntu-latest
outputs:
chain-network: ${{ steps.get_branch.outputs.chain_network }}
steps:
- name: Get release information from API
id: get_branch
run: |
# Use the GitHub CLI to get the release details by tag name
# The result is a JSON object
RELEASE_INFO=$(gh release view --json targetCommitish -t ${{ github.ref_name }})
# Extract the target commitish (the source branch)
SOURCE_BRANCH=$(echo "$RELEASE_INFO" | jq -r '.targetCommitish')
# Set the chain network based on the source branch
if [ "$SOURCE_BRANCH" == "dev" ]; then
echo "chain_network=testnet" >> $GITHUB_OUTPUT
else
echo "chain_network=mainnet" >> $GITHUB_OUTPUT
fi
echo "Source Branch: $SOURCE_BRANCH"
echo "Chain Network: ${{ steps.get_branch.outputs.chain_network }}"
build-linux-intel:
name: Chain
uses: ./.github/workflows/build-linux-intel.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-linux-arm:
name: Chain
uses: ./.github/workflows/build-linux-arm64.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-windows-intel:
name: Chain
uses: ./.github/workflows/build-windows-intel.yml
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-arm64:
name: Chain
uses: ./.github/workflows/build-macos-arm64.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-macos-intel:
name: Chain
uses: ./.github/workflows/build-macos-intel.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-docker:
name: Docker
uses: ./.github/workflows/build-docker.yml
secrets: inherit
with:
chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }}
build-docs:
name: Docs
uses: ./.github/workflows/build-docs.yml

54
.github/workflows/build-docker.yml vendored Normal file
View file

@ -0,0 +1,54 @@
name: Docker
permissions:
contents: read
on:
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
inputs:
chain-network:
description: "The network to use, can either be testnet, stagenet or mainnet"
default: testnet
required: false
type: string
jobs:
build:
name: "lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}"
runs-on: ubuntu-24.04
steps:
- name: Checkout Project
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
with:
file: utils/docker/lthn-chain/Dockerfile
context: ${{ github.workspace }}
push: true
build-args: |
BUILD_TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
THREADS=2
BUILD_LOCAL=1
tags: lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}

40
.github/workflows/build-docs.yml vendored Normal file
View file

@ -0,0 +1,40 @@
name: docs
permissions:
contents: write
on:
workflow_call:
jobs:
deploy:
name: Offline Local Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Cache SDK Folder
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- 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 mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin mkdocs-material[imaging]
- name: Build Offline Version
run: make docs
- name: CLI Artifacts
uses: ./.github/actions/upload-artifacts
with:
chain-network: ${{ inputs.chain-network }}
assets: "*"
asset-type: 'docs'
asset-directory: ${{ github.workspace }}/build/docs

90
.github/workflows/build-linux-arm64.yml vendored Normal file
View file

@ -0,0 +1,90 @@
name: Linux
permissions:
contents: write
on:
workflow_call:
inputs:
chain-network:
description: "The network to use, can either be testnet, stagenet or mainnet"
default: testnet
required: false
type: string
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:
name: compile-arm64
needs: cache
runs-on: ubuntu-22.04-arm
steps:
- name: Checkout Project
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: install dependencies
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
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Release
run: make ${{ inputs.chain-network }}
- name: CLI Artifacts
uses: ./.github/actions/upload-artifacts
with:
chain-network: ${{ inputs.chain-network }}
assets: lethean-*
asset-type: 'cli'
asset-directory: ${{ github.workspace }}/build/packages

90
.github/workflows/build-linux-intel.yml vendored Normal file
View file

@ -0,0 +1,90 @@
name: Linux
permissions:
contents: write
on:
workflow_call:
inputs:
chain-network:
description: "The network to use, can either be testnet, stagenet or mainnet"
default: testnet
required: false
type: string
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:
name: compile-x86_64
needs: cache
runs-on: ubuntu-22.04
steps:
- name: Checkout Project
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: install dependencies
run: sudo apt-get install -y autotools-dev git build-essential
- name: Cache SDK Folder
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Release
run: make ${{ inputs.chain-network }}
- name: CLI Artifacts
uses: ./.github/actions/upload-artifacts
with:
chain-network: ${{ inputs.chain-network }}
assets: lethean-*
asset-type: 'cli'
asset-directory: ${{ github.workspace }}/build/packages

85
.github/workflows/build-macos-arm64.yml vendored Normal file
View file

@ -0,0 +1,85 @@
name: build-macos-arm64
permissions:
contents: write
on:
workflow_call:
inputs:
chain-network:
description: "The network to use, can either be testnet, stagenet or mainnet"
default: testnet
required: false
type: string
jobs:
cache:
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
steps:
- name: Checkout Project
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: Cache SDK Folder
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Release
run: make ${{ inputs.chain-network }}
- name: CLI Artifacts
uses: ./.github/actions/upload-artifacts
with:
chain-network: ${{ inputs.chain-network }}
assets: lethean-*
asset-type: 'cli'
asset-directory: ${{ github.workspace }}/build/packages

81
.github/workflows/build-macos-intel.yml vendored Normal file
View file

@ -0,0 +1,81 @@
name: build-macos-intel
permissions:
contents: write
on:
workflow_call:
inputs:
chain-network:
description: "The network to use, can either be testnet, stagenet or mainnet"
default: testnet
required: false
type: string
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:
name: compile-x86_64
needs: cache
runs-on: macos-13
steps:
- name: Checkout Project
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: Cache SDK Folder
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Release
run: make ${{ inputs.chain-network }}
- name: CLI Artifacts
uses: ./.github/actions/upload-artifacts
with:
chain-network: ${{ inputs.chain-network }}
assets: lethean-*
asset-type: 'cli'
asset-directory: ${{ github.workspace }}/build/packages

View file

@ -0,0 +1,82 @@
name: build-windows
permissions:
contents: write
on:
workflow_call:
inputs:
chain-network:
description: "The network to use, can either be testnet, stagenet or mainnet"
default: testnet
required: false
type: string
jobs:
cache:
name: cache-x86_64
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:
- name: Checkout Project
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: Cache SDK Folder
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/build/sdk
${{ github.workspace }}/build/bin
key: ${{ runner.os }}-${{ runner.arch }}-sdk
- run: choco install nsis.install
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Compile Release
run: make ${{ inputs.chain-network }}
- name: CLI Artifacts
uses: ./.github/actions/upload-artifacts
with:
chain-network: ${{ inputs.chain-network }}
assets: lethean-*
asset-type: 'cli'
asset-directory: ${{ github.workspace }}/build/packages

View file

@ -1,247 +0,0 @@
name: cli-testnet
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
env:
CMAKE_OSX_SYSROOT: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.2.1.sdk"
CCACHE_SETTINGS: |
ccache --max-size=150M
ccache --set-config=compression=true
jobs:
compile:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest]
include:
- os: ubuntu-latest
target: linux-amd64
net: testnet
# - os: macos-11
# target: macos-amd64
# net: testnet
# - os: macos-12
# target: macos-amd64
# net: testnet
# - os: windows-2019
# target: windows-amd64
# net: testnet
env:
CCACHE_TEMPDIR: ${{ github.workspace }}/ccache
CONAN_HOME: "${{ github.workspace }}/build/"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
if: ${{ matrix.os == 'windows-2019' }}
name: setup msvc vcvars
- name: install dependencies
run: |
sudo apt update
sudo apt-get install -y git ccache
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
- name: Install autotools on macOS
run: brew install automake
if: ${{ matrix.os == 'macos-13' }}
- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/ccache
key: ccache-${{ runner.os }}-${{ matrix.target }}-build-testnet-cli
- name: Cache Conan
id: github-cache-conan
uses: actions/cache@v4
env:
cache-name: cache-conan-modules
with:
save-always: true
path: ${{ github.workspace }}/build/p
key: host-${{ runner.os }}-target-${{ matrix.target }}-${{ hashFiles('contrib/cmake/conanfile.py') }}
- name: Install Conan
run: pip install conan pytest && conan --version
- name: Setup CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.25.0"
ninjaVersion: "^1.11.1"
- name: Call make release-testnet
run: |
make ci-${{ matrix.target }}-testnet
- name: Release Tag
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: '*ethean-${{ matrix.target }}-cli.*'
- name: Release Branch
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/heads/iTw3')
with:
tag_name: canary
prerelease: true
files: '*ethean-${{ matrix.target }}-cli.*'
# linux-amd64:
# runs-on: ubuntu-20.04
# env:
# CCACHE_TEMPDIR: ${{ github.workspace }}/ccache
# steps:
# - name: Cancel Previous Runs
# uses: styfle/cancel-workflow-action@0.9.1
# with:
# access_token: ${{ github.token }}
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# submodules: recursive
# - uses: actions/cache@v3
# with:
# path: ${{ github.workspace }}/ccache
# key: ccache-${{ runner.os }}-build-testnet-cli
# restore-keys: ccache-${{ runner.os }}-build-testnet-cli
# - name: update apt
# run: sudo apt update
# - name: install dependencies
# run: sudo apt-get install -y python-dev autotools-dev libboost-all-dev libicu-dev libbz2-dev git screen checkinstall zlib1g-dev ccache miniupnpc
# - name: build server
# run: |
# ${{env.CCACHE_SETTINGS}}
# ./utils/build/testnet_linux_cli.sh
# - name: Move Tarball
# run: cd build/release && mv lethean-linux-cli-*.tar.bz2 ../../
# - uses: actions/upload-artifact@v3
# with:
# name: lethean-linux-cli
# if-no-files-found: error
# path: lethean-linux-cli-*.tar.bz2
# - name: Release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: ${{ github.workspace }}/testnet-lethean-linux-cli-*.tar.bz2
# - name: Release Tag
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: '*ethean-${{ matrix.target }}-cli.*'
# - name: Release Branch
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/heads/iTw3')
# with:
# tag_name: canary
# prerelease: true
# files: '*ethean-${{ matrix.target }}-cli.*'
# macos-amd64:
# runs-on: macos-latest
# env:
# CCACHE_TEMPDIR: ${{ github.workspace }}/ccache
# steps:
# - name: Cancel Previous Runs
# uses: styfle/cancel-workflow-action@0.9.1
# with:
# access_token: ${{ github.token }}
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# submodules: recursive
# - uses: actions/cache@v3
# with:
# path: ${{ github.workspace }}/ccache
# key: ccache-${{ runner.os }}-build-testnet-cli
# restore-keys: ccache-${{ runner.os }}-build-testnet-cli
# - name: install dependencies
# run: HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl boost icu4c ccache miniupnpc
# - name: build server
# env:
# PKG_CONFIG_PATH: "/usr/local/opt/openssl@3/lib/pkgconfig"
# OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3"
# ZANO_BOOST_ROOT: "/opt/homebrew/opt/boost"
# ZANO_BOOST_LIBS_PATH: "/opt/homebrew/opt/boost/lib"
# CMAKE_OSX_SYSROOT: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk"
# run: |
# ${{env.CCACHE_SETTINGS}}
# export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/opt/icu4c/lib
# ./utils/build/testnet_mac_osx_cli.sh
# - name: Move Tarball
# run: cd build/release && mv lethean-macos-cli-*.tar.bz2 ../../
# - uses: actions/upload-artifact@v3
# with:
# name: lethean-macos-cli
# if-no-files-found: error
# path: lethean-macos-cli-*.tar.bz2
# - name: Release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: ${{ github.workspace }}/lethean-macos-cli-*.tar.bz2
# windows-amd64:
# runs-on: windows-latest
# env:
# CCACHE_TEMPDIR: ${{ github.workspace }}/ccache
# steps:
# - name: Cancel Previous Runs
# uses: styfle/cancel-workflow-action@0.9.1
# with:
# access_token: ${{ github.token }}
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# submodules: recursive
# - uses: actions/cache@v3
# with:
# path: ${{ github.workspace }}/ccache
# key: ccache-${{ runner.os }}-build-testnet-cli
# restore-keys: ccache-${{ runner.os }}-build-testnet-cli
# - name: Eat the Choco
# run: |
# choco install ccache -y
# choco install zip -y
# - name: Cache Conan
# id: github-cache-conan
# uses: actions/cache@v4
# env:
# cache-name: cache-conan-modules
# with:
# save-always: true
# path: ${{ github.workspace }}\build\p
# key: host-${{ runner.os }}-target-windows-${{ hashFiles('contrib/cmake/conanfile.py') }}
# - name: install msvc toolset
# uses: ilammy/msvc-dev-cmd@v1
#
# - name: Set up Visual Studio shell
# uses: egor-tensin/vs-shell@v2
# with:
# arch: x64
# - name: build server
# env:
# CCACHE_TEMPDIR: ${{ github.workspace }}/ccache
# run: |
# ${{env.CCACHE_SETTINGS}}
# .\utils\build\testnet_windows_cli.bat
# - uses: actions/upload-artifact@v3
# with:
# name: lethean-windows-cli
# if-no-files-found: error
# path: ${{ github.workspace }}\lethean-win-cli-*.zip
# - name: Release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: |
# lethean-win-cli-*

View file

@ -1,67 +0,0 @@
name: chain-itw3:testnet
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
branches:
- main
tags:
- v*
paths-ignore:
- '**.md'
pull_request:
branches:
- main
tags:
- v*
paths-ignore:
- '**.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Login to GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build
if: ${{ github.event_name != 'pull_request' }}
uses: docker/build-push-action@v3
with:
context: .
file: utils/docker/Dockerfile
cache-to: ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.ref_name }}
cache-from: ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.ref_name }}
push: true
tags: lthn/chain:testnet-${{ github.ref_name }},ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.ref_name }}
- name: Docker Build
if: ${{ github.event_name == 'pull_request' }}
uses: docker/build-push-action@v3
with:
context: .
file: utils/docker/Dockerfile
cache-to: ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.head_ref }}
cache-from: ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.head_ref }}
push: true
tags: lthn/chain:testnet-${{ github.head_ref }},ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.head_ref }}

13
.gitignore vendored
View file

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

21
.gitmodules vendored
View file

@ -1,7 +1,18 @@
[submodule "contrib/miniupnp"]
path = contrib/miniupnp
url = https://github.com/miniupnp/miniupnp
[submodule "contrib/jwt-cpp"]
path = contrib/jwt-cpp
url = https://github.com/Thalhammer/jwt-cpp.git
[submodule "contrib/bitcoin-secp256k1"]
path = contrib/bitcoin-secp256k1
url = https://github.com/bitcoin-core/secp256k1.git
[submodule "contrib/tor-connect"]
path = contrib/tor-connect
url = https://github.com/letheanVPN/tor-connect.git
branch = main
url = https://github.com/hyle-team/tor-connect.git
[submodule "docs"]
path = docs
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

2
.idea/.name generated
View file

@ -1 +1 @@
Lethean
Lethean

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />

3
.idea/cmake.xml generated
View file

@ -2,8 +2,7 @@
<project version="4">
<component name="CMakeSharedSettings">
<configurations>
<configuration PROFILE_NAME="Debug" ENABLED="true" GENERATION_DIR="build/debug" CONFIG_NAME="Debug" GENERATION_OPTIONS="-G &quot;Unix Makefiles&quot; -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=&quot;contrib/cmake/conan_provider.cmake&quot;" />
<configuration PROFILE_NAME="Release" ENABLED="true" GENERATION_DIR="build/release" CONFIG_NAME="Release" GENERATION_OPTIONS="-G &quot;Unix Makefiles&quot; -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=&quot;contrib/cmake/conan_provider.cmake&quot;" />
<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>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CodeComments" version="1">
<comments />
</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>

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>

View file

@ -1,15 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="docker-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="lthn/chain-itw3:testnet" />
<option name="buildCliOptions" value="--platform linux/x86_64 --build-arg THREADS=4" />
<option name="buildKitEnabled" value="true" />
<option name="containerName" value="" />
<option name="contextFolderPath" value="." />
<option name="sourceFilePath" value="utils/docker/Dockerfile" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>

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>

7
.idea/vcs.xml generated
View file

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/contrib/miniupnp" vcs="Git" />
<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$/src/gui/qt-daemon/layout" 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,46 +1,16 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
message(STATUS "Using CMake version: ${CMAKE_VERSION}")
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake")
set(DISABLE_TOR TRUE CACHE BOOL "Disable TOR library(and related tor-connect submodule)")
PROJECT(Lethean)
option (USE_CCACHE "Use ccache if a usable instance is found" ON)
if (USE_CCACHE)
include(FindCcache) # Has to be included after the project() macro, to be able to read the CXX variable.
else()
message(STATUS "ccache deselected")
endif()
option (USE_COMPILATION_TIME_PROFILER "Use compilation time profiler (for CLang >= 9 only)" OFF)
if (USE_COMPILATION_TIME_PROFILER)
if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
message(FATAL_ERROR "The flag USE_COMPILATION_TIME_PROFILER is meant to be set only for CLang compiler!")
endif()
add_compile_options("-ftime-trace")
endif()
set(VERSION "1.0" CACHE STRING "Build version")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (${CMAKE_VERSION} VERSION_GREATER "3.0.0" AND CMAKE_MAKE_PROGRAM MATCHES "ninja")
set(CCACHE_PARALLEL_COMPILE_JOBS "" CACHE STRING "The maximum number of concurrent compilation jobs.")
if (CCACHE_PARALLEL_COMPILE_JOBS)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${CCACHE_PARALLEL_COMPILE_JOBS})
set(CMAKE_JOB_POOL_COMPILE compile_job_pool)
endif ()
set(CCACHE_PARALLEL_LINK_JOBS "" CACHE STRING "The maximum number of concurrent link jobs.")
if (CCACHE_PARALLEL_LINK_JOBS)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${CCACHE_PARALLEL_LINK_JOBS})
set(CMAKE_JOB_POOL_LINK link_job_pool)
endif ()
endif ()
message("OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}")
message("OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}")
message("OPENSSL_SSL_LIBRARY: ${OPENSSL_SSL_LIBRARY}")
set(VERSION "1.0")
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/.core/build/cmake")
if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW)
@ -48,18 +18,30 @@ endif()
if(POLICY CMP0043)
cmake_policy(SET CMP0074 NEW)
endif()
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif()
if(POLICY CMP0167)
cmake_policy(SET CMP0167 OLD)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(DocBuilder)
option (USE_CCACHE "Use ccache if a usable instance is found" OFF)
if (USE_CCACHE)
include(FindCcache)
else()
message(STATUS "ccache deselected")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
add_definitions(-DMOBILE_WALLET_BUILD)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS" )
add_definitions(-DIOS_BUILD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fembed-bitcode")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fembed-bitcode")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fembed-bitcode -Wno-enum-constexpr-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fembed-bitcode -Wno-enum-constexpr-conversion")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
add_definitions(-DANDROID_BUILD)
@ -80,7 +62,7 @@ if (UNIX AND NOT APPLE)
else()
# multi configurations for MSVC and XCode
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_CONFIGURATION_TYPES "Release")
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
else()
@ -96,36 +78,29 @@ find_package(OpenSSL REQUIRED)
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "Minimum OS X deployment version")
set(CMAKE_OSX_DEPLOYMENT_TARGET 12.0)
endif()
set(USE_PCH FALSE CACHE BOOL "Use shared precompiled headers")
set(DISABLE_TOR FALSE CACHE BOOL "Disable TOR library(and related tor-connect submodule)")
set(TESTNET FALSE CACHE BOOL "Compile for testnet")
set(MUTE_ERRORS TRUE CACHE BOOL "Disable Error Suppression")
set(TESTNET 0 CACHE BOOL "Build TESTNET")
set(BUILD_GUI FALSE CACHE BOOL "Build qt-daemon")
include_directories(src contrib/eos_portable_archive contrib contrib/epee/include ${OPENSSL_INCLUDE_DIR} "${CMAKE_BINARY_DIR}/version" "${CMAKE_BINARY_DIR}/contrib/zlib")
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)
add_definitions(-DUSE_OPEN_SSL_FOR_ECDSA)
endif()
add_definitions(-DSTATICLIB)
if(TESTNET)
message("!!!!!! NOTICE: Project is building for TESTNET !!!!!!")
add_definitions(-DTESTNET)
if(MUTE_ERRORS)
# shhhhh sleepy time errors, we know...
add_definitions(-w)
endif()
else()
if(MUTE_ERRORS)
# shhhhh sleepy time errors, we know...
add_definitions(-w)
endif()
endif()
if(CAKEWALLET)
message("NOTICE: Building libraries for CAKEWALLET")
add_definitions(-DCAKEWALLET)
add_definitions(-DDISABLE_PFR_SERIALIZATION_SELFCHECK)
endif()
set(OPENSSL_USE_STATIC_LIBS TRUE) # link statically
@ -137,10 +112,6 @@ if(DISABLE_TOR)
endif()
include_directories(src contrib/eos_portable_archive contrib contrib/epee/include "${CMAKE_BINARY_DIR}/version" "${CMAKE_BINARY_DIR}/contrib/zlib")
add_definitions(-DSTATICLIB)
set(STATIC ${MSVC} CACHE BOOL "Link libraries statically")
if (UNIX AND NOT APPLE)
# Note that at the time of this writing the -Wstrict-prototypes flag added below will make this fail
@ -153,12 +124,15 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
endif()
add_definitions("/DBOOST_NO_CXX98_FUNCTION_BASE")
add_definitions("/DBOOST_NO_CXX98_FUNCTION_BASE")
if(WIN32)
add_definitions(-DBOOST_ALL_NO_LIB)
endif()
if(MSVC)
add_definitions("/D_CRT_SECURE_NO_WARNINGS /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0")
add_compile_options(/bigobj /Zm1000 /Z7 /MP2 /W3 /GS- /wd4996 /wd4503 /wd4345 /wd4091 /FIinline_c.h)
add_compile_options(/EHa /bigobj /Zm1000 /Z7 /MP2 /W3 /GS- /wd4996 /wd4503 /wd4345 /wd4091 /FIinline_c.h)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10485760 /DEBUG dbghelp.lib crypt32.lib")
if(STATIC)
foreach(VAR CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE)
@ -166,6 +140,7 @@ if(MSVC)
endforeach()
endif()
include_directories(SYSTEM src/platform/msc)
else()
set(ARCH default CACHE STRING "CPU to build for: -march value or default")
if("${ARCH}" STREQUAL "default")
@ -180,7 +155,7 @@ else()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(WARNINGS "${WARNINGS} -Wno-implicit-function-declaration -Wno-shift-count-overflow -Wno-error=mismatched-tags -Wno-error=null-conversion -Wno-overloaded-shift-op-parentheses -Wno-error=shift-count-overflow -Wno-error=tautological-constant-out-of-range-compare -Wno-error=unused-private-field -Wno-error=unneeded-internal-declaration")
else()
set(WARNINGS "${WARNINGS} -Wno-error=write-strings -Wlogical-op -Wno-error=maybe-uninitialized")
set(WARNINGS "${WARNINGS} -Wno-error=write-strings -Wno-error=uninitialized")
endif()
# Since gcc 4.9 the LTO format is non-standard (slim), so we need the gcc-specific ar and ranlib binaries
@ -207,7 +182,7 @@ else()
endif()
set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wstrict-prototypes -Wno-comment")
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)
set(STATIC_ASSERT_FLAG "")
else()
@ -220,6 +195,7 @@ else()
set(LLVM_USE_LINKER "gold")
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
link_libraries("$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:-lstdc++fs>") # GCC < 9 requires additional linking for std::filesystem. Remove after stop supporting GCC 8.x -- sowle
endif()
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8))
@ -227,21 +203,21 @@ else()
else()
set(DEBUG_FLAGS "-g3 -O0")
endif()
set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable")
set(RELEASE_FLAGS "-O3 -ffast-math -DNDEBUG -w")
if(NOT APPLE AND NOT (CMAKE_SYSTEM_NAME STREQUAL "Android"))
set(RELEASE_FLAGS "${RELEASE_FLAGS} -flto")
set(RELEASE_FLAGS "${RELEASE_FLAGS} -flto=auto -g3")
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT MINGW)
set(RELEASE_FLAGS "${RELEASE_FLAGS} -fno-fat-lto-objects")
endif()
#if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT MINGW)
# set(RELEASE_FLAGS "${RELEASE_FLAGS} -fno-fat-lto-objects")
#endif()
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_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_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}")
if(STATIC)
if(APPLE)
# message(SEND_ERROR "Static build is not supported on MacOS X")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
endif()
@ -249,68 +225,51 @@ else()
endif()
# always use local Boost installation rather than the system-wide (unless ZANO_USE_SYSTEM_BOOST is defined for some reason, which is not recommended)
if(NOT DEFINED ENV{ZANO_USE_SYSTEM_BOOST})
set(Boost_NO_SYSTEM_PATHS ON)
endif()
if(MSVC)
# Link Boost statically, consistent with previous setup
if(MSVC OR STATIC)
set(Boost_USE_STATIC_LIBS ON)
if (MSVC)
set(Boost_USE_MULTITHREADED ON)
endif ()
endif()
if(STATIC)
set(Boost_USE_STATIC_LIBS ON)
# set(Boost_USE_STATIC_RUNTIME ON)
set(Boost_USE_STATIC_RUNTIME ON)
endif()
message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_OSX_DEPLOYMENT_TARGET 12.00)
set(Boost_LIBRARIES "libboost.a")
#workaround for new XCode 12 policy for builds(now it includes a slice for the "arm64" when builds for simulator)
set(__iphoneos_archs "arm64")
set(__iphonesimulator_archs "x86_64")
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}")
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}")
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "${__iphonesimulator_archs}")
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "${__iphonesimulator_archs}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(Boost_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}/${CMAKE_ANDROID_ARCH_ABI}/")
set(Boost_LIBRARIES "${Boost_LIBRARY_DIRS}libboost_system.a;${Boost_LIBRARY_DIRS}libboost_filesystem.a;${Boost_LIBRARY_DIRS}libboost_thread.a;${Boost_LIBRARY_DIRS}libboost_timer.a;${Boost_LIBRARY_DIRS}libboost_date_time.a;${Boost_LIBRARY_DIRS}libboost_chrono.a;${Boost_LIBRARY_DIRS}libboost_regex.a;${Boost_LIBRARY_DIRS}libboost_serialization.a;${Boost_LIBRARY_DIRS}libboost_atomic.a;${Boost_LIBRARY_DIRS}libboost_program_options.a")
elseif(APPLE)
find_package(Boost 1.71 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale)
else()
find_package(Boost 1.70 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale log)
# Define Boost components
set(BOOST_COMPONENTS system filesystem locale thread timer date_time chrono regex serialization atomic program_options)
if(NOT APPLE)
list(APPEND BOOST_COMPONENTS log)
endif()
message(STATUS "Using Boost ${Boost_VERSION} from Conan")
find_package(miniupnpc REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
include_directories(src "${CMAKE_BINARY_DIR}/version")
message(STATUS "Boost: ${Boost_VERSION} from ${Boost_LIBRARY_DIRS}")
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
)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/contrib/ethereum/libethash)
# Append other needed libraries
if(MINGW)
set(Boost_LIBRARIES "${Boost_LIBRARIES};ws2_32;mswsock")
elseif(NOT MSVC)
if(NOT APPLE)
set(Boost_LIBRARIES "${Boost_LIBRARIES};")
if(STATIC)
message("NOTICE: Including static ICU libraries")
set(Boost_LIBRARIES "${Boost_LIBRARIES};icui18n.a;icuuc.a;icudata.a;dl")
endif()
endif()
list(APPEND Boost_LIBRARIES ws2_32 mswsock)
elseif(NOT MSVC AND NOT APPLE AND NOT CAKEWALLET AND STATIC)
message("NOTICE: Including static ICU libraries")
list(APPEND Boost_LIBRARIES icui18n.a icuuc.a icudata.a dl)
endif()
if(BUILD_GUI)
cmake_minimum_required(VERSION 3.1)
if(APPLE AND NOT CMAKE_PREFIX_PATH)
execute_process(COMMAND brew --prefix qt5 OUTPUT_VARIABLE QT5_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
list(APPEND CMAKE_PREFIX_PATH ${QT5_DIR})
endif()
find_package(Qt5Widgets REQUIRED)
endif()
set(COMMIT_ID_IN_VERSION ON CACHE BOOL "Include commit ID in version")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/version")
@ -351,3 +310,5 @@ add_subdirectory(src)
if (BUILD_TESTS)
add_subdirectory(tests)
endif()
include(CPackConfig)

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"
}
]
}
]
}

View file

@ -1,2 +0,0 @@
* @snider
docs/* @snider @bodane

9
ConanPresets.json Normal file
View file

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

View file

@ -284,4 +284,5 @@ the rights granted in Article 2 of this Licence and protect the covered Source
Code from exclusive appropriation.
All other changes or additions to this Appendix require the production of a new
EUPL version.
EUPL version.

268
Makefile
View file

@ -1,150 +1,196 @@
# Copyright (c) 2017-2025 Lethean https://lt.hn
# Copyright (c) 2014-2019 Zano Project
# Copyright (c) 2014 The Cryptonote developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Define CMake generator
system := $(shell uname)
ifneq (, $(findstring MINGW, $(system)))
cmake_gen = -G 'MSYS Makefiles'
# ============================================================
# 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,
# macOS, BSD, and Windows (both cmd.exe and PowerShell).
# ------------------------------------------------------------
UNAME_S := $(shell uname -s 2>/dev/null || echo Unknown)
ifeq ($(UNAME_S),Linux)
CPU_CORES := $(shell nproc 2>/dev/null || \
grep -c ^processor /proc/cpuinfo 2>/dev/null || echo 1)
endif
cmake = cmake $(cmake_gen)
ifeq ($(UNAME_S),Darwin)
CPU_CORES := $(shell sysctl -n hw.logicalcpu 2>/dev/null || echo 1)
endif
cmake_debug = $(cmake) -D CMAKE_BUILD_TYPE=Debug -D MUTE_ERRORS=FALSE
cmake_release = $(cmake) -D CMAKE_BUILD_TYPE=Release -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=contrib/cmake/conan_provider.cmake
ifeq ($(filter %BSD,$(UNAME_S)),%BSD)
CPU_CORES := $(shell sysctl -n hw.ncpu 2>/dev/null || echo 1)
endif
cmake_testnet = -D TESTNET=ON -D BUILD_TESTS=OFF
cmake_static = -D STATIC=ON
cmake_tests = -D BUILD_TESTS=ON -D TESTNET=ON
ifeq ($(OS),Windows_NT)
PRESET_CONFIGURE:=conan-default
# Helper macro
define CMAKE
mkdir -p $1 && cd $1 && $2 ../../
endef
CPU_CORES := $(NUMBER_OF_PROCESSORS)
build = build
dir_debug = $(build)/debug
dir_release = $(build)/release
current_dir := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
export CONAN_HOME = $(current_dir)$(build)
ifeq ($(CPU_CORES),)
CPU_CORES := $(shell powershell -NoProfile -Command ^ "[Environment]::ProcessorCount")
endif
endif
conan_profile_linux = $(CONAN_HOME)/profiles/linux-amd64
conan_profile_windows = $(CONAN_HOME)/profiles/windows-amd64
conan_toolchain = -DCMAKE_TOOLCHAIN_FILE=./build/release/conan/build/Release/generators/conan_toolchain.cmake
# Safety net
CPU_CORES := $(or $(CPU_CORES),1)
CPU_CORES := $(shell expr $(CPU_CORES) + 0 2>/dev/null || echo 1)
CONAN_CPU_COUNT=$(CPU_CORES)
# ============================================================
# Paths — profiles and cmake modules from .build submodule
# ============================================================
PROFILES :=$(patsubst $(CMAKE_DIR)/profiles/%,%,$(wildcard $(CMAKE_DIR)/profiles/*))
SORTED_PROFILES :=$(sort $(PROFILES))
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
release: ## Build release non-static binaries
$(eval command += $(cmake_release))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
testnet:
$(MAKE) configure TESTNET=1 STATIC=$(STATIC)
CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) build .
$(MAKE) package
release-testnet: ## Build testnet non-static binaries
$(eval command += $(cmake_release) $(cmake_testnet))
$(call CMAKE,$(dir_release),$(command)) && "$(MAKE)"
mainnet:
$(MAKE) configure TESTNET=0 STATIC=$(STATIC)
CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) build .
$(MAKE) package
debug:
$(eval command += $(cmake_debug))
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE)
release: docs build
(cd $(BUILD_FOLDER) && cpack)
@rm -rf $(CURDIR)/build/packages/_CPack_Packages
debug-testnet:
$(eval command += $(cmake_debug) $(cmake_testnet))
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE)
build: configure
cmake --build --preset $(PRESET_BUILD) --parallel=$(CPU_CORES)
static: static-release
static-release: ## Build release static binaries
$(eval command += $(cmake_release) $(cmake_static))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
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)
static-release-testnet: ## Build testnet release static binaries
$(eval command += $(cmake_release) $(cmake_static) $(cmake_testnet))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
package:
@echo "Packaging: $(BUILD_TYPE) testnet=$(TESTNET)"
(cd $(BUILD_FOLDER) && cpack)
ifneq ($(OS),Windows_NT)
@rm -rf $(CURDIR)/build/packages/_CPack_Packages
endif
#
# CI
#
configure: build-deps
@echo "Running Configure: $(BUILD_TYPE) testnet=$(TESTNET)"
cmake --preset $(PRESET_CONFIGURE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
ci-package-linux:
@rm -fr lethean && mkdir -p lethean
@cp -r build/release/src/letheand lethean/letheand
@cp -r build/release/src/lethean-wallet lethean/lethean-wallet
@chmod +x lethean/lethean*
docs: configure
@echo "Building Documentation"
cmake --build build/release --target=docs --config=Release --parallel=$(CPU_CORES)
ci-package-windows:
@rm -fr lethean && mkdir -p lethean
@cp -r build\\release\\src\\letheand.exe lethean\\letheand.exe
@cp -r build\\release\\src\\lethean-wallet.exe lethean\\lethean-wallet.exe
sdk:
$(MAKE) -C utils/sdk $(filter-out $@,$(MAKECMDGOALS)) PACKAGE_VERSION=$(BUILD_VERSION)
ci-windows-amd64-release: static-release ci-package-windows ## Build lethean-windows-amd64-cli.tar.bz2
@tar -cjvf lethean-windows-amd64-cli.tar.bz2 lethean/
# Rule for each profile — uses .build/cmake/profiles/
$(PROFILES): conan-profile-detect
@echo "Building profile: $@"
CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) install . -pr:h=$(CMAKE_DIR)/profiles/$@ --build=missing -s build_type=$(BUILD_TYPE)
cmake -S . -B $(BUILD_FOLDER) -DCMAKE_TOOLCHAIN_FILE=$(BUILD_FOLDER)/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
cmake --build $(BUILD_FOLDER) --config=$(BUILD_TYPE) --parallel=$(CPU_CORES)
(cd $(BUILD_FOLDER) && cpack)
ci-linux-amd64-release: static-release ci-package-linux ## Build lethean-linux-amd64-cli.tar.bz2
@tar -cjvf lethean-linux-amd64-cli.tar.bz2 lethean/
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:"
@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 testnet" "Build testnet"
@printf " %-42s %s\n" "make mainnet" "Build mainnet"
@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-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 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";)
@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"
ci-macos-amd64-release: static-release ci-package-linux ## Build lethean-macos-amd64-cli.tar.bz2
@tar -cjvf lethean-macos-amd64-cli.tar.bz2 lethean/
ci-macos-arm64-release: static-release ci-package-linux ## Build lethean-macos-arm64-cli.tar.bz2
@tar -cjvf lethean-macos-arm64-cli.tar.bz2 lethean/
ci-linux-amd64-testnet: ## Build testnet-lethean-linux-amd64-cli.tar.bz2
conan install ./contrib/cmake -of=./build/release/conan --profile:build=$(conan_profile_linux) --profile:host=$(conan_profile_linux) --build=missing
(cd build/release && cmake ../../ -DCMAKE_BUILD_TYPE=Release $(conan_toolchain) $(cmake_static) $(cmake_testnet))
(cd build/release && cmake --build .)
@rm -fr lethean && mkdir -p lethean
@cp -r build/release/src/letheand lethean/letheand
@cp -r build/release/src/lethean-wallet lethean/lethean-wallet
@chmod +x lethean/lethean*
@tar -cjvf testnet-lethean-linux-amd64-cli.tar.bz2 lethean/
ci-windows-amd64-testnet: ## Build testnet-lethean-windows-amd64-cli.tar.bz2
conan install ./contrib/cmake -of=./build/release/conan --profile:build=$(conan_profile_windows) --profile:host=$(conan_profile_windows) --build=missing
(cd build/release && cmake ../../ -DCMAKE_BUILD_TYPE=Release $(conan_toolchain) $(cmake_static) $(cmake_testnet))
(cd build/release && cmake --build .)
@rm -fr lethean && mkdir -p lethean
@cp -r build/release/src/letheand lethean/letheand
@cp -r build/release/src/lethean-wallet lethean/lethean-wallet
@chmod +x lethean/lethean*
@tar -cjvf testnet-lethean-windows-amd64-cli.tar.bz2 lethean/
ci-macos-amd64-testnet: static-release-testnet ci-package-linux ## Build testnet-lethean-macos-amd64-cli.tar.bz2
@tar -cjvf testnet-lethean-macos-amd64-cli.tar.bz2 lethean/
ci-macos-arm64-testnet: static-release-testnet ci-package-linux ## Build testnet-lethean-macos-arm64-cli.tar.bz2
@tar -cjvf testnet-lethean-macos-arm64-cli.tar.bz2 lethean/
conan:
@conan config install contrib/cmake/settings_user.yml
#
# Tests
#
test: test-release
test-release:
$(eval command += $(cmake_release) $(cmake_tests))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE) && $(MAKE) test
@echo "Building profile: test-release"
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 --build build/test-release --config=Release --parallel=$(CPU_CORES)
$(MAKE) test
test-debug:
$(eval command += $(cmake_debug) $(cmake_tests))
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE) && $(MAKE) test
@echo "Building profile: test-debug"
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 --build build/test-debug --config=Debug --parallel=$(CPU_CORES)
$(MAKE) test
# Conan management — cmake modules from .build submodule
conan-get:
cmake -P $(CMAKE_DIR)/ConanGet.cmake
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
conan-upload:
CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) upload "*" -r=conan_build --confirm
conan-profile-detect: conan-get
cmake -P $(CMAKE_DIR)/ConanProfileSetup.cmake
docs-dev: configure
@echo "Building Documentation"
cmake --build build/release --target=serve_docs --config=Release
$(SDK_TARGETS):
@# This is a proxy target. Handled by the 'sdk' rule.
clean:
rm -rf ./build/release/ ./build/debug/
@cmake -P $(CMAKE_DIR)/CleanBuild.cmake
macos-gui:
bash ./utils/build/testnet_mac_osx_gui.sh
clean-build: clean
rm -rf build
tags:
ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest
help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m make %-30s\033[0m %s\n", $$1, $$2}'
.PHONY: all release debug static static-release gui gui-release gui-static gui-release-static gui-debug test test-release test-debug clean tags macos-gui ci-testnet ci-release
.PHONY: ci-package-linux ci-linux-amd64-release ci-macos-amd64-release ci-macos-arm64-release ci-linux-amd64-testnet ci-macos-amd64-testnet ci-macos-arm64-testnet
.PHONY: ci-package-windows ci-windows-amd64-release ci-windows-amd64-testnet
.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)

246
README.md
View file

@ -1,194 +1,120 @@
# Addresses
# Lethean Network—Ethics, Encoded.
- `iT`/`0x73f7` - Main prefix
- `iTH`/`0x6af7` - integrated paymennt_id address prefix
- `iTHn`/`0xdeaf7` - auditable wallet address
- `iTHa`/`0x7eaf7` - auditable integrated paymennt_id address prefix
> We are building upto a mainnet launch in 2026, documentation written as if mainnet is live.
## Ports
A buildkit for deploying confidential information networks and commerce systems with immutable auditability.
- STRATUM: `36941`
- RPC: `36942`
- P2P: `36943`
## Cloning
Free for commercial, private, and patent use, self-host or join the community-run network that guarantees participant sovereignty by design.
Be sure to clone the repository properly:\
`$ git clone --recursive https://github.com/letheanVPN/blockchain-iTw3.git`
# Building
--------
[![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
| component / version | minimum <br>(not recommended but may work) | recommended | most recent of what we have ever tested |
|--|--|--|--|
| gcc (Linux) | 5.4.0 | 9.4.0 | 12.3.0 |
| llvm/clang (Linux) | UNKNOWN | 7.0.1 | 8.0.0 |
| [MSVC](https://visualstudio.microsoft.com/downloads/) (Windows) | 2017 (15.9.30) | 2017 (15.9.30) | 2022 (17.7.5) |
| [XCode](https://developer.apple.com/downloads/) (macOS) | 12.3 | 14.3 | 14.3 |
| [CMake](https://cmake.org/download/) | 3.15.5 | 3.22.1 | 3.26.3 |
| [Boost](https://www.boost.org/users/download/) | 1.70 | 1.70 | 1.76 |
| [OpenSSL](https://www.openssl.org/source/) [(win)](https://slproweb.com/products/Win32OpenSSL.html) | 1.1.1n | 1.1.1w | 1.1.1w |
| [Qt](https://download.qt.io/archive/qt/) (*only for GUI*) | 5.8.0 | 5.11.2 | 5.15.2 |
| 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 |
| 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) |
| [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 |
Note:\
[*server version*] denotes steps required for building command-line tools (daemon, simplewallet, etc.).\
[*GUI version*] denotes steps required for building LTHN executable with GUI.
## Cloning
<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*]
sudo apt-get install -y build-essential g++ curl autotools-dev libicu-dev libbz2-dev cmake git screen checkinstall zlib1g-dev
[*GUI 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++ python-dev autotools-dev libicu-dev libbz2-dev cmake git screen checkinstall zlib1g-dev 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.
2. Clone Zano into a local folder\
(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
To skip the packing step, use `make build` as defined in the section below for Advanced Build Customization
In the following steps we assume that you cloned Zano into '~/zano' folder in your home directory.
## Simple Workflow Builds (Recommended)
3. Download and build Boost\
(Assuming you have cloned Zano into the 'zano' folder. If you used a different location for Zano, **edit line 4** accordingly.)
For most use cases, these two commands are all you need. They handle the entire build process from start to finish.
curl -OL https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.tar.bz2
echo "430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778 boost_1_70_0.tar.bz2" | shasum -c && tar -xjf boost_1_70_0.tar.bz2
rm boost_1_70_0.tar.bz2 && cd boost_1_70_0
patch -p0 < ../zano/utils/boost_1.70_gcc_8.patch || cd ..
./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.
* **Build for Mainnet:**
```shell
make mainnet
```
4. Install Qt\
(*GUI version only, skip this step if you're building server version*)
* **Build for Testnet:**
```shell
make testnet
```
[*GUI version*]
## Creating Release Packages
curl -OL https://download.qt.io/new_archive/qt/5.11/5.11.2/qt-opensource-linux-x64-5.11.2.run
chmod +x qt-opensource-linux-x64-5.11.2.run
./qt-opensource-linux-x64-5.11.2.run
Then follow the instructions in Wizard. Don't forget to tick the WebEngine module checkbox!
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.
```shell
make release TESTNET=1
```
The final packages will be located in the `build/packages/` directory
5. Install OpenSSL
## Advanced Build Customization (Makefile Variables)
We recommend installing OpenSSL v1.1.1w locally unless you would like to use the same version system-wide.\
(Assuming that `$HOME` environment variable is set to your home directory. Otherwise, edit line 4 accordingly.)
For advanced use cases, you can override variables in the `Makefile` to customize the build process.
curl -OL https://www.openssl.org/source/openssl-1.1.1w.tar.gz
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 ..
* **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
```
| Variable | Description | Default Value |
|--------------------|------------------------------------------------------------------------|-------------------------|
| `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. | |
6. [*OPTIONAL*] Set global environment variables for convenient use\
For instance, by adding the following lines to `~/.bashrc`
## Cleaning the Build Directory
[*server version*]
ALWAYS USE `make clean` to clean the build directory, manually deleting the `build/release`, `build/SOME_FOLDER` will cause you issues.
export BOOST_ROOT=/home/user/boost_1_70_0
export OPENSSL_ROOT_DIR=/home/user/openssl
Our `make clean` triggers a cmake script that completely resets the build directory &amp; dynamically added CMakePresets to its cached warm-up state,
the selective clean script can be edited here: `cmake/CleanBuild.cmake` or directly run from the repo root `cmake -P cmake/CleanBuild.cmake`
You can NUKE the build directory with `make clean-build` which is `rm -rf build`.
[*GUI version*]
If you do manually delete build folders and get CMake errors (if you have compiled anything previously, you will),
the ConanPresets.json file has entries in the `include` property, delete them all and try again.
export BOOST_ROOT=/home/user/boost_1_70_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_70_0 OPENSSL_ROOT_DIR=$HOME/openssl cmake ..
make -j1 daemon simplewallet
cd lthn/ && make -j1
or
cd lthn && 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 lthn
utils/build_script_linux.sh
Look for the binaries in `build` folder
<br />
### Windows
Recommended OS versions: Windows 7+ x64, Windows 11 x64.
1. Install [Chocolatey](https://chocolatey.org/install)
2. Install required prerequisites (Boost, Qt, CMake, OpenSSL).
_NOTE: At time of writing the following versions were available on Chocolatey_
```
choco install boost-msvc-14.2 --version 1.74.0 -y
choco install qt5-default --version 5.15.2.20211228 -y
choco install cmake --version 3.23.1 -y
choco install openssl --version 1.1.1.1500 -y
```
3. Clone repository, then complete the following:
1. Edit paths in file `utils/configure_local_paths.cmd.example`.
2. Rename `configure_local_paths.cmd.example` to `configure_local_paths.cmd` (do not commit).
4. Run one of `utils/configure_win64_msvsNNNN_gui.cmd` according to your MSVC version.
5. Go to the build folder and open generated Zano.sln in MSVC.
6. Build.
In order to correctly deploy Qt GUI application, you also need to do the following:
6. Copy Lethean.exe to a folder (e.g. `depoy`).
7. Run `PATH_TO_QT\bin\windeployqt.exe deploy\Lethean.exe`.
8. Copy folder `\src\gui\qt-daemon\html` to `deploy\html`.
9. Now you can run `Lethean.exe`
<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 “LetheanVPN” (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 "LetheanVPN". 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`
This happens because CMakePresets.json includes ConanPresets.json, that has the list of toolchains to use that gets populated during the CMake config step,
when you manually delete a folder, the toolchain is now a broken path, and CMake throws a fatal error.

View file

@ -1,8 +0,0 @@
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux

View file

@ -1,8 +0,0 @@
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.version=193
os=Windows

View file

@ -1,5 +0,0 @@
compiler:
gcc:
version: ["9.4.0","11.4.0"]
apple-clang:
version: ["13.0.0.13000029", "14.0.0.14000029", "15.0.0.15000040", "15.0.0.15000309"]

View file

@ -3,4 +3,4 @@
static_assert(1, "FAIL");
int main(int argc, char *argv[]) {
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,12 +1,23 @@
set(UPNPC_BUILD_STATIC ON CACHE BOOL "Build static library")
set(UPNPC_BUILD_SHARED OFF CACHE BOOL "Build shared library")
set(UPNPC_BUILD_TESTS OFF CACHE BOOL "Build test executables")
add_subdirectory(zlib)
add_subdirectory(db)
add_subdirectory(ethereum)
add_subdirectory(randomx)
if( NOT DISABLE_TOR)
add_subdirectory(tor-connect)
if(USE_BITCOIN_SECP256K1_FOR_ECDSA)
option(SECP256K1_BUILD_BENCHMARK "Build benchmarks." OFF)
option(SECP256K1_BUILD_TESTS "Build tests." OFF)
option(SECP256K1_BUILD_EXHAUSTIVE_TESTS "Build exhaustive tests." OFF)
option(SECP256K1_BUILD_CTIME_TESTS "Build constant-time tests." OFF)
option(SECP256K1_BUILD_EXAMPLES "Build examples." OFF)
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
if(STATIC)
set(SECP256K1_DISABLE_SHARED ON CACHE BOOL "Disable shared library for secp256k1")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build static libraries by default" FORCE)
endif()
add_subdirectory(bitcoin-secp256k1)
set_property(TARGET secp256k1 PROPERTY FOLDER "contrib")
set_property(TARGET secp256k1_precomputed PROPERTY FOLDER "contrib")
endif()
@ -15,46 +26,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
return()
endif()
find_package(Miniupnpc REQUIRED)
message(STATUS "Using in-tree miniupnpc")
set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
add_subdirectory(miniupnp/miniupnpc)
set_property(TARGET libminiupnpc-static PROPERTY FOLDER "contrib")
set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON)
if(MSVC)
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
elseif(NOT MSVC)
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE")
endif()
set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
#set_property(TARGET libminiupnpc-static PROPERTY FOLDER "contrib")
set_property(TARGET zlibstatic PROPERTY FOLDER "contrib")
set_property(TARGET mdbx PROPERTY FOLDER "contrib")
set_property(TARGET lmdb PROPERTY FOLDER "contrib")
if( NOT DISABLE_TOR)
set_property(TARGET tor-connect PROPERTY FOLDER "contrib")
endif()
set_property(TARGET mdbx_chk mdbx_copy mdbx_dump mdbx_load mdbx_stat PROPERTY FOLDER "unused")
if(MSVC)
#set_property(TARGET ntdll_extra_target PROPERTY FOLDER "unused")
endif()
if(MSVC)
# set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " /wd4244 /wd4267")
set_property(TARGET zlibstatic APPEND_STRING PROPERTY COMPILE_FLAGS " /wd4267 /wd4267")
else()
# set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value -Wno-implicit-fallthrough -Wno-ignored-qualifiers ")
set_property(TARGET zlibstatic APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value -Wno-implicit-fallthrough -Wno-ignored-qualifiers ")
endif()

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

View file

@ -1,22 +0,0 @@
if (APPLE AND NOT IOS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default")
if (NOT OPENSSL_ROOT_DIR)
EXECUTE_PROCESS(COMMAND brew --prefix openssl
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Using OpenSSL found at ${OPENSSL_ROOT_DIR}")
endif()
endif()
find_package(OpenSSL REQUIRED)
message(STATUS "Using OpenSSL include dir at ${OPENSSL_INCLUDE_DIR}")
include_directories(${OPENSSL_INCLUDE_DIR})
if(STATIC AND NOT IOS)
if(UNIX)
set(OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES};${CMAKE_DL_LIBS};${CMAKE_THREAD_LIBS_INIT}")
endif()
endif()
if (WIN32)
list(APPEND OPENSSL_LIBRARIES ws2_32 crypt32)
endif()

View file

@ -1,67 +0,0 @@
# Copyright (c) 2014-2022, The Monero Project
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other
# materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# - Try to find readline include dirs and libraries
#
# Automatically finds ccache build accelerator, if it's found in PATH.
#
# Usage of this module as follows:
#
# project(monero)
# include(FindCcache) # Include AFTER the project() macro to be able to reach the CMAKE_CXX_COMPILER variable
#
# Properties modified by this module:
#
# GLOBAL PROPERTY RULE_LAUNCH_COMPILE set to ccache, when ccache found
# GLOBAL PROPERTY RULE_LAUNCH_LINK set to ccache, when ccache found
find_program(CCACHE_FOUND ccache)
if (CCACHE_FOUND)
# Try to compile a test program with ccache, in order to verify if it really works. (needed on exotic setups)
set(TEST_PROJECT "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp")
file(WRITE "${TEST_PROJECT}/CMakeLists.txt" [=[
cmake_minimum_required(VERSION 3.5)
project(test)
option (CCACHE "")
file(WRITE "${CMAKE_SOURCE_DIR}/test.cpp" "int main() { return 0; }")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE}")
add_executable(main test.cpp)
]=])
try_compile(RET "${TEST_PROJECT}/build" "${TEST_PROJECT}" "test" CMAKE_FLAGS -DCCACHE="${CCACHE_FOUND}")
unset(TEST_PROJECT)
if (${RET})
# Success
message(STATUS "Found usable ccache: ${CCACHE_FOUND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_FOUND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_FOUND}")
else()
message(STATUS "Found ccache ${CCACHE_FOUND}, but is UNUSABLE! Return code: ${RET}")
endif()
else()
message(STATUS "ccache NOT found! Please install it for faster rebuilds.")
endif()

View file

@ -1,59 +0,0 @@
# --------------------------------- FindMiniupnpc Start ---------------------------------
# Locate miniupnp library
# This module defines
# MINIUPNP_FOUND, if false, do not try to link to miniupnp
# MINIUPNP_LIBRARY, the miniupnp variant
# MINIUPNP_INCLUDE_DIR, where to find miniupnpc.h and family)
# MINIUPNPC_VERSION_1_7_OR_HIGHER, set if we detect the version of miniupnpc is 1.7 or higher
#
# Note that the expected include convention is
# #include "miniupnpc.h"
# and not
# #include <miniupnpc/miniupnpc.h>
# This is because, the miniupnpc location is not standardized and may exist
# in locations other than miniupnpc/
if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY)
# Already in cache, be silent
set(MINIUPNP_FIND_QUIETLY TRUE)
endif ()
find_path(MINIUPNP_INCLUDE_DIR miniupnpc.h
HINTS $ENV{MINIUPNP_INCLUDE_DIR}
PATH_SUFFIXES miniupnpc
)
find_library(MINIUPNP_LIBRARY miniupnpc
HINTS $ENV{MINIUPNP_LIBRARY}
)
find_library(MINIUPNP_STATIC_LIBRARY libminiupnpc.a
HINTS $ENV{MINIUPNP_STATIC_LIBRARY}
)
set(MINIUPNP_INCLUDE_DIRS ${MINIUPNP_INCLUDE_DIR})
set(MINIUPNP_LIBRARIES ${MINIUPNP_LIBRARY})
set(MINIUPNP_STATIC_LIBRARIES ${MINIUPNP_STATIC_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
MiniUPnPc DEFAULT_MSG
MINIUPNP_INCLUDE_DIR
MINIUPNP_LIBRARY
)
IF(MINIUPNPC_FOUND)
file(STRINGS "${MINIUPNP_INCLUDE_DIR}/miniupnpc.h" MINIUPNPC_API_VERSION_STR REGEX "^#define[\t ]+MINIUPNPC_API_VERSION[\t ]+[0-9]+")
if(MINIUPNPC_API_VERSION_STR MATCHES "^#define[\t ]+MINIUPNPC_API_VERSION[\t ]+([0-9]+)")
set(MINIUPNPC_API_VERSION "${CMAKE_MATCH_1}")
if (${MINIUPNPC_API_VERSION} GREATER "10" OR ${MINIUPNPC_API_VERSION} EQUAL "10")
message(STATUS "Found miniupnpc API version " ${MINIUPNPC_API_VERSION})
set(MINIUPNP_FOUND true)
set(MINIUPNPC_VERSION_1_7_OR_HIGHER true)
endif()
endif()
ENDIF()
mark_as_advanced(MINIUPNP_INCLUDE_DIR MINIUPNP_LIBRARY MINIUPNP_STATIC_LIBRARY)
# --------------------------------- FindMiniupnpc End ---------------------------------

View file

@ -1,631 +0,0 @@
# This file is managed by Conan, contents will be overwritten.
# To keep your changes, remove these comment lines, but the plugin won't be able to modify your requirements
set(CONAN_MINIMUM_VERSION 2.0.5)
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)
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()
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 "src" ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
list(GET VERSION_LIST 0 _COMPILER_VERSION)
elseif(_COMPILER MATCHES Clang)
set(_COMPILER "clang")
string(REPLACE "src" ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
list(GET VERSION_LIST 0 _COMPILER_VERSION)
elseif(_COMPILER MATCHES GNU)
set(_COMPILER "gcc")
string(REPLACE "src" ";" VERSION_LIST ${CMAKE_CXX_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 "")
if(CMAKE_C_COMPILER)
set(_conan_c_compiler "\"c\":\"${CMAKE_C_COMPILER}\",")
set_conan_compiler_if_appleclang(C cc _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)
else()
message(WARNING "CMake-Conan: The C++ compiler is not defined. "
"Please define CMAKE_CXX_COMPILER or enable the C++ language.")
endif()
if(NOT "x${_conan_c_compiler}${_conan_cpp_compiler}" STREQUAL "x")
string(APPEND PROFILE "tools.build:compiler_executables={${_conan_c_compiler}${_conan_cpp_compiler}}\n")
endif()
unset(_conan_c_compiler)
unset(_conan_cpp_compiler)
endmacro()
function(detect_host_profile output_file)
detect_os(MYOS MYOS_API_LEVEL MYOS_SDK MYOS_SUBSYSTEM MYOS_VERSION)
detect_arch(MYARCH)
detect_compiler(MYCOMPILER MYCOMPILER_VERSION MYCOMPILER_RUNTIME MYCOMPILER_RUNTIME_TYPE)
detect_cxx_standard(MYCXX_STANDARD)
detect_lib_cxx(MYLIB_CXX)
detect_build_type(MYBUILD_TYPE)
set(PROFILE "")
string(APPEND PROFILE "[settings]\n")
if(MYARCH)
string(APPEND PROFILE arch=${MYARCH} "\n")
endif()
if(MYOS)
string(APPEND PROFILE os=${MYOS} "\n")
endif()
if(MYOS_API_LEVEL)
string(APPEND PROFILE os.api_level=${MYOS_API_LEVEL} "\n")
endif()
if(MYOS_VERSION)
string(APPEND PROFILE os.version=${MYOS_VERSION} "\n")
endif()
if(MYOS_SDK)
string(APPEND PROFILE os.sdk=${MYOS_SDK} "\n")
endif()
if(MYOS_SUBSYSTEM)
string(APPEND PROFILE os.subsystem=${MYOS_SUBSYSTEM} "\n")
endif()
if(MYCOMPILER)
string(APPEND PROFILE compiler=${MYCOMPILER} "\n")
endif()
if(MYCOMPILER_VERSION)
string(APPEND PROFILE compiler.version=${MYCOMPILER_VERSION} "\n")
endif()
if(MYCOMPILER_RUNTIME)
string(APPEND PROFILE compiler.runtime=${MYCOMPILER_RUNTIME} "\n")
endif()
if(MYCOMPILER_RUNTIME_TYPE)
string(APPEND PROFILE compiler.runtime_type=${MYCOMPILER_RUNTIME_TYPE} "\n")
endif()
if(MYCXX_STANDARD)
string(APPEND PROFILE compiler.cppstd=${MYCXX_STANDARD} "\n")
endif()
if(MYLIB_CXX)
string(APPEND PROFILE compiler.libcxx=${MYLIB_CXX} "\n")
endif()
if(MYBUILD_TYPE)
string(APPEND PROFILE "build_type=${MYBUILD_TYPE}\n")
endif()
if(NOT DEFINED output_file)
set(_FN "${CMAKE_BINARY_DIR}/profile")
else()
set(_FN ${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(MYOS STREQUAL "Android")
string(APPEND PROFILE "tools.android:ndk_path=${CMAKE_ANDROID_NDK}\n")
endif()
message(STATUS "CMake-Conan: Creating profile ${_FN}")
file(WRITE ${_FN} ${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)
cmake_parse_arguments(ARGS CONAN_ARGS ${ARGN})
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}/contrib/cmake ${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("conan stdout: ${conan_stdout}")
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}/contrib/cmake/${CONANFILE}")
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/contrib/cmake/${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(oneValueArgs MINIMUM CURRENT)
set(multiValueArgs )
cmake_parse_arguments(CONAN_VERSION_CHECK
"${options}" "${oneValueArgs}" "${multiValueArgs}" ${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()

View file

@ -1,3 +0,0 @@
requirements:
- "openssl/3.2.1"
- "boost/1.84.0"

View file

@ -1,25 +0,0 @@
# This file is managed by Conan, contents will be overwritten.
# To keep your changes, remove these comment lines, but the plugin won't be able to modify your requirements
import os
from io import StringIO
from conan import ConanFile
from conan.tools.files import load, copy
from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain
class ConanApplication(ConanFile):
package_type = "application"
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeDeps", "CMakeToolchain"
def layout(self):
# The root of the project is one level above
#self.folders.root = os.path.dirname(os.path.dirname('.'))
# The source of the project (the root CMakeLists.txt) is the source folder
#self.folders.source = "."
#self.folders.build = "build"
cmake_layout(self)
def requirements(self):
requirements = self.conan_data.get('requirements', [])
for requirement in requirements:
self.requires(requirement)

View file

@ -1,2 +0,0 @@
conan
pytest

View file

@ -1,5 +0,0 @@
compiler:
gcc:
version: ["11.4.0"]
apple-clang:
version: ["15.0.0.15000040"]

View file

@ -6,15 +6,18 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
endif()
message("DB ENGINE: lmdb")
add_subdirectory(liblmdb)
if(MSVC)
target_compile_options(lmdb PRIVATE /wd4996 /wd4503 /wd4345 /wd4267 /wd4244 /wd4146 /wd4333 /wd4172)
else()
# Warnings as used by LMDB itself (LMDB_0.9.23)
target_compile_options(lmdb PRIVATE -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized)
endif()
if(NOT DISABLE_MDBX)
message("DB ENGINE: mdbx")
add_subdirectory(libmdbx)
endif()
message("DB ENGINE: lmdb")
add_subdirectory(liblmdb)
if(MSVC)
target_compile_options(lmdb PRIVATE /wd4996 /wd4503 /wd4345 /wd4267 /wd4244 /wd4146 /wd4333 /wd4172)
else()
# Warnings as used by LMDB itself (LMDB_0.9.23)
target_compile_options(lmdb PRIVATE -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized)
endif()
if(NOT DISABLE_MDBX)
message("DB ENGINE: mdbx")
add_subdirectory(libmdbx)
# remove mdbx tools from the default MSVC build
set_target_properties(mdbx_chk mdbx_copy mdbx_dump mdbx_load mdbx_stat PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
endif()

View file

@ -126,9 +126,9 @@ if(UNIX AND NOT APPLE)
target_link_libraries(${TARGET}_SHARED rt)
endif()
install(TARGETS ${TARGET}_STATIC DESTINATION ${CMAKE_INSTALL_PREFIX}/lib64 COMPONENT mdbx)
install(TARGETS ${TARGET}_SHARED DESTINATION ${CMAKE_INSTALL_PREFIX}/lib64 COMPONENT mdbx)
install(FILES mdbx.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include COMPONENT mdbx-devel)
#install(TARGETS ${TARGET}_STATIC DESTINATION ${CMAKE_INSTALL_PREFIX}/lib64 COMPONENT mdbx)
#install(TARGETS ${TARGET}_SHARED DESTINATION ${CMAKE_INSTALL_PREFIX}/lib64 COMPONENT mdbx)
#install(FILES mdbx.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include COMPONENT mdbx-devel)
add_subdirectory(src/tools)
add_subdirectory(test)

View file

@ -61,12 +61,12 @@ if(CC_HAS_VISIBILITY)
target_compile_options(mdbx PRIVATE "-fvisibility=hidden")
endif()
install(TARGETS mdbx
LIBRARY DESTINATION lib COMPONENT runtime
RUNTIME DESTINATION bin COMPONENT runtime
ARCHIVE DESTINATION lib/static COMPONENT devel
PUBLIC_HEADER DESTINATION include
INCLUDES DESTINATION include COMPONENT devel)
#install(TARGETS mdbx
# LIBRARY DESTINATION lib COMPONENT runtime
# RUNTIME DESTINATION bin COMPONENT runtime
# ARCHIVE DESTINATION lib/static COMPONENT devel
# PUBLIC_HEADER DESTINATION include
# INCLUDES DESTINATION include COMPONENT devel)
################################################################################
#

View file

@ -32,8 +32,8 @@ foreach(TOOL ${MDBX_TOOLS})
C_STANDARD ${MDBX_C_STANDARD} C_STANDARD_REQUIRED ON
INTERPROCEDURAL_OPTIMIZATION $<BOOL:${INTERPROCEDURAL_OPTIMIZATION}>)
install(TARGETS ${TOOL} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin COMPONENT mdbx)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../man1/${TOOL}.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1 COMPONENT mdbx)
# install(TARGETS ${TOOL} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin COMPONENT mdbx)
# install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../man1/${TOOL}.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1 COMPONENT mdbx)
endforeach()
if(LIB_MATH)

View file

@ -60,25 +60,35 @@ namespace epee
template<bool is_ordered_container, typename t_key, typename t_value, uint64_t max_elements>
class cache_base
{
uint64_t mac_allowed_elements;
std::list<t_key> most_recet_acessed;
uint64_t max_allowed_elements;
std::list<t_key> most_recent_accessed;
typename container_selector<is_ordered_container, t_key, std::pair<t_value, typename std::list<t_key>::iterator> >::container data;
protected:
critical_section m_lock;
public:
cache_base() : mac_allowed_elements(max_elements)
cache_base() : max_allowed_elements(max_elements)
{}
size_t size()
size_t size() const
{
return data.size();
}
size_t most_recent_accessed_container_size() const
{
return most_recent_accessed.size();
}
uint64_t get_max_elements() const
{
return max_allowed_elements;
}
void set_max_elements(uint64_t e)
{
mac_allowed_elements = e;
max_allowed_elements = e;
}
bool get(const t_key& k, t_value& v)
@ -88,7 +98,11 @@ namespace epee
if (it == data.end())
return false;
most_recet_acessed.splice(most_recet_acessed.begin(), most_recet_acessed, it->second.second);
//most_recent_accessed.splice(most_recent_accessed.begin(), most_recent_accessed, it->second.second);
most_recent_accessed.erase(it->second.second);
most_recent_accessed.push_front(k);
it->second.second = most_recent_accessed.begin();
v = it->second.first;
return true;
}
@ -96,8 +110,19 @@ namespace epee
bool set(const t_key& k, const t_value& v)
{
CRITICAL_REGION_LOCAL(m_lock);
most_recet_acessed.push_front(k);
data[k] = std::pair<t_value, typename std::list<t_key>::iterator>(v, most_recet_acessed.begin());
auto it = data.find(k);
if (it == data.end())
{
most_recent_accessed.push_front(k);
data.insert(std::make_pair(k, std::make_pair(v, most_recent_accessed.begin())));
}
else
{
most_recent_accessed.erase(it->second.second);
most_recent_accessed.push_front(k);
it->second.first = v;
it->second.second = most_recent_accessed.begin();
}
trim();
return true;
@ -107,7 +132,7 @@ namespace epee
{
CRITICAL_REGION_LOCAL(m_lock);
data.clear();
most_recet_acessed.clear();
most_recent_accessed.clear();
}
bool erase(const t_key& k)
@ -117,20 +142,21 @@ namespace epee
if (data_it == data.end())
return false;
most_recet_acessed.erase(data_it->second.second);
most_recent_accessed.erase(data_it->second.second);
data.erase(data_it);
return true;
}
protected:
void trim()
{
CRITICAL_REGION_LOCAL(m_lock);
while (most_recet_acessed.size() > mac_allowed_elements)
while (most_recent_accessed.size() > max_allowed_elements)
{
auto data_it = data.find(most_recet_acessed.back());
auto data_it = data.find(most_recent_accessed.back());
if (data_it != data.end())
data.erase(data_it);
most_recet_acessed.erase(--most_recet_acessed.end());
most_recent_accessed.erase(--most_recent_accessed.end());
}
}
};
@ -238,7 +264,10 @@ namespace epee
bool erase(const t_key& k)
{
return m_isolation.isolated_write_access<bool>([&](){return base_class::erase(k); });
return m_isolation.isolated_write_access<bool>([&]()
{
return base_class::erase(k);
});
}
};

View file

@ -81,7 +81,7 @@ namespace epee
m_run.store(false, std::memory_order_relaxed);
#if defined(WIN32)
::CloseHandle(::GetStdHandle(STD_INPUT_HANDLE));
// ::CloseHandle(::GetStdHandle(STD_INPUT_HANDLE)); -- commented out by sowle, I belive we don't need to close this handle here
#endif
m_request_cv.notify_one();

View file

@ -36,6 +36,19 @@
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#if __has_include(<filesystem>)
#include <filesystem>
namespace stdfs = std::filesystem;
#else
#if TARGET_OS_IOS
#error "This should never happen on ios."
#endif
namespace stdfs = boost::filesystem;
#endif
//#include <filesystem>
#ifndef MAKE64
#define MAKE64(low,high) ((__int64)(((DWORD)(low)) | ((__int64)((DWORD)(high))) << 32))
#endif
@ -561,16 +574,15 @@ namespace file_io_utils
try
{
boost::filesystem::directory_iterator end_itr; // default construction yields past-the-end
for ( boost::filesystem::directory_iterator itr( epee::string_encoding::utf8_to_wstring(path) ); itr != end_itr; ++itr )
stdfs::directory_iterator end_itr; // default construction yields past-the-end
for (stdfs::directory_iterator itr( epee::string_encoding::utf8_to_wstring(path) ); itr != end_itr; ++itr )
{
if ( only_files && boost::filesystem::is_directory(itr->status()) )
if ( only_files && stdfs::is_directory(itr->status()) )
{
continue;
}
target_list.push_back(itr->path().filename().string());
}
}
catch(...)

View file

@ -31,7 +31,7 @@
#define _GZIP_ENCODING_H_
#include "boost/core/ignore_unused.hpp"
#include "net/http_client_base.h"
#include "zlib/zlib.h"
#include "zlib.h"
namespace epee
@ -182,7 +182,7 @@ namespace net_utils
*
*/
inline
virtual void stop(std::string& OUT collect_remains)
virtual void stop(std::string& OUT collect_remains) override
{
}
protected:
@ -260,6 +260,10 @@ namespace net_utils
m_pcb.reset(new abstract_callback<callback_t>(cb));
return content_encoding_gzip::update_in(piece_of_transfer);
}
virtual void stop(std::string& OUT collect_remains) override
{}
template<class callback_t>
bool stop(callback_t cb)
{return true;}

View file

@ -30,5 +30,3 @@
#define ENABLE_RELEASE_LOGGING
#include "misc_log_ex.h"

View file

@ -1,4 +1,4 @@
// Copyright (c) 2019, anonimal, <anonimal@lethean.org>
// Copyright (c) 2019, anonimal, <anonimal@zano.org>
// Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net
// All rights reserved.
//
@ -82,6 +82,13 @@ namespace epee
namespace misc_utils
{
template<typename t_type_a, typename t_type_b>
void cast_assign_a_to_b(const t_type_a& a, t_type_b& b)
{
*static_cast<t_type_a*>(&b) = a;
}
template<class _Ty1,
class _Ty2,
class _Ty3>
@ -364,7 +371,7 @@ namespace misc_utils
}
#define ON_EXIT misc_utils::auto_scope_leave_caller scope_exit_handler = misc_utils::create_scope_leave_handler
#define ON_FUNC_EXIT misc_utils::auto_scope_leave_caller scope_exit_handler = misc_utils::create_scope_leave_handler
template< typename t_contaner, typename t_redicate>
@ -532,7 +539,105 @@ namespace misc_utils
};
template<typename key, typename expiration_type>
struct expirating_set
{
typedef std::set<key> main_set;
main_set m_set;
std::multimap<expiration_type, typename main_set::iterator> m_expirations;
const main_set& get_set()
{
return m_set;
}
void add(const key& k, const expiration_type& e)
{
auto res = m_set.insert(k);
m_expirations.insert({ e, res.first });
}
void remove_if_expiration_less_than(const expiration_type& e)
{
while(m_expirations.size() && m_expirations.begin()->first < e)
{
m_set.erase(m_expirations.begin()->second);
m_expirations.erase(m_expirations.begin());
}
}
};
template<typename key, typename expiration_type, typename value_type>
struct expirating_map
{
typedef std::map<key, value_type> main_map;
main_map m_map;
std::multimap<expiration_type, typename main_map::iterator> m_expirations;
const main_map& get_map()
{
return m_map;
}
void add(const key& k, const value_type& v, const expiration_type& e)
{
auto res = m_map.insert(k, v);
m_expirations.insert({ e, res.first });
}
void remove_if_expiration_less_than(const expiration_type& e)
{
while (m_expirations.size() && m_expirations.begin()->first < e)
{
m_map.erase(m_expirations.begin()->second);
m_expirations.erase(m_expirations.begin());
}
}
template <class t_archive>
inline void serialize(t_archive& a, const unsigned int ver)
{
std::vector<std::tuple<key, value_type, expiration_type> > items;
if constexpr (t_archive::is_saving::value)
{
for (const auto& item: m_expirations)
{
items.resize(items.size + 1);
std::get<2>(items.back()) = item.first;
std::get<0>(items.back()) = item.second.first;
std::get<1>(items.back()) = item.second.second;
}
}
a & items;
if constexpr (!t_archive::is_saving::value)
{
for (const auto& item : items)
{
this->add(std::get<0>(item), std::get<1>(item), std::get<2>(item));
items.resize(items.size + 1);
std::get<2>(items.back()) = item.first;
std::get<0>(items.back()) = item.second.first;
std::get<1>(items.back()) = item.second.second;
}
}
}
};
// helper class mainly intended for using with std::atomic to repair copy-construction in classes where std::atomic is aggregated
template<typename parent_t>
struct void_copy : public parent_t
{
void_copy() = default;
void_copy(void_copy&&) noexcept = default;
void_copy& operator=(void_copy&&) noexcept = default;
void_copy(const void_copy&) : parent_t{} {}
void_copy& operator=(const void_copy&) { return *this; }
};
} // namespace misc_utils
} // namespace epee

View file

@ -1,5 +1,5 @@
// Copyright (c) 2019, Zano Project
// Copyright (c) 2019, anonimal <anonimal@lethean.org>
// Copyright (c) 2019-2024, Zano Project
// Copyright (c) 2019, anonimal <anonimal@zano.org>
// Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net
// All rights reserved.
//
@ -90,7 +90,7 @@ DISABLE_VS_WARNINGS(4100)
#define LOG_JOURNAL_MAX_ELEMENTS 100
#ifdef _DEBUG
#define _ASSERTE__(expr) if(!expr) {__debugbreak();}
#define _ASSERTE__(expr) if(!(expr)) {__debugbreak();}
#else
#define _ASSERTE__(expr)
#endif
@ -244,11 +244,6 @@ DISABLE_VS_WARNINGS(4100)
#define CHECK_AND_ASSERT_MES_CUSTOM(expr, fail_ret_val, custom_code, message) do{if(!(expr)) {LOG_ERROR(message); custom_code; return fail_ret_val;};}while(0)
#endif
/*#ifndef CHECK_AND_ASSERT_MES_AND_THROW
#define CHECK_AND_ASSERT_MES_AND_THROW(expr, message) do{if(!(expr)) {LOG_ERROR(message); throw std::runtime_error(message);};}while(0)
#endif
*/
#ifndef CHECK_AND_NO_ASSERT_MES
#define CHECK_AND_NO_ASSERT_MES(expr, fail_ret_val, message) do{if(!(expr)) {LOG_PRINT_MAGENTA(message, LOG_LEVEL_0); /*LOCAL_ASSERT(expr);*/ return fail_ret_val;};}while(0)
#endif
@ -265,6 +260,22 @@ DISABLE_VS_WARNINGS(4100)
#define CHECK_AND_ASSERT_MES2(expr, message) do{if(!(expr)) {LOG_ERROR(message); };}while(0)
#endif
#ifndef CHECK_AND_ASSERT_EQ
#define CHECK_AND_ASSERT_EQ(A, B) CHECK_AND_ASSERT_MES((A) == (B), false, STR(A) " != " STR(B) " because " << A << " != " << B)
#endif
#ifndef CHECK_AND_ASSERT_NEQ
#define CHECK_AND_ASSERT_NEQ(A, B) CHECK_AND_ASSERT_MES((A) != (B), false, STR(A) " == " STR(B) " because " << A << " == " << B)
#endif
#ifndef CHECK_AND_ASSERT_LESS
#define CHECK_AND_ASSERT_LESS(A, B) CHECK_AND_ASSERT_MES((A) < (B), false, STR(A) " >= " STR(B) " because " << A << " >= " << B)
#endif
#ifndef CHECK_AND_ASSERT_GREATER
#define CHECK_AND_ASSERT_GREATER(A, B) CHECK_AND_ASSERT_MES((A) > (B), false, STR(A) " <= " STR(B) " because " << A << " <= " << B)
#endif
namespace epee
{
namespace debug

View file

@ -114,26 +114,33 @@ namespace misc_utils
#include <execinfo.h>
#include <boost/core/demangle.hpp>
#endif
inline std::string print_trace_default()
inline std::string print_trace_default() noexcept
{
std::stringstream ss;
try
{
std::stringstream ss;
#if defined(__GNUC__) && !defined(__ANDROID__)
ss << std::endl << "STACK" << std::endl;
const size_t max_depth = 100;
size_t stack_depth;
void *stack_addrs[max_depth];
char **stack_strings;
ss << std::endl << "STACK" << std::endl;
const size_t max_depth = 100;
size_t stack_depth;
void *stack_addrs[max_depth];
char **stack_strings;
stack_depth = backtrace(stack_addrs, max_depth);
stack_strings = backtrace_symbols(stack_addrs, stack_depth);
stack_depth = backtrace(stack_addrs, max_depth);
stack_strings = backtrace_symbols(stack_addrs, stack_depth);
for (size_t i = 1; i < stack_depth; i++)
{
ss << boost::core::demangle(stack_strings[i]) << std::endl;
}
free(stack_strings); // malloc()ed by backtrace_symbols
for (size_t i = 1; i < stack_depth; i++)
{
ss << boost::core::demangle(stack_strings[i]) << std::endl;
}
free(stack_strings); // malloc()ed by backtrace_symbols
#endif
return ss.str();
return ss.str();
}
catch(...)
{
return std::string("(no callstack due to an exception)");
}
}
typedef std::string (stack_retrieving_function_t)();
@ -141,27 +148,35 @@ namespace misc_utils
//
// To get stack trace call it with the defaults.
//
inline std::string get_callstack(stack_retrieving_function_t* p_stack_retrieving_function_to_be_added = nullptr, bool remove_func = false)
inline std::string get_callstack(stack_retrieving_function_t* p_stack_retrieving_function_to_be_added = nullptr, bool remove_func = false) noexcept
{
static stack_retrieving_function_t* p_srf = nullptr;
if (remove_func)
{
p_srf = nullptr;
return "";
}
if (p_stack_retrieving_function_to_be_added != nullptr)
{
p_srf = p_stack_retrieving_function_to_be_added;
return "";
}
if (p_srf != nullptr)
return p_srf();
try
{
if (remove_func)
{
p_srf = nullptr;
return "";
}
if (p_stack_retrieving_function_to_be_added != nullptr)
{
p_srf = p_stack_retrieving_function_to_be_added;
return "";
}
return print_trace_default();
if (p_srf != nullptr)
return p_srf();
return print_trace_default();
}
catch(...)
{
return std::string("(no callstack due to an exception)");
}
}
}
}
} // namespace misc_utils
} // namespace epee

View file

@ -54,7 +54,7 @@ namespace epee {
namespace net_utils {
struct i_connection_filter {
virtual bool is_remote_ip_allowed(uint32_t adress) = 0;
virtual bool is_remote_ip_allowed(uint32_t adress, bool is_incoming) = 0;
protected:
virtual ~i_connection_filter()

View file

@ -44,6 +44,18 @@ namespace net_utils {
/************************************************************************/
DISABLE_VS_WARNINGS(4355)
template <typename, typename = std::void_t<>>
struct has_pre_destructor_handler : std::false_type {};
// This specialization is selected if T has a valid 'b()' that can be called
template <typename T>
struct has_pre_destructor_handler<T, std::void_t<decltype(std::declval<T&>().on_pre_destroy())>>
: std::true_type {};
template<class t_protocol_handler>
connection<t_protocol_handler>::connection(boost::asio::io_service& io_service,
typename t_protocol_handler::config_type& config, volatile uint32_t& sock_count, i_connection_filter*& pfilter)
@ -66,6 +78,12 @@ connection<t_protocol_handler>::~connection()
{
NESTED_TRY_ENTRY();
if constexpr (has_pre_destructor_handler<t_protocol_handler>::value)
{
m_protocol_handler.on_pre_destroy();
}
if(!m_was_shutdown) {
LOG_PRINT_L3("[sock " << socket_.native_handle() << "] Socket destroyed without shutdown.");
shutdown();
@ -128,7 +146,7 @@ bool connection<t_protocol_handler>::start(bool is_income, bool is_multithreaded
LOG_PRINT_L3("[sock " << socket_.native_handle() << "] new connection, remote end_point: " << print_connection_context_short(context) << " local end_point: " << local_ep.address().to_string() << ':' << local_ep.port() << ", total sockets objects " << m_ref_sockets_count);
if(is_income && m_pfilter && !m_pfilter->is_remote_ip_allowed(context.m_remote_ip)) {
if(is_income && m_pfilter && !m_pfilter->is_remote_ip_allowed(context.m_remote_ip, is_income)) {
LOG_PRINT_L0("[sock " << socket_.native_handle() << "] ip denied " << string_tools::get_ip_string_from_int32(context.m_remote_ip) << ", shutdowning connection");
close();
return false;

View file

@ -98,7 +98,7 @@ namespace net_utils
std::string m_transfer_encoding;//"Transfer-Encoding:"
std::string m_content_encoding; //"Content-Encoding:"
std::string m_host; //"Host:"
std::string m_cookie; //"Cookie:"
std::string m_cookie; //"Cookie:"
fields_list m_etc_fields;
void clear()
@ -147,10 +147,10 @@ namespace net_utils
std::string m_http_method_str;
std::string m_full_request_str;
std::string m_replace_html;
std::string m_request_head;
std::string m_request_head;
int m_http_ver_hi;
int m_http_ver_lo;
bool m_have_to_block;
bool m_have_to_block;
http_header_info m_header_info;
uri_content m_uri_content;
size_t m_full_request_buf_size;
@ -166,11 +166,11 @@ namespace net_utils
struct http_response_info
{
int m_response_code;
std::string m_response_comment;
int m_response_code;
std::string m_response_comment;
fields_list m_additional_fields;
std::string m_body;
std::string m_mime_tipe;
std::string m_body;
std::string m_mime_tipe;
http_header_info m_header_info;
int m_http_ver_hi;// OUT paramter only
int m_http_ver_lo;// OUT paramter only

View file

@ -200,8 +200,26 @@ namespace epee
namespace http
{
struct i_http_client
{
virtual void set_host_name(const std::string& name) = 0;
virtual boost::asio::ip::tcp::socket& get_socket() = 0;
virtual bool connect(const std::string& host, int port, unsigned int timeout) = 0;
virtual bool set_timeouts(unsigned int connection_timeout, unsigned int recv_timeout) = 0;
virtual bool connect(const std::string& host, std::string port) = 0;
virtual bool connect(const std::string& host, const std::string& port, unsigned int timeout) = 0;
virtual bool disconnect() = 0;
virtual bool is_connected() = 0;
virtual bool invoke_get(const std::string& uri, const std::string& body = std::string(), const http_response_info** ppresponse_info = NULL, const fields_list& additional_params = fields_list()) = 0;
virtual bool invoke(const std::string& uri, const std::string& method, const std::string& body, const http_response_info** ppresponse_info = NULL, const fields_list& additional_params = fields_list()) = 0;
virtual bool invoke_post(const std::string& uri, const std::string& body, const http_response_info** ppresponse_info = NULL, const fields_list& additional_params = fields_list()) = 0;
};
template<bool is_ssl>
class http_simple_client_t : public i_target_handler
class http_simple_client_t : public i_target_handler,
public i_http_client
{
public:
@ -893,25 +911,90 @@ namespace epee
typedef http_simple_client_t<true> https_simple_client;
//suitable for both http and https
class http_universal_client: public i_http_client
{
public:
http_universal_client(): m_pclient(new http_simple_client())
{}
// Forward all calls to m_pclient
void set_host_name(const std::string& name) override
{
m_pclient->set_host_name(name);
}
bool connect(const std::string& host, int port, unsigned int timeout) override
{
return m_pclient->connect(host, port, timeout);
}
boost::asio::ip::tcp::socket& get_socket() override { return m_pclient->get_socket(); }
bool set_timeouts(unsigned int connection_timeout, unsigned int recv_timeout) override { return m_pclient->set_timeouts(connection_timeout, recv_timeout); }
bool connect(const std::string& host, std::string port) override { return m_pclient->connect(host, port); }
bool connect(const std::string& host, const std::string& port, unsigned int timeout) override { return m_pclient->connect(host, port, timeout); }
bool disconnect() override { return m_pclient->disconnect(); }
bool is_connected() override { return m_pclient->is_connected(); }
bool invoke_get(const std::string& uri, const std::string& body = std::string(), const http_response_info** ppresponse_info = nullptr, const fields_list& additional_params = fields_list()) override { return m_pclient->invoke_get(uri, body, ppresponse_info, additional_params); }
bool invoke(const std::string& uri, const std::string& method, const std::string& body, const http_response_info** ppresponse_info = nullptr, const fields_list& additional_params = fields_list()) override { return m_pclient->invoke(uri, method, body, ppresponse_info, additional_params); }
bool invoke_post(const std::string& uri, const std::string& body, const http_response_info** ppresponse_info = nullptr, const fields_list& additional_params = fields_list()) override { return m_pclient->invoke_post(uri, body, ppresponse_info, additional_params); }
void set_is_ssl(bool is_ssl)
{
if (m_is_ssl != is_ssl)
{
if (is_ssl)
{
m_pclient.reset(new https_simple_client());
}
else
{
m_pclient.reset(new http_simple_client());
}
m_is_ssl = is_ssl;
}
}
private:
bool m_is_ssl = false;
std::shared_ptr<i_http_client> m_pclient;
};
template<typename transport>
void configure_transport(const std::string schema, transport& tr)
{}
inline void configure_transport(const std::string schema, http_universal_client& tr)
{
if (schema == "https")
tr.set_is_ssl(true);
else
tr.set_is_ssl(false);
}
/************************************************************************/
/* */
/************************************************************************/
template<class t_transport>
bool invoke_request(const std::string& url, t_transport& tr, unsigned int timeout, const http_response_info** ppresponse_info, const std::string& method = "GET", const std::string& body = std::string(), const fields_list& additional_params = fields_list())
{
http::url_content u_c;
bool res = parse_url(url, u_c);
http::url_content u_c{};
bool r = parse_url(url, u_c);
CHECK_AND_ASSERT_MES(tr.is_connected() || u_c.host.empty() || r, false, "failed to parse url: " << url);
r = invoke_request(u_c, tr, timeout, ppresponse_info, method, body, additional_params);
return r;
}
template<class t_transport>
bool invoke_request(const http::url_content& u_c, t_transport& tr, unsigned int timeout, const http_response_info** ppresponse_info, const std::string& method = "GET", const std::string& body = std::string(), const fields_list& additional_params = fields_list())
{
if (!tr.is_connected() && !u_c.host.empty())
{
CHECK_AND_ASSERT_MES(res, false, "failed to parse url: " << url);
int port = static_cast<int>(u_c.port);
if (!port)
port = 80;//default for http
if (!u_c.port)
u_c.port = 80;//default for http
if (!tr.connect(u_c.host, static_cast<int>(u_c.port), timeout))
configure_transport(u_c.schema, tr);
if (!tr.connect(u_c.host, port, timeout))
{
LOG_PRINT_L2("invoke_request: cannot connect to " << u_c.host << ":" << u_c.port);
LOG_PRINT_L2("invoke_request: cannot connect to " << u_c.host << ":" << port);
return false;
}
}
@ -937,28 +1020,67 @@ namespace epee
}
};
class interruptible_http_client : public http_simple_client
{
std::shared_ptr<idle_handler_base> m_pcb;
bool m_permanent_error = false;
virtual bool handle_target_data(std::string& piece_of_transfer)
class http_https_simple_client_wrapper : virtual public http_simple_client, virtual public https_simple_client
{
public:
http_https_simple_client_wrapper(bool is_ssl, std::shared_ptr<idle_handler_base> ihb_cb)
: m_ssl(is_ssl)
, m_ihb_cb(ihb_cb)
{}
bool invoke_request(const http::url_content& u_c, unsigned int timeout, const http_response_info** ppresponse_info, const std::string& method = "GET", const std::string& body = std::string(), const fields_list& additional_params = fields_list())
{
bool r = m_pcb->do_call(piece_of_transfer, m_len_in_summary, m_len_in_summary - m_len_in_remain);
bool r = false;
if (m_ssl)
r = epee::net_utils::http::invoke_request(u_c, static_cast<https_simple_client&>(*this), timeout, ppresponse_info, method, body, additional_params);
else
r = epee::net_utils::http::invoke_request(u_c, static_cast<http_simple_client&>(*this), timeout, ppresponse_info, method, body, additional_params);
return r;
}
private:
// class i_target_handler
virtual bool handle_target_data(std::string& piece_of_transfer) override
{
bool r = false;
if (m_ssl)
r = m_ihb_cb->do_call(piece_of_transfer, https_simple_client::m_len_in_summary, https_simple_client::m_len_in_summary - https_simple_client::m_len_in_remain);
else
r = m_ihb_cb->do_call(piece_of_transfer, http_simple_client::m_len_in_summary, http_simple_client::m_len_in_summary - http_simple_client::m_len_in_remain);
piece_of_transfer.clear();
return r;
}
bool m_ssl;
std::shared_ptr<idle_handler_base> m_ihb_cb;
};
class interruptible_http_client
{
bool m_permanent_error = false;
public:
template<typename callback_t>
bool invoke_cb(callback_t cb, const std::string& url, uint64_t timeout, const std::string& method = "GET", const std::string& body = std::string(), const fields_list& additional_params = fields_list())
{
m_pcb.reset(new idle_handler<callback_t>(cb));
http::url_content uc{};
if (!parse_url(url, uc))
{
LOG_PRINT_L0("HTTP request to " << url << " failed because the URL couldn't be parsed.");
m_permanent_error = true;
return false;
}
bool is_ssl = uc.schema == "https";
http_https_simple_client_wrapper wrapper(is_ssl, std::make_shared<idle_handler<callback_t>>(cb));
const http_response_info* p_hri = nullptr;
bool r = invoke_request(url, *this, timeout, &p_hri, method, body, additional_params);
bool r = wrapper.invoke_request(uc, timeout, &p_hri, method, body, additional_params);
if (p_hri && !(p_hri->m_response_code >= 200 && p_hri->m_response_code < 300))
{
LOG_PRINT_L0("HTTP request to " << url << " failed with code: " << p_hri->m_response_code);
LOG_PRINT_L0(boost::to_upper_copy(uc.schema) << " request to " << url << " failed with code: " << p_hri->m_response_code);
m_permanent_error = true;
return false;
}

View file

@ -30,133 +30,11 @@
#include "storages/portable_storage_template_helper.h"
#include "http_base.h"
#include "net/net_utils_base.h"
#include "storages/portable_storage_extended_for_doc.h"
template<typename typename_t>
typename_t get_documentation_json_struct()
{
return AUTO_VAL_INIT_T(typename_t);
}
template<typename request_t, typename response_t>
bool auto_doc_t(const std::string& prefix_name, std::string& generate_reference)
{
if (!generate_reference.size()) return true;
request_t req = get_documentation_json_struct<request_t>();
response_t res = get_documentation_json_struct<response_t>();
std::stringstream ss;
ss << prefix_name << ENDL
<< "REQUEST: " << ENDL << epee::serialization::store_t_to_json(req) << ENDL << "--------------------------------" << ENDL
<< "RESPONSE: " << ENDL << epee::serialization::store_t_to_json(res) << ENDL << "################################" << ENDL;
generate_reference += ss.str();
return true;
}
template<typename command_type_t>
bool auto_doc(const std::string& prefix_name, std::string& generate_reference)
{
return auto_doc_t<typename command_type_t::request, typename command_type_t::response>(prefix_name, generate_reference);
}
namespace epee {
namespace net_utils {
namespace http {
struct i_chain_handler
{
virtual bool handle_http_request_map(const epee::net_utils::http::http_request_info& query_info, epee::net_utils::http::http_response_info& response_info,
epee::net_utils::connection_context_base& m_conn_context, bool& call_found, std::string& generate_reference) = 0;
};
}
}
}
#define CHAIN_HTTP_TO_MAP2(context_type) bool handle_http_request(const epee::net_utils::http::http_request_info& query_info, \
epee::net_utils::http::http_response_info& response, \
context_type& m_conn_context) \
{\
response.m_response_code = 200; \
response.m_response_comment = "Ok"; \
std::string reference_stub; \
bool call_found = false; \
if(!handle_http_request_map(query_info, response, m_conn_context, call_found, reference_stub) && response.m_response_code == 200) \
{ response.m_response_code = 500; response.m_response_comment = "Internal Server Error"; return true; } \
if (!call_found) \
{ response.m_response_code = 404; response.m_response_comment = "Not Found"; return true; } \
return true; \
}
#define BEGIN_URI_MAP2() template<class t_context> bool handle_http_request_map(const epee::net_utils::http::http_request_info& query_info, \
epee::net_utils::http::http_response_info& response_info, \
t_context& m_conn_context, bool& call_found, std::string& generate_reference) { \
call_found = false; \
if(false) return true; //just a stub to have "else if"
#define BEGIN_URI_MAP2_VIRTUAL() virtual bool handle_http_request_map(const epee::net_utils::http::http_request_info& query_info, \
epee::net_utils::http::http_response_info& response_info, \
epee::net_utils::connection_context_base& m_conn_context, bool& call_found, std::string& generate_reference) { \
call_found = false; \
if(false) return true; //just a stub to have "else if"
#define MAP_URI2(pattern, callback) else if(std::string::npos != query_info.m_URI.find(pattern)) return callback(query_info, response_info, m_conn_context);
#define MAP_URI_AUTO_XML2(s_pattern, callback_f, command_type) //TODO: don't think i ever again will use xml - ambiguous and "overtagged" format
#define MAP_URI_AUTO_JON2(s_pattern, callback_f, command_type) \
else if(auto_doc<command_type>(s_pattern "[JSON]", generate_reference) && query_info.m_URI == s_pattern) \
{ \
call_found = true; \
uint64_t ticks = misc_utils::get_tick_count(); \
boost::value_initialized<command_type::request> req; \
bool res = epee::serialization::load_t_from_json(static_cast<command_type::request&>(req), query_info.m_body); \
CHECK_AND_ASSERT_MES(res, false, "Failed to parse json: \r\n" << query_info.m_body); \
uint64_t ticks1 = epee::misc_utils::get_tick_count(); \
boost::value_initialized<command_type::response> resp;\
res = callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp), m_conn_context); \
CHECK_AND_ASSERT_MES(res, false, "Failed to call " << #callback_f << "() while handling " << s_pattern); \
uint64_t ticks2 = epee::misc_utils::get_tick_count(); \
epee::serialization::store_t_to_json(static_cast<command_type::response&>(resp), response_info.m_body); \
uint64_t ticks3 = epee::misc_utils::get_tick_count(); \
response_info.m_mime_tipe = "application/json"; \
response_info.m_header_info.m_content_type = " application/json"; \
LOG_PRINT("[HTTP/JSON][" << epee::string_tools::get_ip_string_from_int32(m_conn_context.m_remote_ip ) << "][" << query_info.m_URI << "] processed with " << ticks1-ticks << "/"<< ticks2-ticks1 << "/" << ticks3-ticks2 << "ms", LOG_LEVEL_2); \
}
#define MAP_URI_AUTO_BIN2(s_pattern, callback_f, command_type) \
else if(auto_doc<command_type>(s_pattern "[BIN]", generate_reference) && query_info.m_URI == s_pattern) \
{ \
call_found = true; \
uint64_t ticks = misc_utils::get_tick_count(); \
boost::value_initialized<command_type::request> req; \
bool res = epee::serialization::load_t_from_binary(static_cast<command_type::request&>(req), query_info.m_body); \
CHECK_AND_ASSERT_MES(res, false, "Failed to parse bin body data, body size=" << query_info.m_body.size()); \
uint64_t ticks1 = misc_utils::get_tick_count(); \
boost::value_initialized<command_type::response> resp;\
res = callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp), m_conn_context); \
CHECK_AND_ASSERT_MES(res, false, "Failed to call " << #callback_f << "() while handling " << s_pattern); \
uint64_t ticks2 = misc_utils::get_tick_count(); \
epee::serialization::store_t_to_binary(static_cast<command_type::response&>(resp), response_info.m_body); \
uint64_t ticks3 = epee::misc_utils::get_tick_count(); \
response_info.m_mime_tipe = " application/octet-stream"; \
response_info.m_header_info.m_content_type = " application/octet-stream"; \
LOG_PRINT( "[HTTP/BIN][" << epee::string_tools::get_ip_string_from_int32(m_conn_context.m_remote_ip ) << "][" << query_info.m_URI << "] processed with " << ticks1-ticks << "/"<< ticks2-ticks1 << "/" << ticks3-ticks2 << "ms", LOG_LEVEL_2); \
}
#define CHAIN_TO_PHANDLER(pi_chain_handler) else if (pi_chain_handler && pi_chain_handler->handle_http_request_map(query_info, response_info, m_conn_context, call_found, generate_reference) && call_found) { return true;}
#define CHAIN_URI_MAP2(callback) else {callback(query_info, response_info, m_conn_context);call_found = true;}
#define END_URI_MAP2() return true;}
namespace epee
namespace epee
{
namespace json_rpc
{
@ -169,7 +47,7 @@ namespace epee
t_param params;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(jsonrpc)
KV_SERIALIZE(jsonrpc) DOC_DSCR("") DOC_EXMP("2.0") DOC_END
KV_SERIALIZE(id)
KV_SERIALIZE(method)
KV_SERIALIZE(params)
@ -185,7 +63,7 @@ namespace epee
KV_SERIALIZE(message)
END_KV_SERIALIZE_MAP()
};
struct dummy_error
{
BEGIN_KV_SERIALIZE_MAP()
@ -220,7 +98,7 @@ namespace epee
t_param result;
epee::serialization::storage_entry id;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(jsonrpc)
KV_SERIALIZE(jsonrpc) DOC_DSCR("") DOC_EXMP("2.0") DOC_END
KV_SERIALIZE(id)
KV_SERIALIZE(result)
END_KV_SERIALIZE_MAP()
@ -245,20 +123,277 @@ namespace epee
}
}
template<typename command_type_t>
struct json_command_type_t
template<typename typename_t>
typename_t get_documentation_json_struct()
{
typedef typename epee::json_rpc::request<typename command_type_t::request> request;
typedef typename epee::json_rpc::request<typename command_type_t::response> response;
return AUTO_VAL_INIT_T(typename_t);
}
struct documentation_entry
{
std::string uri;
bool is_binary = false; //if not - then it's JSON
std::string json_method_name;
std::string request_json_example;
std::string request_json_descriptions;
std::string response_json_example;
std::string response_json_descriptions;
std::string method_general_decription;
};
#define JSON_RPC_REFERENCE_MARKER "JSON_RPC"
struct documentation
{
bool do_generate_documentation = false;
std::list<documentation_entry> entries;
};
// Primary template
template<typename T>
struct has_static_member_description {
private:
// SFINAE test function
template<typename U>
static auto test(int) -> decltype(U::description, std::true_type{});
// Fallback function
template<typename>
static auto test(...) -> std::false_type;
public:
// Member constant indicating whether T has a static member
static constexpr bool value = decltype(test<T>(0))::value;
};
#define BEGIN_JSON_RPC_MAP(uri) else if(query_info.m_URI == JSON_RPC_REFERENCE_MARKER || query_info.m_URI == uri) \
template <typename T>
const char* get_command_description()
{
if constexpr (has_static_member_description<T>::value)
{
return T::description;
}
else
{
return "NO DESCRIPTION";
}
}
template <typename T>
void f(T) {} // Definition #2
// Base template
template<typename T>
struct is_std_simple_container : std::false_type {};
// Specializations for each container
template<typename T, typename Alloc>
struct is_std_simple_container<std::vector<T, Alloc>> : std::true_type {};
template<typename T, typename Alloc>
struct is_std_simple_container<std::deque<T, Alloc>> : std::true_type {};
template<typename T, typename Alloc>
struct is_std_simple_container<std::list<T, Alloc>> : std::true_type {};
template<typename T, std::size_t N>
struct is_std_simple_container<std::array<T, N>> : std::true_type {};
template<typename command_type_t, bool is_json_rpc_method>
bool auto_doc(const std::string& uri, const std::string& method, bool is_json, documentation& docs)
{
if (!docs.do_generate_documentation) return true;
docs.entries.resize(docs.entries.size()+1);
docs.entries.back().is_binary = !is_json;
docs.entries.back().uri = uri;
docs.entries.back().json_method_name = method;
docs.entries.back().method_general_decription = get_command_description<command_type_t>();
if constexpr (is_json_rpc_method)
{
//json rpc-like call
typedef typename epee::json_rpc::request<typename command_type_t::request> request_t;
typedef typename epee::json_rpc::response<typename command_type_t::response, typename epee::json_rpc::dummy_error> response_t;
request_t req = AUTO_VAL_INIT(req); //get_documentation_json_struct<request_t>();
if constexpr (is_std_simple_container<typename command_type_t::request>::value)
{
req.params.resize(1);
}
response_t res = AUTO_VAL_INIT(res);
if constexpr (is_std_simple_container<typename command_type_t::response>::value)
{
req.result.resize(1);
}
req.method = method;
epee::serialization::portable_storage_extended_doc ps;
req.store(ps, nullptr);
ps.dump_as_json(docs.entries.back().request_json_example);
ps.dump_as_decriptions(docs.entries.back().request_json_descriptions);
epee::serialization::portable_storage_extended_doc ps_res;
res.store(ps_res, nullptr);
ps_res.dump_as_json(docs.entries.back().response_json_example);
ps_res.dump_as_decriptions(docs.entries.back().response_json_descriptions);
}
else
{
//json/bin uri/based
typedef typename command_type_t::request request_t;
typedef typename command_type_t::response response_t;
request_t req = AUTO_VAL_INIT(req); //get_documentation_json_struct<request_t>();
response_t res = AUTO_VAL_INIT(res); //get_documentation_json_struct<response_t>();
epee::serialization::portable_storage_extended_doc ps;
req.store(ps, nullptr);
ps.dump_as_json(docs.entries.back().request_json_example);
ps.dump_as_decriptions(docs.entries.back().request_json_descriptions);
epee::serialization::portable_storage_extended_doc ps_res;
res.store(ps_res, nullptr);
ps_res.dump_as_json(docs.entries.back().response_json_example);
ps_res.dump_as_decriptions(docs.entries.back().response_json_descriptions);
}
// std::stringstream ss;
// ss << prefix_name << ENDL
// << "REQUEST: " << ENDL << req_str << ENDL << req_str_descr << "--------------------------------" << ENDL
// << "RESPONSE: " << ENDL << res_str << ENDL << res_str_descr << "################################" << ENDL;
// generate_reference += ss.str();
return true;
//return auto_doc_t<typename command_type_t::request, typename command_type_t::response>(prefix_name, generate_reference);
}
namespace epee {
namespace net_utils {
namespace http {
struct i_chain_handler
{
virtual bool handle_http_request(const epee::net_utils::http::http_request_info& query_info, epee::net_utils::http::http_response_info& response_info,
epee::net_utils::connection_context_base& conn_context, bool& call_found, documentation& docs = epee::net_utils::http::i_chain_handler::m_empty_documentation)
{
return this->handle_http_request_map(query_info, response_info, conn_context, call_found, docs);
}
virtual bool handle_http_request_map(const epee::net_utils::http::http_request_info& query_info, epee::net_utils::http::http_response_info& response_info,
epee::net_utils::connection_context_base& m_conn_context, bool& call_found, documentation& docs = epee::net_utils::http::i_chain_handler::m_empty_documentation) = 0;
static inline documentation m_empty_documentation;
};
}
}
}
#define CHAIN_HTTP_TO_MAP2(context_type) bool handle_http_request(const epee::net_utils::http::http_request_info& query_info, \
epee::net_utils::http::http_response_info& response, \
context_type& m_conn_context) \
{\
response.m_response_code = 200; \
response.m_response_comment = "Ok"; \
bool call_found = false; \
if(!handle_http_request_map(query_info, response, m_conn_context, call_found) && response.m_response_code == 200) \
{ response.m_response_code = 500; response.m_response_comment = "Internal Server Error"; return true; } \
if (!call_found) \
{ response.m_response_code = 404; response.m_response_comment = "Not Found"; return true; } \
return true; \
}
#define BEGIN_URI_MAP2() template<class t_context> bool handle_http_request_map(const epee::net_utils::http::http_request_info& query_info, \
epee::net_utils::http::http_response_info& response_info, \
t_context& m_conn_context, bool& call_found, documentation& docs = epee::net_utils::http::i_chain_handler::m_empty_documentation) { \
call_found = false; \
if(false) return true; //just a stub to have "else if"
#define BEGIN_URI_MAP2_VIRTUAL() virtual bool handle_http_request_map(const epee::net_utils::http::http_request_info& query_info, \
epee::net_utils::http::http_response_info& response_info, \
epee::net_utils::connection_context_base& m_conn_context, bool& call_found, documentation& docs = epee::net_utils::http::i_chain_handler::m_empty_documentation) { \
call_found = false; \
if(false) return true; //just a stub to have "else if"
#define MAP_URI2(pattern, callback) else if(std::string::npos != query_info.m_URI.find(pattern)) return callback(query_info, response_info, m_conn_context);
#define MAP_URI_AUTO_XML2(s_pattern, callback_f, command_type) //TODO: don't think i ever again will use xml - ambiguous and "overtagged" format
#define MAP_URI_AUTO_JON2(s_pattern, callback_f, command_type) \
else if(auto_doc<command_type, false>(s_pattern, "", true, docs) && query_info.m_URI == s_pattern) \
{ \
if(query_info.m_URI == JSON_RPC_REFERENCE_MARKER) {generate_reference = "JSON RPC URL: " uri "\n";} \
call_found = true; \
uint64_t ticks = misc_utils::get_tick_count(); \
boost::value_initialized<command_type::request> req; \
bool res = epee::serialization::load_t_from_json(static_cast<command_type::request&>(req), query_info.m_body); \
CHECK_AND_ASSERT_MES(res, false, "Failed to parse json: \r\n" << query_info.m_body); \
uint64_t ticks1 = epee::misc_utils::get_tick_count(); \
boost::value_initialized<command_type::response> resp;\
res = callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp), m_conn_context); \
CHECK_AND_ASSERT_MES(res, false, "Failed to call " << #callback_f << "() while handling " << s_pattern); \
uint64_t ticks2 = epee::misc_utils::get_tick_count(); \
epee::serialization::store_t_to_json(static_cast<command_type::response&>(resp), response_info.m_body); \
uint64_t ticks3 = epee::misc_utils::get_tick_count(); \
response_info.m_mime_tipe = "application/json"; \
response_info.m_header_info.m_content_type = " application/json"; \
LOG_PRINT("[HTTP/JSON][" << epee::string_tools::get_ip_string_from_int32(m_conn_context.m_remote_ip ) << "][" << query_info.m_URI << "] processed with " << ticks1-ticks << "/"<< ticks2-ticks1 << "/" << ticks3-ticks2 << "ms", LOG_LEVEL_2); \
}
#define MAP_URI_AUTO_BIN2(s_pattern, callback_f, command_type) \
else if(auto_doc<command_type, false>(s_pattern, "", false, docs) && query_info.m_URI == s_pattern) \
{ \
call_found = true; \
uint64_t ticks = misc_utils::get_tick_count(); \
boost::value_initialized<command_type::request> req; \
bool res = epee::serialization::load_t_from_binary(static_cast<command_type::request&>(req), query_info.m_body); \
CHECK_AND_ASSERT_MES(res, false, "Failed to parse bin body data, body size=" << query_info.m_body.size()); \
uint64_t ticks1 = misc_utils::get_tick_count(); \
boost::value_initialized<command_type::response> resp;\
res = callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp), m_conn_context); \
CHECK_AND_ASSERT_MES(res, false, "Failed to call " << #callback_f << "() while handling " << s_pattern); \
uint64_t ticks2 = misc_utils::get_tick_count(); \
epee::serialization::store_t_to_binary(static_cast<command_type::response&>(resp), response_info.m_body); \
uint64_t ticks3 = epee::misc_utils::get_tick_count(); \
response_info.m_mime_tipe = " application/octet-stream"; \
response_info.m_header_info.m_content_type = " application/octet-stream"; \
LOG_PRINT( "[HTTP/BIN][" << epee::string_tools::get_ip_string_from_int32(m_conn_context.m_remote_ip ) << "][" << query_info.m_URI << "] processed with " << ticks1-ticks << "/"<< ticks2-ticks1 << "/" << ticks3-ticks2 << "ms", LOG_LEVEL_2); \
}
#define CHAIN_TO_PHANDLER(pi_chain_handler) else if (pi_chain_handler && pi_chain_handler->handle_http_request(query_info, response_info, m_conn_context, call_found, docs) && call_found) { return true;}
#define CHAIN_URI_MAP2(callback) else {callback(query_info, response_info, m_conn_context);call_found = true;}
#define END_URI_MAP2() return true;}
//template<typename command_type_t>
//struct json_command_type_t
//{
// typedef typename epee::json_rpc::request<typename command_type_t::request> request;
// typedef typename epee::json_rpc::request<typename command_type_t::response> response;
//};
//#define JSON_RPC_REFERENCE_MARKER "JSON_RPC"
// if(query_info.m_URI == JSON_RPC_REFERENCE_MARKER) {generate_reference = "JSON RPC URL: " uri "\n";} \
#define BEGIN_JSON_RPC_MAP(uri) else if(docs.do_generate_documentation || query_info.m_URI == uri) \
{ \
const char* current_zone_json_uri = uri;\
LOG_PRINT_L4("[JSON_REQUEST_BODY]: " << ENDL << query_info.m_body); \
uint64_t ticks = epee::misc_utils::get_tick_count(); \
epee::serialization::portable_storage ps; \
@ -317,7 +452,7 @@ struct json_command_type_t
LOG_PRINT( query_info.m_URI << "[" << method_name << "] processed with " << ticks1-ticks << "/"<< ticks2-ticks1 << "/" << ticks3-ticks2 << "ms", LOG_LEVEL_2);
#define MAP_JON_RPC_WE(method_name, callback_f, command_type) \
else if(auto_doc<json_command_type_t<command_type>>("[" method_name "]", generate_reference) && callback_name == method_name) \
else if(auto_doc<command_type, true>(current_zone_json_uri, method_name, true, docs) && callback_name == method_name) \
{ \
call_found = true; \
PREPARE_OBJECTS_FROM_JSON(command_type) \
@ -335,7 +470,7 @@ struct json_command_type_t
}
#define MAP_JON_RPC_WERI(method_name, callback_f, command_type) \
else if(auto_doc<json_command_type_t<command_type>>("[" method_name "]", generate_reference) && callback_name == method_name) \
else if(auto_doc<command_type, true>(current_zone_json_uri, method_name, true, docs) && callback_name == method_name) \
{ \
call_found = true; \
PREPARE_OBJECTS_FROM_JSON(command_type) \
@ -353,7 +488,27 @@ struct json_command_type_t
}
#define MAP_JON_RPC(method_name, callback_f, command_type) \
else if(auto_doc<json_command_type_t<command_type>>(std::string("[") + method_name + "]", generate_reference) && callback_name == method_name) \
else if(auto_doc<command_type, true>(current_zone_json_uri, method_name, true, docs) && callback_name == method_name) \
{ \
call_found = true; \
PREPARE_OBJECTS_FROM_JSON(command_type) \
if(!callback_f(req.params, resp.result, m_conn_context)) \
{ \
epee::json_rpc::error_response fail_resp = AUTO_VAL_INIT(fail_resp); \
fail_resp.jsonrpc = "2.0"; \
fail_resp.method = req.method; \
fail_resp.id = req.id; \
fail_resp.error.code = -32603; \
fail_resp.error.message = "Internal error"; \
epee::serialization::store_t_to_json(static_cast<epee::json_rpc::error_response&>(fail_resp), response_info.m_body); \
return true; \
} \
FINALIZE_OBJECTS_TO_JSON(method_name) \
return true;\
}
#define MAP_JON_RPC_CONDITIONAL(method_name, callback_f, command_type, predicate) \
else if(predicate && auto_doc<command_type, true>(current_zone_json_uri, method_name, true, docs) && callback_name == method_name) \
{ \
call_found = true; \
PREPARE_OBJECTS_FROM_JSON(command_type) \
@ -386,4 +541,53 @@ struct json_command_type_t
return true; \
}
namespace epee
{
template<typename t_rpc_server>
bool generate_doc_as_md_files(const std::string& folder, t_rpc_server& server, const std::string& sufix = std::string())
{
LOG_PRINT_L0("Dumping RPC auto-generated documents!");
epee::net_utils::http::http_request_info query_info;
epee::net_utils::http::http_response_info response_info;
epee::net_utils::connection_context_base conn_context;
//std::string generate_reference = std::string("WALLET_RPC_COMMANDS_LIST:\n");
bool call_found = false;
documentation docs;
docs.do_generate_documentation = true;
// query_info.m_URI = JSON_RPC_REFERENCE_MARKER;
query_info.m_body = "{\"jsonrpc\": \"2.0\", \"method\": \"nonexisting_method\", \"params\": {}},";
server.handle_http_request_map(query_info, response_info, conn_context, call_found, docs);
for (const auto& de : docs.entries)
{
std::stringstream ss;
ss << de.method_general_decription << ENDL << ENDL;;
ss << "URL: ```http:://127.0.0.1:11211" << de.uri << "```" << ENDL;
ss << "### Request: " << ENDL << "```json" << ENDL << de.request_json_example << ENDL << "```" << ENDL;
ss << "### Request description: " << ENDL << "```" << ENDL << de.request_json_descriptions << ENDL << "```" << ENDL;
ss << "### Response: " << ENDL << "```json" << ENDL << de.response_json_example << ENDL << "```" << ENDL;
ss << "### Response description: " << ENDL << "```" << ENDL << de.response_json_descriptions << ENDL << "```" << ENDL;
ss << sufix;
std::string filename = de.json_method_name;
if (!filename.size())
{
filename = de.uri;
if (filename.front() == '/')
filename.erase(filename.begin());
}
filename += ".md";
bool r = epee::file_io_utils::save_string_to_file(folder + "/" + filename, ss.str());
if (!r)
{
LOG_ERROR("Failed to save file " << filename);
return false;
}
}
return true;
}
}

View file

@ -33,6 +33,25 @@
#define LEVIN_SIGNATURE 0x0101010101012101LL //Bender's nightmare
#define LEVIN_OK 0
#define LEVIN_ERROR_CONNECTION -1
#define LEVIN_ERROR_CONNECTION_NOT_FOUND -2
#define LEVIN_ERROR_CONNECTION_DESTROYED -3
#define LEVIN_ERROR_CONNECTION_TIMEDOUT -4
#define LEVIN_ERROR_CONNECTION_NO_DUPLEX_PROTOCOL -5
#define LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED -6
#define LEVIN_ERROR_FORMAT -7
#define LEVIN_ERROR_EXCEPTION -8
#define LEVIN_ERROR_UNKNOWN_ERROR -9
#define LEVIN_ERROR_INTERNAL -10
#define LEVIN_ERROR_PROTOCOL_INCONSISTENT -11
#define LEVIN_ERROR_NET_ERROR -12
#define LEVIN_ERROR_SIGNATURE_MISMATCH -13
namespace epee
{
namespace levin
@ -86,23 +105,15 @@ namespace levin
virtual void on_connection_new(t_connection_context& context){};
virtual void on_connection_close(t_connection_context& context){};
};
#define LEVIN_OK 0
#define LEVIN_ERROR_CONNECTION -1
#define LEVIN_ERROR_CONNECTION_NOT_FOUND -2
#define LEVIN_ERROR_CONNECTION_DESTROYED -3
#define LEVIN_ERROR_CONNECTION_TIMEDOUT -4
#define LEVIN_ERROR_CONNECTION_NO_DUPLEX_PROTOCOL -5
#define LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED -6
#define LEVIN_ERROR_FORMAT -7
#define LEVIN_ERROR_EXCEPTION -8
#define LEVIN_ERROR_UNKNOWN_ERROR -9
#define LEVIN_ERROR_INTERNAL -10
#define LEVIN_ERROR_PROTOCOL_INCONSISTENT -11
#define LEVIN_ERROR_NET_ERROR -12
#define LEVIN_ERROR_SIGNATURE_MISMATCH -13
template<class t_connection_context = net_utils::connection_context_base>
struct levin_commands_handler_dummy: public levin_commands_handler<t_connection_context>
{
virtual int invoke(int command, const std::string& in_buff, std::string& buff_out, t_connection_context& context) { return LEVIN_OK; }
virtual int notify(int command, const std::string& in_buff, t_connection_context& context) { return LEVIN_OK; }
};
#define DESCRIBE_RET_CODE(code) case code: return #code;
inline

View file

@ -59,6 +59,7 @@ class async_protocol_handler_config
critical_section m_connects_lock;
std::atomic<bool> m_is_in_sendstop_loop;
connections_map m_connects;
levin_commands_handler_dummy<t_connection_context> m_commands_handler_dummy;
void add_connection(async_protocol_handler<t_connection_context>* pc);
void del_connection(async_protocol_handler<t_connection_context>* pc);
@ -87,7 +88,7 @@ public:
bool foreach_connection(callback_t cb);
size_t get_connections_count();
async_protocol_handler_config() :m_pcommands_handler(NULL), m_max_packet_size(LEVIN_DEFAULT_MAX_PACKET_SIZE), m_is_in_sendstop_loop(false), m_invoke_timeout{}
async_protocol_handler_config() :m_pcommands_handler(&m_commands_handler_dummy), m_max_packet_size(LEVIN_DEFAULT_MAX_PACKET_SIZE), m_is_in_sendstop_loop(false), m_invoke_timeout{}
{}
~async_protocol_handler_config()
{
@ -252,6 +253,7 @@ public:
LOG_PRINT_CC(m_connection_context, "[LEVIN_PROTOCOL" << this << "] CONSTRUCTED", LOG_LEVEL_4);
}
virtual ~async_protocol_handler()
{
NESTED_TRY_ENTRY();
@ -278,6 +280,11 @@ public:
NESTED_CATCH_ENTRY(__func__);
}
void on_pre_destroy()
{
m_config.del_connection(this);
}
bool start_outer_call()
{
LOG_PRINT_CC_L4(m_connection_context, "[LEVIN_PROTOCOL" << this << "] -->> start_outer_call");
@ -349,7 +356,7 @@ public:
//update threads name to see connection context where errors came from
std::string original_prefix = epee::log_space::log_singletone::get_thread_log_prefix();
epee::log_space::log_singletone::set_thread_log_prefix(original_prefix + "[" + epee::net_utils::print_connection_context_short(m_connection_context) + "]");
ON_EXIT([&](){epee::log_space::log_singletone::set_thread_log_prefix(original_prefix); });
ON_FUNC_EXIT([&](){epee::log_space::log_singletone::set_thread_log_prefix(original_prefix); });
//create_scope_leave_handler()
@ -810,7 +817,9 @@ template<class t_connection_context> template<class callback_t>
bool async_protocol_handler_config<t_connection_context>::foreach_connection(callback_t cb)
{
CRITICAL_REGION_LOCAL(m_connects_lock);
for(auto& c: m_connects)
//in case any of the cb() leads to erasing items from m_connects, let's go over local copy of it
auto connects_local = m_connects;
for(auto& c: connects_local)
{
async_protocol_handler<t_connection_context>* aph = c.second;
if(!cb(aph->get_context_ref()))

View file

@ -1,4 +1,4 @@
// Copyright (c) 2019, anonimal, <anonimal@zano.org>
// Copyright (c) 2019, anonimal, <anonimal@zano.org>
// Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net
// All rights reserved.
//
@ -116,7 +116,9 @@ namespace epee
void on_after_connect()
{
LOG_PRINT_L2("SSL Handshake....");
m_socket.handshake(boost::asio::ssl::stream_base::client);
LOG_PRINT_L2("SSL Handshake OK");
}
private:
@ -149,11 +151,52 @@ namespace epee
{
}
void reset()
{
}
private:
boost::asio::ip::tcp::socket m_socket;
};
template<bool is_ssl>
struct socket_backend_resetable
{
socket_backend_resetable(boost::asio::io_service& _io_service) : mr_io_service(_io_service), m_pbackend(std::make_shared<socket_backend<is_ssl>>(_io_service))
{}
boost::asio::ip::tcp::socket& get_socket()
{
return m_pbackend->get_socket();
}
void set_domain(const std::string& domain_name)
{
return m_pbackend->set_domain(domain_name);
}
auto& get_stream()
{
return m_pbackend->get_stream();
}
void on_after_connect()
{
return m_pbackend->on_after_connect();
}
void reset()
{
m_pbackend = std::make_shared<socket_backend<is_ssl>>(mr_io_service);
}
private:
boost::asio::io_service& mr_io_service;
std::shared_ptr<socket_backend<is_ssl>> m_pbackend;
};
template<bool is_ssl>
@ -227,6 +270,7 @@ namespace epee
inline
bool connect(const std::string& addr, const std::string& port, unsigned int connect_timeout, unsigned int reciev_timeout, const std::string& bind_ip = "0.0.0.0")
{
LOG_PRINT_L1("Connecting to " << addr << ":" << port << ", cn_timeout: " << connect_timeout << ", rv_timeout: " << reciev_timeout);
m_connect_timeout = connect_timeout;
m_reciev_timeout = reciev_timeout;
m_connected = false;
@ -238,7 +282,7 @@ namespace epee
m_sct_back.get_socket().close();
// Get a list of endpoints corresponding to the server name.
m_sct_back.reset();
//////////////////////////////////////////////////////////////////////////
boost::asio::ip::tcp::resolver resolver(m_io_service);
@ -281,13 +325,14 @@ namespace epee
if (!ec && m_sct_back.get_socket().is_open())
{
m_sct_back.on_after_connect();
m_connected = true;
m_connected = true;
m_deadline.expires_at(boost::posix_time::pos_infin);
LOG_PRINT_L1("Connected OK: " << addr << ":" << port);
return true;
}
else
{
LOG_PRINT("Some problems at connect, message: " << ec.message(), LOG_LEVEL_3);
LOG_PRINT("Error on connect to " << addr << ":" << port << ", message: " << ec.message(), LOG_LEVEL_3);
return false;
}
@ -652,7 +697,7 @@ namespace epee
// The deadline has passed. The socket is closed so that any outstanding
// asynchronous operations are cancelled. This allows the blocked
// connect(), read_line() or write_line() functions to return.
LOG_PRINT_L3("Timed out socket");
LOG_PRINT_L2("Timed out socket");
m_connected = false;
m_sct_back.get_socket().close();
@ -669,7 +714,7 @@ namespace epee
protected:
boost::asio::io_service m_io_service;
socket_backend<is_ssl> m_sct_back;
socket_backend_resetable<is_ssl> m_sct_back;//socket_backend<is_ssl> m_sct_back;
int m_connect_timeout;
int m_reciev_timeout;
bool m_initialized;

View file

@ -1,3 +1,4 @@
// Copyright (c) 2024, Zano Project
// Copyright (c) 2006-2017, Andrey N. Sabelnikov, www.sabelnikov.net
// All rights reserved.
//
@ -35,11 +36,14 @@ namespace epee
inline std::string print_fixed_decimal_point(t_number amount, size_t decimal_point)
{
std::string s = boost::lexical_cast<std::string>(amount);
if (decimal_point > 32)
return std::string("!!") + s; // avoiding overflow issues
if (s.size() < decimal_point + 1)
{
s.insert(0, decimal_point + 1 - s.size(), '0');
}
s.insert(s.size() - decimal_point, ".");
if (decimal_point > 0)
s.insert(s.size() - decimal_point, ".");
return s;
}
}

View file

@ -1,4 +1,4 @@
// Copyright (c) 2019, anonimal <anonimal@lethean.org>
// Copyright (c) 2019, anonimal <anonimal@zano.org>
// Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net
// All rights reserved.
//

View file

@ -25,6 +25,8 @@
//
#pragma once
#include <type_traits>
#include <optional>
#include "misc_language.h"
namespace epee
{
@ -51,24 +53,73 @@ namespace epee
}
};
template<typename T>
struct is_std_optional : std::false_type {};
template<typename T>
struct is_std_optional<std::optional<T>> : std::true_type {};
template<typename T>
struct is_std_optional<boost::optional<T>> : std::true_type {};
//basic helpers for pod-to-hex serialization
template<class t_pod_type>
std::string transform_t_pod_to_str_internal(const t_pod_type& a)
{
return epee::string_tools::pod_to_hex(a);
}
template<class t_pod_type>
std::string transform_t_pod_to_str_internal(const std::optional<t_pod_type>& a)
{
if (a.has_value())
return epee::string_tools::pod_to_hex(*a);
else
return "";
}
template<class t_pod_type>
std::string transform_t_pod_to_str_internal(const boost::optional<t_pod_type>& a)
{
if (a.has_value())
return epee::string_tools::pod_to_hex(*a);
else
return "";
}
//basic helpers for pod-to-hex serialization
template<class t_pod_type>
std::string transform_t_pod_to_str(const t_pod_type & a)
{
return epee::string_tools::pod_to_hex(a);
return transform_t_pod_to_str_internal(a);
}
template<class t_pod_type>
template<class t_pod_type>
t_pod_type transform_str_to_t_pod(const std::string& a)
{
t_pod_type res = AUTO_VAL_INIT(res);
t_pod_type res = AUTO_VAL_INIT(res);
if (a.empty())
return res;
if constexpr (is_std_optional<t_pod_type>::value)
{
typename t_pod_type::value_type v = AUTO_VAL_INIT(v);
if (!epee::string_tools::hex_to_pod(a, v))
throw std::runtime_error(std::string("Unable to transform \"") + a + "\" to pod type " + typeid(typename t_pod_type::value_type).name());
return v;
}
if (!epee::string_tools::hex_to_pod(a, res))
throw std::runtime_error(std::string("Unable to transform \"") + a + "\" to pod type " + typeid(t_pod_type).name());
return res;
}
//basic helpers for blob-to-hex serialization
inline std::string transform_binbuf_to_hexstr(const std::string& a)
@ -85,6 +136,57 @@ namespace epee
}
return res;
}
// helper for blob-to-base64 serialization
inline std::string transfrom_binbuf_to_base64(const std::string& a)
{
return epee::string_encoding::base64_encode(a);
}
inline std::string transform_base64_to_binbuf(const std::string& a)
{
return epee::string_encoding::base64_decode(a);
}
//basic helpers for pod-to-hex serialization
template<class t_pod_container_type>
std::string transform_t_pod_array_to_hex_str_array(const t_pod_container_type& a)
{
std::string res;
for (const auto& item : a)
{
res += epee::string_tools::pod_to_hex(item) + ", ";
}
if (a.size())
{
res.erase(res.size() - 2);
}
return res;
}
template<class t_pod_container_type>
t_pod_container_type transform_hex_str_array_to_t_pod_array(const std::string& a)
{
std::vector<std::string> pod_items;
boost::split(pod_items, a, boost::is_any_of(", ][\""));
t_pod_container_type res;
if (!a.size())
return res;
for (const auto& item : pod_items)
{
if(!item.size())
continue;
res.resize(res.size() + 1);
typename t_pod_container_type::value_type& pod_val = res.back();
if (!epee::string_tools::hex_to_pod(item, pod_val))
throw std::runtime_error(std::string("Unable to transform \"") + item + "\" to pod type " + typeid(typename t_pod_container_type::value_type).name());
}
return res;
}
//-------------------------------------------------------------------------------------------------------------------
#pragma pack(push, 1)
template<class first_t, class second_t>

View file

@ -32,7 +32,7 @@
#include "keyvalue_helpers.h"
#include "keyvalue_serialization_overloads.h"
namespace epee
{
{
/************************************************************************/
/* Serialize map declarations */
/************************************************************************/
@ -65,13 +65,72 @@ public: \
static bool serialize_map(this_type& this_ref, t_storage& stg, typename t_storage::hsection hparent_section) \
{
#define KV_CAT_(a, b) a ## b
#define KV_CAT(a, b) KV_CAT_(a, b)
#define VARNAME(Var) KV_CAT(Var, __LINE__)
#define KV_MAKE_ALIAS_NAME() VARNAME(alias_tmp_name)
#define KV_MAKE_VAR_NAME() VARNAME(val_tmp_name)
#define KV_SERIALIZE_N(varialble, val_name) \
using KV_MAKE_ALIAS_NAME() [[maybe_unused]] = decltype(this_ref.varialble); \
[[maybe_unused]] const char* KV_MAKE_VAR_NAME() = val_name;\
epee::serialization::selector<is_store>::serialize(this_ref.varialble, stg, hparent_section, val_name);
//#define KV_SERIALIZE_N_DOC(varialble, val_name) \
// using KV_MAKE_ALIAS_NAME() = decltype(this_ref.varialble); \
// epee::serialization::selector<is_store>::serialize(this_ref.varialble, stg, hparent_section, val_name); \
// if constexpr (t_storage::use_descriptions::value) \
// { \
// epee::serialization::selector<is_store>::template serialize_and_doc<KV_MAKE_ALIAS_NAME()>(stg, hparent_section, val_name
#define DOC_DSCR(description) if constexpr (t_storage::use_descriptions::value) \
{ \
epee::serialization::selector<is_store>::template serialize_and_doc<KV_MAKE_ALIAS_NAME()>(stg, hparent_section, KV_MAKE_VAR_NAME(), description
/*
{using var_type = decltype(this_ref.varialble); \
epee::serialization::selector<is_store>::serialize(this_ref.varialble, stg, hparent_section, val_name); \
if constexpr (t_storage::use_descriptions::value) \
{ \
epee::serialization::selector<is_store>::set_descr<var_type>(stg, hparent_section, val_name, description, default = var_type()); \
} \
}
*/
//#define DOC_DSCR(description) , description
#define DOC_EXMP(substitute) , substitute
//#define DOC_EXMP_AUTO_1(arg_1) , KV_MAKE_ALIAS_NAME() (arg_1)
//#define DOC_EXMP_AUTO_2(arg_1, arg_2) , KV_MAKE_ALIAS_NAME() (arg_1, arg_2)
#define DOC_END ); }
#define DOC_EXMP_AUTO(...) , epee::create_t_object<KV_MAKE_ALIAS_NAME() >(__VA_ARGS__)
#define DOC_EXMP_AGGR(...) , epee::create_t_object<KV_MAKE_ALIAS_NAME() >(KV_MAKE_ALIAS_NAME(){__VA_ARGS__})
// Function template to create an object with forwarded constructor arguments
template<typename T, typename... Args>
T create_t_object(Args&&... args) {
return T(std::forward<Args>(args)...);
}
//substitute, description);
//#define DOC_EXAMPLE(substitute) substitute,
//#define DOC_EX(substitute__) var_type(substitute__),
//#define DOC_COMMAND(command_general_description) static const char* explain_yourseflf = command_general_description;
#define KV_SERIALIZE_CUSTOM_N(varialble, stored_type, from_v_to_stored, from_stored_to_v, val_name) \
using KV_MAKE_ALIAS_NAME() [[maybe_unused]] = stored_type; \
[[maybe_unused]] const char* VARNAME(val_tmp_name) = val_name;\
epee::serialization::selector<is_store>::template serialize_custom<stored_type>(this_ref.varialble, stg, hparent_section, val_name, from_v_to_stored, from_stored_to_v);
#define KV_SERIALIZE_EPHEMERAL_N(stored_type, from_v_to_stored, val_name) \
using KV_MAKE_ALIAS_NAME() [[maybe_unused]] = stored_type; \
[[maybe_unused]] const char* VARNAME(val_tmp_name) = val_name;\
epee::serialization::selector<is_store>::template serialize_ephemeral<stored_type>(this_ref, stg, hparent_section, val_name, from_v_to_stored);
@ -81,6 +140,8 @@ public: \
#define KV_SERIALIZE_BLOB_AS_HEX_STRING_N(varialble, val_name) \
KV_SERIALIZE_CUSTOM_N(varialble, std::string, epee::transform_binbuf_to_hexstr, epee::transform_hexstr_to_binbuff, val_name)
#define KV_SERIALIZE_BLOB_AS_BASE64_STRING_N(varialble, val_name) \
KV_SERIALIZE_CUSTOM_N(varialble, std::string, epee::transfrom_binbuf_to_base64, epee::transform_base64_to_binbuf, val_name)
#define KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, val_name) \
epee::serialization::selector<is_store>::serialize_t_val_as_blob(this_ref.varialble, stg, hparent_section, val_name);
@ -89,19 +150,30 @@ public: \
static_assert(std::is_pod<decltype(this_ref.varialble)>::value, "t_type must be a POD type."); \
KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, val_name)
#define KV_SERIALIZE_CONTAINER_POD_AS_HEX_N(varialble, val_name) \
KV_SERIALIZE_CUSTOM_N(varialble, std::string, epee::transform_t_pod_array_to_hex_str_array<decltype(varialble)>, epee::transform_hex_str_array_to_t_pod_array<decltype(varialble)>, val_name)
#define KV_SERIALIZE_CONTAINER_POD_AS_BLOB_N(varialble, val_name) \
epee::serialization::selector<is_store>::serialize_stl_container_pod_val_as_blob(this_ref.varialble, stg, hparent_section, val_name);
#define END_KV_SERIALIZE_MAP() return true;}
#define KV_SERIALIZE(varialble) KV_SERIALIZE_N(varialble, #varialble)
#define KV_SERIALIZE_VAL_POD_AS_BLOB(varialble) KV_SERIALIZE_VAL_POD_AS_BLOB_N(varialble, #varialble)
#define KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE(varialble) KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, #varialble) //skip is_pod compile time check
#define KV_SERIALIZE_CONTAINER_POD_AS_BLOB(varialble) KV_SERIALIZE_CONTAINER_POD_AS_BLOB_N(varialble, #varialble)
#define KV_SERIALIZE_CUSTOM(varialble, stored_type, from_v_to_stored, from_stored_to_v) KV_SERIALIZE_CUSTOM_N(varialble, stored_type, from_v_to_stored, from_stored_to_v, #varialble)
#define KV_SERIALIZE_POD_AS_HEX_STRING(varialble) KV_SERIALIZE_POD_AS_HEX_STRING_N(varialble, #varialble)
#define KV_SERIALIZE_BLOB_AS_HEX_STRING(varialble) KV_SERIALIZE_BLOB_AS_HEX_STRING_N(varialble, #varialble)
#define KV_SERIALIZE(varialble) KV_SERIALIZE_N(varialble, #varialble)
#define KV_SERIALIZE_DOC(varialble) KV_SERIALIZE_N_DOC( varialble, #varialble)
#define DOC_COMMAND(desciption_text) inline static const char* description = desciption_text;
#define KV_SERIALIZE_VAL_POD_AS_BLOB(varialble) KV_SERIALIZE_VAL_POD_AS_BLOB_N(varialble, #varialble)
#define KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE(varialble) KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, #varialble) //skip is_pod compile time check
#define KV_SERIALIZE_CONTAINER_POD_AS_BLOB(varialble) KV_SERIALIZE_CONTAINER_POD_AS_BLOB_N(varialble, #varialble)
#define KV_SERIALIZE_CONTAINER_POD_AS_HEX(varialble) KV_SERIALIZE_CONTAINER_POD_AS_HEX_N(varialble, #varialble)
#define KV_SERIALIZE_CUSTOM(varialble, stored_type, from_v_to_stored, from_stored_to_v) KV_SERIALIZE_CUSTOM_N(varialble, stored_type, from_v_to_stored, from_stored_to_v, #varialble)
#define KV_SERIALIZE_POD_AS_HEX_STRING(varialble) KV_SERIALIZE_POD_AS_HEX_STRING_N(varialble, #varialble)
#define KV_SERIALIZE_BLOB_AS_HEX_STRING(varialble) KV_SERIALIZE_BLOB_AS_HEX_STRING_N(varialble, #varialble)
#define KV_SERIALIZE_BLOB_AS_BASE64_STRING(variable) KV_SERIALIZE_BLOB_AS_BASE64_STRING_N(variable, #variable)
#define KV_CHAIN_MAP(variable_obj) epee::namespace_accessor<decltype(this_ref.variable_obj)>::template serialize_map<is_store>(this_ref.variable_obj, stg, hparent_section);

View file

@ -1,3 +1,4 @@
// Copyright (c) 2024, Zano Project
// Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net
// All rights reserved.
//
@ -116,7 +117,7 @@ namespace epee
static bool unserialize_stl_container_t_val(stl_container& container, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
{
container.clear();
typename stl_container::value_type exchange_val;
typename stl_container::value_type exchange_val{};
typename t_storage::harray hval_array = stg.get_first_value(pname, exchange_val, hparent_section);
if(!hval_array) return false;
container.push_back(std::move(exchange_val));
@ -315,9 +316,28 @@ namespace epee
struct selector<true>
{
template<class t_type, class t_storage>
static bool serialize(const t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
static bool serialize(const t_type& d, t_storage& stg, [[maybe_unused]] typename t_storage::hsection hparent_section, [[maybe_unused]] const char* pname)
{
return kv_serialize(d, stg, hparent_section, pname);
//if constexpr (!t_storage::use_descriptions::value)
//{
return kv_serialize(d, stg, hparent_section, pname);
//}
//else
// return false;
}
//const t_type& doc_substitute = t_type(), const std::string& description = std::string()
template<class t_type, class t_storage>
static bool serialize_and_doc(t_storage& stg, typename t_storage::hsection hparent_section, const char* pname, const std::string& description = std::string(), const t_type& doc_substitute = t_type())
{
if constexpr (t_storage::use_descriptions::value)
{
stg.set_entry_description(hparent_section, pname, description);
return kv_serialize(doc_substitute, stg, hparent_section, pname);
}
else
return false;
}
template<class t_type, class t_storage>
@ -340,8 +360,12 @@ namespace epee
template< class t_type_stored, class t_type, class t_storage, typename cb_serialize>
static bool serialize_ephemeral(const t_type& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname, cb_serialize cb_s)
{
t_type_stored a = cb_s(d);
return epee::serialization::selector<true>::serialize(a, stg, hparent_section, pname);
t_type_stored a = AUTO_VAL_INIT(a);
bool add_val = cb_s(d, a);
if (add_val)
return epee::serialization::selector<true>::serialize(a, stg, hparent_section, pname);
else
return true;
}
};
@ -454,6 +478,29 @@ namespace epee
return r;
}
//-------------------------------------------------------------------------------------------------------------------
//std::optional
template<class t_type, class t_storage>
bool kv_serialize(const std::optional<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
{
if(d.has_value())
{
return kv_serialize(*d, stg, hparent_section, pname);
}
return true;
}
//-------------------------------------------------------------------------------------------------------------------
template<class t_type, class t_storage>
bool kv_unserialize(std::optional<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
{
d = t_type{};
bool r = kv_unserialize(*d, stg, hparent_section, pname);
if (!r)
{
d = std::nullopt;
}
return r;
}
//-------------------------------------------------------------------------------------------------------------------
//boost::shared_ptr
template<class t_type, class t_storage>
bool kv_serialize(const boost::shared_ptr<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
@ -477,7 +524,30 @@ namespace epee
}
return r;
}
//-------------------------------------------------------------------------------------------------------------------
//std::shared_ptr
template<class t_type, class t_storage>
bool kv_serialize(const std::shared_ptr<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
{
if (d.get())
{
return kv_serialize(*d, stg, hparent_section, pname);
}
return true;
}
//-------------------------------------------------------------------------------------------------------------------
template<class t_type, class t_storage>
bool kv_unserialize(std::shared_ptr<t_type>& d, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
{
d.reset();
t_type* ptr = new t_type();
bool r = kv_unserialize(*ptr, stg, hparent_section, pname);
if (!r)
{
d.reset(ptr);
}
return r;
}
}
}

View file

@ -23,10 +23,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#pragma once
#include <algorithm>
namespace epee
{

View file

@ -44,15 +44,20 @@ namespace epee
/************************************************************************/
/* */
/************************************************************************/
class portable_storage
template<typename t_section>
class portable_storage_base
{
public:
typedef epee::serialization::hsection hsection;
//typedef epee::serialization::hsection hsection;
using use_descriptions = std::false_type;
typedef t_section* hsection;
typedef epee::serialization::harray harray;
typedef storage_entry meta_entry;
portable_storage(){}
virtual ~portable_storage(){}
portable_storage_base
(){}
virtual ~portable_storage_base
(){}
hsection open_section(const std::string& section_name, hsection hparent_section, bool create_if_notexist = false);
template<class t_value>
bool get_value(const std::string& value_name, t_value& val, hsection hparent_section);
@ -63,18 +68,18 @@ namespace epee
//serial access for arrays of values --------------------------------------
//values
template<class t_value>
harray get_first_value(const std::string& value_name, t_value& target, hsection hparent_section);
harray get_first_value(const std::string& value_name, t_value& target, hsection hparent_section);
template<class t_value>
bool get_next_value(harray hval_array, t_value& target);
template<class t_value>
harray insert_first_value(const std::string& value_name, const t_value& target, hsection hparent_section);
harray insert_first_value(const std::string& value_name, const t_value& target, hsection hparent_section);
template<class t_value>
bool insert_next_value(harray hval_array, const t_value& target);
//sections
harray get_first_section(const std::string& pSectionName, hsection& h_child_section, hsection hparent_section);
bool get_next_section(harray hSecArray, hsection& h_child_section);
harray insert_first_section(const std::string& pSectionName, hsection& hinserted_childsection, hsection hparent_section);
bool insert_next_section(harray hSecArray, hsection& hinserted_childsection);
harray get_first_section(const std::string& pSectionName, hsection& h_child_section, hsection hparent_section);
bool get_next_section(harray hSecArray, hsection& h_child_section);
harray insert_first_section(const std::string& pSectionName, hsection& hinserted_childsection, hsection hparent_section);
bool insert_next_section(harray hSecArray, hsection& hinserted_childsection);
//------------------------------------------------------------------------
//delete entry (section, value or array)
bool delete_entry(const std::string& pentry_name, hsection hparent_section = nullptr);
@ -83,12 +88,13 @@ namespace epee
bool load_from_binary(const binarybuffer& target);
template<class trace_policy>
bool dump_as_xml(std::string& targetObj, const std::string& root_name = "");
bool dump_as_json(std::string& targetObj, size_t indent = 0, end_of_line_t eol = eol_crlf);
bool dump_as_json(std::string& targetObj, size_t indent = 0/*, end_of_line_t eol = eol_crlf*/);
bool load_from_json(const std::string& source);
void set_entry_description(hsection hparent_section, const std::string& name, const std::string& description) {}
template<typename cb_t>
bool enum_entries(hsection hparent_section, cb_t cb);
private:
protected:
section m_root;
hsection get_root_section() {return &m_root;}
storage_entry* find_storage_entry(const std::string& pentry_name, hsection psection);
@ -107,32 +113,36 @@ namespace epee
};
#pragma pack(pop)
};
inline
bool portable_storage::dump_as_json(std::string& buff, size_t indent /* = 0 */, end_of_line_t eol /* = eol_crlf */)
template<typename t_section>
bool portable_storage_base<t_section>::dump_as_json(std::string& buff, size_t indent /* = 0 *//*, end_of_line_t eol *//* = eol_crlf */)
{
TRY_ENTRY();
std::stringstream ss;
epee::serialization::dump_as_json(ss, m_root, indent, eol);
epee::serialization::recursive_visitor<strategy_json>::dump_as_(ss, m_root, indent/*, eol*/);
buff = ss.str();
return true;
CATCH_ENTRY("portable_storage::dump_as_json", false)
CATCH_ENTRY("portable_storage_base<t_section>::dump_as_json", false)
}
inline
bool portable_storage::load_from_json(const std::string& source)
template<typename t_section>
bool portable_storage_base<t_section>::load_from_json(const std::string& source)
{
TRY_ENTRY();
return json::load_from_json(source, *this);
CATCH_ENTRY("portable_storage::load_from_json", false)
CATCH_ENTRY("portable_storage_base<t_section>::load_from_json", false)
}
template<typename t_section>
template<class trace_policy>
bool portable_storage::dump_as_xml(std::string& targetObj, const std::string& root_name)
bool portable_storage_base<t_section>::dump_as_xml(std::string& targetObj, const std::string& root_name)
{
return false;//TODO: don't think i ever again will use xml - ambiguous and "overtagged" format
}
inline
bool portable_storage::store_to_binary(binarybuffer& target)
template<typename t_section>
bool portable_storage_base<t_section>::store_to_binary(binarybuffer& target)
{
TRY_ENTRY();
std::stringstream ss;
@ -144,10 +154,10 @@ namespace epee
pack_entry_to_buff(ss, m_root);
target = ss.str();
return true;
CATCH_ENTRY("portable_storage::store_to_binary", false)
CATCH_ENTRY("portable_storage_base<t_section>::store_to_binary", false)
}
inline
bool portable_storage::load_from_binary(const binarybuffer& source)
template<typename t_section>
bool portable_storage_base<t_section>::load_from_binary(const binarybuffer& source)
{
m_root.m_entries.clear();
if(source.size() < sizeof(storage_block_header))
@ -172,11 +182,11 @@ namespace epee
throwable_buffer_reader buf_reader(source.data()+sizeof(storage_block_header), source.size()-sizeof(storage_block_header));
buf_reader.read(m_root);
return true;//TODO:
CATCH_ENTRY("portable_storage::load_from_binary", false);
CATCH_ENTRY("portable_storage_base<t_section>::load_from_binary", false);
}
//---------------------------------------------------------------------------------------------------------------
inline
hsection portable_storage::open_section(const std::string& section_name, hsection hparent_section, bool create_if_notexist)
template<typename t_section>
typename portable_storage_base<t_section>::hsection portable_storage_base<t_section>::open_section(const std::string& section_name, hsection hparent_section, bool create_if_notexist)
{
TRY_ENTRY();
hparent_section = hparent_section ? hparent_section:&m_root;
@ -197,7 +207,7 @@ namespace epee
return nullptr;
}
return &boost::get<section>(*pentry);
CATCH_ENTRY("portable_storage::open_section", nullptr);
CATCH_ENTRY("portable_storage_base<t_section>::open_section", nullptr);
}
//---------------------------------------------------------------------------------------------------------------
template<class to_type>
@ -209,8 +219,9 @@ namespace epee
void operator()(const from_type& v){convert_t(v, m_target);}
};
template<typename t_section>
template<class t_value>
bool portable_storage::get_value(const std::string& value_name, t_value& val, hsection hparent_section)
bool portable_storage_base<t_section>::get_value(const std::string& value_name, t_value& val, hsection hparent_section)
{
BOOST_MPL_ASSERT(( boost::mpl::contains<storage_entry::types, t_value> ));
//TRY_ENTRY();
@ -222,11 +233,11 @@ namespace epee
get_value_visitor<t_value> gvv(val);
boost::apply_visitor(gvv, *pentry);
return true;
//CATCH_ENTRY("portable_storage::template<>get_value", false);
//CATCH_ENTRY("portable_storage_base<t_section>::template<>get_value", false);
}
//---------------------------------------------------------------------------------------------------------------
inline
bool portable_storage::get_value(const std::string& value_name, storage_entry& val, hsection hparent_section)
template<typename t_section>
bool portable_storage_base<t_section>::get_value(const std::string& value_name, storage_entry& val, hsection hparent_section)
{
//TRY_ENTRY();
if(!hparent_section) hparent_section = &m_root;
@ -236,11 +247,12 @@ namespace epee
val = *pentry;
return true;
//CATCH_ENTRY("portable_storage::template<>get_value", false);
//CATCH_ENTRY("portable_storage_base<t_section>::template<>get_value", false);
}
//---------------------------------------------------------------------------------------------------------------
template<typename t_section>
template<class t_value>
bool portable_storage::set_value(const std::string& value_name, const t_value& v, hsection hparent_section)
bool portable_storage_base<t_section>::set_value(const std::string& value_name, const t_value& v, hsection hparent_section)
{
BOOST_MPL_ASSERT(( boost::mpl::contains<boost::mpl::push_front<storage_entry::types, storage_entry>::type, t_value> ));
TRY_ENTRY();
@ -256,11 +268,11 @@ namespace epee
}
*pentry = storage_entry(v);
return true;
CATCH_ENTRY("portable_storage::template<>set_value", false);
CATCH_ENTRY("portable_storage_base<t_section>::template<>set_value", false);
}
//---------------------------------------------------------------------------------------------------------------
inline
storage_entry* portable_storage::find_storage_entry(const std::string& pentry_name, hsection psection)
template<typename t_section>
storage_entry* portable_storage_base<t_section>::find_storage_entry(const std::string& pentry_name, hsection psection)
{
TRY_ENTRY();
CHECK_AND_ASSERT(psection, nullptr);
@ -269,27 +281,28 @@ namespace epee
return nullptr;
return &it->second;
CATCH_ENTRY("portable_storage::find_storage_entry", nullptr);
CATCH_ENTRY("portable_storage_base<t_section>::find_storage_entry", nullptr);
}
//---------------------------------------------------------------------------------------------------------------
template<typename t_section>
template<class entry_type>
storage_entry* portable_storage::insert_new_entry_get_storage_entry(const std::string& pentry_name, hsection psection, const entry_type& entry)
storage_entry* portable_storage_base<t_section>::insert_new_entry_get_storage_entry(const std::string& pentry_name, hsection psection, const entry_type& entry)
{
TRY_ENTRY();
CHECK_AND_ASSERT(psection, nullptr);
auto ins_res = psection->m_entries.insert(std::pair<std::string, storage_entry>(pentry_name, entry));
return &ins_res.first->second;
CATCH_ENTRY("portable_storage::insert_new_entry_get_storage_entry", nullptr);
CATCH_ENTRY("portable_storage_base<t_section>::insert_new_entry_get_storage_entry", nullptr);
}
//---------------------------------------------------------------------------------------------------------------
inline
hsection portable_storage::insert_new_section(const std::string& pentry_name, hsection psection)
template<typename t_section>
typename portable_storage_base<t_section>::hsection portable_storage_base<t_section>::insert_new_section(const std::string& pentry_name, hsection psection)
{
TRY_ENTRY();
storage_entry* pse = insert_new_entry_get_storage_entry(pentry_name, psection, section());
if(!pse) return nullptr;
return &boost::get<section>(*pse);
CATCH_ENTRY("portable_storage::insert_new_section", nullptr);
CATCH_ENTRY("portable_storage_base<t_section>::insert_new_section", nullptr);
}
//---------------------------------------------------------------------------------------------------------------
template<class to_type>
@ -308,8 +321,9 @@ namespace epee
}
};
//---------------------------------------------------------------------------------------------------------------
template<typename t_section>
template<class t_value>
harray portable_storage::get_first_value(const std::string& value_name, t_value& target, hsection hparent_section)
harray portable_storage_base<t_section>::get_first_value(const std::string& value_name, t_value& target, hsection hparent_section)
{
BOOST_MPL_ASSERT(( boost::mpl::contains<storage_entry::types, t_value> ));
//TRY_ENTRY();
@ -325,7 +339,7 @@ namespace epee
if(!boost::apply_visitor(gfv, ar_entry))
return nullptr;
return &ar_entry;
//CATCH_ENTRY("portable_storage::get_first_value", nullptr);
//CATCH_ENTRY("portable_storage_base<t_section>::get_first_value", nullptr);
}
//---------------------------------------------------------------------------------------------------------------
template<class to_type>
@ -344,10 +358,10 @@ namespace epee
return true;
}
};
//---------------------------------------------------------------------------------------------------------------
template<typename t_section>
template<class t_value>
bool portable_storage::get_next_value(harray hval_array, t_value& target)
bool portable_storage_base<t_section>::get_next_value(harray hval_array, t_value& target)
{
BOOST_MPL_ASSERT(( boost::mpl::contains<storage_entry::types, t_value> ));
//TRY_ENTRY();
@ -357,11 +371,12 @@ namespace epee
if(!boost::apply_visitor(gnv, ar_entry))
return false;
return true;
//CATCH_ENTRY("portable_storage::get_next_value", false);
//CATCH_ENTRY("portable_storage_base<t_section>::get_next_value", false);
}
//---------------------------------------------------------------------------------------------------------------
template<typename t_section>
template<class t_value>
harray portable_storage::insert_first_value(const std::string& value_name, const t_value& target, hsection hparent_section)
harray portable_storage_base<t_section>::insert_first_value(const std::string& value_name, const t_value& target, hsection hparent_section)
{
TRY_ENTRY();
if(!hparent_section) hparent_section = &m_root;
@ -382,11 +397,12 @@ namespace epee
array_entry_t<t_value>& arr_typed = boost::get<array_entry_t<t_value> >(arr);
arr_typed.insert_first_val(target);
return &arr;
CATCH_ENTRY("portable_storage::insert_first_value", nullptr);
CATCH_ENTRY("portable_storage_base<t_section>::insert_first_value", nullptr);
}
//---------------------------------------------------------------------------------------------------------------
template<typename t_section>
template<typename cb_t>
bool portable_storage::enum_entries(hsection hparent_section, cb_t cb)
bool portable_storage_base<t_section>::enum_entries(hsection hparent_section, cb_t cb)
{
TRY_ENTRY();
if (!hparent_section) hparent_section = &m_root;
@ -396,11 +412,12 @@ namespace epee
break;
}
return true;
CATCH_ENTRY("portable_storage::enum_entries", false);
CATCH_ENTRY("portable_storage_base<t_section>::enum_entries", false);
}
//---------------------------------------------------------------------------------------------------------------
template<typename t_section>
template<class t_value>
bool portable_storage::insert_next_value(harray hval_array, const t_value& target)
bool portable_storage_base<t_section>::insert_next_value(harray hval_array, const t_value& target)
{
TRY_ENTRY();
CHECK_AND_ASSERT(hval_array, false);
@ -411,12 +428,12 @@ namespace epee
array_entry_t<t_value>& arr_typed = boost::get<array_entry_t<t_value> >(*hval_array);
arr_typed.insert_next_value(target);
return true;
CATCH_ENTRY("portable_storage::insert_next_value", false);
CATCH_ENTRY("portable_storage_base<t_section>::insert_next_value", false);
}
//---------------------------------------------------------------------------------------------------------------
//sections
inline
harray portable_storage::get_first_section(const std::string& sec_name, hsection& h_child_section, hsection hparent_section)
template<typename t_section>
harray portable_storage_base<t_section>::get_first_section(const std::string& sec_name, hsection& h_child_section, hsection hparent_section)
{
TRY_ENTRY();
if(!hparent_section) hparent_section = &m_root;
@ -434,11 +451,11 @@ namespace epee
return nullptr;
h_child_section = psec;
return &ar_entry;
CATCH_ENTRY("portable_storage::get_first_section", nullptr);
CATCH_ENTRY("portable_storage_base<t_section>::get_first_section", nullptr);
}
//---------------------------------------------------------------------------------------------------------------
inline
bool portable_storage::get_next_section(harray hsec_array, hsection& h_child_section)
template<typename t_section>
bool portable_storage_base<t_section>::get_next_section(harray hsec_array, hsection& h_child_section)
{
TRY_ENTRY();
CHECK_AND_ASSERT(hsec_array, false);
@ -449,11 +466,11 @@ namespace epee
if(!h_child_section)
return false;
return true;
CATCH_ENTRY("portable_storage::get_next_section", false);
CATCH_ENTRY("portable_storage_base<t_section>::get_next_section", false);
}
//---------------------------------------------------------------------------------------------------------------
inline
harray portable_storage::insert_first_section(const std::string& sec_name, hsection& hinserted_childsection, hsection hparent_section)
template<typename t_section>
harray portable_storage_base<t_section>::insert_first_section(const std::string& sec_name, hsection& hinserted_childsection, hsection hparent_section)
{
TRY_ENTRY();
if(!hparent_section) hparent_section = &m_root;
@ -474,11 +491,11 @@ namespace epee
array_entry_t<section>& sec_array = boost::get<array_entry_t<section>>(ar_entry);
hinserted_childsection = &sec_array.insert_first_val(section());
return &ar_entry;
CATCH_ENTRY("portable_storage::insert_first_section", nullptr);
CATCH_ENTRY("portable_storage_base<t_section>::insert_first_section", nullptr);
}
//---------------------------------------------------------------------------------------------------------------
inline
bool portable_storage::insert_next_section(harray hsec_array, hsection& hinserted_childsection)
template<typename t_section>
bool portable_storage_base<t_section>::insert_next_section(harray hsec_array, hsection& hinserted_childsection)
{
TRY_ENTRY();
CHECK_AND_ASSERT(hsec_array, false);
@ -488,8 +505,9 @@ namespace epee
array_entry_t<section>& sec_array = boost::get<array_entry_t<section>>(*hsec_array);
hinserted_childsection = &sec_array.insert_next_value(section());
return true;
CATCH_ENTRY("portable_storage::insert_next_section", false);
CATCH_ENTRY("portable_storage_base<t_section>::insert_next_section", false);
}
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
typedef portable_storage_base<section> portable_storage;
}
}

View file

@ -153,6 +153,7 @@ namespace epee
/************************************************************************/
struct section
{
std::map<std::string, std::string> m_descriptions;
std::map<std::string, storage_entry> m_entries;
};

View file

@ -0,0 +1,67 @@
// Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the Andrey N. Sabelnikov nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#pragma once
#include "portable_storage.h"
#include "portable_storage_to_description.h"
namespace epee
{
namespace serialization
{
/************************************************************************/
/* */
/************************************************************************/
class portable_storage_extended_doc: public portable_storage
{
public:
using use_descriptions = std::true_type;
void set_entry_description(hsection hparent_section, const std::string& name, const std::string& description)
{
if (!hparent_section)
hparent_section = &m_root;
hparent_section->m_descriptions[name] = description;
}
bool dump_as_decriptions(std::string& buff, size_t indent = 0 , end_of_line_t eol = eol_crlf)
{
TRY_ENTRY();
std::stringstream ss;
recursive_visitor<strategy_descriptin>::dump_as_(ss, m_root, indent);
buff = ss.str();
return true;
CATCH_ENTRY("portable_storage_base<t_section>::dump_as_json", false)
}
};
//---------------------------------------------------------------------------------------------------------------
}
}

View file

@ -59,6 +59,7 @@ namespace epee
storage_entry load_storage_entry();
void read(section& sec);
void read(std::string& str);
void read(array_entry &ae);
private:
struct recursuion_limitation_guard
{
@ -114,6 +115,7 @@ namespace epee
void throwable_buffer_reader::read(t_pod_type& pod_val)
{
RECURSION_LIMITATION();
static_assert(std::is_pod<t_pod_type>::value, "POD type expected");
read(&pod_val, sizeof(pod_val));
}
@ -277,5 +279,11 @@ namespace epee
m_ptr+=len;
m_count -= len;
}
inline
void throwable_buffer_reader::read(array_entry &ae)
{
RECURSION_LIMITATION();
CHECK_AND_ASSERT_THROW_MES(false, "Reading array entry is not supported");
}
}
}

View file

@ -28,22 +28,38 @@
#include "parserse_base_utils.h"
#include "file_io_utils.h"
#define EPEE_JSON_RECURSION_LIMIT_INTERNAL 100
namespace epee
{
namespace serialization
{
namespace json
{
#define CHECK_ISSPACE() if(!isspace(*it)){ ASSERT_MES_AND_THROW("Wrong JSON character at: " << std::string(it, buf_end));}
namespace details
{
inline bool report_wrong_char_with_context(const std::string::const_iterator begin, const std::string::const_iterator it, const std::string::const_iterator end)
{
auto before_it = it - std::min(it - begin, static_cast<ptrdiff_t>(8));
auto after_it = it + std::min(end - it, static_cast<ptrdiff_t>(8));
std::string escaped_str(before_it, after_it);
std::replace_if(escaped_str.begin(), escaped_str.end(), [](int c){ return std::isprint(c); }, '?');
ASSERT_MES_AND_THROW("Wrong JSON character 0x" << std::hex << (int)*it << ", context: " << escaped_str);
}
}
#define CHECK_ISSPACE() if (!isspace(*it)) details::report_wrong_char_with_context(sec_buf_begin, it, buf_end)
/*inline void parse_error()
{
ASSERT_MES_AND_THROW("json parse error");
}*/
template<class t_storage>
inline void run_handler(typename t_storage::hsection current_section, std::string::const_iterator& sec_buf_begin, std::string::const_iterator buf_end, t_storage& stg)
inline void run_handler(typename t_storage::hsection current_section, std::string::const_iterator& sec_buf_begin, std::string::const_iterator buf_end, t_storage& stg, unsigned int recursion)
{
CHECK_AND_ASSERT_THROW_MES(recursion < EPEE_JSON_RECURSION_LIMIT_INTERNAL,
"Wrong JSON data: recursion limitation (" << EPEE_JSON_RECURSION_LIMIT_INTERNAL << ") exceeded");
std::string::const_iterator sub_element_start;
std::string name;
typename t_storage::harray h_array = nullptr;
@ -154,7 +170,7 @@ namespace epee
//sub section here
typename t_storage::hsection new_sec = stg.open_section(name, current_section, true);
CHECK_AND_ASSERT_THROW_MES(new_sec, "Failed to insert new section in json: " << std::string(it, buf_end));
run_handler(new_sec, it, buf_end, stg);
run_handler(new_sec, it, buf_end, stg, recursion + 1);
state = match_state_wonder_after_value;
}else if(*it == '[')
{//array of something
@ -183,7 +199,7 @@ namespace epee
typename t_storage::hsection new_sec = nullptr;
h_array = stg.insert_first_section(name, new_sec, current_section);
CHECK_AND_ASSERT_THROW_MES(h_array&&new_sec, "failed to create new section");
run_handler(new_sec, it, buf_end, stg);
run_handler(new_sec, it, buf_end, stg, recursion + 1);
state = match_state_array_after_value;
array_md = array_mode_sections;
}else if(*it == '"')
@ -257,7 +273,7 @@ namespace epee
typename t_storage::hsection new_sec = NULL;
bool res = stg.insert_next_section(h_array, new_sec);
CHECK_AND_ASSERT_THROW_MES(res&&new_sec, "failed to insert next section");
run_handler(new_sec, it, buf_end, stg);
run_handler(new_sec, it, buf_end, stg, recursion + 1);
state = match_state_array_after_value;
}else CHECK_ISSPACE();
break;
@ -359,7 +375,7 @@ namespace epee
std::string::const_iterator sec_buf_begin = buff_json.begin();
try
{
run_handler(nullptr, sec_buf_begin, buff_json.end(), stg);
run_handler(nullptr, sec_buf_begin, buff_json.end(), stg, 0);
return true;
}
catch(const std::exception& ex)

View file

@ -56,16 +56,16 @@ namespace epee
}
//-----------------------------------------------------------------------------------------------------------
template<class t_struct>
bool store_t_to_json(const t_struct& str_in, std::string& json_buff, size_t indent = 0, end_of_line_t eol = eol_crlf)
bool store_t_to_json(const t_struct& str_in, std::string& json_buff, size_t indent = 0)
{
portable_storage ps;
str_in.store(ps);
ps.dump_as_json(json_buff, indent, eol);
ps.dump_as_json(json_buff, indent);
return true;
}
//-----------------------------------------------------------------------------------------------------------
template<class t_struct>
std::string store_t_to_json(const t_struct& str_in, size_t indent = 0, end_of_line_t eol = eol_crlf)
std::string store_t_to_json(const t_struct& str_in, size_t indent = 0)
{
std::string json_buff;
store_t_to_json(str_in, json_buff, indent);

View file

@ -0,0 +1,149 @@
// Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the Andrey N. Sabelnikov nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#pragma once
#include "misc_language.h"
#include "portable_storage_base.h"
namespace epee
{
namespace serialization
{
template <typename t_strategy_layout_strategy>
class recursive_visitor
{
public:
template<class t_stream>
struct array_entry_store_to_json_visitor : public boost::static_visitor<void>
{
t_stream& m_strm;
size_t m_indent;
array_entry_store_to_json_visitor(t_stream& strm, size_t indent)
: m_strm(strm)
, m_indent(indent)
{}
template<class t_type>
void operator()(const array_entry_t<t_type>& a)
{
t_strategy_layout_strategy::handle_array_start(m_strm, m_indent);
if (a.m_array.size())
{
auto last_it = --a.m_array.end();
for (auto it = a.m_array.begin(); it != a.m_array.end(); it++)
{
dump_as_(m_strm, *it, m_indent);
if (it != last_it)
t_strategy_layout_strategy::handle_array_entry_separator(m_strm, m_indent);
}
}
t_strategy_layout_strategy::handle_array_end(m_strm, m_indent);
}
};
template<class t_stream>
struct storage_entry_store_to_json_visitor : public boost::static_visitor<void>
{
t_stream& m_strm;
size_t m_indent;
storage_entry_store_to_json_visitor(t_stream& strm, size_t indent)
: m_strm(strm)
, m_indent(indent)
{}
//section, array_entry
template<class visited_type>
void operator()(const visited_type& v)
{
dump_as_(m_strm, v, m_indent);
}
};
template<class t_stream>
void static dump_as_(t_stream& strm, const array_entry& ae, size_t indent)
{
array_entry_store_to_json_visitor<t_stream> aesv(strm, indent);
boost::apply_visitor(aesv, ae);
}
template<class t_stream>
void static dump_as_(t_stream& strm, const storage_entry& se, size_t indent)
{
storage_entry_store_to_json_visitor<t_stream> sv(strm, indent);
boost::apply_visitor(sv, se);
}
template<class t_stream, class t_type>
void static dump_as_(t_stream& strm, const t_type& v, size_t indent)
{
t_strategy_layout_strategy::handle_value(strm, v, indent);
}
template<class t_stream>
void static dump_as_(t_stream& strm, const section& sec, size_t indent)
{
size_t local_indent = indent + 1;
t_strategy_layout_strategy::handle_obj_begin(strm, indent);
t_strategy_layout_strategy::handle_line_break(strm, indent);
if (sec.m_entries.size())
{
auto it_last = --sec.m_entries.end();
for (auto it = sec.m_entries.begin(); it != sec.m_entries.end(); it++)
{
if constexpr (t_strategy_layout_strategy::use_descriptions::value)
{
std::string descr;
auto it_descr = sec.m_descriptions.find(it->first);
if (it_descr != sec.m_descriptions.end())
descr = it_descr->second;
t_strategy_layout_strategy::handle_print_key(strm, it->first, descr, local_indent);
}
else
{
t_strategy_layout_strategy::handle_print_key(strm, it->first, local_indent);
}
dump_as_(strm, it->second, local_indent);
if (it_last != it)
t_strategy_layout_strategy::handle_section_entry_separator(strm, indent);
t_strategy_layout_strategy::handle_line_break(strm, indent);
}
}
t_strategy_layout_strategy::handle_obj_end(strm, indent);
}
};
}
}

View file

@ -0,0 +1,107 @@
// Copyright (c) 2006-2024, Andrey N. Sabelnikov, www.sabelnikov.net
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the Andrey N. Sabelnikov nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#pragma once
#include "misc_language.h"
#include "portable_storage_base.h"
#include "portable_storage_to_.h"
namespace epee
{
namespace serialization
{
class strategy_descriptin
{
public:
using use_descriptions = std::true_type;
inline static const char* eol = get_endline(eol_crlf);
//static const end_of_line_t eol = eol_crlf;
template<class t_stream, class t_type>
static void handle_value(t_stream& strm, const t_type& v, size_t indent)
{}
template<class t_stream>
static void handle_array_start(t_stream& strm, size_t indent)
{
//strm << "[";
}
template<class t_stream>
static void handle_array_end(t_stream& strm, size_t indent)
{
//strm << "]";
}
template<class t_stream>
static void handle_obj_begin(t_stream& strm, size_t indent)
{}
template<class t_stream>
static void handle_obj_end(t_stream& strm, size_t indent)
{}
template<class t_stream>
static void handle_print_key(t_stream& strm, const std::string& key, const std::string& description, size_t indent)
{
if (description.size())
{
const std::string indent_str = make_indent(indent);
strm << indent_str << "\"" << key << "\"" << ": " << description << eol;
}
}
template<class t_stream>
static void handle_print_description(t_stream& strm, const std::string& description, size_t indent)
{
}
template<class t_stream>
static void handle_section_entry_separator(t_stream& strm, size_t indent)
{
//strm << ",";
}
template<class t_stream>
static void handle_array_entry_separator(t_stream& strm, size_t indent)
{
//strm << ",";
}
template<class t_stream>
static void handle_line_break(t_stream& strm, size_t indent)
{
//strm << eol;
}
};
}
}

View file

@ -30,174 +30,121 @@
#include "misc_language.h"
#include "portable_storage_base.h"
#include "portable_storage_to_.h"
namespace epee
{
namespace serialization
{
template<class t_stream>
void dump_as_json(t_stream& strm, const array_entry& ae, size_t indent, end_of_line_t eol = eol_crlf);
template<class t_stream>
void dump_as_json(t_stream& strm, const storage_entry& se, size_t indent, end_of_line_t eol = eol_crlf);
template<class t_stream>
void dump_as_json(t_stream& strm, const std::string& v, size_t indent, end_of_line_t eol = eol_crlf);
template<class t_stream>
void dump_as_json(t_stream& strm, const int8_t& v, size_t indent, end_of_line_t eol = eol_crlf);
template<class t_stream>
void dump_as_json(t_stream& strm, const uint8_t& v, size_t indent, end_of_line_t eol = eol_crlf);
template<class t_stream>
void dump_as_json(t_stream& strm, const bool& v, size_t indent, end_of_line_t eol = eol_crlf);
template<class t_stream>
void dump_as_json(t_stream& strm, const double& v, size_t indent, end_of_line_t eol = eol_crlf);
template<class t_stream, class t_type>
void dump_as_json(t_stream& strm, const t_type& v, size_t indent, end_of_line_t eol = eol_crlf);
template<class t_stream>
void dump_as_json(t_stream& strm, const section& sec, size_t indent, end_of_line_t eol = eol_crlf);
inline const char* get_endline(end_of_line_t eol)
{
switch (eol)
{
case eol_lf: return "\n";
case eol_cr: return "\r";
case eol_space: return " ";
default: return "\r\n";
}
}
inline std::string make_indent(size_t indent)
{
return std::string(indent*2, ' ');
return std::string(indent * 2, ' ');
}
template<class t_stream>
struct array_entry_store_to_json_visitor: public boost::static_visitor<void>
class strategy_json
{
t_stream& m_strm;
size_t m_indent;
end_of_line_t m_eol;
public:
using use_descriptions = std::false_type;
array_entry_store_to_json_visitor(t_stream& strm, size_t indent, end_of_line_t eol)
: m_strm(strm)
, m_indent(indent)
, m_eol(eol)
{}
template<class t_type>
void operator()(const array_entry_t<t_type>& a)
inline static const char* eol = get_endline(eol_crlf);
//static const end_of_line_t eol = eol_crlf;
template<class t_stream>
static void handle_value(t_stream& strm, const std::string& v, size_t indent)
{
m_strm << "[";
if(a.m_array.size())
{
auto last_it = --a.m_array.end();
for(auto it = a.m_array.begin(); it != a.m_array.end(); it++)
{
dump_as_json(m_strm, *it, m_indent, m_eol);
if(it != last_it)
m_strm << ",";
}
}
m_strm << "]";
strm << "\"" << misc_utils::parse::transform_to_json_escape_sequence(v) << "\"";
}
template<class t_stream>
static void handle_value(t_stream& strm, const int8_t& v, size_t indent)
{
strm << static_cast<int32_t>(v);
}
template<class t_stream>
static void handle_value(t_stream& strm, const uint8_t& v, size_t indent)
{
strm << static_cast<int32_t>(v);
}
template<class t_stream>
static void handle_value(t_stream& strm, const bool& v, size_t indent)
{
if (v)
strm << "true";
else
strm << "false";
}
template<class t_stream>
static void handle_value(t_stream& strm, const double& v, size_t indent)
{
boost::io::ios_flags_saver ifs(strm);
strm.precision(8);
strm << std::fixed << v;
}
template<class t_stream, class t_type>
static void handle_value(t_stream& strm, const t_type& v, size_t indent)
{
strm << v;
}
template<class t_stream>
static void handle_array_start(t_stream& strm, size_t indent)
{
strm << "[";
}
template<class t_stream>
static void handle_array_end(t_stream& strm, size_t indent)
{
strm << "]";
}
template<class t_stream>
static void handle_obj_begin(t_stream& strm, size_t indent)
{
strm << "{";
}
template<class t_stream>
static void handle_obj_end(t_stream& strm, size_t indent)
{
strm << make_indent(indent) << "}";
}
template<class t_stream>
static void handle_print_key(t_stream& strm, const std::string& key, size_t indent)
{
const std::string indent_str = make_indent(indent);
strm << indent_str << "\"" << misc_utils::parse::transform_to_json_escape_sequence(key) << "\"" << ": ";
}
template<class t_stream>
static void handle_section_entry_separator(t_stream& strm, size_t indent)
{
strm << ",";
}
template<class t_stream>
static void handle_array_entry_separator(t_stream& strm, size_t indent)
{
strm << ",";
}
template<class t_stream>
static void handle_line_break(t_stream& strm, size_t indent)
{
strm << eol;
}
};
template<class t_stream>
struct storage_entry_store_to_json_visitor: public boost::static_visitor<void>
{
t_stream& m_strm;
size_t m_indent;
end_of_line_t m_eol;
storage_entry_store_to_json_visitor(t_stream& strm, size_t indent, end_of_line_t eol)
: m_strm(strm)
, m_indent(indent)
, m_eol(eol)
{}
//section, array_entry
template<class visited_type>
void operator()(const visited_type& v)
{
dump_as_json(m_strm, v, m_indent, m_eol);
}
};
template<class t_stream>
void dump_as_json(t_stream& strm, const array_entry& ae, size_t indent, end_of_line_t eol)
{
array_entry_store_to_json_visitor<t_stream> aesv(strm, indent, eol);
boost::apply_visitor(aesv, ae);
}
template<class t_stream>
void dump_as_json(t_stream& strm, const storage_entry& se, size_t indent, end_of_line_t eol)
{
storage_entry_store_to_json_visitor<t_stream> sv(strm, indent, eol);
boost::apply_visitor(sv, se);
}
template<class t_stream>
void dump_as_json(t_stream& strm, const std::string& v, size_t indent, end_of_line_t eol)
{
strm << "\"" << misc_utils::parse::transform_to_json_escape_sequence(v) << "\"";
}
template<class t_stream>
void dump_as_json(t_stream& strm, const int8_t& v, size_t indent, end_of_line_t eol)
{
strm << static_cast<int32_t>(v);
}
template<class t_stream>
void dump_as_json(t_stream& strm, const uint8_t& v, size_t indent, end_of_line_t eol)
{
strm << static_cast<int32_t>(v);
}
template<class t_stream>
void dump_as_json(t_stream& strm, const bool& v, size_t indent, end_of_line_t eol)
{
if(v)
strm << "true";
else
strm << "false";
}
template<class t_stream>
void dump_as_json(t_stream& strm, const double& v, size_t indent, end_of_line_t eol)
{
boost::io::ios_flags_saver ifs(strm);
strm.precision(8);
strm << std::fixed << v;
}
template<class t_stream, class t_type>
void dump_as_json(t_stream& strm, const t_type& v, size_t indent, end_of_line_t eol)
{
strm << v;
}
template<class t_stream>
void dump_as_json(t_stream& strm, const section& sec, size_t indent, end_of_line_t eol)
{
auto put_eol = [&]() {
switch (eol)
{
case eol_lf: strm << "\n"; break;
case eol_cr: strm << "\r"; break;
case eol_space: strm << " "; break;
default: strm << "\r\n"; break;
}
};
size_t local_indent = indent + 1;
strm << "{";
put_eol();
std::string indent_str = make_indent(local_indent);
if(sec.m_entries.size())
{
auto it_last = --sec.m_entries.end();
for(auto it = sec.m_entries.begin(); it!= sec.m_entries.end();it++)
{
strm << indent_str << "\"" << misc_utils::parse::transform_to_json_escape_sequence(it->first) << "\"" << ": ";
dump_as_json(strm, it->second, local_indent, eol);
if(it_last != it)
strm << ",";
put_eol();
}
}
strm << make_indent(indent) << "}";
}
}
}

View file

@ -22,12 +22,13 @@
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//
#ifndef _STRING_TOOLS_H_
#define _STRING_TOOLS_H_
#include <locale>
#include <cstdlib>
#include <iomanip>
#include <map>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_io.hpp>
@ -444,7 +445,7 @@ POP_GCC_WARNINGS
inline bool string_to_num_fast(const std::string& buff, int& val)
{
val = atoi(buff.c_str());
if(buff != "0" && val == 0)
if (val == 0 && buff.find_first_not_of('0') != std::string::npos)
return false;
return true;

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