Commit graph

30 commits

Author SHA1 Message Date
johba
ca2bc03567 fix: feat: basic analytics funnel tracking for launch readiness (#1101)
Add self-hosted Umami analytics to replace the third-party cloud.umami.is
tracker. Creates @harb/analytics package with typed event helpers and
instruments the conversion funnel: CTA clicks (landing), wallet connect,
swap initiated, and stake created (web-app).

- Add Umami Docker service sharing existing postgres (separate DB)
- Add Caddy /analytics route to proxy Umami dashboard
- Configure via VITE_UMAMI_URL and VITE_UMAMI_WEBSITE_ID env vars
- Document setup and funnel events in docs/ENVIRONMENT.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:04:24 +00:00
openhands
45770d274f fix: webapp-entrypoint.sh and e2e.yml hardcode Sepolia SwapRouter (#951) 2026-03-18 11:07:17 +00:00
openhands
9b7143af55 fix: bootstrap.sh hardcodes BASE_SEPOLIA_LOCAL_FORK even on mainnet forks (#746)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 22:36:52 +00:00
openhands
404bbd2b21 fix: bootstrap.sh hardcodes BASE_SEPOLIA_LOCAL_FORK even on mainnet forks (#746)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 22:07:22 +00:00
openhands
89580171b7 fix: DeployLocal.sol feeDest 0xf6a3... may have code on Base Sepolia fork (#760) 2026-03-14 20:21:32 +00:00
openhands
dbf78de793 fix: bootstrap + red-team on forked networks
Bootstrap fixes:
- Idempotency check: skip if Kraiken already deployed on Anvil
- anvil_setCode to strip ERC-4337 code from deployer + feeDest
- DeployLocal.sol: feeDest derived from keccak256('harb.local.feeDest')

Red-team fixes:
- New bootstrap-light.sh: Anvil-only, ~30s deploy
- red-team.sh uses bootstrap-light instead of full docker compose
- anvil_setBalance for feeDest before impersonation
- forge --color never, path resolution, docker chown

Address fixes (all Base mainnet, in both FitnessEvaluator + AttackRunner):
- V3_FACTORY: 0x33128a8fC17869897dcE68Ed026d694621f6FDfD
- SWAP_ROUTER: 0x2626664c2603336E57B271c5C0b26F421741e481
- NPM_ADDR: 0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1
2026-03-14 13:31:23 +00:00
openhands
02b055ceb9 fix: move VWAP bootstrap from forge script to bootstrap-common.sh
vm.warp in forge script --broadcast only affects the local simulation
phase, not the actual Anvil node.  The pool.observe([300,0]) call in
recenter() therefore reverted with OLD when Forge pre-flighted the
broadcast transactions on Anvil.

Fix:
- Remove the vm.warp + 2-recenter + SeedSwapper VWAP bootstrap from
  DeployLocal.sol (only contract deployment now, simpler and reliable).
- Add bootstrap_vwap() to bootstrap-common.sh that uses Anvil RPC
  evm_increaseTime + evm_mine to advance chain time before each recenter,
  then executes a 0.5 ETH WETH->KRK seed swap between them.
- Call bootstrap_vwap() before fund_liquidity_manager() in both
  containers/bootstrap.sh and ci-bootstrap.sh so the LM is seeded with
  thin positions (1 ETH) during bootstrap, ensuring the 0.5 ETH swap
  moves the price >400 ticks (amplitude gate).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 23:28:52 +00:00
openhands
1a410a30b7 fix: Remove recenterAccess — make recenter() public with TWAP enforcement (#706) 2026-03-13 22:32:53 +00:00
openhands
6c54a92657 fix: webapp-entrypoint.sh CI path bypasses contracts.env sourcing without documentation (#422)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 07:24:54 +00:00
openhands
d301f75523 fix: webapp-entrypoint.sh CI path bypasses contracts.env sourcing without documentation (#422)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 07:01:07 +00:00
openhands
1abe51b348 fix: Add cache headers to Ponder GraphQL proxy in Caddy (#447) 2026-03-06 02:30:56 +00:00
openhands
a46c30cff6 fix: landing page user test fixes (#162)
- Add VueQueryPlugin to landing main.ts (wagmi/vue requires it)
- Add Vite proxy for /api/graphql → ponder:42069/graphql
- Replace axios with native fetch in WalletCard.vue
- Add navigateTo() for CTA buttons (uses VITE_APP_URL env)
- Load contract addresses from bootstrap in landing entrypoint
- Add via_ir to foundry.toml (OptimizerV3Push3 stack-too-deep)
- Add VITE_APP_URL env to docker-compose landing service

Fixes: blank landing pages, broken LiveStats, missing CTA links,
missing contract addresses in footer
2026-02-23 14:47:38 +00:00
johba
31063379a8 feat/ponder-lm-indexing (#142) 2026-02-18 00:19:05 +01:00
openhands
37b1002dae feat: add Otterscan block explorer to dev environment (#109)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:55:07 +00:00
johba
e5e1308e72 refactor: consolidate CI and local dev orchestration (#108)
## Summary
- Extract shared bootstrap functions into `scripts/bootstrap-common.sh` (eliminates ~120 lines of duplicated forge/cast commands from e2e.yml)
- Create reusable `scripts/wait-for-service.sh` for health checks (replaces 60-line inline wait-for-stack)
- Merge dev and CI entrypoints into unified scripts branching on `CI` env var (delete `docker/ci-entrypoints/`)
- Replace 4 per-service CI Dockerfiles with parameterized `docker/Dockerfile.service-ci`
- Add `sync-tax-rates.mjs` to CI image builder stage
- Fix: CI now grants txnBot recenter access (was missing)
- Fix: txnBot funding parameterized (CI=10eth, local=1eth)
- Delete 5 obsolete migration docs and 4 DinD integration files

Net: -1540 lines removed

Closes #107

## Test plan
- [ ] E2E pipeline passes (bootstrap sources shared script, services use old images with commands override)
- [ ] build-ci-images pipeline builds all 4 services with unified Dockerfile
- [ ] Local dev stack boots via `./scripts/dev.sh start`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/108
2026-02-03 12:07:28 +01:00
johba
1c6f118f6b fix/node-modules-named-volumes (#94)
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/94
2025-11-13 18:17:56 +01:00
johba
5d71753086 migrate/podman-to-docker (#92)
podman to docker

Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/92
2025-11-08 14:08:46 +01:00
openhands
3564a36408 config: add configurable RPC timeout for Ponder stability
Adds PONDER_RPC_TIMEOUT environment variable to improve Ponder
stability on slow RPC connections or under load. Default is 20000ms
(20 seconds).

## Changes
- containers/ponder-dev-entrypoint.sh: Export PONDER_RPC_TIMEOUT with default of 20000ms
- podman-compose.yml: Add PONDER_RPC_TIMEOUT to ponder service environment

## Configuration
The timeout can be overridden by setting PONDER_RPC_TIMEOUT in your
environment before starting the stack:
```bash
export PONDER_RPC_TIMEOUT=30000  # 30 seconds
./scripts/dev.sh start
```

## Impact
- Low risk: Configuration-only change
- No breaking changes
- Improves stability on slower networks or forked environments
- Defaults to 20 seconds if not specified

Fixes #87

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-06 08:58:31 +00:00
johba
371a8557b7 improve web-app config 2025-10-11 10:55:49 +00:00
johba
f7ef56f65f reworked stack 2025-10-07 21:57:32 +00:00
johba
1645865c5a first integration tests (#64)
resolves #60

Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/64
2025-10-05 19:40:14 +02:00
johba
d6f0bf4f02 ponder speedup (#59)
Successfully applied and tested the bootstrap speedup optimizations. Here's what was accomplished:                                                                                                                                                                                                  Fixes Applied
                                                                                                                                                    1. podman-compose.yml - Changed ponder dependency from service_started to service_completed_successfully to eliminate race condition
  2. services/ponder/src/helpers/stats.ts - Fixed two context errors:                                                                                 - Used START_BLOCK from environment instead of context.network.contracts.Kraiken.startBlock                                                       - Added console fallback for context.logger (undefined in block handlers)
  Test Results                                                                                                                                                                                                                                                                                        Core Services:  All Healthy                                                                                                                     - Anvil (blockchain): Running, healthy                                                                                                            - Postgres (database): Running, healthy
  - Ponder (indexer): Running, healthy                                                                                                              - Bootstrap: Completed successfully (exit code 0)                                                                                                                                                                                                                                                   GraphQL API:  Working                                                                                                                           {"data":{"stats":{"kraikenTotalSupply":"413226953999797390248016","outstandingStake":"0"}}}
                                                                                                                                                    Bootstrap Optimizations:  Confirmed
  -  Reduced mining from 2000 to 200 blocks                                                                                                       -  Batch mining support (anvil_mine RPC)                                                                                                        -  Dependency caching with marker files                                                                                                         -  Ponder waits for bootstrap completion (no more stale .env.local issues)                                                                                                                                                                                                                        Timing: Bootstrap completes in ~20 seconds (vs 90+ seconds previously - approximately 75% faster)
                                                                                                                                                    The optimization branch is working correctly. The core issue (ponder race condition) has been fixed and ponder now successfully queries           contract data after bootstrap completes.

Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/59
2025-10-04 18:08:10 +02:00
johba
514be62cbb txnbot - rewrite and lint (#53)
resolves #46

Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/53
2025-10-04 15:40:30 +02:00
johba
4f7cebda56 start stack from container (#40)
resolves #36

Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/40
2025-10-02 17:11:22 +02:00
johba
3a7162462b startup-optimizations (#48)
resolves #34

Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/48
2025-10-02 17:00:21 +02:00
johba
3ab2d9454a health checks (#39)
resolves #35

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/39
2025-10-02 14:37:59 +02:00
johba
a29ca1a26a Harden kraiken-lib watch loop and confirm host-built dist propagation (#38)
- expand scripts/watch-kraiken-lib.sh to watch atomic rename events, validate required tools, and gracefully restart only the containers that mount kraiken-
  lib/dist
  - verify the host-built dist is mounted read-only inside each service and observe live rebuild + restart behavior under inotify
  - run the local podman stack, exercise the watcher by editing kraiken-lib/src/helpers.ts, and confirm GraphQL responds through Caddy after restarts

resolves #33

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/38
2025-10-02 14:33:59 +02:00
johba
b4c829e4d6 fix/podman-postgres-integration (#37)
resolves #25

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/37
2025-10-01 20:26:49 +02:00
root
ea27fcb722 feat: Complete Podman stack setup with working services
- Fixed service dependencies (removed bootstrap dependency for runtime services)
- Added landing service for documentation site at root path
- Moved web-app to /app path, landing to / path
- Fixed permission issues with lowercase 'z' SELinux context
- Added kraiken-lib compilation in txn-bot container
- Fixed TypeScript build for kraiken-lib with proper volumes
- Updated entrypoint scripts to handle npm installs properly
- Added locale fixes to Containerfiles
- Changed Caddy port from 80 to 8081 for external access
- Updated Docs link to point to local landing page

All services now working:
- Landing page at /
- Web app at /app/
- GraphQL at /graphql
- Transaction bot at /txn
- Anvil RPC at /rpc/anvil

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 12:12:54 +00:00
johba
18d63e14d7 podman wip 2025-09-24 12:12:54 +00:00