1
0
Fork 0
forked from lthn/blockchain

Compare commits

..

1041 commits
autodoc ... 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
Reviewed-on: lthn/blockchain#1
Reviewed-by: Snider <snider@noreply.forge.lthn.ai>
2026-02-14 20:19:13 +00:00
Claude
c9ad4de9bb
ci: multi-platform Forgejo Actions pipeline
Build Linux x86_64 (snider-linux) and macOS ARM64 (M3 Ultra) natively
via self-hosted forgejo-runner, aggregate into single release.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

### Highlights

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

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

* Update Makefile

* Update _on-pr.yml

* Refactor build presets and folder layout for Windows

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

* Update build presets and CPack config for Windows

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

8
.dockerignore Normal file
View file

@ -0,0 +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

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

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

12
.gitignore vendored
View file

@ -5,5 +5,13 @@
._.DS_Store
Thumbs.db
._*
.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

26
.gitmodules vendored
View file

@ -1,14 +1,18 @@
[submodule "contrib/miniupnp"]
path = contrib/miniupnp
url = https://github.com/miniupnp/miniupnp
[submodule "src/gui/qt-daemon/layout"]
path = src/gui/qt-daemon/layout
url = https://github.com/hyle-team/zano_ui.git
branch = main
[submodule "contrib/tor-connect"]
path = contrib/tor-connect
url = https://github.com/hyle-team/tor-connect.git
branch = main
[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/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

1
.idea/.name generated Normal file
View file

@ -0,0 +1 @@
Lethean

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

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

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

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

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

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

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

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

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

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

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

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

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

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

View file

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

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

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

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

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

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

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

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

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

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

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

55
AGENTS.md Normal file
View file

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

View file

@ -1,16 +1,16 @@
cmake_minimum_required(VERSION 3.16)
message(STATUS "Using CMake version: ${CMAKE_VERSION}")
PROJECT(Zano)
set(DISABLE_TOR TRUE CACHE BOOL "Disable TOR library(and related tor-connect submodule)")
PROJECT(Lethean)
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" CACHE STRING "Build version")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
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)
@ -18,26 +18,35 @@ 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" )
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)
message("Android sdk prefix: ${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}")
message("Android CMAKE_CXX_COMPILER prefix: ${CMAKE_CXX_COMPILER}")
message("Android sdk prefix: ${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}")
message("Android CMAKE_CXX_COMPILER prefix: ${CMAKE_CXX_COMPILER}")
message("Android ANDROID_LD: ${ANDROID_LD}")
endif()
endif()
@ -52,9 +61,9 @@ if (UNIX AND NOT APPLE)
endif()
else()
# multi configurations for MSVC and XCode
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_CONFIGURATION_TYPES "Release")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
else()
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
@ -69,34 +78,37 @@ find_package(OpenSSL REQUIRED)
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12)
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(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 contrib/jwt-cpp/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)
message("!!!!!! NOTICE: Project is building for TESTNET !!!!!!")
add_definitions(-DTESTNET)
endif()
if(CAKEWALLET)
message("NOTICE: Building libraries for CAKEWALLET")
add_definitions(-DCAKEWALLET)
message("NOTICE: Building libraries for CAKEWALLET")
add_definitions(-DCAKEWALLET)
add_definitions(-DDISABLE_PFR_SERIALIZATION_SELFCHECK)
endif()
set(OPENSSL_USE_STATIC_LIBS TRUE) # link statically
find_package(OpenSSL REQUIRED)
if(DISABLE_TOR)
message("NOTICE: Building with disabled TOR support!")
add_definitions(-DDISABLE_TOR)
message("NOTICE: Building with disabled TOR support!")
add_definitions(-DDISABLE_TOR)
endif()
@ -112,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)
@ -125,7 +140,7 @@ if(MSVC)
endforeach()
endif()
include_directories(SYSTEM src/platform/msc)
configure_file(utils/Directory.Build.props.in ${CMAKE_BINARY_DIR}/Directory.Build.props)
else()
set(ARCH default CACHE STRING "CPU to build for: -march value or default")
if("${ARCH}" STREQUAL "default")
@ -140,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
@ -167,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()
@ -180,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))
@ -187,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()
@ -209,63 +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)
if(STATIC)
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)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5WebEngineWidgets REQUIRED)
find_package(Qt5WebChannel REQUIRED)
endif()
set(COMMIT_ID_IN_VERSION ON CACHE BOOL "Include commit ID in version")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/version")
@ -293,16 +297,18 @@ else()
endif()
endif()
set(BUILD_TESTS FALSE CACHE BOOL "Build Zano tests")
set(DISABLE_MDBX FALSE CACHE BOOL "Exclude mdbx from build(need for a first time)")
set(BUILD_TESTS FALSE CACHE BOOL "Build Lethean tests")
set(DISABLE_MDBX FALSE CACHE BOOL "Exclude mdbx from build(need for a first time)")
if(NOT DISABLE_MDBX)
add_definitions(-DENABLED_ENGINE_MDBX)
endif()
add_subdirectory(contrib)
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"
}
]
}
]
}

9
ConanPresets.json Normal file
View file

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

288
LICENSE.txt Normal file
View file

@ -0,0 +1,288 @@
EUROPEAN UNION PUBLIC LICENCE v. 1.2
EUPL © the European Union 2007, 2016
This European Union Public Licence (the EUPL) applies to the Work (as defined
below) which is provided under the terms of this Licence. Any use of the Work,
other than as authorised under this Licence is prohibited (to the extent such
use is covered by a right of the copyright holder of the Work).
The Work is provided under the terms of this Licence when the Licensor (as
defined below) has placed the following notice immediately following the
copyright notice for the Work:
Licensed under the EUPL
or has expressed by any other means his willingness to license under the EUPL.
1. Definitions
In this Licence, the following terms have the following meaning:
- The Licence: this Licence.
- The Original Work: the work or software distributed or communicated by the
Licensor under this Licence, available as Source Code and also as Executable
Code as the case may be.
- Derivative Works: the works or software that could be created by the
Licensee, based upon the Original Work or modifications thereof. This Licence
does not define the extent of modification or dependence on the Original Work
required in order to classify a work as a Derivative Work; this extent is
determined by copyright law applicable in the country mentioned in Article 15.
- The Work: the Original Work or its Derivative Works.
- The Source Code: the human-readable form of the Work which is the most
convenient for people to study and modify.
- The Executable Code: any code which has generally been compiled and which is
meant to be interpreted by a computer as a program.
- The Licensor: the natural or legal person that distributes or communicates
the Work under the Licence.
- Contributor(s): any natural or legal person who modifies the Work under the
Licence, or otherwise contributes to the creation of a Derivative Work.
- The Licensee or You: any natural or legal person who makes any usage of
the Work under the terms of the Licence.
- Distribution or Communication: any act of selling, giving, lending,
renting, distributing, communicating, transmitting, or otherwise making
available, online or offline, copies of the Work or providing access to its
essential functionalities at the disposal of any other natural or legal
person.
2. Scope of the rights granted by the Licence
The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
sublicensable licence to do the following, for the duration of copyright vested
in the Original Work:
- use the Work in any circumstance and for all usage,
- reproduce the Work,
- modify the Work, and make Derivative Works based upon the Work,
- communicate to the public, including the right to make available or display
the Work or copies thereof to the public and perform publicly, as the case may
be, the Work,
- distribute the Work or copies thereof,
- lend and rent the Work or copies thereof,
- sublicense rights in the Work or copies thereof.
Those rights can be exercised on any media, supports and formats, whether now
known or later invented, as far as the applicable law permits so.
In the countries where moral rights apply, the Licensor waives his right to
exercise his moral right to the extent allowed by law in order to make effective
the licence of the economic rights here above listed.
The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to
any patents held by the Licensor, to the extent necessary to make use of the
rights granted on the Work under this Licence.
3. Communication of the Source Code
The Licensor may provide the Work either in its Source Code form, or as
Executable Code. If the Work is provided as Executable Code, the Licensor
provides in addition a machine-readable copy of the Source Code of the Work
along with each copy of the Work that the Licensor distributes or indicates, in
a notice following the copyright notice attached to the Work, a repository where
the Source Code is easily and freely accessible for as long as the Licensor
continues to distribute or communicate the Work.
4. Limitations on copyright
Nothing in this Licence is intended to deprive the Licensee of the benefits from
any exception or limitation to the exclusive rights of the rights owners in the
Work, of the exhaustion of those rights or of other applicable limitations
thereto.
5. Obligations of the Licensee
The grant of the rights mentioned above is subject to some restrictions and
obligations imposed on the Licensee. Those obligations are the following:
Attribution right: The Licensee shall keep intact all copyright, patent or
trademarks notices and all notices that refer to the Licence and to the
disclaimer of warranties. The Licensee must include a copy of such notices and a
copy of the Licence with every copy of the Work he/she distributes or
communicates. The Licensee must cause any Derivative Work to carry prominent
notices stating that the Work has been modified and the date of modification.
Copyleft clause: If the Licensee distributes or communicates copies of the
Original Works or Derivative Works, this Distribution or Communication will be
done under the terms of this Licence or of a later version of this Licence
unless the Original Work is expressly distributed only under this version of the
Licence — for example by communicating EUPL v. 1.2 only. The Licensee
(becoming Licensor) cannot offer or impose any additional terms or conditions on
the Work or Derivative Work that alter or restrict the terms of the Licence.
Compatibility clause: If the Licensee Distributes or Communicates Derivative
Works or copies thereof based upon both the Work and another work licensed under
a Compatible Licence, this Distribution or Communication can be done under the
terms of this Compatible Licence. For the sake of this clause, Compatible
Licence refers to the licences listed in the appendix attached to this Licence.
Should the Licensee's obligations under the Compatible Licence conflict with
his/her obligations under this Licence, the obligations of the Compatible
Licence shall prevail.
Provision of Source Code: When distributing or communicating copies of the Work,
the Licensee will provide a machine-readable copy of the Source Code or indicate
a repository where this Source will be easily and freely available for as long
as the Licensee continues to distribute or communicate the Work.
Legal Protection: This Licence does not grant permission to use the trade names,
trademarks, service marks, or names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the copyright notice.
6. Chain of Authorship
The original Licensor warrants that the copyright in the Original Work granted
hereunder is owned by him/her or licensed to him/her and that he/she has the
power and authority to grant the Licence.
Each Contributor warrants that the copyright in the modifications he/she brings
to the Work are owned by him/her or licensed to him/her and that he/she has the
power and authority to grant the Licence.
Each time You accept the Licence, the original Licensor and subsequent
Contributors grant You a licence to their contributions to the Work, under the
terms of this Licence.
7. Disclaimer of Warranty
The Work is a work in progress, which is continuously improved by numerous
Contributors. It is not a finished work and may therefore contain defects or
bugs inherent to this type of development.
For the above reason, the Work is provided under the Licence on an as is basis
and without warranties of any kind concerning the Work, including without
limitation merchantability, fitness for a particular purpose, absence of defects
or errors, accuracy, non-infringement of intellectual property rights other than
copyright as stated in Article 6 of this Licence.
This disclaimer of warranty is an essential part of the Licence and a condition
for the grant of any rights to the Work.
8. Disclaimer of Liability
Except in the cases of wilful misconduct or damages directly caused to natural
persons, the Licensor will in no event be liable for any direct or indirect,
material or moral, damages of any kind, arising out of the Licence or of the use
of the Work, including without limitation, damages for loss of goodwill, work
stoppage, computer failure or malfunction, loss of data or any commercial
damage, even if the Licensor has been advised of the possibility of such damage.
However, the Licensor will be liable under statutory product liability laws as
far such laws apply to the Work.
9. Additional agreements
While distributing the Work, You may choose to conclude an additional agreement,
defining obligations or services consistent with this Licence. However, if
accepting obligations, You may act only on your own behalf and on your sole
responsibility, not on behalf of the original Licensor or any other Contributor,
and only if You agree to indemnify, defend, and hold each Contributor harmless
for any liability incurred by, or claims asserted against such Contributor by
the fact You have accepted any warranty or additional liability.
10. Acceptance of the Licence
The provisions of this Licence can be accepted by clicking on an icon I agree
placed under the bottom of a window displaying the text of this Licence or by
affirming consent in any other similar way, in accordance with the rules of
applicable law. Clicking on that icon indicates your clear and irrevocable
acceptance of this Licence and all of its terms and conditions.
Similarly, you irrevocably accept this Licence and all of its terms and
conditions by exercising any rights granted to You by Article 2 of this Licence,
such as the use of the Work, the creation by You of a Derivative Work or the
Distribution or Communication by You of the Work or copies thereof.
11. Information to the public
In case of any Distribution or Communication of the Work by means of electronic
communication by You (for example, by offering to download the Work from a
remote location) the distribution channel or media (for example, a website) must
at least provide to the public the information requested by the applicable law
regarding the Licensor, the Licence and the way it may be accessible, concluded,
stored and reproduced by the Licensee.
12. Termination of the Licence
The Licence and the rights granted hereunder will terminate automatically upon
any breach by the Licensee of the terms of the Licence.
Such a termination will not terminate the licences of any person who has
received the Work from the Licensee under the Licence, provided such persons
remain in full compliance with the Licence.
13. Miscellaneous
Without prejudice of Article 9 above, the Licence represents the complete
agreement between the Parties as to the Work.
If any provision of the Licence is invalid or unenforceable under applicable
law, this will not affect the validity or enforceability of the Licence as a
whole. Such provision will be construed or reformed so as necessary to make it
valid and enforceable.
The European Commission may publish other linguistic versions or new versions of
this Licence or updated versions of the Appendix, so far this is required and
reasonable, without reducing the scope of the rights granted by the Licence. New
versions of the Licence will be published with a unique version number.
All linguistic versions of this Licence, approved by the European Commission,
have identical value. Parties can take advantage of the linguistic version of
their choice.
14. Jurisdiction
Without prejudice to specific agreement between parties,
- any litigation resulting from the interpretation of this License, arising
between the European Union institutions, bodies, offices or agencies, as a
Licensor, and any Licensee, will be subject to the jurisdiction of the Court
of Justice of the European Union, as laid down in article 272 of the Treaty on
the Functioning of the European Union,
- any litigation arising between other parties and resulting from the
interpretation of this License, will be subject to the exclusive jurisdiction
of the competent court where the Licensor resides or conducts its primary
business.
15. Applicable Law
Without prejudice to specific agreement between parties,
- this Licence shall be governed by the law of the European Union Member State
where the Licensor has his seat, resides or has his registered office,
- this licence shall be governed by Belgian law if the Licensor has no seat,
residence or registered office inside a European Union Member State.
Appendix
Compatible Licences according to Article 5 EUPL are:
- GNU General Public License (GPL) v. 2, v. 3
- GNU Affero General Public License (AGPL) v. 3
- Open Software License (OSL) v. 2.1, v. 3.0
- Eclipse Public License (EPL) v. 1.0
- CeCILL v. 2.0, v. 2.1
- Mozilla Public Licence (MPL) v. 2
- GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
- Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
works other than software
- European Union Public Licence (EUPL) v. 1.1, v. 1.2
- Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong
Reciprocity (LiLiQ-R+).
The European Commission may update this Appendix to later versions of the above
licences without producing a new version of the EUPL, as long as they provide
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.

214
Makefile
View file

@ -1,82 +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
cmake_release = $(cmake) -D CMAKE_BUILD_TYPE=Release
ifeq ($(filter %BSD,$(UNAME_S)),%BSD)
CPU_CORES := $(shell sysctl -n hw.ncpu 2>/dev/null || echo 1)
endif
cmake_gui = -D BUILD_GUI=ON
cmake_static = -D STATIC=ON
cmake_tests = -D BUILD_TESTS=ON
ifeq ($(OS),Windows_NT)
# Helper macro
define CMAKE
mkdir -p $1 && cd $1 && $2 ../../
endef
PRESET_CONFIGURE:=conan-default
build = build
dir_debug = $(build)/debug
dir_release = $(build)/release
CPU_CORES := $(NUMBER_OF_PROCESSORS)
all: release
ifeq ($(CPU_CORES),)
CPU_CORES := $(shell powershell -NoProfile -Command ^ "[Environment]::ProcessorCount")
endif
endif
release:
$(eval command += $(cmake_release))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
# 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)
debug:
$(eval command += $(cmake_debug))
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE)
# ============================================================
# 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))
static: static-release
static-release:
$(eval command += $(cmake_release) $(cmake_static))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
all: help
#
# GUI
#
testnet:
$(MAKE) configure TESTNET=1 STATIC=$(STATIC)
CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) build .
$(MAKE) package
gui: gui-release
gui-release:
$(eval command += $(cmake_release) $(cmake_gui))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
mainnet:
$(MAKE) configure TESTNET=0 STATIC=$(STATIC)
CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) build .
$(MAKE) package
gui-debug:
$(eval command += $(cmake_debug) $(cmake_gui))
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE)
release: docs build
(cd $(BUILD_FOLDER) && cpack)
@rm -rf $(CURDIR)/build/packages/_CPack_Packages
gui-static: gui-release-static
gui-release-static:
$(eval command += $(cmake_release) $(cmake_gui) $(cmake_static))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
build: configure
cmake --build --preset $(PRESET_BUILD) --parallel=$(CPU_CORES)
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)
package:
@echo "Packaging: $(BUILD_TYPE) testnet=$(TESTNET)"
(cd $(BUILD_FOLDER) && cpack)
ifneq ($(OS),Windows_NT)
@rm -rf $(CURDIR)/build/packages/_CPack_Packages
endif
configure: build-deps
@echo "Running Configure: $(BUILD_TYPE) testnet=$(TESTNET)"
cmake --preset $(PRESET_CONFIGURE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
docs: configure
@echo "Building Documentation"
cmake --build build/release --target=docs --config=Release --parallel=$(CPU_CORES)
sdk:
$(MAKE) -C utils/sdk $(filter-out $@,$(MAKECMDGOALS)) PACKAGE_VERSION=$(BUILD_VERSION)
# Rule for each profile — uses .build/cmake/profiles/
$(PROFILES): conan-profile-detect
@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)
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"
#
# 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:
@cmake -P $(CMAKE_DIR)/CleanBuild.cmake
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
.PHONY: all release debug static static-release gui gui-release gui-static gui-release-static gui-debug test test-release test-debug clean tags
.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)

227
README.md
View file

@ -1,171 +1,120 @@
[![Coverity Scan](https://scan.coverity.com/projects/18767/badge.svg)](https://scan.coverity.com/projects/zanoproject)
[![Discord](https://img.shields.io/discord/538361472691077130?label=discord&logo=discord)](https://discord.gg/wE3rmYY)
# Lethean Network—Ethics, Encoded.
## Cloning
> We are building upto a mainnet launch in 2026, documentation written as if mainnet is live.
Be sure to clone the repository properly:\
`$ git clone --recursive https://github.com/hyle-team/zano.git`
A buildkit for deploying confidential information networks and commerce systems with immutable auditability.
# Building
--------
Free for commercial, private, and patent use, self-host or join the community-run network that guarantees participant sovereignty by design.
[![Discord](https://img.shields.io/discord/379876792003067906?label=discord&logo=discord)](https://discord.gg/pfgT2Kz)
Web2 Website: https://lt.hn/
Web3 Network Gateway [HNS](https://handshake.org): [https://lthn](https://www.namebase.io/domains/lthn)
<br/>_(our chain aliases will come with a working Web2(`*.lt.hn`)+Web3(`*.lthn`) domain name)_
### Dependencies
| 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 Zano 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
2. If you set the variables in step 6:
cd zano && mkdir build && cd build
cmake ..
make -j1 daemon simplewallet
or simply:
cd zano && make -j1
**NOTICE**: If you are building on a machine with a relatively high amount of RAM or with the proper setting of virtual memory, then you can use `-j2` or `-j` option to speed up the building process. Use with caution.
**NOTICE 2**: If you'd like to build binaries for the testnet, use `cmake -D TESTNET=TRUE ..` instead of `cmake ..` .
1. Build GUI:
cd zano
utils/build_script_linux.sh
Look for the binaries in `build` folder
<br />
### Windows
Recommended OS version: Windows 7 x64, Windows 11 x64.
1. Install required prerequisites (Boost, Qt, CMake, OpenSSL).
2. Edit paths in `utils/configure_local_paths.cmd`.
3. Run one of `utils/configure_win64_msvsNNNN_gui.cmd` according to your MSVC version.
4. Go to the build folder and open generated Zano.sln in MSVC.
5. Build.
In order to correctly deploy Qt GUI application, you also need to do the following:
6. Copy Zano.exe to a folder (e.g. `depoy`).
7. Run `PATH_TO_QT\bin\windeployqt.exe deploy\Zano.exe`.
8. Copy folder `\src\gui\qt-daemon\html` to `deploy\html`.
9. Now you can run `Zano.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 “Zano” (without quotes) as certificate name.\
d. Choose “Code Signing” in “Certificate Type” field.\
e. Press “Create”, then “Done”.\
f. Make sure the certificate was added to keychain "System". If not—move it to "System".\
g. Double click the certificate you've just added, enter the trust section and under "When using this certificate" select "Always trust".\
h. Unfold the certificate in Keychain Access window and double click the underlying private key "Zano". Select "Access Control" tab, then select "Allow all applications to access this item". Click "Save Changes".
2. Revise building script, comment out unwanted steps and run it: `utils/build_script_mac_osx.sh`
3. The application should be here: `/buid_mac_osx_64/release/src`
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

@ -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,29 +26,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
return()
endif()
add_subdirectory(miniupnp/miniupnpc)
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 upnpc-static 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-discarded-qualifiers ")
set_property(TARGET zlibstatic APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value -Wno-implicit-fallthrough -Wno-discarded-qualifiers ")
endif()
set_property(TARGET mdbx_chk mdbx_copy mdbx_dump mdbx_load mdbx_stat PROPERTY FOLDER "unused")

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

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

@ -84,9 +84,9 @@ namespace misc_utils
{
template<typename t_type_a, typename t_type_b>
void cast_assign_a_to_b(t_type_a& a, const t_type_b& b)
void cast_assign_a_to_b(const t_type_a& a, t_type_b& b)
{
*static_cast<t_type_b*>(&a) = b;
*static_cast<t_type_a*>(&b) = a;
}
template<class _Ty1,
@ -371,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>
@ -560,11 +560,84 @@ namespace misc_utils
{
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,4 +1,4 @@
// Copyright (c) 2019, Zano Project
// 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

@ -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,146 +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::string req_str;
epee::serialization::portable_storage ps;
req.store(ps, nullptr, true);
ps.dump_as_json(req_str);
std::string res_str;
epee::serialization::portable_storage ps_res;
res.store(ps_res, nullptr, true);
ps_res.dump_as_json(res_str);
std::stringstream ss;
ss << prefix_name << ENDL
<< "REQUEST: " << ENDL << req_str << ENDL << "--------------------------------" << ENDL
<< "RESPONSE: " << ENDL << res_str << 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
{
@ -182,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)
@ -198,7 +63,7 @@ namespace epee
KV_SERIALIZE(message)
END_KV_SERIALIZE_MAP()
};
struct dummy_error
{
BEGIN_KV_SERIALIZE_MAP()
@ -233,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()
@ -258,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; \
@ -330,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) \
@ -348,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) \
@ -366,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) \
@ -399,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

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

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

@ -39,9 +39,9 @@ namespace epee
#define BEGIN_KV_SERIALIZE_MAP() \
public: \
template<class t_storage> \
bool store(t_storage& st, typename t_storage::hsection hparent_section = nullptr, bool auto_doc_mode = false) const\
bool store(t_storage& st, typename t_storage::hsection hparent_section = nullptr) const\
{\
return serialize_map<true>(*this, st, hparent_section, auto_doc_mode); \
return serialize_map<true>(*this, st, hparent_section); \
}\
template<class t_storage> \
bool _load(t_storage& stg, typename t_storage::hsection hparent_section = nullptr)\
@ -62,19 +62,75 @@ public: \
}\
}\
template<bool is_store, class this_type, class t_storage> \
static bool serialize_map(this_type& this_ref, t_storage& stg, typename t_storage::hsection hparent_section, bool auto_doc_mode = false) \
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, substitute) \
epee::serialization::selector<is_store>::serialize(this_ref.varialble, stg, hparent_section, val_name, auto_doc_mode, substitute);
//#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);
@ -84,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);
@ -92,20 +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_DOC(varialble, substitute) KV_SERIALIZE_N_DOC( varialble, #varialble, substitute)
#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, bool doc_mode = false, const t_type& doc_substitute = t_type())
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( (doc_mode ? doc_substitute: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);
@ -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

@ -28,6 +28,7 @@
#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;

View file

@ -277,7 +277,7 @@ namespace epee
#define POTENTIAL_HANG_PREVENT_LIMIT 1000
#define DEADLOCK_GUARD_JOURNAL_LIMIT 1000
/************************************************************************/
/* */
@ -290,11 +290,11 @@ namespace epee
struct thread_info
{
std::map<lock_reference_type, size_t> m_owned_objects;
bool is_blocked;
lock_reference_type blocker_lock;
const char* block_location;
const char* func_name;
const char* lock_name;
bool is_blocked = false;
lock_reference_type blocker_lock = nullptr;
const char* block_location = "unknown";
const char* func_name = "unknown";
const char* lock_name = "unknown";
std::string thread_name;
};
@ -307,6 +307,18 @@ namespace epee
std::map<lock_reference_type, thread_id_to_info_map::iterator> m_owned_locks_to_thread;
// deadlock journal
std::list<std::string> m_deadlock_journal;
//lock/unlock journal
struct journal_entry
{
std::thread::id tid;
lock_reference_type lock = nullptr;
bool is_lock_event = false;
const char* func_name = "unkonwn";
const char* lock_name = "unkonwn";
std::string thread_name;
};
std::list<journal_entry> m_journal;
public:
void on_before_lock(lock_reference_type lock, const char* func_name, const char* loction, const char* lock_name, const std::string& thread_name)
@ -363,6 +375,10 @@ namespace epee
}
else
{
m_journal.push_front(journal_entry{ this_id, lock, false, "", "", ""});
if (m_journal.size() > DEADLOCK_GUARD_JOURNAL_LIMIT)
m_journal.pop_back();
m_owned_locks_to_thread.erase(lock_to_thread_it);
}
it->second.m_owned_objects.erase(ownership_it);
@ -400,6 +416,15 @@ namespace epee
ss << "-----------------------------------------------------------------------" << std::endl << err << std::endl;
}
ss << "Ownership history history:" << std::endl;
size_t count = 0;
for (auto entry : m_journal)
{
ss << "tid(" << entry.thread_name << "): " << entry.tid << ", lock_addr: " << entry.lock << (entry.is_lock_event ? "-->":"<--") << ", func: " << (entry.func_name ? entry.func_name:"") << ", lock_name: " << (entry.lock_name ? entry.lock_name : "") << std::endl;
if (++count > 100)
break;
}
return ss.str();
}
@ -429,6 +454,10 @@ namespace epee
//need to add lock-to-thread reccord
m_owned_locks_to_thread[lock] = it;
DO_DEBUG_COUT("[" << std::this_thread::get_id() << "][ADDED_OWNERSHIP]: " << lock << std::endl);
m_journal.push_front(journal_entry{ this_id, lock, true, it->second.func_name, it->second.lock_name, it->second.thread_name });
if (m_journal.size() > DEADLOCK_GUARD_JOURNAL_LIMIT)
m_journal.pop_back();
}
else
{

View file

@ -27,7 +27,7 @@
#pragma once
extern "C" {
#include "zlib/zlib.h"
#include "zlib.h"
}
namespace epee
@ -98,6 +98,7 @@ namespace zlib_helper
if (ret != Z_OK)
{
LOCAL_ASSERT(0);
inflateEnd(&zstream);
return false;
}
@ -108,6 +109,7 @@ namespace zlib_helper
if (ret != Z_OK && ret != Z_STREAM_END)
{
LOCAL_ASSERT(0);
inflateEnd(&zstream);
return false;
}
@ -118,6 +120,7 @@ namespace zlib_helper
if(ungzip_buff_size == zstream.avail_out)
{
LOG_ERROR("Can't unpack buffer");
inflateEnd(&zstream);
return false;
}

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

1
contrib/randomx Submodule

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

@ -1 +1 @@
Subproject commit b589edb1906dccb387cfeded6ed12286c5f0405f
Subproject commit 1be2073ed3da5e9e6e94e8362548df26a22b1bd2

View file

@ -1,248 +0,0 @@
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
project(zlib C)
set(VERSION "1.2.11")
option(ASM686 "Enable building i686 assembly implementation")
option(AMD64 "Enable building amd64 assembly implementation")
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages")
set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
include(CheckTypeSize)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckCSourceCompiles)
enable_testing()
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H)
#
# Check to see if we have large file support
#
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
# We add these other definitions here because CheckTypeSize.cmake
# in CMake 2.4.x does not automatically do so and we want
# compatibility with CMake 2.4.x.
if(HAVE_SYS_TYPES_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
endif()
if(HAVE_STDINT_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
endif()
if(HAVE_STDDEF_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
endif()
check_type_size(off64_t OFF64_T)
if(HAVE_OFF64_T)
add_definitions(-D_LARGEFILE64_SOURCE=1)
endif()
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
#
# Check for fseeko
#
check_function_exists(fseeko HAVE_FSEEKO)
if(NOT HAVE_FSEEKO)
add_definitions(-DNO_FSEEKO)
endif()
#
# Check for unistd.h
#
check_include_file(unistd.h Z_HAVE_UNISTD_H)
if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
endif()
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
# If we're doing an out of source build and the user has a zconf.h
# in their source tree...
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
message(STATUS "Renaming")
message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h")
message(STATUS "to 'zconf.h.included' because this file is included with zlib")
message(STATUS "but CMake generates it automatically in the build directory.")
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included)
endif()
endif()
set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
${ZLIB_PC} @ONLY)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
#============================================================================
# zlib
#============================================================================
set(ZLIB_PUBLIC_HDRS
${CMAKE_CURRENT_BINARY_DIR}/zconf.h
zlib.h
)
set(ZLIB_PRIVATE_HDRS
crc32.h
deflate.h
gzguts.h
inffast.h
inffixed.h
inflate.h
inftrees.h
trees.h
zutil.h
)
set(ZLIB_SRCS
adler32.c
compress.c
crc32.c
deflate.c
gzclose.c
gzlib.c
gzread.c
gzwrite.c
inflate.c
infback.c
inftrees.c
inffast.c
trees.c
uncompr.c
zutil.c
)
if(NOT MINGW)
set(ZLIB_DLL_SRCS
win32/zlib1.rc # If present will override custom build rule below.
)
endif()
if(CMAKE_COMPILER_IS_GNUCC)
if(ASM686)
set(ZLIB_ASMS contrib/asm686/match.S)
elseif (AMD64)
set(ZLIB_ASMS contrib/amd64/amd64-match.S)
endif ()
if(ZLIB_ASMS)
add_definitions(-DASMV)
set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
endif()
endif()
if(MSVC)
if(ASM686)
ENABLE_LANGUAGE(ASM_MASM)
set(ZLIB_ASMS
contrib/masmx86/inffas32.asm
contrib/masmx86/match686.asm
)
elseif (AMD64)
ENABLE_LANGUAGE(ASM_MASM)
set(ZLIB_ASMS
contrib/masmx64/gvmat64.asm
contrib/masmx64/inffasx64.asm
)
endif()
if(ZLIB_ASMS)
add_definitions(-DASMV -DASMINF)
endif()
endif()
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
if(MINGW)
# This gets us DLL resource information when compiling on MinGW.
if(NOT CMAKE_RC_COMPILER)
set(CMAKE_RC_COMPILER windres.exe)
endif()
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
COMMAND ${CMAKE_RC_COMPILER}
-D GCC_WINDRES
-I ${CMAKE_CURRENT_SOURCE_DIR}
-I ${CMAKE_CURRENT_BINARY_DIR}
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
endif(MINGW)
#add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
# set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
# set_target_properties(zlib PROPERTIES SOVERSION 1)
if(NOT CYGWIN)
# This property causes shared libraries on Linux to have the full version
# encoded into their final filename. We disable this on Cygwin because
# it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll
# seems to be the default.
#
# This has no effect with MSVC, on that platform the version info for
# the DLL comes from the resource file win32/zlib1.rc
# set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
endif()
if(UNIX)
# On unix-like platforms the library is almost always called libz
set_target_properties( zlibstatic PROPERTIES OUTPUT_NAME z)
if(NOT APPLE)
#set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
elseif(BUILD_SHARED_LIBS AND WIN32)
# Creates zlib1.dll when building shared library version
# set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
endif()
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
install(TARGETS zlibstatic
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${INSTALL_INC_DIR}")
endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3")
endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}")
endif()
#============================================================================
# Example binaries
#============================================================================
#add_executable(example test/example.c)
#target_link_libraries(example zlib)
#add_test(example example)
#add_executable(minigzip test/minigzip.c)
#target_link_libraries(minigzip zlib)
if(HAVE_OFF64_T)
# add_executable(example64 test/example.c)
# target_link_libraries(example64 zlib)
# set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
# add_test(example64 example64)
# add_executable(minigzip64 test/minigzip.c)
# target_link_libraries(minigzip64 zlib)
# set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()

File diff suppressed because it is too large Load diff

View file

@ -1,368 +0,0 @@
Frequently Asked Questions about zlib
If your question is not there, please check the zlib home page
http://zlib.net/ which may have more recent information.
The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
1. Is zlib Y2K-compliant?
Yes. zlib doesn't handle dates.
2. Where can I get a Windows DLL version?
The zlib sources can be compiled without change to produce a DLL. See the
file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the
precompiled DLL are found in the zlib web site at http://zlib.net/ .
3. Where can I get a Visual Basic interface to zlib?
See
* http://marknelson.us/1997/01/01/zlib-engine/
* win32/DLL_FAQ.txt in the zlib distribution
4. compress() returns Z_BUF_ERROR.
Make sure that before the call of compress(), the length of the compressed
buffer is equal to the available size of the compressed buffer and not
zero. For Visual Basic, check that this parameter is passed by reference
("as any"), not by value ("as long").
5. deflate() or inflate() returns Z_BUF_ERROR.
Before making the call, make sure that avail_in and avail_out are not zero.
When setting the parameter flush equal to Z_FINISH, also make sure that
avail_out is big enough to allow processing all pending input. Note that a
Z_BUF_ERROR is not fatal--another call to deflate() or inflate() can be
made with more input or output space. A Z_BUF_ERROR may in fact be
unavoidable depending on how the functions are used, since it is not
possible to tell whether or not there is more output pending when
strm.avail_out returns with zero. See http://zlib.net/zlib_how.html for a
heavily annotated example.
6. Where's the zlib documentation (man pages, etc.)?
It's in zlib.h . Examples of zlib usage are in the files test/example.c
and test/minigzip.c, with more in examples/ .
7. Why don't you use GNU autoconf or libtool or ...?
Because we would like to keep zlib as a very small and simple package.
zlib is rather portable and doesn't need much configuration.
8. I found a bug in zlib.
Most of the time, such problems are due to an incorrect usage of zlib.
Please try to reproduce the problem with a small program and send the
corresponding source to us at zlib@gzip.org . Do not send multi-megabyte
data files without prior agreement.
9. Why do I get "undefined reference to gzputc"?
If "make test" produces something like
example.o(.text+0x154): undefined reference to `gzputc'
check that you don't have old files libz.* in /usr/lib, /usr/local/lib or
/usr/X11R6/lib. Remove any old versions, then do "make install".
10. I need a Delphi interface to zlib.
See the contrib/delphi directory in the zlib distribution.
11. Can zlib handle .zip archives?
Not by itself, no. See the directory contrib/minizip in the zlib
distribution.
12. Can zlib handle .Z files?
No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt
the code of uncompress on your own.
13. How can I make a Unix shared library?
By default a shared (and a static) library is built for Unix. So:
make distclean
./configure
make
14. How do I install a shared zlib library on Unix?
After the above, then:
make install
However, many flavors of Unix come with a shared zlib already installed.
Before going to the trouble of compiling a shared version of zlib and
trying to install it, you may want to check if it's already there! If you
can #include <zlib.h>, it's there. The -lz option will probably link to
it. You can check the version at the top of zlib.h or with the
ZLIB_VERSION symbol defined in zlib.h .
15. I have a question about OttoPDF.
We are not the authors of OttoPDF. The real author is on the OttoPDF web
site: Joel Hainley, jhainley@myndkryme.com.
16. Can zlib decode Flate data in an Adobe PDF file?
Yes. See http://www.pdflib.com/ . To modify PDF forms, see
http://sourceforge.net/projects/acroformtool/ .
17. Why am I getting this "register_frame_info not found" error on Solaris?
After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib
generates an error such as:
ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so:
symbol __register_frame_info: referenced symbol not found
The symbol __register_frame_info is not part of zlib, it is generated by
the C compiler (cc or gcc). You must recompile applications using zlib
which have this problem. This problem is specific to Solaris. See
http://www.sunfreeware.com for Solaris versions of zlib and applications
using zlib.
18. Why does gzip give an error on a file I make with compress/deflate?
The compress and deflate functions produce data in the zlib format, which
is different and incompatible with the gzip format. The gz* functions in
zlib on the other hand use the gzip format. Both the zlib and gzip formats
use the same compressed data format internally, but have different headers
and trailers around the compressed data.
19. Ok, so why are there two different formats?
The gzip format was designed to retain the directory information about a
single file, such as the name and last modification date. The zlib format
on the other hand was designed for in-memory and communication channel
applications, and has a much more compact header and trailer and uses a
faster integrity check than gzip.
20. Well that's nice, but how do I make a gzip file in memory?
You can request that deflate write the gzip format instead of the zlib
format using deflateInit2(). You can also request that inflate decode the
gzip format using inflateInit2(). Read zlib.h for more details.
21. Is zlib thread-safe?
Yes. However any library routines that zlib uses and any application-
provided memory allocation routines must also be thread-safe. zlib's gz*
functions use stdio library routines, and most of zlib's functions use the
library memory allocation routines by default. zlib's *Init* functions
allow for the application to provide custom memory allocation routines.
Of course, you should only operate on any given zlib or gzip stream from a
single thread at a time.
22. Can I use zlib in my commercial application?
Yes. Please read the license in zlib.h.
23. Is zlib under the GNU license?
No. Please read the license in zlib.h.
24. The license says that altered source versions must be "plainly marked". So
what exactly do I need to do to meet that requirement?
You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In
particular, the final version number needs to be changed to "f", and an
identification string should be appended to ZLIB_VERSION. Version numbers
x.x.x.f are reserved for modifications to zlib by others than the zlib
maintainers. For example, if the version of the base zlib you are altering
is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and
ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also
update the version strings in deflate.c and inftrees.c.
For altered source distributions, you should also note the origin and
nature of the changes in zlib.h, as well as in ChangeLog and README, along
with the dates of the alterations. The origin should include at least your
name (or your company's name), and an email address to contact for help or
issues with the library.
Note that distributing a compiled zlib library along with zlib.h and
zconf.h is also a source distribution, and so you should change
ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes
in zlib.h as you would for a full source distribution.
25. Will zlib work on a big-endian or little-endian architecture, and can I
exchange compressed data between them?
Yes and yes.
26. Will zlib work on a 64-bit machine?
Yes. It has been tested on 64-bit machines, and has no dependence on any
data types being limited to 32-bits in length. If you have any
difficulties, please provide a complete problem report to zlib@gzip.org
27. Will zlib decompress data from the PKWare Data Compression Library?
No. The PKWare DCL uses a completely different compressed data format than
does PKZIP and zlib. However, you can look in zlib's contrib/blast
directory for a possible solution to your problem.
28. Can I access data randomly in a compressed stream?
No, not without some preparation. If when compressing you periodically use
Z_FULL_FLUSH, carefully write all the pending data at those points, and
keep an index of those locations, then you can start decompression at those
points. You have to be careful to not use Z_FULL_FLUSH too often, since it
can significantly degrade compression. Alternatively, you can scan a
deflate stream once to generate an index, and then use that index for
random access. See examples/zran.c .
29. Does zlib work on MVS, OS/390, CICS, etc.?
It has in the past, but we have not heard of any recent evidence. There
were working ports of zlib 1.1.4 to MVS, but those links no longer work.
If you know of recent, successful applications of zlib on these operating
systems, please let us know. Thanks.
30. Is there some simpler, easier to read version of inflate I can look at to
understand the deflate format?
First off, you should read RFC 1951. Second, yes. Look in zlib's
contrib/puff directory.
31. Does zlib infringe on any patents?
As far as we know, no. In fact, that was originally the whole point behind
zlib. Look here for some more information:
http://www.gzip.org/#faq11
32. Can zlib work with greater than 4 GB of data?
Yes. inflate() and deflate() will process any amount of data correctly.
Each call of inflate() or deflate() is limited to input and output chunks
of the maximum value that can be stored in the compiler's "unsigned int"
type, but there is no limit to the number of chunks. Note however that the
strm.total_in and strm_total_out counters may be limited to 4 GB. These
counters are provided as a convenience and are not used internally by
inflate() or deflate(). The application can easily set up its own counters
updated after each call of inflate() or deflate() to count beyond 4 GB.
compress() and uncompress() may be limited to 4 GB, since they operate in a
single call. gzseek() and gztell() may be limited to 4 GB depending on how
zlib is compiled. See the zlibCompileFlags() function in zlib.h.
The word "may" appears several times above since there is a 4 GB limit only
if the compiler's "long" type is 32 bits. If the compiler's "long" type is
64 bits, then the limit is 16 exabytes.
33. Does zlib have any security vulnerabilities?
The only one that we are aware of is potentially in gzprintf(). If zlib is
compiled to use sprintf() or vsprintf(), then there is no protection
against a buffer overflow of an 8K string space (or other value as set by
gzbuffer()), other than the caller of gzprintf() assuring that the output
will not exceed 8K. On the other hand, if zlib is compiled to use
snprintf() or vsnprintf(), which should normally be the case, then there is
no vulnerability. The ./configure script will display warnings if an
insecure variation of sprintf() will be used by gzprintf(). Also the
zlibCompileFlags() function will return information on what variant of
sprintf() is used by gzprintf().
If you don't have snprintf() or vsnprintf() and would like one, you can
find a portable implementation here:
http://www.ijs.si/software/snprintf/
Note that you should be using the most recent version of zlib. Versions
1.1.3 and before were subject to a double-free vulnerability, and versions
1.2.1 and 1.2.2 were subject to an access exception when decompressing
invalid compressed data.
34. Is there a Java version of zlib?
Probably what you want is to use zlib in Java. zlib is already included
as part of the Java SDK in the java.util.zip package. If you really want
a version of zlib written in the Java language, look on the zlib home
page for links: http://zlib.net/ .
35. I get this or that compiler or source-code scanner warning when I crank it
up to maximally-pedantic. Can't you guys write proper code?
Many years ago, we gave up attempting to avoid warnings on every compiler
in the universe. It just got to be a waste of time, and some compilers
were downright silly as well as contradicted each other. So now, we simply
make sure that the code always works.
36. Valgrind (or some similar memory access checker) says that deflate is
performing a conditional jump that depends on an uninitialized value.
Isn't that a bug?
No. That is intentional for performance reasons, and the output of deflate
is not affected. This only started showing up recently since zlib 1.2.x
uses malloc() by default for allocations, whereas earlier versions used
calloc(), which zeros out the allocated memory. Even though the code was
correct, versions 1.2.4 and later was changed to not stimulate these
checkers.
37. Will zlib read the (insert any ancient or arcane format here) compressed
data format?
Probably not. Look in the comp.compression FAQ for pointers to various
formats and associated software.
38. How can I encrypt/decrypt zip files with zlib?
zlib doesn't support encryption. The original PKZIP encryption is very
weak and can be broken with freely available programs. To get strong
encryption, use GnuPG, http://www.gnupg.org/ , which already includes zlib
compression. For PKZIP compatible "encryption", look at
http://www.info-zip.org/
39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?
"gzip" is the gzip format, and "deflate" is the zlib format. They should
probably have called the second one "zlib" instead to avoid confusion with
the raw deflate compressed data format. While the HTTP 1.1 RFC 2616
correctly points to the zlib specification in RFC 1950 for the "deflate"
transfer encoding, there have been reports of servers and browsers that
incorrectly produce or expect raw deflate data per the deflate
specification in RFC 1951, most notably Microsoft. So even though the
"deflate" transfer encoding using the zlib format would be the more
efficient approach (and in fact exactly what the zlib format was designed
for), using the "gzip" transfer encoding is probably more reliable due to
an unfortunate choice of name on the part of the HTTP 1.1 authors.
Bottom line: use the gzip format for HTTP 1.1 encoding.
40. Does zlib support the new "Deflate64" format introduced by PKWare?
No. PKWare has apparently decided to keep that format proprietary, since
they have not documented it as they have previous compression formats. In
any case, the compression improvements are so modest compared to other more
modern approaches, that it's not worth the effort to implement.
41. I'm having a problem with the zip functions in zlib, can you help?
There are no zip functions in zlib. You are probably using minizip by
Giles Vollant, which is found in the contrib directory of zlib. It is not
part of zlib. In fact none of the stuff in contrib is part of zlib. The
files in there are not supported by the zlib authors. You need to contact
the authors of the respective contribution for help.
42. The match.asm code in contrib is under the GNU General Public License.
Since it's part of zlib, doesn't that mean that all of zlib falls under the
GNU GPL?
No. The files in contrib are not part of zlib. They were contributed by
other authors and are provided as a convenience to the user within the zlib
distribution. Each item in contrib has its own license.
43. Is zlib subject to export controls? What is its ECCN?
zlib is not subject to export controls, and so is classified as EAR99.
44. Can you please sign these lengthy legal documents and fax them back to us
so that we can use your software in our product?
No. Go away. Shoo.

View file

@ -1,68 +0,0 @@
CMakeLists.txt cmake build file
ChangeLog history of changes
FAQ Frequently Asked Questions about zlib
INDEX this file
Makefile dummy Makefile that tells you to ./configure
Makefile.in template for Unix Makefile
README guess what
configure configure script for Unix
make_vms.com makefile for VMS
test/example.c zlib usages examples for build testing
test/minigzip.c minimal gzip-like functionality for build testing
test/infcover.c inf*.c code coverage for build coverage testing
treebuild.xml XML description of source file dependencies
zconf.h.cmakein zconf.h template for cmake
zconf.h.in zconf.h template for configure
zlib.3 Man page for zlib
zlib.3.pdf Man page in PDF format
zlib.map Linux symbol information
zlib.pc.in Template for pkg-config descriptor
zlib.pc.cmakein zlib.pc template for cmake
zlib2ansi perl script to convert source files for C++ compilation
amiga/ makefiles for Amiga SAS C
as400/ makefiles for AS/400
doc/ documentation for formats and algorithms
msdos/ makefiles for MSDOS
nintendods/ makefile for Nintendo DS
old/ makefiles for various architectures and zlib documentation
files that have not yet been updated for zlib 1.2.x
qnx/ makefiles for QNX
watcom/ makefiles for OpenWatcom
win32/ makefiles for Windows
zlib public header files (required for library use):
zconf.h
zlib.h
private source files used to build the zlib library:
adler32.c
compress.c
crc32.c
crc32.h
deflate.c
deflate.h
gzclose.c
gzguts.h
gzlib.c
gzread.c
gzwrite.c
infback.c
inffast.c
inffast.h
inffixed.h
inflate.c
inflate.h
inftrees.c
inftrees.h
trees.c
trees.h
uncompr.c
zutil.c
zutil.h
source files for sample programs
See examples/README.examples
unsupported contributions by third parties
See contrib/README.contrib

View file

@ -1,5 +0,0 @@
all:
-@echo "Please use ./configure first. Thank you."
distclean:
make -f Makefile.in distclean

View file

@ -1,410 +0,0 @@
# Makefile for zlib
# Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler
# For conditions of distribution and use, see copyright notice in zlib.h
# To compile and test, type:
# ./configure; make test
# Normally configure builds both a static and a shared library.
# If you want to build just a static library, use: ./configure --static
# To use the asm code, type:
# cp contrib/asm?86/match.S ./match.S
# make LOC=-DASMV OBJA=match.o
# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
# make install
# To install in $HOME instead of /usr/local, use:
# make install prefix=$HOME
CC=cc
CFLAGS=-O
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
#CFLAGS=-g -DZLIB_DEBUG
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
# -Wstrict-prototypes -Wmissing-prototypes
SFLAGS=-O
LDFLAGS=
TEST_LDFLAGS=-L. libz.a
LDSHARED=$(CC)
CPP=$(CC) -E
STATICLIB=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.11
SHAREDLIBM=libz.so.1
LIBS=$(STATICLIB) $(SHAREDLIBV)
AR=ar
ARFLAGS=rc
RANLIB=ranlib
LDCONFIG=ldconfig
LDSHAREDLIBC=-lc
TAR=tar
SHELL=/bin/sh
EXE=
prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
sharedlibdir = ${libdir}
includedir = ${prefix}/include
mandir = ${prefix}/share/man
man3dir = ${mandir}/man3
pkgconfigdir = ${libdir}/pkgconfig
SRCDIR=
ZINC=
ZINCOUT=-I.
OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
OBJC = $(OBJZ) $(OBJG)
PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo
PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo
PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG)
# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
OBJA =
PIC_OBJA =
OBJS = $(OBJC) $(OBJA)
PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
all: static shared
static: example$(EXE) minigzip$(EXE)
shared: examplesh$(EXE) minigzipsh$(EXE)
all64: example64$(EXE) minigzip64$(EXE)
check: test
test: all teststatic testshared
teststatic: static
@TMPST=tmpst_$$; \
if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
echo ' *** zlib test OK ***'; \
else \
echo ' *** zlib test FAILED ***'; false; \
fi; \
rm -f $$TMPST
testshared: shared
@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
TMPSH=tmpsh_$$; \
if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
echo ' *** zlib shared test OK ***'; \
else \
echo ' *** zlib shared test FAILED ***'; false; \
fi; \
rm -f $$TMPSH
test64: all64
@TMP64=tmp64_$$; \
if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
echo ' *** zlib 64-bit test OK ***'; \
else \
echo ' *** zlib 64-bit test FAILED ***'; false; \
fi; \
rm -f $$TMP64
infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
infcover: infcover.o libz.a
$(CC) $(CFLAGS) -o $@ infcover.o libz.a
cover: infcover
rm -f *.gcda
./infcover
gcov inf*.c
libz.a: $(OBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
match.o: match.S
$(CPP) match.S > _match.s
$(CC) -c _match.s
mv _match.o match.o
rm -f _match.s
match.lo: match.S
$(CPP) match.S > _match.s
$(CC) -c -fPIC _match.s
mv _match.o match.lo
rm -f _match.s
example.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/example.c
minigzip.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/minigzip.c
example64.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
$(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/example.c
minigzip64.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
$(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/minigzip.c
adler32.o: $(SRCDIR)adler32.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)adler32.c
crc32.o: $(SRCDIR)crc32.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)crc32.c
deflate.o: $(SRCDIR)deflate.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
infback.o: $(SRCDIR)infback.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)infback.c
inffast.o: $(SRCDIR)inffast.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inffast.c
inflate.o: $(SRCDIR)inflate.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inflate.c
inftrees.o: $(SRCDIR)inftrees.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inftrees.c
trees.o: $(SRCDIR)trees.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)trees.c
zutil.o: $(SRCDIR)zutil.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)zutil.c
compress.o: $(SRCDIR)compress.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)compress.c
uncompr.o: $(SRCDIR)uncompr.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)uncompr.c
gzclose.o: $(SRCDIR)gzclose.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzclose.c
gzlib.o: $(SRCDIR)gzlib.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzlib.c
gzread.o: $(SRCDIR)gzread.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzread.c
gzwrite.o: $(SRCDIR)gzwrite.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzwrite.c
adler32.lo: $(SRCDIR)adler32.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
-@mv objs/adler32.o $@
crc32.lo: $(SRCDIR)crc32.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
-@mv objs/crc32.o $@
deflate.lo: $(SRCDIR)deflate.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
-@mv objs/deflate.o $@
infback.lo: $(SRCDIR)infback.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/infback.o $(SRCDIR)infback.c
-@mv objs/infback.o $@
inffast.lo: $(SRCDIR)inffast.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
-@mv objs/inffast.o $@
inflate.lo: $(SRCDIR)inflate.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
-@mv objs/inflate.o $@
inftrees.lo: $(SRCDIR)inftrees.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
-@mv objs/inftrees.o $@
trees.lo: $(SRCDIR)trees.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/trees.o $(SRCDIR)trees.c
-@mv objs/trees.o $@
zutil.lo: $(SRCDIR)zutil.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
-@mv objs/zutil.o $@
compress.lo: $(SRCDIR)compress.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/compress.o $(SRCDIR)compress.c
-@mv objs/compress.o $@
uncompr.lo: $(SRCDIR)uncompr.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
-@mv objs/uncompr.o $@
gzclose.lo: $(SRCDIR)gzclose.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
-@mv objs/gzclose.o $@
gzlib.lo: $(SRCDIR)gzlib.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
-@mv objs/gzlib.o $@
gzread.lo: $(SRCDIR)gzread.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
-@mv objs/gzread.o $@
gzwrite.lo: $(SRCDIR)gzwrite.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
-@mv objs/gzwrite.o $@
placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
rm -f $(SHAREDLIB) $(SHAREDLIBM)
ln -s $@ $(SHAREDLIB)
ln -s $@ $(SHAREDLIBM)
-@rmdir objs
example$(EXE): example.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
minigzip$(EXE): minigzip.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
examplesh$(EXE): example.o $(SHAREDLIBV)
$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
example64$(EXE): example64.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
minigzip64$(EXE): minigzip64.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
install-libs: $(LIBS)
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
-@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
-@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
-@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
rm -f $(DESTDIR)$(libdir)/$(STATICLIB)
cp $(STATICLIB) $(DESTDIR)$(libdir)
chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
-@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
-@if test -n "$(SHAREDLIBV)"; then \
rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
($(LDCONFIG) || true) >/dev/null 2>&1; \
fi
rm -f $(DESTDIR)$(man3dir)/zlib.3
cp $(SRCDIR)zlib.3 $(DESTDIR)$(man3dir)
chmod 644 $(DESTDIR)$(man3dir)/zlib.3
rm -f $(DESTDIR)$(pkgconfigdir)/zlib.pc
cp zlib.pc $(DESTDIR)$(pkgconfigdir)
chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
# The ranlib in install is needed on NeXTSTEP which checks file times
# ldconfig is for Linux
install: install-libs
-@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
rm -f $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
cp $(SRCDIR)zlib.h zconf.h $(DESTDIR)$(includedir)
chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
uninstall:
cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h
cd $(DESTDIR)$(libdir) && rm -f libz.a; \
if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
fi
cd $(DESTDIR)$(man3dir) && rm -f zlib.3
cd $(DESTDIR)$(pkgconfigdir) && rm -f zlib.pc
docs: zlib.3.pdf
zlib.3.pdf: $(SRCDIR)zlib.3
groff -mandoc -f H -T ps $(SRCDIR)zlib.3 | ps2pdf - $@
zconf.h.cmakein: $(SRCDIR)zconf.h.in
-@ TEMPFILE=zconfh_$$; \
echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
touch -r $(SRCDIR)zconf.h.in $@ &&\
rm $$TEMPFILE
zconf: $(SRCDIR)zconf.h.in
cp -p $(SRCDIR)zconf.h.in zconf.h
mostlyclean: clean
clean:
rm -f *.o *.lo *~ \
example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
example64$(EXE) minigzip64$(EXE) \
infcover \
libz.* foo.gz so_locations \
_match.s maketree contrib/infback9/*.o
rm -rf objs
rm -f *.gcda *.gcno *.gcov
rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
maintainer-clean: distclean
distclean: clean zconf zconf.h.cmakein docs
rm -f Makefile zlib.pc configure.log
-@rm -f .DS_Store
@if [ -f Makefile.in ]; then \
printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
touch -r $(SRCDIR)Makefile.in Makefile ; fi
@if [ ! -f zconf.h.in ]; then rm -f zconf.h zconf.h.cmakein ; fi
@if [ ! -f zlib.3 ]; then rm -f zlib.3.pdf ; fi
tags:
etags $(SRCDIR)*.[ch]
adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
gzclose.o gzlib.o gzread.o gzwrite.o: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
compress.o example.o minigzip.o uncompr.o: $(SRCDIR)zlib.h zconf.h
crc32.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
deflate.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
infback.o inflate.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
inffast.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
inftrees.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
trees.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
adler32.lo zutil.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
gzclose.lo gzlib.lo gzread.lo gzwrite.lo: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
compress.lo example.lo minigzip.lo uncompr.lo: $(SRCDIR)zlib.h zconf.h
crc32.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
deflate.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
infback.lo inflate.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
inffast.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
inftrees.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
trees.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h

View file

@ -1,115 +0,0 @@
ZLIB DATA COMPRESSION LIBRARY
zlib 1.2.11 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
rfc1952 (gzip format).
All functions of the compression library are documented in the file zlib.h
(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
of the library is given in the file test/example.c which also tests that
the library is working correctly. Another example is given in the file
test/minigzip.c. The compression library itself is composed of all source
files in the root directory.
To compile all files and run the test program, follow the instructions given at
the top of Makefile.in. In short "./configure; make test", and if that goes
well, "make install" should work for most flavors of Unix. For Windows, use
one of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
make_vms.com.
Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
<info@winimage.com> for the Windows DLL version. The zlib home page is
http://zlib.net/ . Before reporting a problem, please check this site to
verify that you have the latest version of zlib; otherwise get the latest
version and check whether the problem still exists or not.
PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available at
http://marknelson.us/1997/01/01/zlib-engine/ .
The changes made in version 1.2.11 are documented in the file ChangeLog.
Unsupported third party contributions are provided in directory contrib/ .
zlib is available in Java using the java.util.zip package, documented at
http://java.sun.com/developer/technicalArticles/Programming/compression/ .
A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
at CPAN (Comprehensive Perl Archive Network) sites, including
http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
available in Python 1.5 and later versions, see
http://docs.python.org/library/zlib.html .
zlib is built into tcl: http://wiki.tcl.tk/4610 .
An experimental package to read and write files in .zip format, written on top
of zlib by Gilles Vollant <info@winimage.com>, is available in the
contrib/minizip directory of zlib.
Notes for some targets:
- For Windows DLL versions, please see win32/DLL_FAQ.txt
- For 64-bit Irix, deflate.c must be compiled without any optimization. With
-O, one libpng test fails. The test works in 32 bit mode (with the -n32
compiler flag). The compiler bug has been reported to SGI.
- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
when compiled with cc.
- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
necessary to get gzprintf working correctly. This is done by configure.
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
other compilers. Use "make test" to check your compiler.
- gzdopen is not supported on RISCOS or BEOS.
- For PalmOs, see http://palmzlib.sourceforge.net/
Acknowledgments:
The deflate format used by zlib was defined by Phil Katz. The deflate and
zlib specifications were written by L. Peter Deutsch. Thanks to all the
people who reported problems and suggested various improvements in zlib; they
are too numerous to cite here.
Copyright notice:
(C) 1995-2017 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
If you use the zlib library in a product, we would appreciate *not* receiving
lengthy legal documents to sign. The sources are provided for free but without
warranty of any kind. The library has been entirely written by Jean-loup
Gailly and Mark Adler; it does not include third-party code.
If you redistribute modified sources, we would appreciate that you include in
the file ChangeLog history information documenting your changes. Please read
the FAQ for more information on the distribution of modified source versions.

View file

@ -1,186 +0,0 @@
/* adler32.c -- compute the Adler-32 checksum of a data stream
* Copyright (C) 1995-2011, 2016 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#include "zutil.h"
local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
#define BASE 65521U /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
#define DO16(buf) DO8(buf,0); DO8(buf,8);
/* use NO_DIVIDE if your processor does not do division in hardware --
try it both ways to see which is faster */
#ifdef NO_DIVIDE
/* note that this assumes BASE is 65521, where 65536 % 65521 == 15
(thank you to John Reiser for pointing this out) */
# define CHOP(a) \
do { \
unsigned long tmp = a >> 16; \
a &= 0xffffUL; \
a += (tmp << 4) - tmp; \
} while (0)
# define MOD28(a) \
do { \
CHOP(a); \
if (a >= BASE) a -= BASE; \
} while (0)
# define MOD(a) \
do { \
CHOP(a); \
MOD28(a); \
} while (0)
# define MOD63(a) \
do { /* this assumes a is not negative */ \
z_off64_t tmp = a >> 32; \
a &= 0xffffffffL; \
a += (tmp << 8) - (tmp << 5) + tmp; \
tmp = a >> 16; \
a &= 0xffffL; \
a += (tmp << 4) - tmp; \
tmp = a >> 16; \
a &= 0xffffL; \
a += (tmp << 4) - tmp; \
if (a >= BASE) a -= BASE; \
} while (0)
#else
# define MOD(a) a %= BASE
# define MOD28(a) a %= BASE
# define MOD63(a) a %= BASE
#endif
/* ========================================================================= */
uLong ZEXPORT adler32_z(adler, buf, len)
uLong adler;
const Bytef *buf;
z_size_t len;
{
unsigned long sum2;
unsigned n;
/* split Adler-32 into component sums */
sum2 = (adler >> 16) & 0xffff;
adler &= 0xffff;
/* in case user likes doing a byte at a time, keep it fast */
if (len == 1) {
adler += buf[0];
if (adler >= BASE)
adler -= BASE;
sum2 += adler;
if (sum2 >= BASE)
sum2 -= BASE;
return adler | (sum2 << 16);
}
/* initial Adler-32 value (deferred check for len == 1 speed) */
if (buf == Z_NULL)
return 1L;
/* in case short lengths are provided, keep it somewhat fast */
if (len < 16) {
while (len--) {
adler += *buf++;
sum2 += adler;
}
if (adler >= BASE)
adler -= BASE;
MOD28(sum2); /* only added so many BASE's */
return adler | (sum2 << 16);
}
/* do length NMAX blocks -- requires just one modulo operation */
while (len >= NMAX) {
len -= NMAX;
n = NMAX / 16; /* NMAX is divisible by 16 */
do {
DO16(buf); /* 16 sums unrolled */
buf += 16;
} while (--n);
MOD(adler);
MOD(sum2);
}
/* do remaining bytes (less than NMAX, still just one modulo) */
if (len) { /* avoid modulos if none remaining */
while (len >= 16) {
len -= 16;
DO16(buf);
buf += 16;
}
while (len--) {
adler += *buf++;
sum2 += adler;
}
MOD(adler);
MOD(sum2);
}
/* return recombined sums */
return adler | (sum2 << 16);
}
/* ========================================================================= */
uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
{
return adler32_z(adler, buf, len);
}
/* ========================================================================= */
local uLong adler32_combine_(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off64_t len2;
{
unsigned long sum1;
unsigned long sum2;
unsigned rem;
/* for negative len, return invalid adler32 as a clue for debugging */
if (len2 < 0)
return 0xffffffffUL;
/* the derivation of this formula is left as an exercise for the reader */
MOD63(len2); /* assumes len2 >= 0 */
rem = (unsigned)len2;
sum1 = adler1 & 0xffff;
sum2 = rem * sum1;
MOD(sum2);
sum1 += (adler2 & 0xffff) + BASE - 1;
sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
if (sum1 >= BASE) sum1 -= BASE;
if (sum1 >= BASE) sum1 -= BASE;
if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1);
if (sum2 >= BASE) sum2 -= BASE;
return sum1 | (sum2 << 16);
}
/* ========================================================================= */
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off64_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}

View file

@ -1,69 +0,0 @@
# Amiga powerUP (TM) Makefile
# makefile for libpng and SAS C V6.58/7.00 PPC compiler
# Copyright (C) 1998 by Andreas R. Kleinert
LIBNAME = libzip.a
CC = scppc
CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \
OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 NOVER
AR = ppc-amigaos-ar cr
RANLIB = ppc-amigaos-ranlib
LD = ppc-amigaos-ld -r
LDFLAGS = -o
LDLIBS = LIB:scppc.a LIB:end.o
RM = delete quiet
OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \
uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
TEST_OBJS = example.o minigzip.o
all: example minigzip
check: test
test: all
example
echo hello world | minigzip | minigzip -d
$(LIBNAME): $(OBJS)
$(AR) $@ $(OBJS)
-$(RANLIB) $@
example: example.o $(LIBNAME)
$(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS)
minigzip: minigzip.o $(LIBNAME)
$(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS)
mostlyclean: clean
clean:
$(RM) *.o example minigzip $(LIBNAME) foo.gz
zip:
zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
descrip.mms *.[ch]
tgz:
cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
# DO NOT DELETE THIS LINE -- make depend depends on it.
adler32.o: zlib.h zconf.h
compress.o: zlib.h zconf.h
crc32.o: crc32.h zlib.h zconf.h
deflate.o: deflate.h zutil.h zlib.h zconf.h
example.o: zlib.h zconf.h
gzclose.o: zlib.h zconf.h gzguts.h
gzlib.o: zlib.h zconf.h gzguts.h
gzread.o: zlib.h zconf.h gzguts.h
gzwrite.o: zlib.h zconf.h gzguts.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
minigzip.o: zlib.h zconf.h
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
uncompr.o: zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h

View file

@ -1,68 +0,0 @@
# SMakefile for zlib
# Modified from the standard UNIX Makefile Copyright Jean-loup Gailly
# Osma Ahvenlampi <Osma.Ahvenlampi@hut.fi>
# Amiga, SAS/C 6.56 & Smake
CC=sc
CFLAGS=OPT
#CFLAGS=OPT CPU=68030
#CFLAGS=DEBUG=LINE
LDFLAGS=LIB z.lib
SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \
NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX \
DEF=POSTINC
OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \
uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
TEST_OBJS = example.o minigzip.o
all: SCOPTIONS example minigzip
check: test
test: all
example
echo hello world | minigzip | minigzip -d
install: z.lib
copy clone zlib.h zconf.h INCLUDE:
copy clone z.lib LIB:
z.lib: $(OBJS)
oml z.lib r $(OBJS)
example: example.o z.lib
$(CC) $(CFLAGS) LINK TO $@ example.o $(LDFLAGS)
minigzip: minigzip.o z.lib
$(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS)
mostlyclean: clean
clean:
-delete force quiet example minigzip *.o z.lib foo.gz *.lnk SCOPTIONS
SCOPTIONS: Makefile.sas
copy to $@ <from <
$(SCOPTIONS)
<
# DO NOT DELETE THIS LINE -- make depend depends on it.
adler32.o: zlib.h zconf.h
compress.o: zlib.h zconf.h
crc32.o: crc32.h zlib.h zconf.h
deflate.o: deflate.h zutil.h zlib.h zconf.h
example.o: zlib.h zconf.h
gzclose.o: zlib.h zconf.h gzguts.h
gzlib.o: zlib.h zconf.h gzguts.h
gzread.o: zlib.h zconf.h gzguts.h
gzwrite.o: zlib.h zconf.h gzguts.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
minigzip.o: zlib.h zconf.h
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
uncompr.o: zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h

View file

@ -1,86 +0,0 @@
/* compress.c -- compress a memory buffer
* Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#define ZLIB_INTERNAL
#include "zlib.h"
/* ===========================================================================
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
length of the source buffer. Upon entry, destLen is the total size of the
destination buffer, which must be at least 0.1% larger than sourceLen plus
12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
int level;
{
z_stream stream;
int err;
const uInt max = (uInt)-1;
uLong left;
left = *destLen;
*destLen = 0;
stream.zalloc = (alloc_func)0;
stream.zfree = (free_func)0;
stream.opaque = (voidpf)0;
err = deflateInit(&stream, level);
if (err != Z_OK) return err;
stream.next_out = dest;
stream.avail_out = 0;
stream.next_in = (z_const Bytef *)source;
stream.avail_in = 0;
do {
if (stream.avail_out == 0) {
stream.avail_out = left > (uLong)max ? max : (uInt)left;
left -= stream.avail_out;
}
if (stream.avail_in == 0) {
stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
sourceLen -= stream.avail_in;
}
err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH);
} while (err == Z_OK);
*destLen = stream.total_out;
deflateEnd(&stream);
return err == Z_STREAM_END ? Z_OK : err;
}
/* ===========================================================================
*/
int ZEXPORT compress (dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
{
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
}
/* ===========================================================================
If the default memLevel or windowBits for deflateInit() is changed, then
this function needs to be updated.
*/
uLong ZEXPORT compressBound (sourceLen)
uLong sourceLen;
{
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13;
}

921
contrib/zlib/configure vendored
View file

@ -1,921 +0,0 @@
#!/bin/sh
# configure script for zlib.
#
# Normally configure builds both a static and a shared library.
# If you want to build just a static library, use: ./configure --static
#
# To impose specific compiler or flags or install directory, use for example:
# prefix=$HOME CC=cc CFLAGS="-O4" ./configure
# or for csh/tcsh users:
# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
# If you have problems, try without defining CC and CFLAGS before reporting
# an error.
# start off configure.log
echo -------------------- >> configure.log
echo $0 $* >> configure.log
date >> configure.log
# get source directory
SRCDIR=`dirname $0`
if test $SRCDIR = "."; then
ZINC=""
ZINCOUT="-I."
SRCDIR=""
else
ZINC='-include zconf.h'
ZINCOUT='-I. -I$(SRCDIR)'
SRCDIR="$SRCDIR/"
fi
# set command prefix for cross-compilation
if [ -n "${CHOST}" ]; then
uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`"
CROSS_PREFIX="${CHOST}-"
fi
# destination name for static library
STATICLIB=libz.a
# extract zlib version numbers from zlib.h
VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}zlib.h`
VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < ${SRCDIR}zlib.h`
VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h`
VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h`
# establish commands for library building
if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
AR=${AR-"${CROSS_PREFIX}ar"}
test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
else
AR=${AR-"ar"}
test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
fi
ARFLAGS=${ARFLAGS-"rc"}
if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log
else
RANLIB=${RANLIB-"ranlib"}
fi
if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
NM=${NM-"${CROSS_PREFIX}nm"}
test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log
else
NM=${NM-"nm"}
fi
# set defaults before processing command line options
LDCONFIG=${LDCONFIG-"ldconfig"}
LDSHAREDLIBC="${LDSHAREDLIBC--lc}"
ARCHS=
prefix=${prefix-/usr/local}
exec_prefix=${exec_prefix-'${prefix}'}
libdir=${libdir-'${exec_prefix}/lib'}
sharedlibdir=${sharedlibdir-'${libdir}'}
includedir=${includedir-'${prefix}/include'}
mandir=${mandir-'${prefix}/share/man'}
shared_ext='.so'
shared=1
solo=0
cover=0
zprefix=0
zconst=0
build64=0
gcc=0
warn=0
debug=0
old_cc="$CC"
old_cflags="$CFLAGS"
OBJC='$(OBJZ) $(OBJG)'
PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
# leave this script, optionally in a bad way
leave()
{
if test "$*" != "0"; then
echo "** $0 aborting." | tee -a configure.log
fi
rm -f $test.[co] $test $test$shared_ext $test.gcno ./--version
echo -------------------- >> configure.log
echo >> configure.log
echo >> configure.log
exit $1
}
# process command line options
while test $# -ge 1
do
case "$1" in
-h* | --help)
echo 'usage:' | tee -a configure.log
echo ' configure [--const] [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]' | tee -a configure.log
echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
echo ' [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
exit 0 ;;
-p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
-e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
-l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;;
--sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/.*=//'`; shift ;;
-i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;;
-u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;;
-p* | --prefix) prefix="$2"; shift; shift ;;
-e* | --eprefix) exec_prefix="$2"; shift; shift ;;
-l* | --libdir) libdir="$2"; shift; shift ;;
-i* | --includedir) includedir="$2"; shift; shift ;;
-s* | --shared | --enable-shared) shared=1; shift ;;
-t | --static) shared=0; shift ;;
--solo) solo=1; shift ;;
--cover) cover=1; shift ;;
-z* | --zprefix) zprefix=1; shift ;;
-6* | --64) build64=1; shift ;;
-a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
--sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
--localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
-c* | --const) zconst=1; shift ;;
-w* | --warn) warn=1; shift ;;
-d* | --debug) debug=1; shift ;;
*)
echo "unknown option: $1" | tee -a configure.log
echo "$0 --help for help" | tee -a configure.log
leave 1;;
esac
done
# temporary file name
test=ztest$$
# put arguments in log, also put test file in log if used in arguments
show()
{
case "$*" in
*$test.c*)
echo === $test.c === >> configure.log
cat $test.c >> configure.log
echo === >> configure.log;;
esac
echo $* >> configure.log
}
# check for gcc vs. cc and set compile and link flags based on the system identified by uname
cat > $test.c <<EOF
extern int getchar();
int hello() {return getchar();}
EOF
test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
cc=${CC-${CROSS_PREFIX}gcc}
cflags=${CFLAGS-"-O3"}
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
case "$cc" in
*gcc*) gcc=1 ;;
*clang*) gcc=1 ;;
esac
case `$cc -v 2>&1` in
*gcc*) gcc=1 ;;
*clang*) gcc=1 ;;
esac
show $cc -c $test.c
if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
echo ... using gcc >> configure.log
CC="$cc"
CFLAGS="${CFLAGS--O3}"
SFLAGS="${CFLAGS--O3} -fPIC"
if test "$ARCHS"; then
CFLAGS="${CFLAGS} ${ARCHS}"
LDFLAGS="${LDFLAGS} ${ARCHS}"
fi
if test $build64 -eq 1; then
CFLAGS="${CFLAGS} -m64"
SFLAGS="${SFLAGS} -m64"
fi
if test "$warn" -eq 1; then
if test "$zconst" -eq 1; then
CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
else
CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
fi
fi
if test $debug -eq 1; then
CFLAGS="${CFLAGS} -DZLIB_DEBUG"
SFLAGS="${SFLAGS} -DZLIB_DEBUG"
fi
if test -z "$uname"; then
uname=`(uname -s || echo unknown) 2>/dev/null`
fi
case "$uname" in
Linux* | linux* | GNU | GNU/* | solaris*)
LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} ;;
*BSD | *bsd* | DragonFly)
LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"}
LDCONFIG="ldconfig -m" ;;
CYGWIN* | Cygwin* | cygwin* | OS/2*)
EXE='.exe' ;;
MINGW* | mingw*)
# temporary bypass
rm -f $test.[co] $test $test$shared_ext
echo "Please use win32/Makefile.gcc instead." | tee -a configure.log
leave 1
LDSHARED=${LDSHARED-"$cc -shared"}
LDSHAREDLIBC=""
EXE='.exe' ;;
QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
# (alain.bonnefoy@icbt.com)
LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
HP-UX*)
LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
case `(uname -m || echo unknown) 2>/dev/null` in
ia64)
shared_ext='.so'
SHAREDLIB='libz.so' ;;
*)
shared_ext='.sl'
SHAREDLIB='libz.sl' ;;
esac ;;
Darwin* | darwin*)
shared_ext='.dylib'
SHAREDLIB=libz$shared_ext
SHAREDLIBV=libz.$VER$shared_ext
SHAREDLIBM=libz.$VER1$shared_ext
LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
if libtool -V 2>&1 | grep Apple > /dev/null; then
AR="libtool"
else
AR="/usr/bin/libtool"
fi
ARFLAGS="-o" ;;
*) LDSHARED=${LDSHARED-"$cc -shared"} ;;
esac
else
# find system name and corresponding cc options
CC=${CC-cc}
gcc=0
echo ... using $CC >> configure.log
if test -z "$uname"; then
uname=`(uname -sr || echo unknown) 2>/dev/null`
fi
case "$uname" in
HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
CFLAGS=${CFLAGS-"-O"}
# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
LDSHARED=${LDSHARED-"ld -b"}
case `(uname -m || echo unknown) 2>/dev/null` in
ia64)
shared_ext='.so'
SHAREDLIB='libz.so' ;;
*)
shared_ext='.sl'
SHAREDLIB='libz.sl' ;;
esac ;;
IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
CFLAGS=${CFLAGS-"-ansi -O2"}
LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
CFLAGS=${CFLAGS-"-O -std1"}
LDFLAGS="${LDFLAGS} -Wl,-rpath,."
LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"} ;;
OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
CFLAGS=${CFLAGS-"-O -std1"}
LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
QNX*) SFLAGS=${CFLAGS-"-4 -O"}
CFLAGS=${CFLAGS-"-4 -O"}
LDSHARED=${LDSHARED-"cc"}
RANLIB=${RANLIB-"true"}
AR="cc"
ARFLAGS="-A" ;;
SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
CFLAGS=${CFLAGS-"-O3"}
LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
SunOS\ 5* | solaris*)
LDSHARED=${LDSHARED-"cc -G -h libz$shared_ext.$VER1"}
SFLAGS=${CFLAGS-"-fast -KPIC"}
CFLAGS=${CFLAGS-"-fast"}
if test $build64 -eq 1; then
# old versions of SunPRO/Workshop/Studio don't support -m64,
# but newer ones do. Check for it.
flag64=`$CC -flags | egrep -- '^-m64'`
if test x"$flag64" != x"" ; then
CFLAGS="${CFLAGS} -m64"
SFLAGS="${SFLAGS} -m64"
else
case `(uname -m || echo unknown) 2>/dev/null` in
i86*)
SFLAGS="$SFLAGS -xarch=amd64"
CFLAGS="$CFLAGS -xarch=amd64" ;;
*)
SFLAGS="$SFLAGS -xarch=v9"
CFLAGS="$CFLAGS -xarch=v9" ;;
esac
fi
fi
if test -n "$ZINC"; then
ZINC='-I- -I. -I$(SRCDIR)'
fi
;;
SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
CFLAGS=${CFLAGS-"-O2"}
LDSHARED=${LDSHARED-"ld"} ;;
SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
UNIX_System_V\ 4.2.0)
SFLAGS=${CFLAGS-"-KPIC -O"}
CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -G"} ;;
UNIX_SV\ 4.2MP)
SFLAGS=${CFLAGS-"-Kconform_pic -O"}
CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -G"} ;;
OpenUNIX\ 5)
SFLAGS=${CFLAGS-"-KPIC -O"}
CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -G"} ;;
AIX*) # Courtesy of dbakker@arrayasolutions.com
SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
LDSHARED=${LDSHARED-"xlc -G"} ;;
# send working options for other systems to zlib@gzip.org
*) SFLAGS=${CFLAGS-"-O"}
CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -shared"} ;;
esac
fi
# destination names for shared library if not defined above
SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
echo >> configure.log
# define functions for testing compiler and library characteristics and logging the results
cat > $test.c <<EOF
#error error
EOF
if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
try()
{
show $*
test "`( $* ) 2>&1 | tee -a configure.log`" = ""
}
echo - using any output from compiler to indicate an error >> configure.log
else
try()
{
show $*
( $* ) >> configure.log 2>&1
ret=$?
if test $ret -ne 0; then
echo "(exit code "$ret")" >> configure.log
fi
return $ret
}
fi
tryboth()
{
show $*
got=`( $* ) 2>&1`
ret=$?
printf %s "$got" >> configure.log
if test $ret -ne 0; then
return $ret
fi
test "$got" = ""
}
cat > $test.c << EOF
int foo() { return 0; }
EOF
echo "Checking for obsessive-compulsive compiler options..." >> configure.log
if try $CC -c $CFLAGS $test.c; then
:
else
echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
leave 1
fi
echo >> configure.log
# see if shared library build supported
cat > $test.c <<EOF
extern int getchar();
int hello() {return getchar();}
EOF
if test $shared -eq 1; then
echo Checking for shared library support... | tee -a configure.log
# we must test in two steps (cc then ld), required at least on SunOS 4.x
if try $CC -w -c $SFLAGS $test.c &&
try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
elif test -z "$old_cc" -a -z "$old_cflags"; then
echo No shared library support. | tee -a configure.log
shared=0;
else
echo 'No shared library support; try without defining CC and CFLAGS' | tee -a configure.log
shared=0;
fi
fi
if test $shared -eq 0; then
LDSHARED="$CC"
ALL="static"
TEST="all teststatic"
SHAREDLIB=""
SHAREDLIBV=""
SHAREDLIBM=""
echo Building static library $STATICLIB version $VER with $CC. | tee -a configure.log
else
ALL="static shared"
TEST="all teststatic testshared"
fi
# check for underscores in external names for use by assembler code
CPP=${CPP-"$CC -E"}
case $CFLAGS in
*ASMV*)
echo >> configure.log
show "$NM $test.o | grep _hello"
if test "`$NM $test.o | grep _hello | tee -a configure.log`" = ""; then
CPP="$CPP -DNO_UNDERLINE"
echo Checking for underline in external names... No. | tee -a configure.log
else
echo Checking for underline in external names... Yes. | tee -a configure.log
fi ;;
esac
echo >> configure.log
# check for size_t
cat > $test.c <<EOF
#include <stdio.h>
#include <stdlib.h>
size_t dummy = 0;
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for size_t... Yes." | tee -a configure.log
need_sizet=0
else
echo "Checking for size_t... No." | tee -a configure.log
need_sizet=1
fi
echo >> configure.log
# find the size_t integer type, if needed
if test $need_sizet -eq 1; then
cat > $test.c <<EOF
long long dummy = 0;
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for long long... Yes." | tee -a configure.log
cat > $test.c <<EOF
#include <stdio.h>
int main(void) {
if (sizeof(void *) <= sizeof(int)) puts("int");
else if (sizeof(void *) <= sizeof(long)) puts("long");
else puts("z_longlong");
return 0;
}
EOF
else
echo "Checking for long long... No." | tee -a configure.log
cat > $test.c <<EOF
#include <stdio.h>
int main(void) {
if (sizeof(void *) <= sizeof(int)) puts("int");
else puts("long");
return 0;
}
EOF
fi
if try $CC $CFLAGS -o $test $test.c; then
sizet=`./$test`
echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
else
echo "Failed to find a pointer-size integer type." | tee -a configure.log
leave 1
fi
fi
if test $need_sizet -eq 1; then
CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
fi
echo >> configure.log
# check for large file support, and if none, check for fseeko()
cat > $test.c <<EOF
#include <sys/types.h>
off64_t dummy = 0;
EOF
if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then
CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
ALL="${ALL} all64"
TEST="${TEST} test64"
echo "Checking for off64_t... Yes." | tee -a configure.log
echo "Checking for fseeko... Yes." | tee -a configure.log
else
echo "Checking for off64_t... No." | tee -a configure.log
echo >> configure.log
cat > $test.c <<EOF
#include <stdio.h>
int main(void) {
fseeko(NULL, 0, 0);
return 0;
}
EOF
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for fseeko... Yes." | tee -a configure.log
else
CFLAGS="${CFLAGS} -DNO_FSEEKO"
SFLAGS="${SFLAGS} -DNO_FSEEKO"
echo "Checking for fseeko... No." | tee -a configure.log
fi
fi
echo >> configure.log
# check for strerror() for use by gz* functions
cat > $test.c <<EOF
#include <string.h>
#include <errno.h>
int main() { return strlen(strerror(errno)); }
EOF
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for strerror... Yes." | tee -a configure.log
else
CFLAGS="${CFLAGS} -DNO_STRERROR"
SFLAGS="${SFLAGS} -DNO_STRERROR"
echo "Checking for strerror... No." | tee -a configure.log
fi
# copy clean zconf.h for subsequent edits
cp -p ${SRCDIR}zconf.h.in zconf.h
echo >> configure.log
# check for unistd.h and save result in zconf.h
cat > $test.c <<EOF
#include <unistd.h>
int main() { return 0; }
EOF
if try $CC -c $CFLAGS $test.c; then
sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
mv zconf.temp.h zconf.h
echo "Checking for unistd.h... Yes." | tee -a configure.log
else
echo "Checking for unistd.h... No." | tee -a configure.log
fi
echo >> configure.log
# check for stdarg.h and save result in zconf.h
cat > $test.c <<EOF
#include <stdarg.h>
int main() { return 0; }
EOF
if try $CC -c $CFLAGS $test.c; then
sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
mv zconf.temp.h zconf.h
echo "Checking for stdarg.h... Yes." | tee -a configure.log
else
echo "Checking for stdarg.h... No." | tee -a configure.log
fi
# if the z_ prefix was requested, save that in zconf.h
if test $zprefix -eq 1; then
sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
mv zconf.temp.h zconf.h
echo >> configure.log
echo "Using z_ prefix on all symbols." | tee -a configure.log
fi
# if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists
if test $solo -eq 1; then
sed '/#define ZCONF_H/a\
#define Z_SOLO
' < zconf.h > zconf.temp.h
mv zconf.temp.h zconf.h
OBJC='$(OBJZ)'
PIC_OBJC='$(PIC_OBJZ)'
fi
# if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
if test $cover -eq 1; then
CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
if test -n "$GCC_CLASSIC"; then
CC=$GCC_CLASSIC
fi
fi
echo >> configure.log
# conduct a series of tests to resolve eight possible cases of using "vs" or "s" printf functions
# (using stdarg or not), with or without "n" (proving size of buffer), and with or without a
# return value. The most secure result is vsnprintf() with a return value. snprintf() with a
# return value is secure as well, but then gzprintf() will be limited to 20 arguments.
cat > $test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
#include "zconf.h"
int main()
{
#ifndef STDC
choke me
#endif
return 0;
}
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
echo >> configure.log
cat > $test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
int mytest(const char *fmt, ...)
{
char buf[20];
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
return 0;
}
int main()
{
return (mytest("Hello%d\n", 1));
}
EOF
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
int mytest(const char *fmt, ...)
{
int n;
char buf[20];
va_list ap;
va_start(ap, fmt);
n = vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
return n;
}
int main()
{
return (mytest("Hello%d\n", 1));
}
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for return value of vsnprintf()... Yes." | tee -a configure.log
else
CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
echo "Checking for return value of vsnprintf()... No." | tee -a configure.log
echo " WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a configure.log
echo " can build but will be open to possible string-format security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
fi
else
CFLAGS="$CFLAGS -DNO_vsnprintf"
SFLAGS="$SFLAGS -DNO_vsnprintf"
echo "Checking for vsnprintf() in stdio.h... No." | tee -a configure.log
echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log
echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
int mytest(const char *fmt, ...)
{
int n;
char buf[20];
va_list ap;
va_start(ap, fmt);
n = vsprintf(buf, fmt, ap);
va_end(ap);
return n;
}
int main()
{
return (mytest("Hello%d\n", 1));
}
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for return value of vsprintf()... Yes." | tee -a configure.log
else
CFLAGS="$CFLAGS -DHAS_vsprintf_void"
SFLAGS="$SFLAGS -DHAS_vsprintf_void"
echo "Checking for return value of vsprintf()... No." | tee -a configure.log
echo " WARNING: apparently vsprintf() does not return a value. zlib" | tee -a configure.log
echo " can build but will be open to possible string-format security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
fi
fi
else
echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a configure.log
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
int mytest()
{
char buf[20];
snprintf(buf, sizeof(buf), "%s", "foo");
return 0;
}
int main()
{
return (mytest());
}
EOF
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
int mytest()
{
char buf[20];
return snprintf(buf, sizeof(buf), "%s", "foo");
}
int main()
{
return (mytest());
}
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for return value of snprintf()... Yes." | tee -a configure.log
else
CFLAGS="$CFLAGS -DHAS_snprintf_void"
SFLAGS="$SFLAGS -DHAS_snprintf_void"
echo "Checking for return value of snprintf()... No." | tee -a configure.log
echo " WARNING: apparently snprintf() does not return a value. zlib" | tee -a configure.log
echo " can build but will be open to possible string-format security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
fi
else
CFLAGS="$CFLAGS -DNO_snprintf"
SFLAGS="$SFLAGS -DNO_snprintf"
echo "Checking for snprintf() in stdio.h... No." | tee -a configure.log
echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log
echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
int mytest()
{
char buf[20];
return sprintf(buf, "%s", "foo");
}
int main()
{
return (mytest());
}
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for return value of sprintf()... Yes." | tee -a configure.log
else
CFLAGS="$CFLAGS -DHAS_sprintf_void"
SFLAGS="$SFLAGS -DHAS_sprintf_void"
echo "Checking for return value of sprintf()... No." | tee -a configure.log
echo " WARNING: apparently sprintf() does not return a value. zlib" | tee -a configure.log
echo " can build but will be open to possible string-format security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
fi
fi
fi
# see if we can hide zlib internal symbols that are linked between separate source files
if test "$gcc" -eq 1; then
echo >> configure.log
cat > $test.c <<EOF
#define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
int ZLIB_INTERNAL foo;
int main()
{
return 0;
}
EOF
if tryboth $CC -c $CFLAGS $test.c; then
CFLAGS="$CFLAGS -DHAVE_HIDDEN"
SFLAGS="$SFLAGS -DHAVE_HIDDEN"
echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log
else
echo "Checking for attribute(visibility) support... No." | tee -a configure.log
fi
fi
# show the results in the log
echo >> configure.log
echo ALL = $ALL >> configure.log
echo AR = $AR >> configure.log
echo ARFLAGS = $ARFLAGS >> configure.log
echo CC = $CC >> configure.log
echo CFLAGS = $CFLAGS >> configure.log
echo CPP = $CPP >> configure.log
echo EXE = $EXE >> configure.log
echo LDCONFIG = $LDCONFIG >> configure.log
echo LDFLAGS = $LDFLAGS >> configure.log
echo LDSHARED = $LDSHARED >> configure.log
echo LDSHAREDLIBC = $LDSHAREDLIBC >> configure.log
echo OBJC = $OBJC >> configure.log
echo PIC_OBJC = $PIC_OBJC >> configure.log
echo RANLIB = $RANLIB >> configure.log
echo SFLAGS = $SFLAGS >> configure.log
echo SHAREDLIB = $SHAREDLIB >> configure.log
echo SHAREDLIBM = $SHAREDLIBM >> configure.log
echo SHAREDLIBV = $SHAREDLIBV >> configure.log
echo STATICLIB = $STATICLIB >> configure.log
echo TEST = $TEST >> configure.log
echo VER = $VER >> configure.log
echo Z_U4 = $Z_U4 >> configure.log
echo SRCDIR = $SRCDIR >> configure.log
echo exec_prefix = $exec_prefix >> configure.log
echo includedir = $includedir >> configure.log
echo libdir = $libdir >> configure.log
echo mandir = $mandir >> configure.log
echo prefix = $prefix >> configure.log
echo sharedlibdir = $sharedlibdir >> configure.log
echo uname = $uname >> configure.log
# udpate Makefile with the configure results
sed < ${SRCDIR}Makefile.in "
/^CC *=/s#=.*#=$CC#
/^CFLAGS *=/s#=.*#=$CFLAGS#
/^SFLAGS *=/s#=.*#=$SFLAGS#
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
/^LDSHARED *=/s#=.*#=$LDSHARED#
/^CPP *=/s#=.*#=$CPP#
/^STATICLIB *=/s#=.*#=$STATICLIB#
/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
/^AR *=/s#=.*#=$AR#
/^ARFLAGS *=/s#=.*#=$ARFLAGS#
/^RANLIB *=/s#=.*#=$RANLIB#
/^LDCONFIG *=/s#=.*#=$LDCONFIG#
/^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
/^EXE *=/s#=.*#=$EXE#
/^SRCDIR *=/s#=.*#=$SRCDIR#
/^ZINC *=/s#=.*#=$ZINC#
/^ZINCOUT *=/s#=.*#=$ZINCOUT#
/^prefix *=/s#=.*#=$prefix#
/^exec_prefix *=/s#=.*#=$exec_prefix#
/^libdir *=/s#=.*#=$libdir#
/^sharedlibdir *=/s#=.*#=$sharedlibdir#
/^includedir *=/s#=.*#=$includedir#
/^mandir *=/s#=.*#=$mandir#
/^OBJC *=/s#=.*#= $OBJC#
/^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
/^all: */s#:.*#: $ALL#
/^test: */s#:.*#: $TEST#
" > Makefile
# create zlib.pc with the configure results
sed < ${SRCDIR}zlib.pc.in "
/^CC *=/s#=.*#=$CC#
/^CFLAGS *=/s#=.*#=$CFLAGS#
/^CPP *=/s#=.*#=$CPP#
/^LDSHARED *=/s#=.*#=$LDSHARED#
/^STATICLIB *=/s#=.*#=$STATICLIB#
/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
/^AR *=/s#=.*#=$AR#
/^ARFLAGS *=/s#=.*#=$ARFLAGS#
/^RANLIB *=/s#=.*#=$RANLIB#
/^EXE *=/s#=.*#=$EXE#
/^prefix *=/s#=.*#=$prefix#
/^exec_prefix *=/s#=.*#=$exec_prefix#
/^libdir *=/s#=.*#=$libdir#
/^sharedlibdir *=/s#=.*#=$sharedlibdir#
/^includedir *=/s#=.*#=$includedir#
/^mandir *=/s#=.*#=$mandir#
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
" | sed -e "
s/\@VERSION\@/$VER/g;
" > zlib.pc
# done
leave 0

View file

@ -1,78 +0,0 @@
All files under this contrib directory are UNSUPPORTED. There were
provided by users of zlib and were not tested by the authors of zlib.
Use at your own risk. Please contact the authors of the contributions
for help about these, not the zlib authors. Thanks.
ada/ by Dmitriy Anisimkov <anisimkov@yahoo.com>
Support for Ada
See http://zlib-ada.sourceforge.net/
amd64/ by Mikhail Teterin <mi@ALDAN.algebra.com>
asm code for AMD64
See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393
asm686/ by Brian Raiter <breadbox@muppetlabs.com>
asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax
See http://www.muppetlabs.com/~breadbox/software/assembly.html
blast/ by Mark Adler <madler@alumni.caltech.edu>
Decompressor for output of PKWare Data Compression Library (DCL)
delphi/ by Cosmin Truta <cosmint@cs.ubbcluj.ro>
Support for Delphi and C++ Builder
dotzlib/ by Henrik Ravn <henrik@ravn.com>
Support for Microsoft .Net and Visual C++ .Net
gcc_gvmat64/by Gilles Vollant <info@winimage.com>
GCC Version of x86 64-bit (AMD64 and Intel EM64t) code for x64
assembler to replace longest_match() and inflate_fast()
infback9/ by Mark Adler <madler@alumni.caltech.edu>
Unsupported diffs to infback to decode the deflate64 format
inflate86/ by Chris Anderson <christop@charm.net>
Tuned x86 gcc asm code to replace inflate_fast()
iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
A C++ I/O streams interface to the zlib gz* functions
iostream2/ by Tyge Løvset <Tyge.Lovset@cmr.no>
Another C++ I/O streams interface
iostream3/ by Ludwig Schwardt <schwardt@sun.ac.za>
and Kevin Ruland <kevin@rodin.wustl.edu>
Yet another C++ I/O streams interface
masmx64/ by Gilles Vollant <info@winimage.com>
x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to
replace longest_match() and inflate_fast(), also masm x86
64-bits translation of Chris Anderson inflate_fast()
masmx86/ by Gilles Vollant <info@winimage.com>
x86 asm code to replace longest_match() and inflate_fast(),
for Visual C++ and MASM (32 bits).
Based on Brian Raiter (asm686) and Chris Anderson (inflate86)
minizip/ by Gilles Vollant <info@winimage.com>
Mini zip and unzip based on zlib
Includes Zip64 support by Mathias Svensson <mathias@result42.com>
See http://www.winimage.com/zLibDll/minizip.html
pascal/ by Bob Dellaca <bobdl@xtra.co.nz> et al.
Support for Pascal
puff/ by Mark Adler <madler@alumni.caltech.edu>
Small, low memory usage inflate. Also serves to provide an
unambiguous description of the deflate format.
testzlib/ by Gilles Vollant <info@winimage.com>
Example of the use of zlib
untgz/ by Pedro A. Aranda Gutierrez <paag@tid.es>
A very simple tar.gz file extractor using zlib
vstudio/ by Gilles Vollant <info@winimage.com>
Building a minizip-enhanced zlib with Microsoft Visual Studio
Includes vc11 from kreuzerkrieg and vc12 from davispuh

View file

@ -1,106 +0,0 @@
----------------------------------------------------------------
-- ZLib for Ada thick binding. --
-- --
-- Copyright (C) 2002-2004 Dmitriy Anisimkov --
-- --
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
--
-- $Id: buffer_demo.adb,v 1.3 2004/09/06 06:55:35 vagul Exp $
-- This demo program provided by Dr Steve Sangwine <sjs@essex.ac.uk>
--
-- Demonstration of a problem with Zlib-Ada (already fixed) when a buffer
-- of exactly the correct size is used for decompressed data, and the last
-- few bytes passed in to Zlib are checksum bytes.
-- This program compresses a string of text, and then decompresses the
-- compressed text into a buffer of the same size as the original text.
with Ada.Streams; use Ada.Streams;
with Ada.Text_IO;
with ZLib; use ZLib;
procedure Buffer_Demo is
EOL : Character renames ASCII.LF;
Text : constant String
:= "Four score and seven years ago our fathers brought forth," & EOL &
"upon this continent, a new nation, conceived in liberty," & EOL &
"and dedicated to the proposition that `all men are created equal'.";
Source : Stream_Element_Array (1 .. Text'Length);
for Source'Address use Text'Address;
begin
Ada.Text_IO.Put (Text);
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
("Uncompressed size : " & Positive'Image (Text'Length) & " bytes");
declare
Compressed_Data : Stream_Element_Array (1 .. Text'Length);
L : Stream_Element_Offset;
begin
Compress : declare
Compressor : Filter_Type;
I : Stream_Element_Offset;
begin
Deflate_Init (Compressor);
-- Compress the whole of T at once.
Translate (Compressor, Source, I, Compressed_Data, L, Finish);
pragma Assert (I = Source'Last);
Close (Compressor);
Ada.Text_IO.Put_Line
("Compressed size : "
& Stream_Element_Offset'Image (L) & " bytes");
end Compress;
-- Now we decompress the data, passing short blocks of data to Zlib
-- (because this demonstrates the problem - the last block passed will
-- contain checksum information and there will be no output, only a
-- check inside Zlib that the checksum is correct).
Decompress : declare
Decompressor : Filter_Type;
Uncompressed_Data : Stream_Element_Array (1 .. Text'Length);
Block_Size : constant := 4;
-- This makes sure that the last block contains
-- only Adler checksum data.
P : Stream_Element_Offset := Compressed_Data'First - 1;
O : Stream_Element_Offset;
begin
Inflate_Init (Decompressor);
loop
Translate
(Decompressor,
Compressed_Data
(P + 1 .. Stream_Element_Offset'Min (P + Block_Size, L)),
P,
Uncompressed_Data
(Total_Out (Decompressor) + 1 .. Uncompressed_Data'Last),
O,
No_Flush);
Ada.Text_IO.Put_Line
("Total in : " & Count'Image (Total_In (Decompressor)) &
", out : " & Count'Image (Total_Out (Decompressor)));
exit when P = L;
end loop;
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
("Decompressed text matches original text : "
& Boolean'Image (Uncompressed_Data = Source));
end Decompress;
end;
end Buffer_Demo;

View file

@ -1,156 +0,0 @@
----------------------------------------------------------------
-- ZLib for Ada thick binding. --
-- --
-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
-- --
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
-- Continuous test for ZLib multithreading. If the test would fail
-- we should provide thread safe allocation routines for the Z_Stream.
--
-- $Id: mtest.adb,v 1.4 2004/07/23 07:49:54 vagul Exp $
with ZLib;
with Ada.Streams;
with Ada.Numerics.Discrete_Random;
with Ada.Text_IO;
with Ada.Exceptions;
with Ada.Task_Identification;
procedure MTest is
use Ada.Streams;
use ZLib;
Stop : Boolean := False;
pragma Atomic (Stop);
subtype Visible_Symbols is Stream_Element range 16#20# .. 16#7E#;
package Random_Elements is
new Ada.Numerics.Discrete_Random (Visible_Symbols);
task type Test_Task;
task body Test_Task is
Buffer : Stream_Element_Array (1 .. 100_000);
Gen : Random_Elements.Generator;
Buffer_First : Stream_Element_Offset;
Compare_First : Stream_Element_Offset;
Deflate : Filter_Type;
Inflate : Filter_Type;
procedure Further (Item : in Stream_Element_Array);
procedure Read_Buffer
(Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
-------------
-- Further --
-------------
procedure Further (Item : in Stream_Element_Array) is
procedure Compare (Item : in Stream_Element_Array);
-------------
-- Compare --
-------------
procedure Compare (Item : in Stream_Element_Array) is
Next_First : Stream_Element_Offset := Compare_First + Item'Length;
begin
if Buffer (Compare_First .. Next_First - 1) /= Item then
raise Program_Error;
end if;
Compare_First := Next_First;
end Compare;
procedure Compare_Write is new ZLib.Write (Write => Compare);
begin
Compare_Write (Inflate, Item, No_Flush);
end Further;
-----------------
-- Read_Buffer --
-----------------
procedure Read_Buffer
(Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset)
is
Buff_Diff : Stream_Element_Offset := Buffer'Last - Buffer_First;
Next_First : Stream_Element_Offset;
begin
if Item'Length <= Buff_Diff then
Last := Item'Last;
Next_First := Buffer_First + Item'Length;
Item := Buffer (Buffer_First .. Next_First - 1);
Buffer_First := Next_First;
else
Last := Item'First + Buff_Diff;
Item (Item'First .. Last) := Buffer (Buffer_First .. Buffer'Last);
Buffer_First := Buffer'Last + 1;
end if;
end Read_Buffer;
procedure Translate is new Generic_Translate
(Data_In => Read_Buffer,
Data_Out => Further);
begin
Random_Elements.Reset (Gen);
Buffer := (others => 20);
Main : loop
for J in Buffer'Range loop
Buffer (J) := Random_Elements.Random (Gen);
Deflate_Init (Deflate);
Inflate_Init (Inflate);
Buffer_First := Buffer'First;
Compare_First := Buffer'First;
Translate (Deflate);
if Compare_First /= Buffer'Last + 1 then
raise Program_Error;
end if;
Ada.Text_IO.Put_Line
(Ada.Task_Identification.Image
(Ada.Task_Identification.Current_Task)
& Stream_Element_Offset'Image (J)
& ZLib.Count'Image (Total_Out (Deflate)));
Close (Deflate);
Close (Inflate);
exit Main when Stop;
end loop;
end loop Main;
exception
when E : others =>
Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (E));
Stop := True;
end Test_Task;
Test : array (1 .. 4) of Test_Task;
pragma Unreferenced (Test);
Dummy : Character;
begin
Ada.Text_IO.Get_Immediate (Dummy);
Stop := True;
end MTest;

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