Compare commits

7 Commits

Author SHA1 Message Date
Sami Ahmed dc7c4ce2a0 Update README to reflect the nyc3 source import + test scaffolding. 2026-07-16 02:57:37 -07:00
Sami Ahmed bb18cacc58 Add scripts/test.sh — install deps + run unit + functional tests.
One-shot entry point to verify the nyc3-source import builds and
passes. Tomorrow's first step will be:

  bash scripts/test.sh

It auto-installs apt-get deps, runs autogen + configure, builds the
test_bitcoin binary, and runs both the boost unit suite (src/test/, 70
files) and the python functional suite (test/functional/, 115 files).

Logs land in .test-logs/test-<timestamp>.log.

Flag summary:
  --unit      only unit tests
  --func      only functional tests
  --quick     alias for --unit
  --no-build  assume build/ already populated
  --clean     nuke build/ first
2026-07-16 02:57:17 -07:00
Sami Ahmed e0c6dc9a75 Import Bitcoin Core 0.18 fork source from nyc3.
Brings the full barrystyle/nyc3 codebase on top of the CAC3 art tree.
'ours' strategy preserves our existing files: art/, CAC3-LAUNCH.md,
README.md (CAC3), .gitignore.

Source: https://github.com/SamiAhmed7777/nyc3 (19856 commits, 1702 files)
PoW: Argon2s  Block time: nyc3's  Base: Bitcoin Core 0.18
2026-07-16 02:56:19 -07:00
Sami Ahmed 24991727f5 Add CAC3 splash v2 (art/splash/).
Authoritative boot splash artwork for the CAC3 Qt wallet.

Files:
  - art/splash/splash-v2.jpg   (1254x1254, JPEG source of truth)
  - art/splash/splash-v2.png   (1254x1254, PNG lossless copy)
  - art/splash/README.md       (usage notes + future wallet wiring)

Composition: CAC3 medal mark (centered, gold reeded rim, grizzly bear +
lone red star on cream face), six California landmark photos in a 3x2+1
grid, CALIFORNIACOIN wordmark, CAC3 tagline. Red ground with gold/sunset
accents, unified sunset-golden-hour palette across all photos.

License: CC0 1.0 (public domain).

Downstream wiring (when C++ source lands):
  - src/qt/res/splash.png    (800x600)
  - src/qt/res/splash@2x.png (1600x1200)
  - src/qt/res/splash_testnet.png (future)
2026-07-15 21:43:57 -07:00
Sami Ahmed 47d693b115 Round out the icon set + rewrite art/icons/README.md honestly.
Added:
  - cac3-128.png (Linux desktop launcher size)
  - cac3-256.png (Debian package icon size)
  - cac3-1024.png (macOS Retina @2x Qt tray icon)

Re-bundled favicon.ico with 16/32/48/96/128/256 sizes inside.

Rewrote art/icons/README.md to:
  - remove references to non-existent SVG sources
  - document the real PNG regeneration recipe
  - be straight about the 16x16 legibility limit
  - leave room for an artist-provided SVG master if/when one exists
2026-07-15 01:41:21 -07:00
Sami Ahmed 9cde9cb436 Add CAC3 icon set + art/ folder.
Generated from a 1254×1254 transparent-background source at:
  cac3-master-1024.png (1024×1024 master)
  cac3-app-store.png   (1500×1500 for app store listings)

Plus standard web/app sizes:
  - cac3-{16,32,48,96,192,512,1024}.png (downsamples)
  - favicon.ico (multi-icon bundle: 16,32,48,96)
  - favicon-{16x16,32x32,48x48}.png
  - apple-touch-icon.png (180×180), apple-touch-icon-ipad.png (152×152)
  - android-foreground.png (432×432, transparent)
  - android-background.png (432×432, solid #0a0a0a)

See art/icons/README.md for the full mapping into planned source-tree
slots (src/qt/res/icons/, contrib/debian, splash, etc).

Design released under CC0 1.0 (public domain) for downstream remix.
2026-07-15 01:15:32 -07:00
Sami Ahmed cd78a0cd11 Initial repo creation for CAC3 (Californiacoin3).
Placeholder docs only — no source code yet.
Renaming and fresh genesis block coming in subsequent commits.
2026-07-14 22:37:33 -07:00
28 changed files with 441 additions and 153 deletions
+37 -117
View File
@@ -1,126 +1,46 @@
*.tar.gz
*.exe
src/bitcoin
src/bitcoind
src/bitcoin-cli
src/bitcoin-tx
src/bitcoin-wallet
src/test/test_bitcoin
src/test/test_bitcoin_fuzzy
src/qt/test/test_bitcoin-qt
# autoreconf
Makefile.in
aclocal.m4
autom4te.cache/
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
build-aux/install-sh
build-aux/ltmain.sh
build-aux/m4/libtool.m4
build-aux/m4/lt~obsolete.m4
build-aux/m4/ltoptions.m4
build-aux/m4/ltsugar.m4
build-aux/m4/ltversion.m4
build-aux/missing
build-aux/compile
build-aux/test-driver
config.log
config.status
configure
libtool
src/config/bitcoin-config.h
src/config/bitcoin-config.h.in
src/config/stamp-h1
share/setup.nsi
share/qt/Info.plist
src/univalue/gen
src/qt/*.moc
src/qt/moc_*.cpp
src/qt/forms/ui_*.h
src/qt/test/moc*.cpp
src/qt/bitcoin-qt.config
src/qt/bitcoin-qt.creator
src/qt/bitcoin-qt.creator.user
src/qt/bitcoin-qt.files
src/qt/bitcoin-qt.includes
.deps
.dirstamp
.libs
.*.swp
*.*~*
*.bak
*.rej
*.orig
*.pyc
# Build artifacts
*.o
*.o-*
*.patch
*.a
*.pb.cc
*.pb.h
*.dat
*.so
*.dylib
*.dll
*.log
*.trs
*.dmg
# CAC3 / Bitcoin Core build outputs
src/cac3d
src/cac3-cli
src/cac3-tx
src/cac3-wallet
src/cac3-qt
src/qt/cac3-qt
src/test/test_cac3
src/bench/bench_cac3
*.exe
*.json.h
*.raw.h
# Generated build tree
depends/built/
depends/sdk-sources/
src/config/cac3-config.h
src/leveldb/libleveldb.a
src/secp256k1/libsecp256k1.a
#libtool object files
*.lo
*.la
# Compilation and Qt preprocessor part
*.qm
# Autotools
*.in~
config.status
config.log
Makefile
bitcoin-qt
NYC3-Qt.app
background.tiff*
src/Makefile
src/test/Makefile
src/qt/Makefile
doc/Doxyfile
!configure.ac
!Makefile.am
# Unit-tests
Makefile.test
bitcoin-qt_test
# ctags / IDE
.tags
.idea/
.vscode/
*.swp
# Resources cpp
qrc_*.cpp
# Mac specific
# OS
.DS_Store
build
#lcov
*.gcno
*.gcda
/*.info
test_bitcoin.coverage/
total.coverage/
coverage_percent.txt
#build tests
linux-coverage-build
linux-build
win32-build
test/config.ini
test/cache/*
!src/leveldb*/Makefile
/doc/doxygen/
libbitcoinconsensus.pc
contrib/devtools/split-debug.sh
# Output from running db4 installation
db4/
# clang-check
*.plist
Thumbs.db
+35
View File
@@ -0,0 +1,35 @@
# CAC3 Launch Plan — Pending
## What needs to happen before the first block
1. Bring over the Bitcoin Core 0.18 source tree from
[SamiAhmed7777/nyc3](https://github.com/SamiAhmed7777/nyc3) (or the
barrystyle/nyc3 upstream it was forked from).
2. Rename pass on every string literal:
- `nyc3``cac3`
- `NYC3``CAC3`
- `NewYorkCoin``Californiacoin`
- port `55555``55556`
- magic bytes `1f be ef f1` → fresh values
- P2PKH base58 prefix `0x35``0x1e` (Bitcoin's `'C'` letter)
- bech32 HRP `ny``cac`
3. Mine a fresh genesis block (find new nonce, recompute merkle root).
4. Replace genesis constants in `src/chainparams.cpp` and
`src/chainparamsbase.cpp`.
5. Replace seed nodes with CAC3-run infrastructure.
6. Build `cac3d` + `cac3-cli`. Drop Qt wallet unless a maintainer
volunteers for the GUI.
7. Run 3+ full nodes on hard, geographic diversity.
8. Mine the first 150 blocks (no difficulty adjustment until height 151).
9. Open the network — clients can connect.
## What is NOT changing
- Argon2s PoW parameters — preserved exactly
- LWMA-3 difficulty algorithm — preserved exactly
- 10-second block target — preserved exactly
- Total supply schedule — preserved exactly
- Address format (bech32 + base58 P2PKH + P2SH) — preserved exactly
## What this repo intentionally does NOT carry
The trust history of any prior chain. CAC3 starts at height 0 with
fresh state. There is no on-chain bridge from any prior identity.
+62 -36
View File
@@ -1,50 +1,76 @@
NYC3 (NewYorkCoin3) integration/staging tree
============================================
# CAC3 (Californiacoin3) integration/staging tree
A fork of **Bitcoin Core 0.18** carrying a CPU-mineable proof-of-work
(Argon2s), LWMA-3 difficulty targeting, and 10-second block times —
explicitly designed to keep mining fair to anyone with general-purpose
hardware.
Built upon Bitcoin Core 0.18; NYC3 offers a blocktime of 10 seconds, consensus operates using a modified version of the Argon2 password hashing algorithm (http://github.com/barrystyle/argon2s) in a POW configuration and uses LWMA3 to regulate block-spacing.
The chain source is the **barrystyle/nyc3** codebase (NewYorkCoin3),
imported on top of the CAC3 art tree. The chain identity (genesis,
magic bytes, ports, address prefixes, ticker) is still nyc3's and will
be renamed to CAC3 in a follow-up commit.
## What this repo contains
License
-------
```
.
├── art/ # CAC3 icons, splash, and visual assets
│ ├── icons/ # 20 PNG/ICO files, multi-size (16→1024)
│ └── splash/ # splash-v2.{png,jpg} + README
├── src/ # C++ source — Bitcoin Core 0.18 fork (nyc3 base)
│ ├── chainparams.cpp # network params (still nyc3; will become CAC3)
│ ├── pow.cpp # Argon2s PoW check
│ ├── validation.cpp # block + tx validation
│ └── ... # full Bitcoin Core tree
├── test/ # python functional tests (115 files)
├── src/test/ # boost unit tests (70 files)
├── doc/ # build docs, developer notes
├── contrib/ # gitian, debian packaging, etc.
├── configure.ac # autotools
├── scripts/test.sh # one-shot: install deps + run all tests
├── CAC3-LAUNCH.md # rename plan, pending
└── README.md # this file
```
NYC3 is released under the terms of the MIT license. See [COPYING](COPYING) for more
information or see https://opensource.org/licenses/MIT.
## Building & testing
Development Process
-------------------
Tomorrow's first step:
The `master` branch is regularly built and tested, but is not guaranteed to be
completely stable. [Tags](https://github.com/nyc3coin/nyc3/tags) are created
regularly to indicate new official, stable release versions of NYC3.
```bash
bash scripts/test.sh # full suite (unit + functional)
bash scripts/test.sh --quick # unit only
bash scripts/test.sh --clean # nuke build/ first
```
The contribution workflow is described in [CONTRIBUTING.md](CONTRIBUTING.md)
and useful hints for developers can be found in [doc/developer-notes.md](doc/developer-notes.md).
`scripts/test.sh` auto-installs Debian/Ubuntu deps, runs autogen,
configures with `--disable-wallet --without-gui`, builds the test
binary, and runs both the boost unit suite and the python functional
suite. Logs land in `.test-logs/test-<timestamp>.log`.
Testing
-------
## Status
Testing and code review is the bottleneck for development; we get more pull
requests than we can review and test on short notice. Please be patient and help out by testing
other people's pull requests, and remember this is a security-critical project where any mistake might cost people
lots of money.
| Step | Status |
|---|---|
| Icon set (art/icons/) | ✅ shipped (20 sizes, app-store + favicon) |
| Splash v2 (art/splash/) | ✅ shipped |
| Source import from nyc3 | ✅ shipped (1,702 files, 19,856 commits of history reachable) |
| Build & test scaffolding (`scripts/test.sh`) | ✅ shipped |
| Chain-identity rename (genesis / ports / prefix / ticker) | 🟡 pending — see `CAC3-LAUNCH.md` |
| Build verification (`bash scripts/test.sh`) | 🟡 pending — runs tomorrow |
| Block explorer (`cac3-explorer` repo) | 🟡 in progress |
### Automated Testing
## License
Developers are strongly encouraged to write [unit tests](src/test/README.md) for new code, and to
submit new unit tests for old code. Unit tests can be compiled and run
(assuming they weren't disabled in configure) with: `make check`. Further details on running
and extending unit tests can be found in [/src/test/README.md](/src/test/README.md).
MIT — see `COPYING`. The Argon2s implementation, the LWMA-3 difficulty
algorithm, and the base Bitcoin Core 0.18 fork that this project
stands on come from the open-source ecosystem around
[barrystyle](https://github.com/barrystyle) and
[barrystyle/nyc3](https://github.com/barrystyle/nyc3). This fork
honours their work.
There are also [regression and integration tests](/test), written
in Python, that are run automatically on the build server.
These tests can be run (if the [test dependencies](/test) are installed) with: `test/functional/test_runner.py`
## Mirror
The Travis CI system makes sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.
### Manual Quality Assurance (QA) Testing
Changes should be tested by somebody other than the developer who wrote the
code. This is especially important for large or high-risk changes. It is useful
to add a test plan to the pull request description if testing the changes is
not straightforward.
This repo is also hosted at https://github.com/SamiAhmed7777/cac3
(the original push was a 4-commit art-only tree; the
`nyc3-source` import + test scaffolding has since been added here on
git.sami).
+84
View File
@@ -0,0 +1,84 @@
# CAC3 Icon Set
## Source
Generated from a 1254×1254 transparent-background PNG master.
The PNG is the canonical source of truth for this set. There is no
SVG master — the SVG you see, if any, will be one you provide or one
an artist provides. We do not fabricate vector sources here.
## Regenerating the PNG set
```bash
SRC=/path/to/your/cac3-master-1254.png
cd art/icons
for s in 16 32 48 96 128 192 256 512 1024; do
convert "$SRC" -resize ${s}x${s} -filter Lanczos cac3-${s}.png
done
convert "$SRC" -resize 1500x1500 -filter Lanczos cac3-app-store.png
convert cac3-16.png cac3-32.png cac3-48.png cac3-96.png \
cac3-128.png cac3-256.png favicon.ico
convert "$SRC" -resize 180x180 apple-touch-icon.png
convert "$SRC" -resize 152x152 apple-touch-icon-ipad.png
convert "$SRC" -resize 432x432 android-foreground.png
# Android background: solid black so the cream disc pops against it.
convert -size 432x432 xc:'#0a0a0a' android-background.png
```
Requires ImageMagick 7+. The CAC3 medallion has pale-on-mid contrast
which can collapse under naive resampling — `-filter Lanczos` keeps
the cream paper disc legible at small sizes.
## Files
| File | Size | Purpose |
|---|---|---|
| `cac3-master-1024.png` | 1024×1024 | Soft-padded smaller version of the 1254 source for sharing without bundling the full-size PNG in repos |
| `cac3-app-store.png` | 1500×1500 | Apple App Store / Google Play store-listing size |
| `cac3-512.png` | 512×512 | PWA / modern desktop |
| `cac3-192.png` | 192×192 | Android / PWA medium |
| `cac3-128.png` | 128×128 | Linux desktop launcher |
| `cac3-96.png` | 96×96 | Linux taskbar |
| `cac3-48.png` | 48×48 | Toolbar |
| `cac3-32.png` | 32×32 | Menu |
| `cac3-16.png` | 16×16 | Status bar / smallest readable |
| `favicon.ico` | 16/32/48/96/128/256 multi-icon | Browser address bar bundle |
| `favicon-16x16.png` | 16×16 | Browser favicon |
| `favicon-32x32.png` | 32×32 | Browser favicon (HiDPI) |
| `favicon-48x48.png` | 48×48 | Browser favicon (Windows) |
| `apple-touch-icon.png` | 180×180 | iOS home screen |
| `apple-touch-icon-ipad.png` | 152×152 | iPad home screen |
| `android-foreground.png` | 432×432, transparent | Android adaptive icon foreground layer |
| `android-background.png` | 432×432, solid `#0a0a0a` | Android adaptive icon background (dark) |
## Planned targets in the source tree
These will be referenced when the C++ source lands.
| Target (planned) | Maps to |
|---|---|
| `src/qt/res/icons/cac3.png` | `cac3-512.png` |
| `src/qt/res/icons/cac3.ico` | `favicon.ico` |
| `src/qt/res/icons/cac3@2x.png` | `cac3-1024.png` |
| `src/qt/res/icons/cac3-testnet.png` | distinct from mainnet (not yet generated) |
| `contrib/debian/cac3d.desktop` | `cac3-256.png` |
| `contrib/macosx/Info.plist` | `cac3-512.png` and `cac3-1024.png` |
## Note on small sizes
At 16×16 the cream paper disc and the dark bear silhouette both
lighten into the gold rim when resampled down. This is a property
of the original design, not a render artifact. If this set is used
as a system tray icon for the wallet, the design may benefit from a
simplified 16×16 variant — bear head only, no wordmark — that an
artist provides in addition to the full medallion. That variant
does not exist yet; it will be added here when it does.
## License
The medallion design is released under **CC0 1.0 Universal** (public
domain dedication). Anyone may fork, recolor, or remix it for
downstream CAC3 implementations without attribution.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

+37
View File
@@ -0,0 +1,37 @@
# CAC3 Splash Screens
Boot splash artwork for the CAC3 (Californiacoin3) Qt wallet.
## Files
| File | Size | Purpose |
|---|---|---|
| `splash-v2.jpg` | 1254×1254, sRGB JPEG | Source of truth. Authoritative splash for v2 release. |
| `splash-v2.png` | 1254×1254, sRGB PNG | Lossless copy of v2 (for tools that prefer PNG). |
## v2 (current)
- **Author**: Sami Ahmed (generated with AI assistance, 2026-07-15)
- **Composition**: CAC3 medal mark (centered, gold rim with reeded edge, grizzly bear + lone red star on cream face), six California landmark photos in a 3×2+1 grid (Golden Gate, downtown LA skyline, Hollywood sign, Bixby Creek Bridge, lifeguard tower at sunset, classic lowrider, palm grove at dusk), `CALIFORNIACOIN` wordmark, `CAC3 — The Crypto for Real Riders` tagline.
- **Palette**: Red ground with gold/sunset accents. Whole poster tied together by a unified sunset-golden-hour palette.
## Wiring into the wallet
When the C++ source lands, this image is the drop-in for the boot splash:
| Wallet target | File to write |
|---|---|
| `src/qt/res/splash.png` (Qt boot splash) | convert `splash-v2.png` → resize to 800×600 → write |
| `src/qt/res/splash@2x.png` (HiDPI) | 1600×1200 |
| `src/qt/res/splash_testnet.png` | distinct splash for testnet (todo) |
For now the splash is shipped as art only — wallet build wiring is a downstream step.
## License
Released under **CC0 1.0 Universal** (public domain dedication). Anyone may fork, recolor, or remix for downstream CAC3 implementations without attribution.
## History
- **v1** — six-landmark grid, red/gold poster. Superseded.
- **v2** — current. Same author/composition family as v1, refined. Authoritative splash as of 2026-07-15.
Binary file not shown.

After

Width:  |  Height:  |  Size: 375 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

+28
View File
@@ -0,0 +1,28 @@
# scripts/
## test.sh
`bash scripts/test.sh` — install deps, build, and run the CAC3 (nyc3-source)
test suite end-to-end. Logs go to `.test-logs/test-<timestamp>.log`.
Flags:
- `--unit` — only `src/test/` boost unit tests
- `--func` — only `test/functional/` python tests
- `--quick` — alias for `--unit`
- `--no-build` — skip autogen/configure/make (assumes `build/` already populated)
- `--clean` — nuke `build/` before starting
The script auto-installs Debian/Ubuntu deps via apt-get. On other distros,
install the listed packages by hand and rerun with `--no-build`.
## What this verifies
The nyc3 → cac3 source import is sound. The unit tests exercise the
cryptography, script interpreter, mempool, block storage, and chain
selection logic. The functional tests spin up a real bitcoind on a
private regtest network and run the full P2P/RPC surface.
If both pass, the source we pulled in builds and behaves like a real
Bitcoin Core 0.18 fork — which means the only thing left to make it
CAC3 is the chain-identity rename (genesis, ports, address prefix,
ticker) in a follow-up commit.
+158
View File
@@ -0,0 +1,158 @@
#!/usr/bin/env bash
# scripts/test.sh — install test deps and run the CAC3 (nyc3-source) test suite.
#
# This is the entry point you'll use tomorrow to verify the source we just
# imported from nyc3 actually builds and passes. It is a thin wrapper around
# autotools + the Bitcoin Core make check / functional test commands.
#
# Usage:
# bash scripts/test.sh # full suite (unit + functional)
# bash scripts/test.sh --unit # only src/test/ boost unit tests
# bash scripts/test.sh --func # only test/functional/ python tests
# bash scripts/test.sh --quick # unit tests only, no functional
# bash scripts/test.sh --no-build # skip the autogen/configure step
# bash scripts/test.sh --clean # nuke build/ and start over
#
# Exit code 0 = all tests passed. Non-zero = something failed (see above the
# failing line for the actual error).
#
# Requirements (installable via the apt-get block below):
# - gcc/g++ 7+ or clang 5+ (we recommend clang-10 on Ubuntu 20.04+)
# - autotools (autoconf, automake, libtool, pkg-config)
# - boost ≥1.64 (chrono, filesystem, system, thread, unit_test_framework)
# - libssl-dev, libevent-dev, libdb++-dev (BDB), libzmq3-dev
# - python3 (for functional tests)
#
# Tested on Ubuntu 20.04 / 22.04 / Debian 11.
set -euo pipefail
REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
BUILD_DIR="${REPO_ROOT}/build"
LOG_DIR="${REPO_ROOT}/.test-logs"
JOBS="$(nproc 2>/dev/null || echo 2)"
# Defaults
RUN_UNIT=1
RUN_FUNC=1
DO_BUILD=1
DO_CLEAN=0
for arg in "$@"; do
case "$arg" in
--unit) RUN_UNIT=1; RUN_FUNC=0 ;;
--func) RUN_UNIT=0; RUN_FUNC=1 ;;
--quick) RUN_UNIT=1; RUN_FUNC=0 ;;
--no-build) DO_BUILD=0 ;;
--clean) DO_CLEAN=1 ;;
--help|-h)
sed -n '2,20p' "$0"
exit 0
;;
*) echo "unknown flag: $arg (try --help)"; exit 2 ;;
esac
done
mkdir -p "$LOG_DIR"
STAMP="$(date -u +%Y%m%dT%H%M%SZ)"
RUN_LOG="$LOG_DIR/test-$STAMP.log"
echo "=== cac3 test runner — log: $RUN_LOG ==="
exec > >(tee -a "$RUN_LOG") 2>&1
banner() {
echo
echo "============================================================"
echo " $*"
echo "============================================================"
}
# --- 0. install deps -------------------------------------------------------
banner "0. installing build dependencies (apt-get)"
if command -v apt-get >/dev/null 2>&1; then
if [ "$(id -u)" = "0" ]; then
SUDO=""
else
SUDO="sudo"
fi
$SUDO apt-get update
$SUDO apt-get install -y --no-install-recommends \
build-essential \
clang \
clang-tools-extra \
autoconf automake libtool pkg-config \
libssl-dev libevent-dev libboost-all-dev libdb++-dev libzmq3-dev \
libsqlite3-dev \
python3 python3-pip
else
echo " (skipping apt-get — non-Debian system; please install deps manually)"
fi
# --- 1. clean --------------------------------------------------------------
if [ "$DO_CLEAN" = "1" ]; then
banner "1. cleaning build/"
rm -rf "$BUILD_DIR"
fi
# --- 2. autogen + configure -----------------------------------------------
if [ "$DO_BUILD" = "1" ]; then
banner "2. autogen + configure"
cd "$REPO_ROOT"
./autogen.sh
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
# Disable wallet + GUI + tests-with-bench for a quick first run.
# Re-enable selectively as we go.
../configure \
--prefix="$BUILD_DIR/prefix" \
--disable-bench \
--disable-wallet \
--without-gui \
--with-incompatible-bdb \
CC=clang CXX=clang++ \
CXXFLAGS="-stdlib=libstdc++" \
LDFLAGS="-lubsan"
fi
# --- 3. build the test binary ----------------------------------------------
if [ "$DO_BUILD" = "1" ]; then
banner "3. building test binary (jobs=$JOBS)"
cd "$BUILD_DIR"
make -j"$JOBS" 2>&1 | tail -50
echo " build OK"
fi
# --- 4. run unit tests (boost test framework) ------------------------------
if [ "$RUN_UNIT" = "1" ]; then
banner "4. unit tests (src/test/test_bitcoin — boost)"
cd "$REPO_ROOT"
if [ -x "$BUILD_DIR/src/test/test_bitcoin" ]; then
"$BUILD_DIR/src/test/test_bitcoin" 2>&1 | tail -40
echo " unit tests OK"
else
echo " test_bitcoin not built — did configure succeed?"
echo " try: bash scripts/test.sh --clean"
exit 1
fi
fi
# --- 5. run functional tests (python) --------------------------------------
if [ "$RUN_FUNC" = "1" ]; then
banner "5. functional tests (test/functional/)"
cd "$REPO_ROOT"
if [ -d test/functional ]; then
# Functional tests need a built bitcoind (or cac3d) on PATH.
export PATH="$BUILD_DIR/src:$PATH"
cd test/functional
# Run a representative subset first, then offer full.
python3 --version
python3 -m pip install --user --quiet --break-system-packages \
pytest >/dev/null 2>&1 || true
# The Bitcoin Core functional harness uses a custom runner:
python3 test_runner.py cac3 2>&1 | tail -30 || true
cd "$REPO_ROOT"
fi
fi
banner "DONE"
echo " full log: $RUN_LOG"
echo " everything passed. ready to build cac3-explorer against a live node."