Commit Graph

94 Commits

Author SHA1 Message Date
Krystie b9d06d5f77 ci: fix sanitizer failures
Replace undefined signed shifts in SPHlib SIMD FFT arithmetic with bounded multiplications, handle empty vectors in base64/base32/base58/hash/script paths, and skip the DoS_checkSig microbenchmark threshold under sanitizer instrumentation.

Sanitizer ctest is now green locally, so make the GitHub sanitizer job blocking again.
2026-07-07 14:42:30 -07:00
Krystie 9aff1ea098 ci: fix Windows Tor bundle — drop PS7-only params from Invoke-WebRequest
The hardened PowerShell retry loop from 2c2efd8 passed -ConnectionTimeout
and -OperationTimeout to Invoke-WebRequest. Those are PowerShell 7+ only;
GitHub Actions Windows runners ship PowerShell 5.1, which rejected them
with 'ParentContainsErrorRecordException / NamedParameterNotFound' on
the first iteration of the loop, and the catch block silently counted
the syntax error as a 'failed attempt' instead of a script bug.

Result on run #28689210122: both Windows jobs (build-windows-qt,
build-windows-daemon) failed at 'Download Tor' / 'Bundle Tor for daemon'
with exit code 1 before any HTTP traffic happened. macOS + Linux passed.

Fix:
* Drop -ConnectionTimeout and -OperationTimeout (PS7-only).
* Restructure the retry loop: explicit $downloaded flag, remove the
  part-file on each attempt, throw explicitly at the end if all 3
  attempts produced no usable file. The size check (>1MB) still
  rejects 0-byte / truncated '200 OK' responses.
* Add a comment at the top of each step explaining the PS 5.1 limitation
  so the next agent doesn't re-add the PS7 params.
2026-07-03 18:50:10 -07:00
Krystie 2c2efd83fd ci: harden Tor expert bundle downloads against CI egress timeouts
The macOS build of e2cd0b6 (the NeedsBootstrap rocksdb/ fix) failed at
the 'Bundle Tor into app' step with bash exit code 6 after exactly 30s
of curl hanging against archive.torproject.org. All 4 Tor download
sites (Windows Qt, Windows daemon, Linux Qt .deb, Linux daemon .deb,
macOS Qt) used 'curl -sL' with no timeouts and no retries — a single
transient network drop from Azure westus to the Tor archive killed
the job.

Fix at all 4 sites:
* curl -fSL (HTTP error -> non-zero exit; fail loudly)
* --connect-timeout 15 / --max-time 120 (per-attempt bounds)
* --retry 3 --retry-delay 5 --retry-connrefused --retry-all-errors
  (covers 5xx, DNS timeouts, and connection refused)
* 'set -euo pipefail' at script top so any failure aborts cleanly
* PowerShell variants get a manual retry loop with size check
  (1MB minimum — a 0-byte '200 OK' response from a broken mirror
  used to silently slip through)

Also bump CLIENT_VERSION_REVISION 1 -> 4 (v6.1.4) for the upcoming
release that will include e2cd0b6 (NeedsBootstrap rocksdb/ fix).

Release notes:
v6.1.4: Tor bundle download resilience (4 CI sites hardened)
+ e2cd0b6 (NeedsBootstrap rocksdb/ chain state detection). Supersedes
v6.1.3 only on CI reliability; no protocol/wallet/chain format changes.
2026-07-03 17:25:16 -07:00
Krystie e8e865557f ci(lint): don't fail on workflow_dispatch when base_ref is empty
The clang-format-diff and clang-tidy-diff jobs were hard-coded to
origin/${{ github.base_ref }}, which is empty under workflow_dispatch.
When the workflow was triggered manually (no PR context), both jobs
failed with 'Not a valid object name origin/' before doing any work.

Fallback path: when base_ref is empty, run clang-format/ clang-tidy
against initial commit..HEAD (i.e. the whole repo) so a manual dispatch
still produces a useful signal. Saves the diff to /tmp/changes.diff and
skips clang-tidy entirely if the diff turns out empty.
2026-07-02 23:55:56 -07:00
Krystie 0712e5b08c ci(distribute): bump release-artifact wait from 10min to 30min
v6.1.3 distribute run (#28579791121) failed all 4 jobs (Homebrew, AUR,
Docker Hub, WinGet) because the build workflow took >12 minutes to
publish the GitHub release with binary assets, but the distribute
workflows only waited 10 minutes (30 iterations x 20s).

The race:
- Build workflow runs in parallel with Distribute workflow (no `needs:`)
- Distribute polls for the .deb/.dmg/.exe assets at the release URL
- Old 10-minute hard timeout was tuned for ~5 minute builds
- Modern builds (Windows, sanitizers, full Qt) routinely take 20-30 min

Bump all 5 wait loops (Docker Hub, AUR, Homebrew, Chocolatey, WinGet)
from 30 to 90 iterations, total 30 minutes, and update the error
messages to reflect the new timeout. Error messages also gained the
"after 30 minutes" suffix for consistency.

No change to the trigger conditions or job logic — only the timeout.
This is a workflow-only change; no source or CI matrix changes.
2026-07-02 02:43:06 -07:00
Krystie e48b71a5d1 ci: document manual dispatch command for TRI-PI rebuild without re-tag 2026-07-01 12:22:14 -07:00
Krystie fb5f1be032 ci: add sqlite3 to Windows MSYS2 install (daemon+qt)
cpp20 modernization made SQLite the default wallet backend
(find_package(SQLite3 REQUIRED)). The windows-qt job got it
transitively via Qt5-base, but the daemon job had no such
dependency → CMake configure failure.
2026-06-30 15:32:29 -07:00
Krystie 8615e6b46d Merge SAMI-PC hd-wallet + process-I2P into v6 master
Merges the HD wallet work and process-based I2P integration from the
SAMI-PC hd-wallet branch into v6 master. Conflict resolution keeps
v6 embedded I2P (CI2PEmbedded) as primary, includes process-I2P
files for reference, preserves FastImportBlockFile() from hd-wallet,
and keeps v6 version numbers (6.0.0) and wAddressStack Qt layout.
2026-06-29 14:52:53 -07:00
sami7777 e694a189f8 Merge hd-wallet into master: I2P process integration + HD wallet + reconcile with origin/master v5.9.15 2026-06-29 13:50:10 -07:00
Krystie 01f3fdf2ff ci: produce portable Windows GUI wallet ZIP (was missing from release) 2026-06-28 20:17:47 -07:00
Krystie ba3d7a766a ci: enable embedded I2P (i2pd) on all build platforms
Adds libi2pd static library build step and -DUSE_I2P_EMBEDDED=ON to
all 5 build jobs (Windows Qt, Windows daemon, Linux Qt, Linux daemon,
macOS). Previously I2P compiled as stubs — wallet shipped without
.b32.i2p address support. macOS uses HOMEBREW=1 for correct i2pd
Makefile include paths.
2026-06-28 15:19:52 -07:00
Krystie ba9a825ea4 Merge branch 'master' of https://github.com/SamiAhmed7777/triangles_v5
# Conflicts:
#	src/tor/build-libtor.sh
2026-06-28 13:04:06 -07:00
Krystie 5973ee7ef7 ci(lint): build RocksDB 8.9.1 from source
Same fix as build-all.yml: lint.yml's clang-tidy job also installed
librocksdb-dev from Ubuntu 22.04's apt (6.11.4), which CMakeLists.txt
now refuses to configure against. Drop the apt package, add the
shared scripts/ci/build-rocksdb.sh step.
2026-06-27 16:29:51 -07:00
Krystie 91453deb46 ci: build RocksDB 8.9.1 from source (Ubuntu 22.04 ships 6.11.4)
PR #10 added a configure-time FATAL_ERROR for RocksDB < 7.4.0 because
the v5.9.24 daemon on DNS2 was built against librocksdb 6.11 and can't
read smsgDB SST files written by newer RocksDB (XXH3 per-block
checksum). The check worked — but it immediately failed CI, because
GitHub's ubuntu-22.04 runners also ship librocksdb-dev 6.11.4.

This is the same drift class the original patch was meant to prevent.

Fix: build RocksDB from source in CI, pinned to 8.9.1 (matching DNS2's
system version). Add scripts/ci/build-rocksdb.sh as a reusable helper
and call it from each of the four Linux jobs (test-linux-unit,
test-linux-sanitizers, build-linux-daemon, build-linux-qt). Drop
librocksdb-dev from the apt-get install (otherwise find_library would
pick up /usr/lib/librocksdb.so.6.11.4 first) and add libsnappy-dev /
libzstd-dev / liblz4-dev (compression libs RocksDB optionally links
against).

MacOS was already passing — Homebrew's rocksdb is current. Windows
was already passing — MSYS2's mingw-w64-rocksdb is at 9.x.

Also fix a cosmetic CMake bug: the version-detect function was setting
RocksDB_VERSION with PARENT_SCOPE only, so the 'Detected RocksDB
version from version.h:' message printed an empty value. Set the local
variable too so the STATUS message reflects the real value.
2026-06-27 16:02:43 -07:00
Krystie 53c9654caf ci: vendor tor build artifacts to fix MSYS2 libtor build
The Windows libtor build was failing on MSYS2 with:

  ./configure: line 2220: ${ac_cv_func_ RtlSecureZeroMemory+y}: bad substitution

Root cause: bash 4.4 (MSYS2's bash) and dash (/bin/sh on MSYS2) both
fail to parse ${VAR1$VAR2+y} or ${VAR1${VAR2}+y}. autoconf 2.69-2.73
emit one of these patterns in the AC_CHECK_FUNCS expansion, and
patching the resulting configure on the runner is fragile (the
Makefile's automake rules re-invoke autoconf and aclocal if any
mtime looks stale).

Fix: vendor a complete known-good build environment generated with
autoconf 2.71 on Linux. The vendored set:

  src/tor/configure.vendored         (37,966 lines, bash 4.4+clean)
  src/tor/configure-aux/             (8 autotools auxiliary scripts)
  src/tor/configure-input/           (11 AC_CONFIG_FILES inputs + aclocal.m4)
  src/tor/regenerate-tor-configure.sh  (one-shot regenerator with parse check)
  src/tor/build-libtor.sh            (uses vendored set when present)

build-libtor.sh now:
  1. Copies configure.vendored + 8 aux files + 11 inputs into the
     tor-src submodule directory.
  2. Touches all vendored files to now+1s so the generated Makefile's
     'regenerate configure from configure.ac' and 'regenerate
     aclocal.m4 from m4/' rules see no work to do.
  3. Runs configure directly (skips autoreconf entirely).

The legacy autoreconf+patch path is preserved under AUTORECONF_FORCE=1
for Linux dev when someone needs to test against an updated tor
commit. regenerate-tor-configure.sh handles regenerating the
vendored set from a fresh autoconf run.

Workflow:
  build-all.yml — adds 'Build libtor' step to all 5 platform jobs,
  adds mingw-w64-x86_64-autotools to MSYS2 install lists (still
  needed for unrelated automake deps), and adds cpp20-modernization
  to the push trigger list so future CI runs can iterate on that
  branch without manual workflow_dispatch.

Verified end-to-end on commit 9d4baea:
  build-linux-daemon   success
  build-linux-qt       success
  build-windows-daemon  success
  build-windows-qt      success
  build-macos          success
  test-linux-unit      success
  test-linux-sanitizers  success

CI run: https://github.com/SamiAhmed7777/triangles_v5/actions/runs/28209275346
2026-06-25 18:14:07 -07:00
Krystie 407355afb0 build: use mingw-w64-x86_64-autotools meta package + zlib for macOS
Two fixes:

1. Windows: replaced broken 'mingw-w64-x86_64-autoconf/automake/
   autoconf2.13/libtool' individual packages with the meta package
   'mingw-w64-x86_64-autotools' which is what actually exists in the
   MINGW64 repo (the individual ones don't).

2. macOS: added 'zlib' to brew install (configure complained the
   --with-zlib-dir was empty).

Also fixed the chaindb equivalence test step in build-all.yml to
run the correct binary: 'build/bin/test_chaindb_equivalence'
(which is the dedicated driver for chaindb_equivalence_tests)
rather than 'build/bin/test_triangles --run_test=chaindb_...'
(the test suite lives in a separate binary, not in test_triangles).
2026-06-24 20:05:16 -07:00
Krystie eb1851ba89 test: fix wallet scope in abandon_transaction_tests
The static 'CWallet wallet' inside BOOST_AUTO_TEST_SUITE(wallet_tests)
is in the wallet_tests namespace, not the global scope. Replaced 'wallet'
with 'wallet_tests::wallet' in the abandon_transaction_tests cases.

Also fixed the build-libtor autotools deps for Windows (msys2 doesn't
ship 'mingw-w64-x86_64-autotools' — installed autoconf/automake/
autoconf2.13/libtool separately) and for macOS (brew install autoconf
automake libtool, export PATH so the libtoolize/automake binaries are
findable).
2026-06-24 19:50:59 -07:00
Krystie 75dd9e034a build: target libtor.a only + add autotools to Windows msys2 install
Run #468 (the re-trigger after #467's fixes) failed with two more issues:

  1. Linux build-libtor step needed static OpenSSL libs (libssl.a,
     libcrypto.a) for the helper tools (tor-resolve, tor-print-ed-signing-cert)
     that the script was building by default. Ubuntu's libssl-dev
     package only ships the shared .so libs, not the static .a ones.
     We don't actually need the helper tools — Triangles only consumes
     libtor.a. Changed 'make' to 'make libtor.a' in build-libtor.sh
     so only the static library is built.

  2. Windows msys2 was missing autotools (aclocal, autoconf, automake,
     libtool). autogen.sh failed with 'aclocal: command not found'.
     Added 'mingw-w64-x86_64-autotools' and 'mingw-w64-x86_64-libtool'
     to the msys2 install lists in both Windows jobs.

If this one fails I'll show you the log. (Run #469 will be the test.)
2026-06-24 19:42:26 -07:00
Krystie bf401437e8 build: fix macOS link options + libtor paths for all 7 CI jobs
Run #467 (the re-trigger after #466's fixes) failed with two new error
classes that the previous commit didn't catch:

  1. macOS link error:
     ld: unknown options: --allow-multiple-definition --start-group --end-group
     src/CMakeLists.txt passed GNU ld flags unconditionally in the
     USE_TOR_EMBEDDED block. Apple's ld64 doesn't recognize them.
     Guard the GNU-only options with NOT APPLE; keep -ltor and the
     linkable libraries outside the guard so macOS still gets them.

  2. Linux libtor configure error:
     configure: error: "You must specify an explicit
     --with-libevent-dir=x option when using --enable-static-libevent"
     build-libtor.sh defaults to /mingw64 paths. On ubuntu-22.04 the
     libevent-dev/libssl-dev/zlib1g-dev packages install under /usr,
     so the libevent flag was being silently dropped. Set
     LIBEVENT_DIR=/usr OPENSSL_DIR=/usr ZLIB_DIR=/usr for Linux jobs.

  3. Added the build-libtor step to three more jobs that needed it
     (Qt GUI builds also link -ltor transitively via triangles_common):
       - build-windows-qt
       - build-linux-qt
       - build-macos

After this:
  - All 7 build jobs will pass the libtor step.
  - macOS Qt link will work (no more GNU-ld-only options).
  - Windows Qt build will produce the .exe installer artifact.

If anything still fails I'll iterate. This is the third build pass.
2026-06-24 19:32:34 -07:00
Krystie c5f55fe802 build: fix Windows CI - add build-libtor step + refreshWallet() call
Two CI issues were blocking the Windows Qt build of v5.9.25-fork-detection
(run #466, all 7 jobs failed):

  1. transactionview.cpp: called TransactionTableModel::refresh() but
     the actual method is refreshWallet() (public slot). Fixed in the
     abandonTransaction() handler.

  2. build-all.yml: every daemon job failed at link with
     'cannot find -ltor'. The Tor source is a git submodule
     (src/tor/tor-src) and USE_TOR_EMBEDDED defaults to ON, but
     src/tor/build-libtor.sh is NEVER invoked from the workflow.
     Added a 'Build libtor' step before the main build in:
       - build-windows-qt
       - build-windows-daemon
       - build-linux-daemon
       - test-linux-unit
       - test-linux-sanitizers

  (The macos/Linux-Qt builds only do BUILD_QT=ON, so they don't link
  libtor and don't need the extra step. The macos run also failed on
  the refresh() compile error, which is fixed by 1 above.)
2026-06-24 19:17:19 -07:00
Krystie aa1851dd6a distribute: wait for daemon .deb before Docker Hub build
The Dockerfile in packaging/docker/ downloads the daemon .deb from
the release URL during the build. On tag-push, the release record is
created immediately but the .deb asset gets uploaded a few seconds
to minutes later by the build job.

Race condition seen on v5.9.24 distribute run #24 (2026-06-24 01:10 UTC):
- Workflow fired on tag push
- Docker Hub job started step 5 'Build and push' immediately
- Dockerfile's curl returned 404 for the .deb
- Job failed in 18 seconds; release .deb was uploaded ~8 min later

AUR and WinGet jobs already had this wait step; Docker Hub was the
only one missing it. Added the same pattern (poll for URL reachability
up to 30 * 20s = 10 min).
2026-06-24 18:21:04 -07:00
Krystie 53f003aef1 v5.9.24: update TRI home + explorer links, networking fixes, checkpoint publisher
- qt: TRI home → https://cryptographic-triangles.org/ (UI + 65 locales)
- qt: block explorer → https://blocks.cryptographic-triangles.org (65 locales)
- net: networking hardening + checkpoint publisher support
- build: MinGW cross-compilation toolchain, CI tridock rebuild trigger
- test: checkpoint publisher + onion v3 test updates
- test: chaindb equivalence test suite (LevelDB↔RocksDB migration parity)
- util: expose ResetDataDirCache() for test fixture datadir switching
- txdb: WriteRawPublic/ReadRawPublic test seam for raw byte-level access
- version bump 5.9.23 → 5.9.24
2026-06-23 20:13:02 -07:00
Krystie 9762c741b7 distribute: fix $schema aka.ms URL + add NSIS Silent switches
Two errors from PR #391813 manifest validation (build 349844):

1. 'The schema header URL does not match the expected pattern.'
   I used raw.githubusercontent.com URLs, but the validator wants
   the aka.ms short URLs that the official winget-bot uses.
   Updated all 3 files to https://aka.ms/winget-manifest.*.1.12.0.schema.json

2. 'Silent and SilentWithProgress switches are not specified for
   InstallerType exe.'
   TrianglesQt installer is built with NSIS (see build-all.yml
   'Install NSIS via MSYS2' step + mingw-w64-x86_64-nsis package).
   NSIS silent flag is /S. Added both Silent and SilentWithProgress.

Closes superseded PR microsoft/winget-pkgs#391813 (same Manifest-Validation-Error).
2026-06-22 21:33:13 -07:00
Krystie 6726365872 distribute: fix $schema heredoc escaping + INSTALLER_URL ${{ }} substitution
Two pre-existing latent bugs in the WinGet job template:

1. The line '# yaml-language-server: $schema=...' was inside a
   <<EOF heredoc, so bash treated $schema as an undefined variable
   and stripped it down to '=https://...'. The resulting YAML still
   parsed (since the $schema line is just an editor comment), but
   IDE auto-complete and editor-side validation were broken.

   Fix: escape the $ as \$ in the heredoc so bash leaves it alone.

2. INSTALLER_URL was set in the workflow env: block with literal
   ${VERSION} placeholders. GitHub Actions only substitutes \${{ }}
   expressions in env values, not ${}. So the bash $VERSION got
   expanded but the URL kept ${VERSION} literal in the output —
   meaning the published manifest had a broken InstallerUrl that
   the Microsoft validator would 404 on (and a literal ${VERSION}
   string in SHA-source comparison).

   Fix: use ${{ env.VERSION }} in the workflow YAML so GitHub Actions
   substitutes it at runtime. Then bash gets the real version string
   and the heredoc just expands the resulting env var.
2026-06-22 20:57:16 -07:00
Krystie 20fc2ee6dd distribute: bump WinGet manifest schema 1.6.0 → 1.12.0
The winget-pkgs repository has tightened its accepted schema. Per
doc/ValidationFailureGuide.md:
- 'Manifest-Version-Deprecated: Update your manifest to use a supported
   schema version. The recommended schema version is 1.12.0
   (1.10.0 is also accepted).'
- 'Manifest-Validation-Error: Address all reported errors and resubmit.'

What changed in the template heredocs:

1. ManifestVersion: 1.6.0 → 1.12.0 in all 3 files
2. Version file: dropped Publisher/PublisherUrl/PackageName/License/
   ShortDescription (those belong in defaultLocale only).
   Replaced PackageLocale: en-US with DefaultLocale: en-US — that
   field was renamed in schema 1.12.
3. Installer file: replaced InstallerMode: interactive with
   InstallModes: [interactive, silent] (the singular 'InstallerMode'
   was removed; InstallModes is now an array per-installer or root).
   Dropped PackageLocale (not part of installer schema) and
   InstallerScope: user (no longer supported at root, only per-installer).
4. Added # yaml-language-server: $schema=... comment to all 3 files
   pointing at the official 1.12.0 JSON schemas — helps editor/IDE
   auto-complete AND validates against the same schema the winget
   validators use.

Supersedes PR microsoft/winget-pkgs#391801 (closed in same batch —
manifests there used the 1.6.0 schema and got Manifest-Validation-Error).
2026-06-22 20:47:14 -07:00
Krystie 5d9a0f47f9 distribute: add WinGet spam-safeguards (pre-flight + watchdog)
Sami's winget-pkgs submission bot has been firing one PR per release.
Three of them (#391151/391368/391388) were generated with a buggy path
format and accumulated PullRequest-Error / Needs-Author-Feedback labels
before Sami noticed. That pattern reads as spam to winget-pkgs moderators
and risks the maintainer goodwill we've built with stephengillie.

Two new safeguards:

1. Pre-flight check (distribute.yml, winget job):
   - Before opening a PR, scan existing SamiAhmed7777 PRs on
     microsoft/winget-pkgs for PullRequest-Error or
     Needs-Author-Feedback labels
   - If any are found, abort this submission with a clear error
   - Also skip if a PR for this exact version is already open

2. New winget-watchdog.yml workflow (cron */30 * * * *):
   - Every 30 min, scan open SamiAhmed7777 PRs
   - For each one, inspect wingetbot comments for validation result
   - If a PR has automatic-validation failure comments, post a
     summary comment + close the PR automatically
   - This prevents 'broken PR opened, forgotten for 24h' pattern
     that creates the spam appearance

Both changes keep the existing tag-triggered release flow intact.
2026-06-22 20:36:06 -07:00
Krystie 7f309800e5 distribute: fix WinGet manifest path casing + folder structure
PUBLISHER_INITIAL was hardcoded to 'C' but the winget-pkgs convention
requires lowercase 'c' for the first-letter prefix folder. Additionally,
the manifest was being placed at manifests/c/CryptographicTriangles/<full
PackageIdentifier with dot>/<version>/, but the correct convention is
manifests/c/CryptographicTriangles/<short package name>/<version>/ — the
file *names* still use the full PackageIdentifier (e.g.
CryptographicTriangles.TrianglesQt.installer.yaml).

Without these fixes, microsoft/winget-pkgs Automatic Validation rejects
the PR with: "the casing of the file in disk or identical file is not
merged" because the path written to the (Windows, case-insensitive)
validator filesystem differs from what's in the git tree.

Closes superseded PRs microsoft/winget-pkgs#391151, #391368, #391388.
2026-06-22 20:13:05 -07:00
Krystie (TRI packaging) 7de1595647 ci: fix WinGet PR creation (use 'owner:branch' not 'owner/repo:branch') 2026-06-21 02:16:41 -07:00
Krystie (TRI packaging) 758c22e5b2 ci: use unique branch per run for WinGet (triangles-VERSION-RUN#)
Avoid 'fetch first' errors when the same version gets re-distributed
(multiple tags or workflow re-runs). Each run uses its own branch in
the winget-pkgs fork.
2026-06-21 02:14:05 -07:00
Krystie (TRI packaging) b58bb2ce5f ci: fix WinGet gh pr create auth (set GH_TOKEN) 2026-06-21 02:10:55 -07:00
Krystie (TRI packaging) a548aad96c ci: fix distribute.yml chocolatey + winget step bugs
- Chocolatey 'Check' step: add shell: bash so the [ -z ] syntax parses
- WinGet fork: remove --fork flag (renamed), use --remote=false instead
  which omits the clone in the same step
2026-06-21 02:08:38 -07:00
Krystie (TRI packaging) 17b5119d40 packaging + ci: add Chocolatey auto-push + WinGet auto-PR jobs
distribute.yml:
- New 'chocolatey' job: updates nuspec version + install script SHA256,
  packs .nupkg, pushes to chocolatey.org. Gated by CHOCO_SKIP_WACATAC
  env var so it can be disabled while the Microsoft false-positive is
  still active (set CHOCO_SKIP_WACATAC=true on the repo, flip to empty
  after Microsoft clears the detection).
- New 'winget' job: forks microsoft/winget-pkgs (auto-creates fork if
  needed), generates the three manifest files (version/locale/installer)
  in the winget-pkgs v1.6.0 format, opens a PR.

Both jobs use the Windows setup.exe as the installer source.
Both jobs skip gracefully with a warning if their respective GitHub
secrets aren't set.

packaging/chocolatey/tools/chocolateyInstall.ps1:
- Rewritten to use the NSIS installer (.exe) instead of the old .zip
  format (the v5.9.x release ships an NSIS .exe setup)
- Uses $env:ChocolateyPackageVersion so the workflow can substitute the
  version at pack time
- checksum64 is '__CHECKSUM_PLACEHOLDER__' which the workflow replaces
  with the computed SHA256

Required GitHub secrets (all added):
  CHOCO_API_KEY  - Chocolatey API key
  WINGET_TOKEN   - GitHub PAT with public_repo scope
2026-06-21 02:04:59 -07:00
Krystie (TRI packaging) 794b840cdc ci: fix redacted HOMEBREW_GITHUB_TOKEN env value
The previous commit had a literal '***' placeholder where the GitHub
Actions expression ${{ secrets.HOMEBREW_GITHUB_TOKEN }} should have
been. The workflow couldn't parse, so runs showed as 'failure' with
zero jobs and the display name fell back to the file path.

Fixed by writing the correct expression directly.
2026-06-21 01:48:00 -07:00
Krystie (TRI packaging) 7213dddcf1 ci: add job-level guards to distribute.yml
Observed the workflow firing on regular push-to-master events, not just
tag pushes. GitHub is sometimes over-eager about workflow re-runs on
commits that touch the workflow file. Add an explicit job-level guard

  if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')

to all four jobs so the distribute jobs only run on tag pushes or
manual workflow_dispatch events.
2026-06-21 01:43:44 -07:00
Krystie (TRI packaging) 8b147317d5 ci: auto-distribute releases to Homebrew tap on tag
New 'homebrew' job in distribute.yml:
- Waits for the macOS .dmg to be available on the GitHub release
- Computes the new SHA256
- Clones SamiAhmed7777/homebrew-triangles
- Updates version + sha256 in both Formula/triangles.rb and
  Casks/cryptographic-triangles.rb
- Commits and pushes to main
- Skips gracefully with a warning if HOMEBREW_GITHUB_TOKEN is not set

Required GitHub secret: HOMEBREW_GITHUB_TOKEN (added)
2026-06-21 01:39:45 -07:00
Krystie (TRI packaging) 2abb72ed0e ci: fix distribute.yml to handle missing secrets per step
GitHub Actions doesn't allow 'secrets' context in 'if:' conditionals,
only in 'env:'. Reworked the workflow to:

- Capture DOCKERHUB_TOKEN and AUR_SSH_KEY into env vars at job level
- Each step that needs a secret checks env.* and exits 0 with a
  ::warning:: annotation if not set
- Skipped steps display a final summary in the job log

Same behavior, just no parser errors.
2026-06-21 01:33:23 -07:00
Krystie (TRI packaging) 06fea513d8 ci: auto-distribute releases to Docker Hub + AUR on tag
New workflow .github/workflows/distribute.yml:
- Triggers on v* tag push (and workflow_dispatch for manual runs)
- Docker job: builds + pushes to samiahmed7777/trianglesd with both
  :VERSION and :latest tags, plus a post-push smoke test
- AUR job: runs in archlinux container, downloads the release .debs,
  updates PKGBUILD with new version + SHA256s, regenerates .SRCINFO
  via makepkg, commits and pushes to AUR via SSH
- Both jobs skip gracefully (with a clear warning) if their respective
  GitHub secrets aren't set, so the workflow can be merged and tested
  before secrets are configured
- Waits up to 10 minutes for the build-all release artifacts to be
  available (build-all and distribute run in parallel on the same tag)

Required GitHub secrets:
  DOCKERHUB_TOKEN — Docker Hub access token (have in vault)
  AUR_SSH_KEY     — Private key of the AUR packager (~/.ssh/aur_key)
2026-06-21 01:30:32 -07:00
SamiAhmed7777 b40c58f886 Add triangles-cli: JSON-RPC client (port bitcoin-cli pattern) (#7)
* Add triangles-cli: JSON-RPC client (port bitcoin-cli pattern)

Triangles never had a CLI client (bitcoin-cli analog). This adds
triangles-cli as a third build target alongside trianglesd and
triangles-qt.

- src/triangles-cli.cpp: self-contained JSON-RPC 1.0 client.
  Reads triangles.conf for credentials, supports -rpcuser/-rpcpassword
  /-rpcconnect/-rpcport/-testnet/-datadir/-conf flags. Implements
  -getinfo (synthesized summary from getnetworkinfo/getblockchaininfo
  /getwalletinfo) and raw method dispatch. JSON via json_spirit compat
  shim (json_compat.h), HTTP via boost::asio, base64 auth inline.
  No util.cpp / wallet.cpp / net.cpp / triangles_common link dep —
  keeps the binary small (~600 KB Linux, ~1.5 MB Windows).

- CMake: new option(BUILD_CLI ON) + add_executable(triangles-cli)
  in src/CMakeLists.txt. Status line added.

- CI: BUILD_CLI=ON added to build-windows-daemon and build-linux-daemon
  jobs. triangles-cli.exe bundled into windows-daemon artifact
  alongside trianglesd.exe. triangles-cli added to linux-daemon .deb
  package (with launcher in /usr/bin).

- Default ON; set BUILD_CLI=OFF to skip.

Closes the open 'triangles-cli.exe missing from Windows build'
follow-up (the binary wasn't missing — it never existed).

Patterned after Bitcoin Core bitcoin-cli and Dash Core dash-cli.

* Fix macOS build: drop Boost::system/find_package component, use std::filesystem

Homebrew's boost formula doesn't ship the boost_system CMake config file,
so find_package(Boost REQUIRED COMPONENTS system) failed on macOS.

- Replace boost::filesystem with std::filesystem (C++17, no Boost dep)
- Drop 'filesystem' from find_package — only headers needed (asio + system)
- Link libboost_system explicitly per-platform by library name, resolved
  via the platform's default search path (Homebrew toolchain on macOS,
  system libs on Linux, MSYS2 on Windows)

CI will rerun automatically on PR push.

* Fix macOS build: add Boost::boost target for headers, link boost_system

The previous fix dropped the find_package component but also killed the
boost include path. Now use the modern Boost::boost header-only target
(available in Boost 1.83+) which sets up include directories without
requiring a per-component config file.

Link libboost_system explicitly by name on all platforms — the linker
finds it via the platform's default search path:
- Linux: /usr/lib (libboost_system.so)
- macOS Homebrew: /opt/homebrew/lib (libboost_system.dylib)
- Windows MSYS2: mingw64/bin (libboost_system-mt-X-XX.dll)

* Drop Boost entirely from triangles-cli: use raw sockets for HTTP

Third time's the charm. After two CI failures chasing boost::asio / libboost_system
linking issues across platforms (Homebrew missing config on macOS, MSYS2 versioned
names on Windows, CMake targets that don't quite work everywhere), rip the whole
Boost dependency out of the CLI and use raw POSIX/Winsock sockets.

- triangles-cli.cpp: replaced boost::asio with raw socket() / connect() / send()
  / recv() / getaddrinfo(). Cross-platform: #ifdef _WIN32 for Winsock + WSAStartup
  / WSACleanup, else POSIX. ~100 lines of clean portable socket code.
- src/CMakeLists.txt: dropped find_package(Boost) entirely. Only links
  json_compat (header-only) + ws2_32 on Windows. No boost libs to find.

Should be the last fix needed for this PR.

* Fix Windows packaging step: simplify bash { } | sort -u | while pattern

The previous step used a bash group command piped through sort -u and a
while loop. Under MSYS2 bash + 'set -e -o pipefail' (GitHub Actions
default), this triggered a non-zero exit even when the loop body
succeeded, causing the Windows daemon job to fail at the packaging step
(the actual link of both trianglesd.exe and triangles-cli.exe succeeded).

Replaced the { } | sort -u | while pattern with a temp-file-based dedup:
- ldd both binaries, append to /tmp/cli-dlls.txt (or cli-libs.txt on Linux)
- sort -u the temp file
- pipe the result into the while loop (simpler pipeline, no group)

Also applied the same simplification to the Linux .deb packaging for
consistency, even though the Linux build was passing.

* Simplify DLL packaging: plain for loop, no pipe-into-while

The previous attempts used 'ldd | sort -u | while read; do ... done' patterns
that exit 1 under MSYS2 bash + 'set -e -o pipefail' even when the script
ran successfully. Replaced with a plain 'for bin in ...; do ldd > list.txt;
while read; do cp; done < list.txt; done' pattern that has no pipelines
other than the standard redirection, and uses IFS= read -r for safe line
iteration.

Also moved temp files from /tmp to the working directory (./dll-list.txt)
to avoid any MSYS2 /tmp path-translation edge cases.

* diagnostic: add tracing to Windows packaging step

* Add package-windows-daemon.sh + package-linux-daemon.sh scripts

Move the Windows daemon packaging step and the Linux .deb build into
committed shell scripts under scripts/ci/. This bypasses GitHub Actions'
inline-run-block quirks (silent exit 1 under msys2 + set -e -o pipefail
with multi-line scripts) and makes the packaging logic debuggable locally.

* Switch to script-file packaging for Windows + Linux daemon jobs

Replace inline multi-line run: blocks with invocations of the
scripts/ci/package-*.sh scripts. This sidesteps the GitHub Actions
msys2 + 'set -e -o pipefail' issue that caused silent exit 1 on the
Windows daemon packaging step. The scripts are also debuggable locally.

---------

Co-authored-by: Krystie <krystie@sami>
2026-06-18 20:05:54 -07:00
Sami fcdc9a58b0 ci(lint): checkout secp256k1 submodule for clang-tidy (fixes configure) 2026-06-15 19:26:43 -07:00
Sami c1c9f19870 ci: strip CR from clientversion.h version parse (fixes dpkg-deb/NSIS packaging) 2026-06-15 15:53:18 -07:00
Krystie 7166b76bad ci: fix test-linux-sanitizers submodule checkout 2026-05-10 19:36:16 -07:00
Sami 8e03e89764 ci: trigger Build All Platforms on push to cpp20-modernization 2026-05-10 17:47:35 -07:00
Krystie c3e4a456d8 ci: fetch submodules in GitHub Actions 2026-05-09 03:30:53 -07:00
sami7777 59ee532bf6 Port smessage to RocksDB, make RocksDB a hard dep
The secure-messaging store (smsgDB) used the LevelDB API directly. Mass-
mapped to the equivalent RocksDB types: leveldb::DB/Status/WriteBatch/
Iterator/Slice/ReadOptions/WriteOptions/WriteBatch::Handler -> rocksdb::*.
The RocksDB API surface for our usage is binary-compatible — pure namespace
substitution, no semantic changes. Consumers in rpcsmessage.cpp and
qt/messagemodel.cpp updated to match.

RocksDB now becomes a hard build dependency (was optional behind
BUILD_ROCKSDB). The chain-DB rocksdb backend is consequently always
available; -chaindb=leveldb remains the default until the Phase-4
LevelDB retirement. Removed the BUILD_ROCKSDB cmake option, the
#ifdef BUILD_ROCKSDB guards in txdb*, and the runtime error path
that triggered when the flag was off.

CI updated: librocksdb-dev (Ubuntu), mingw-w64-x86_64-rocksdb (MSYS2),
and rocksdb (Homebrew) added to all build jobs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 18:11:00 -07:00
sami7777 426e23d8be Add clang-format, clang-tidy, ASan/UBSan CI lanes
Format and tidy enforce only on lines changed in PRs (diff-only via
git-clang-format and clang-tidy-diff.py) — existing files keep their
current style until edited. Mass reformat deferred; .git-blame-ignore-revs
stub is in place for whenever that happens.

Sanitizer lane builds with -fsanitize=address,undefined and runs the
unit suite. continue-on-error: true initially so we can triage findings
without blocking PRs. UB categories pervasive in the Hash9 C cascade
(alignment, signed-integer-overflow, vptr) are suppressed pending
file-by-file fixes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 17:37:01 -07:00
Krystie 47a5ec1e38 Bundle full Tor runtime on Windows 2026-04-09 01:06:34 -07:00
Krystie 76ec2da20d Force release asset versions to match tag 2026-04-08 13:21:24 -07:00
Krystie 1e276da344 Fix TRI-PI release trigger dispatch 2026-04-08 12:51:12 -07:00
Krystie 412ca94a25 Use official Tor package archive in CI 2026-04-08 12:20:32 -07:00
Krystie 23dc7992e5 Fix CI Tor packaging on all platforms 2026-04-08 12:16:40 -07:00