Skip to content

feat: use arkade-regtest for regtest environment#492

Merged
Kukks merged 52 commits intomasterfrom
feat/use-arkade-regtest
Apr 4, 2026
Merged

feat: use arkade-regtest for regtest environment#492
Kukks merged 52 commits intomasterfrom
feat/use-arkade-regtest

Conversation

@Kukks
Copy link
Copy Markdown
Contributor

@Kukks Kukks commented Mar 28, 2026

Summary

  • Replace custom test infrastructure (test.docker-compose.yml, Dockerfiles, cors config) with shared arkade-regtest submodule
  • start-env.sh handles full stack: nigiri, custom arkd v0.9.1, boltz, LND, fulmine, wallet setup
  • Wallet-specific config via .env.regtest (SESSION_DURATION=10, LOG_LEVEL=6, zero fees)
  • Nostr relay (nak) kept as wallet-specific docker-compose overlay
  • Fixed CORS headers on Boltz restore/rescue nginx proxy endpoints (missing headers prevented swap restoration)

Test plan

  • All 74 Playwright e2e tests pass (including restore test with chain swap)
  • Verify arkd v0.9.1 works with arkade-regtest overlay
  • Verify nostr relay accessible at ws://localhost:10547
  • Verify boltz pairs load at http://localhost:9069
  • Reverse + submarine + chain swap restore works after wallet reset

Replace custom test infrastructure with shared arkade-regtest submodule.
start-env.sh handles the full stack: nigiri, custom arkd v0.9.1,
boltz, LND, fulmine, wallet creation, and funding.

- Add regtest/ submodule with arkade-regtest
- Add .env.regtest for wallet-specific overrides (v0.9.1, session=10)
- Add docker-compose.nak.yml for nostr relay (wallet-specific)
- Simplify setup.mjs to verification-only (infra handled by start-env.sh)
- Update playwright.yml to use submodule + setup-go for nigiri build
- Remove old test.docker-compose.yml, Dockerfiles, cors config
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 28, 2026

Deploying wallet-mutinynet with  Cloudflare Pages  Cloudflare Pages

Latest commit: d6f58a8
Status: ✅  Deploy successful!
Preview URL: https://ae2ff712.arkade-wallet.pages.dev
Branch Preview URL: https://feat-use-arkade-regtest.arkade-wallet.pages.dev

View logs

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 28, 2026

🔍 Arkana PR Review — wallet#492

Scope: Replace custom test infra (docker-compose, Dockerfiles, cors config) with shared arkade-regtest submodule.

What Changed

  • Deleted: arkd.Dockerfile, arkdwallet.Dockerfile, cors.Dockerfile, cors.nginx.conf, test.docker-compose.yml (412 lines of infra removed)
  • Added: regtest submodule pointing to ArkLabsHQ/arkade-regtest at feat/shared-regtest-env-discovery
  • Added: .env.regtest with wallet-specific pins (arkd v0.9.1, SESSION_DURATION=10, LOG_LEVEL=6)
  • Simplified: src/test/setup.mjs from ~300 lines of infra setup to ~30 lines of service verification
  • Added: docker-compose.nak.yml for wallet-specific nostr relay (stays as overlay — correct, this is wallet-specific)

Architecture

Good separation: infrastructure → arkade-regtest submodule, wallet-specific services (nostr relay) → local overlay. The setup.mjs reduction is clean — it now just verifies services are running rather than creating them.

Issues

1. Submodule tracks feature branch, not master (expected)
.gitmodules pins to branch = feat/shared-regtest-env-discovery. This needs updating once arkade-regtest#1 merges. Consider removing the branch line after merge — submodules don't need it when tracking a specific commit.

2. setup.mjsexecCommand is now sync but called with await in some places
The refactored execCommand is no longer async (returns directly instead of wrapping in a Promise), but waitForService still uses async/await pattern correctly for the sleep loop. Looks correct — just noting the sync/async cleanup is a good simplification.

3. CI workflow: sleep 5 before Playwright tests

- name: Run Playwright tests
  run: sleep 5 && pnpm run test:e2e

The pnpm regtest:setup step already waits for services via waitForService(). The extra sleep 5 is belt-and-suspenders — fine but could be removed if setup verification is reliable.

4. CI: Go 1.23 required for nigiri build
Good — this is needed because arkade-regtest/start-env.sh builds nigiri from source. The cache key nigiri-${{ hashFiles('regtest/.env.defaults', '.env.regtest') }} is well-chosen.

5. CI: Failure log capture is comprehensive
The docker logs step captures ark, ark-wallet, boltz, boltz-lnd, boltz-fulmine, and nak. Good for debugging CI failures.

6. ARKD_BOARDING_EXIT_DELAY=1024 in .env.regtest
This overrides the arkade-regtest default of 2048. Make sure the Playwright e2e tests expect this value — if any test checks round parameters, it'll need to match.

Cross-Repo

  • Depends on ArkLabsHQ/arkade-regtest#1 (submodule source)
  • Part of the shared regtest rollout alongside upcoming ts-sdk, boltz-swap, dotnet-sdk PRs

Verdict

Clean infrastructure consolidation. ~400 lines of bespoke Docker infra deleted, replaced by a submodule reference. The nostr relay overlay is correctly kept local. CI workflow is well-structured with proper caching, failure capture, and cleanup. Main action item: update submodule ref once arkade-regtest merges to master.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 28, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Moves regtest orchestration into an external submodule and shell scripts, adds .env.regtest, deletes local Dockerfiles and the monolithic test.docker-compose.yml, introduces docker-compose.nak.yml, updates CI to run the regtest scripts and nak compose, updates npm regtest scripts, and simplifies test setup to health-check verification. (49 words)

Changes

Cohort / File(s) Summary
Regtest env & submodule
\.env.regtest, \.gitmodules, regtest
Adds .env.regtest with pinned images and arkd runtime flags; registers a regtest git submodule and advances its commit pointer.
CI workflow
.github/workflows/playwright.yml
Replaces Nigiri action with explicit submodule checkout, installs Go, makes regtest scripts executable, runs ./regtest/start-env.sh, brings up docker compose -f docker-compose.nak.yml (nak), switches to pnpm regtest:setup, captures logs on failure, and always runs cleanup.
Removed local build artifacts & configs
arkd.Dockerfile, arkdwallet.Dockerfile, cors.Dockerfile, cors.nginx.conf, test.docker-compose.yml
Removes local Dockerfiles, NGINX CORS config, and the large multi-service test.docker-compose.yml test stack.
New compose & service
docker-compose.nak.yml
Adds a compact Compose file defining a nak service (builds from repo, exposes port 10547) attached to external nigiri network.
NPM scripts
package.json
Removes old regtest build/up/down scripts; adds regtest:start, regtest:stop, regtest:clean that call ./regtest/*.sh and docker compose -f docker-compose.nak.yml variants; keeps regtest:setup.
Test setup simplification
src/test/setup.mjs
Strips extensive provisioning and async helpers; replaces async exec with sync execCommand, adds generic waitForService, and reduces setup() to a few HTTP health checks (arkd, boltz, nostr).

Sequence Diagram(s)

sequenceDiagram
    participant GHA as "GitHub Actions"
    participant Repo as "Repository + Submodule"
    participant Scripts as "regtest/*.sh"
    participant Compose as "Docker Compose (docker-compose.nak.yml)"
    participant Services as "Regtest Services (arkd, boltz, nostr, nak)"
    participant Verify as "pnpm regtest:setup (healthchecks)"
    participant Tests as "Playwright Tests"

    GHA->>Repo: checkout with submodules
    GHA->>GHA: install Go 1.23 & cache builds
    GHA->>Scripts: chmod +x regtest/*.sh
    GHA->>Scripts: ./regtest/start-env.sh
    Scripts->>Services: initialize regtest environment (submodule-managed)
    GHA->>Compose: docker compose -f docker-compose.nak.yml up -d --build (nak)
    GHA->>Verify: pnpm regtest:setup (curl health endpoints)
    Verify->>Services: curl /v1/info, boltz endpoints, nostr
    Services-->>Verify: readiness responses
    GHA->>Tests: run Playwright tests
    Tests-->>GHA: results
    alt Failure
        GHA->>Services: docker compose logs capture (selected services)
    end
    GHA->>Scripts: ./regtest/clean-env.sh
    GHA->>Compose: docker compose -f docker-compose.nak.yml down -v
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: use arkade-regtest for regtest environment' directly and clearly describes the main change: migrating from custom regtest infrastructure to using the arkade-regtest submodule.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/use-arkade-regtest

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (3)
src/test/setup.mjs (2)

7-18: execCommand function appears to be unused.

This function is defined but the code uses execSync directly at line 46. Consider removing this dead code, or refactoring line 46 to use execCommand for consistency.

#!/bin/bash
# Verify execCommand usage in this file
echo "=== Searching for execCommand usage ==="
rg -n 'execCommand' src/test/setup.mjs
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/test/setup.mjs` around lines 7 - 18, The execCommand function is defined
but unused; either remove execCommand() entirely or replace the direct
execSync(...) call that appears elsewhere with execCommand(...) to centralize
error handling; locate the unused function named execCommand and the direct call
to execSync and either delete execCommand (if you prefer direct calls) or
refactor the execSync invocation to call execCommand(command, silent) so the
special-case "wallet already initialized" handling is applied consistently.

46-47: Consider using execCommand or add error handling for the JSON parse.

Line 46 uses execSync directly instead of execCommand. If the curl fails or returns invalid JSON, this will throw an unhandled exception. Either use execCommand with silent=true or wrap in try-catch.

Proposed improvement
-    const serverInfo = JSON.parse(execSync('curl -s http://localhost:7070/v1/info').toString())
+    const serverInfo = JSON.parse(execCommand('curl -s http://localhost:7070/v1/info', true))
     console.log(`\narkd Public Key: ${serverInfo.signerPubkey}`)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/test/setup.mjs` around lines 46 - 47, Replace the direct use of execSync
+ JSON.parse with a safe approach: either call execCommand('curl -s
http://localhost:7070/v1/info', { silent: true }) and handle its stdout, or wrap
the execSync + JSON.parse block in a try-catch around JSON.parse and the exec
call to handle non-JSON or failed curl responses; ensure you check for empty
stdout before JSON.parse, log or throw a descriptive error referencing
serverInfo/console.log usage, and keep references to execSync/execCommand and
serverInfo so the change is easy to locate.
.gitmodules (1)

1-4: Submodule points to a feature branch; update to a stable branch once the feature is complete.

The feat/shared-regtest-env-discovery branch exists and currently works, but relying on a feature branch for a submodule reference can break if the branch is deleted after the feature is merged. Consider updating to master once the feature stabilizes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.gitmodules around lines 1 - 4, The .gitmodules entry for submodule
"regtest" currently pins branch = feat/shared-regtest-env-discovery which is a
feature branch; update the submodule configuration to point to a stable branch
(e.g., change branch = feat/shared-regtest-env-discovery to branch = master or
main) once the feature is merged and stable, and ensure the submodule commit is
updated (git submodule sync && git submodule update --remote regtest or update
the submodule to the correct commit) so the "regtest" submodule no longer tracks
the feature branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/playwright.yml:
- Around line 19-22: Update the Playwright workflow cache key so it includes the
regtest submodule revision to invalidate caches when the submodule changes:
modify the actions/cache key (the existing nigiri-${{
hashFiles('regtest/.env.defaults', '.env.regtest') }} value) to append a
submodule identifier — e.g., add the .gitmodules file hash or the current commit
SHA — so the cache key becomes the original env hash plus either
hashFiles('.gitmodules') or github.sha to ensure regtest updates bust the cache.

In `@package.json`:
- Line 52: The package.json "regtest:clean" script currently chains
"./regtest/clean-env.sh && docker compose -f docker-compose.nak.yml down -v" so
the Docker teardown is skipped if clean-env.sh fails; change the order to run
the Docker compose teardown first (docker compose -f docker-compose.nak.yml down
-v) with best-effort error handling (so it won't stop on non-zero exit), then
run "./regtest/clean-env.sh" afterward; update the "regtest:clean" npm script
accordingly so the teardown always attempts to run even when clean-env.sh fails.
- Line 51: The regtest:stop npm script references a non-existent script
regtest/stop-env.sh; update the package.json "regtest:stop" entry to call the
existing teardown script (the regtest:clean target which runs
regtest/clean-env.sh and brings down Docker) or add a new regtest/stop-env.sh
that performs the same teardown; specifically, modify the "regtest:stop" script
string to invoke the working regtest:clean command (or create the missing
regtest/stop-env.sh in the submodule) so pnpm regtest:stop no longer fails due
to a missing file.

In `@src/test/setup.mjs`:
- Around line 11-13: The catch block checks error.stderr.includes but stderr may
be a Buffer or undefined; update the condition to coerce/convert stderr to a
string and guard for undefined (e.g., use error.stderr?.toString() or
String(error.stderr)) before calling includes so the check in the catch (the
wallet already initialized branch) won't throw or silently fail; locate the
catch handling the variable error and change the stderr check accordingly.

---

Nitpick comments:
In @.gitmodules:
- Around line 1-4: The .gitmodules entry for submodule "regtest" currently pins
branch = feat/shared-regtest-env-discovery which is a feature branch; update the
submodule configuration to point to a stable branch (e.g., change branch =
feat/shared-regtest-env-discovery to branch = master or main) once the feature
is merged and stable, and ensure the submodule commit is updated (git submodule
sync && git submodule update --remote regtest or update the submodule to the
correct commit) so the "regtest" submodule no longer tracks the feature branch.

In `@src/test/setup.mjs`:
- Around line 7-18: The execCommand function is defined but unused; either
remove execCommand() entirely or replace the direct execSync(...) call that
appears elsewhere with execCommand(...) to centralize error handling; locate the
unused function named execCommand and the direct call to execSync and either
delete execCommand (if you prefer direct calls) or refactor the execSync
invocation to call execCommand(command, silent) so the special-case "wallet
already initialized" handling is applied consistently.
- Around line 46-47: Replace the direct use of execSync + JSON.parse with a safe
approach: either call execCommand('curl -s http://localhost:7070/v1/info', {
silent: true }) and handle its stdout, or wrap the execSync + JSON.parse block
in a try-catch around JSON.parse and the exec call to handle non-JSON or failed
curl responses; ensure you check for empty stdout before JSON.parse, log or
throw a descriptive error referencing serverInfo/console.log usage, and keep
references to execSync/execCommand and serverInfo so the change is easy to
locate.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c31b5dcd-65d4-4392-9abd-85db6162d697

📥 Commits

Reviewing files that changed from the base of the PR and between 392e244 and d0dda55.

📒 Files selected for processing (12)
  • .env.regtest
  • .github/workflows/playwright.yml
  • .gitmodules
  • arkd.Dockerfile
  • arkdwallet.Dockerfile
  • cors.Dockerfile
  • cors.nginx.conf
  • docker-compose.nak.yml
  • package.json
  • regtest
  • src/test/setup.mjs
  • test.docker-compose.yml
💤 Files with no reviewable changes (5)
  • arkd.Dockerfile
  • test.docker-compose.yml
  • arkdwallet.Dockerfile
  • cors.nginx.conf
  • cors.Dockerfile

Comment on lines +19 to +22
- uses: actions/cache@v4
with:
path: regtest/_build
key: nigiri-${{ hashFiles('regtest/.env.defaults', '.env.regtest') }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
echo "regtest submodule ref:"
git ls-tree HEAD regtest
echo
echo "Workflow cache stanza:"
sed -n '19,22p' .github/workflows/playwright.yml

Repository: arkade-os/wallet

Length of output: 317


🏁 Script executed:

find . -name "start-env.sh" -o -name "clean-env.sh" | head -20

Repository: arkade-os/wallet

Length of output: 42


🏁 Script executed:

cat -n .github/workflows/playwright.yml

Repository: arkade-os/wallet

Length of output: 2258


🏁 Script executed:

# Check if regtest/_build is mentioned anywhere in the codebase
rg "regtest/_build" --type yaml --type sh

Repository: arkade-os/wallet

Length of output: 42


🏁 Script executed:

# Check if regtest directory exists and what's in it
ls -la regtest/ 2>/dev/null | head -20

Repository: arkade-os/wallet

Length of output: 170


🏁 Script executed:

# Look for start-env.sh specifically in regtest
find regtest -name "*.sh" -type f 2>/dev/null | head -20

Repository: arkade-os/wallet

Length of output: 42


🏁 Script executed:

# Check if regtest is a submodule or a regular directory
git config --file=.gitmodules --get-regexp "^submodule\.regtest"

Repository: arkade-os/wallet

Length of output: 219


🏁 Script executed:

# Check what git ls-tree shows for regtest subdirectories
git ls-tree -r HEAD regtest | head -30

Repository: arkade-os/wallet

Length of output: 122


🏁 Script executed:

# Check .gitmodules to see submodule configuration
cat .gitmodules

Repository: arkade-os/wallet

Length of output: 196


🏁 Script executed:

# Look for any documentation or comments in the workflow about submodule handling
head -n 40 .github/workflows/playwright.yml

Repository: arkade-os/wallet

Length of output: 1259


🏁 Script executed:

# Check if there are other workflows that handle submodule caching differently
find .github/workflows -name "*.yml" -o -name "*.yaml" | xargs grep -l "cache" 2>/dev/null

Repository: arkade-os/wallet

Length of output: 117


🏁 Script executed:

# Check the ci.yml workflow for cache patterns
cat .github/workflows/ci.yml

Repository: arkade-os/wallet

Length of output: 1021


🏁 Script executed:

# Since regtest is a submodule and it's checked out, let's verify the concern:
# The cache key does NOT include the submodule commit hash.
# Let's check if there's any documentation about this in the repo
find . -name "README*" -o -name "CONTRIBUTING*" | xargs grep -l "cache\|submodule" 2>/dev/null || echo "No matches in docs"

Repository: arkade-os/wallet

Length of output: 1565


🏁 Script executed:

# Check if there are any recent commits that mention cache invalidation or submodule
git log --oneline --all -n 20 2>/dev/null | head -20

Repository: arkade-os/wallet

Length of output: 1370


Include the submodule commit hash in the cache key to ensure invalidation when regtest is updated.

The cache key at lines 19-22 hashes only .env files but ignores the regtest submodule revision. When the submodule is bumped, the cache key remains unchanged, causing old build artifacts to be reused with new source code. This can lead to CI testing against stale artifacts, invalidating test results.

Add the submodule commit to the cache key:

key: nigiri-${{ hashFiles('regtest/.env.defaults', '.env.regtest') }}-${{ hashFiles('.gitmodules') }}

or use git commit tracking:

key: nigiri-${{ hashFiles('regtest/.env.defaults', '.env.regtest') }}-${{ github.sha }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/playwright.yml around lines 19 - 22, Update the Playwright
workflow cache key so it includes the regtest submodule revision to invalidate
caches when the submodule changes: modify the actions/cache key (the existing
nigiri-${{ hashFiles('regtest/.env.defaults', '.env.regtest') }} value) to
append a submodule identifier — e.g., add the .gitmodules file hash or the
current commit SHA — so the cache key becomes the original env hash plus either
hashFiles('.gitmodules') or github.sha to ensure regtest updates bust the cache.

"regtest:up": "docker compose -f test.docker-compose.yml up arkd arkd-wallet nbxplorer pgnbxplorer -d",
"regtest:down": "docker compose -f test.docker-compose.yml down -v",
"regtest:start": "./regtest/start-env.sh && docker compose -f docker-compose.nak.yml up -d",
"regtest:stop": "./regtest/stop-env.sh && docker compose -f docker-compose.nak.yml down",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
for f in regtest/start-env.sh regtest/stop-env.sh regtest/clean-env.sh; do
  if [ -e "$f" ]; then
    echo "FOUND $f"
  else
    echo "MISSING $f"
  fi
done

Repository: arkade-os/wallet

Length of output: 145


🏁 Script executed:

# Check if regtest is a git submodule and its configuration
cat .gitmodules 2>/dev/null || echo "No .gitmodules file"
echo "---"
git ls-files --stage | grep regtest || echo "No regtest in git index"
echo "---"
# Check what's actually in the regtest directory
ls -la regtest/ 2>/dev/null || echo "regtest directory not found"

Repository: arkade-os/wallet

Length of output: 508


🏁 Script executed:

# Check the CI workflow to see what it actually does
find .github/workflows -name "*.yml" -o -name "*.yaml" | head -5

Repository: arkade-os/wallet

Length of output: 117


🏁 Script executed:

# Check the package.json scripts around lines 50-52
sed -n '48,55p' package.json

Repository: arkade-os/wallet

Length of output: 516


🏁 Script executed:

# Check the CI workflow for submodule handling
cat .github/workflows/playwright.yml | head -50

Repository: arkade-os/wallet

Length of output: 1559


🏁 Script executed:

# Check the main CI workflow
cat .github/workflows/ci.yml | head -50

Repository: arkade-os/wallet

Length of output: 1021


🏁 Script executed:

# Get information about what's in the regtest submodule without cloning
git config --file .gitmodules --get submodule.regtest.url

Repository: arkade-os/wallet

Length of output: 107


🌐 Web query:

arkade-regtest repository github ArkLabsHQ scripts start-env.sh stop-env.sh clean-env.sh

💡 Result:

No public GitHub repository named "arkade-regtest" under ArkLabsHQ or arkade-os was found containing scripts start-env.sh, stop-env.sh, or clean-env.sh. ArkLabsHQ maintains Ark protocol repositories like introspector, fulmine, arkadian (which lists arkade-os repos including arkd, go-sdk), but no regtest-specific repo matches. arkade-os has repos like arkd (protocol server), go-sdk. Older ARK Core (unrelated) has e2e testing with docker scripts, but archived. These env.sh scripts are typical for local dev environments (e.g., Bitcoin regtest), likely private/internal for Ark protocol testing.

Citations:


🏁 Script executed:

# Check if there are any other cleanup steps in the playwright workflow
cat .github/workflows/playwright.yml | tail -20

Repository: arkade-os/wallet

Length of output: 753


🏁 Script executed:

# Check if stop-env.sh is referenced anywhere else in the codebase
rg "stop-env" --type sh --type js --type json

Repository: arkade-os/wallet

Length of output: 166


🏁 Script executed:

# Check if there are any other scripts in the regtest directory pattern
rg "regtest.*\\.sh" package.json

Repository: arkade-os/wallet

Length of output: 349


regtest:stop references a missing script.

The submodule contains start-env.sh and clean-env.sh (both verified in CI), but regtest/stop-env.sh does not exist. This makes pnpm regtest:stop fail immediately. Either add the missing script to the submodule or replace this command with the existing regtest:clean target, which properly tears down both the regtest environment and Docker containers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 51, The regtest:stop npm script references a
non-existent script regtest/stop-env.sh; update the package.json "regtest:stop"
entry to call the existing teardown script (the regtest:clean target which runs
regtest/clean-env.sh and brings down Docker) or add a new regtest/stop-env.sh
that performs the same teardown; specifically, modify the "regtest:stop" script
string to invoke the working regtest:clean command (or create the missing
regtest/stop-env.sh in the submodule) so pnpm regtest:stop no longer fails due
to a missing file.

"regtest:down": "docker compose -f test.docker-compose.yml down -v",
"regtest:start": "./regtest/start-env.sh && docker compose -f docker-compose.nak.yml up -d",
"regtest:stop": "./regtest/stop-env.sh && docker compose -f docker-compose.nak.yml down",
"regtest:clean": "./regtest/clean-env.sh && docker compose -f docker-compose.nak.yml down -v",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Check package.json around line 52
head -60 package.json | tail -15

Repository: arkade-os/wallet

Length of output: 679


🏁 Script executed:

# Check the workflow file referenced in the comment
if [ -f .github/workflows/playwright.yml ]; then
  sed -n '50,65p' .github/workflows/playwright.yml
fi

Repository: arkade-os/wallet

Length of output: 402


🏁 Script executed:

# Also check if clean-env.sh exists and what it does
if [ -f ./regtest/clean-env.sh ]; then
  cat ./regtest/clean-env.sh
fi

Repository: arkade-os/wallet

Length of output: 42


Reorder regtest:clean to ensure Docker teardown runs regardless of clean-env.sh success.

The current script uses && chaining, which skips the Docker teardown entirely if clean-env.sh exits non-zero. This leaves the wallet-specific nak overlay running after a partial failure. The safer pattern—already used in .github/workflows/playwright.yml lines 56-59—is to run the Docker teardown first with best-effort error handling, then run the cleanup script:

-    "regtest:clean": "./regtest/clean-env.sh && docker compose -f docker-compose.nak.yml down -v",
+    "regtest:clean": "docker compose -f docker-compose.nak.yml down -v 2>/dev/null || true; ./regtest/clean-env.sh",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"regtest:clean": "./regtest/clean-env.sh && docker compose -f docker-compose.nak.yml down -v",
"regtest:clean": "docker compose -f docker-compose.nak.yml down -v 2>/dev/null || true; ./regtest/clean-env.sh",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 52, The package.json "regtest:clean" script currently
chains "./regtest/clean-env.sh && docker compose -f docker-compose.nak.yml down
-v" so the Docker teardown is skipped if clean-env.sh fails; change the order to
run the Docker compose teardown first (docker compose -f docker-compose.nak.yml
down -v) with best-effort error handling (so it won't stop on non-zero exit),
then run "./regtest/clean-env.sh" afterward; update the "regtest:clean" npm
script accordingly so the teardown always attempts to run even when clean-env.sh
fails.

Comment on lines +11 to +13
} catch (error) {
if (error.stderr && error.stderr.toString().includes('wallet already initialized')) {
console.log('Wallet already initialized, continuing...')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Potential type issue: error.stderr may be a Buffer.

error.stderr from execSync errors is typically a Buffer, not a string. Call .toString() before .includes() to avoid silent failures.

Proposed fix
   } catch (error) {
-    if (error.stderr && error.stderr.toString().includes('wallet already initialized')) {
+    const stderr = error.stderr?.toString() ?? ''
+    if (stderr.includes('wallet already initialized')) {
       console.log('Wallet already initialized, continuing...')
       return ''
     }
     throw error
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} catch (error) {
if (error.stderr && error.stderr.toString().includes('wallet already initialized')) {
console.log('Wallet already initialized, continuing...')
} catch (error) {
const stderr = error.stderr?.toString() ?? ''
if (stderr.includes('wallet already initialized')) {
console.log('Wallet already initialized, continuing...')
return ''
}
throw error
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/test/setup.mjs` around lines 11 - 13, The catch block checks
error.stderr.includes but stderr may be a Buffer or undefined; update the
condition to coerce/convert stderr to a string and guard for undefined (e.g.,
use error.stderr?.toString() or String(error.stderr)) before calling includes so
the check in the catch (the wallet already initialized branch) won't throw or
silently fail; locate the catch handling the variable error and change the
stderr check accordingly.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 28, 2026

Deploying wallet-bitcoin with  Cloudflare Pages  Cloudflare Pages

Latest commit: d6f58a8
Status: ✅  Deploy successful!
Preview URL: https://d14e8b67.wallet-bitcoin.pages.dev
Branch Preview URL: https://feat-use-arkade-regtest.wallet-bitcoin.pages.dev

View logs

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 28, 2026

Review (iterative — new commit since last review)

New commit: fix: update arkade-regtest submodule (bitcoin restart after arkd init) — submodule bump to a5edba87.

Same fix as ts-sdk#386 and boltz-swap#106 — picks up the sequencing fix from arkade-regtest#1 that moves bitcoin Core restart after arkd wallet initialization, preventing nbxplorer ZMQ disconnects.

The wallet-specific .env.regtest looks correct: v0.9.1 pin, SESSION_DURATION=10 for fast test rounds, LOG_LEVEL=6 for verbose debugging, BOARDING_EXIT_DELAY=1024 matching the old test config.

The nostr relay overlay (docker-compose.nak.yml) is wallet-specific, which is the right design — it doesn't belong in the shared arkade-regtest.

No issues with the new commit.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 28, 2026

🔍 Arkana PR Review

PR: feat: use arkade-regtest for regtest environment

Overview

Replaces wallet's custom test infrastructure (arkd.Dockerfile, arkdwallet.Dockerfile, cors.Dockerfile, test.docker-compose.yml) with the shared arkade-regtest submodule. This is part of a coordinated migration across wallet, ts-sdk, and boltz-swap.

✅ What looks good

  • Clean removal of ~300 lines of duplicated Docker/compose infrastructure
  • Submodule approach ensures all repos use the same regtest baseline
  • Wallet-specific .env.regtest correctly pins to arkd v0.9.1 and preserves the wallet's existing config (BOARDING_EXIT_DELAY=1024, SESSION_DURATION=10, LOG_LEVEL=6)
  • Nostr relay kept as wallet-specific overlay in docker-compose.nak.yml — good separation
  • CI improvements: Go setup for building nigiri, build caching, failure log capture, and proper cleanup
  • Simplified setup.mjs: From ~300 lines of imperative setup to ~30 lines of readiness checks — much cleaner

📋 Observations

  1. Submodule branch reference: .gitmodules points to feat/shared-regtest-env-discovery branch. Ensure this gets merged to a stable branch (e.g., main) before this PR lands, otherwise submodule will break if the feature branch is deleted.

  2. Container name change: The regtest submodule presumably names the arkd container ark instead of arkd. The wallet's setup.mjs failure log step references docker logs ark — make sure Playwright tests also use the new container name if they exec into it.

  3. ARKD_SESSION_DURATION=10: This is specific to wallet's Playwright tests (short round intervals). Good that it's in .env.regtest rather than hardcoded.

  4. nigiri PATH addition: echo "${{ github.workspace }}/regtest/_build/nigiri/build" >> $GITHUB_PATH — this assumes the regtest start script builds nigiri from source. Worth noting in the regtest submodule docs.

🔒 Security

  • No secrets in .env.regtest
  • No production config leakage ✅
  • Docker compose uses nigiri external network — consistent with the submodule's approach ✅

Cross-repo impact

This is part of a 3-repo coordinated change (wallet#492, boltz-swap#106, ts-sdk#386) all adopting the arkade-regtest submodule. All three should land together to keep the test infrastructure consistent.

No blocking issues found. LGTM pending submodule branch stabilization.

arkd v0.9.1 requires scheduler=gocron when vtxo tree expiry is in
seconds. Setting ALLOW_CSV_BLOCK_TYPE=true uses block-based expiry
which is compatible with the default block scheduler.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.env.regtest (1)

6-9: Configuration aligns with PR objectives.

The environment variables correctly configure arkd v0.9.1 for the regtest environment:

  • ARKD_ALLOW_CSV_BLOCK_TYPE=true enables block-based expiry as documented in the commit message.
  • ARKD_SESSION_DURATION=10 matches the test plan requirement.
  • ARKD_LOG_LEVEL=6 provides detailed logging suitable for testing.

Optional: Consider alphabetical ordering.

The linter suggests ordering ARKD_LOG_LEVEL before ARKD_SESSION_DURATION for consistency, though this is a minor stylistic preference.

📝 Optional reordering for consistency
 # Match wallet's existing arkd config
 ARKD_ALLOW_CSV_BLOCK_TYPE=true
 ARKD_BOARDING_EXIT_DELAY=1024
-ARKD_SESSION_DURATION=10
 ARKD_LOG_LEVEL=6
+ARKD_SESSION_DURATION=10
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.env.regtest around lines 6 - 9, Reorder the environment variables for
consistency by placing ARKD_LOG_LEVEL before ARKD_SESSION_DURATION in the
.env.regtest file; specifically, adjust the sequence of the lines containing
ARKD_LOG_LEVEL and ARKD_SESSION_DURATION so the variables appear in alphabetical
order (ARKD_ALLOW_CSV_BLOCK_TYPE, ARKD_BOARDING_EXIT_DELAY, ARKD_LOG_LEVEL,
ARKD_SESSION_DURATION).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.env.regtest:
- Around line 2-3: The ARKD_IMAGE and ARKD_WALLET_IMAGE entries reference
non-existent tags v0.9.1; update the .env.regtest values for ARKD_IMAGE and
ARKD_WALLET_IMAGE to point to an available tag (e.g., v0.8.7) or ensure the
v0.9.1 images are built and pushed to GHCR before referencing them; change the
values for the ARKD_IMAGE and ARKD_WALLET_IMAGE keys accordingly so the regtest
environment can pull valid images.

---

Nitpick comments:
In @.env.regtest:
- Around line 6-9: Reorder the environment variables for consistency by placing
ARKD_LOG_LEVEL before ARKD_SESSION_DURATION in the .env.regtest file;
specifically, adjust the sequence of the lines containing ARKD_LOG_LEVEL and
ARKD_SESSION_DURATION so the variables appear in alphabetical order
(ARKD_ALLOW_CSV_BLOCK_TYPE, ARKD_BOARDING_EXIT_DELAY, ARKD_LOG_LEVEL,
ARKD_SESSION_DURATION).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 840a203c-907a-4108-a498-98070881de60

📥 Commits

Reviewing files that changed from the base of the PR and between 7e283d2 and 2bba13c.

📒 Files selected for processing (2)
  • .env.regtest
  • regtest
✅ Files skipped from review due to trivial changes (1)
  • regtest

Comment on lines +2 to +3
ARKD_IMAGE=ghcr.io/arkade-os/arkd:v0.9.1
ARKD_WALLET_IMAGE=ghcr.io/arkade-os/arkd-wallet:v0.9.1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify v0.9.1 Docker images exist in GitHub Container Registry

echo "Checking arkd:v0.9.1 image..."
docker manifest inspect ghcr.io/arkade-os/arkd:v0.9.1 > /dev/null 2>&1
if [ $? -eq 0 ]; then
  echo "✓ ghcr.io/arkade-os/arkd:v0.9.1 exists"
else
  echo "✗ ghcr.io/arkade-os/arkd:v0.9.1 NOT FOUND"
fi

echo "Checking arkd-wallet:v0.9.1 image..."
docker manifest inspect ghcr.io/arkade-os/arkd-wallet:v0.9.1 > /dev/null 2>&1
if [ $? -eq 0 ]; then
  echo "✓ ghcr.io/arkade-os/arkd-wallet:v0.9.1 exists"
else
  echo "✗ ghcr.io/arkade-os/arkd-wallet:v0.9.1 NOT FOUND"
fi

Repository: arkade-os/wallet

Length of output: 217


The referenced Docker images v0.9.1 do not exist in GitHub Container Registry.

Both ghcr.io/arkade-os/arkd:v0.9.1 and ghcr.io/arkade-os/arkd-wallet:v0.9.1 are unavailable. The regtest environment will fail to start with these image references. Either ensure these v0.9.1 images are built and pushed to the registry, or use the available v0.8.7 versions if v0.9.1 is not yet released.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.env.regtest around lines 2 - 3, The ARKD_IMAGE and ARKD_WALLET_IMAGE
entries reference non-existent tags v0.9.1; update the .env.regtest values for
ARKD_IMAGE and ARKD_WALLET_IMAGE to point to an available tag (e.g., v0.8.7) or
ensure the v0.9.1 images are built and pushed to GHCR before referencing them;
change the values for the ARKD_IMAGE and ARKD_WALLET_IMAGE keys accordingly so
the regtest environment can pull valid images.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 28, 2026

🔍 Arkana Review — wallet#492

Scope: Replace bespoke docker-compose + Dockerfiles with arkade-regtest submodule for Playwright e2e tests.

What Changed

  • Deleted arkd.Dockerfile, arkdwallet.Dockerfile, cors.Dockerfile, cors.nginx.conf, test.docker-compose.yml
  • Added arkade-regtest submodule at regtest/
  • .env.regtest pins arkd v0.9.1 with wallet-specific config
  • New docker-compose.nak.yml for nostr relay (wallet-specific, not in arkade-regtest)
  • CI updated for submodule checkout, Go setup, nigiri cache
  • src/test/setup.mjs massively simplified — from ~300 lines of infra setup to ~50 lines of service verification

Analysis

  1. arkd v0.9.1 — Wallet pins to newest version (vs ts-sdk v0.9.0 and boltz-swap v0.8.11). Makes sense as wallet app tracks latest.

  2. Nostr relaydocker-compose.nak.yml is wallet-specific (joins nigiri network). Clean separation: arkade-regtest handles Bitcoin/Ark/Boltz, wallet handles its own nostr needs.

  3. setup.mjs simplification — The old file had setupArkServer(), setupBoltz(), setupLND() with extensive retry loops and wallet init code. The new version just verifies services are up (waitForService). This is the biggest win — eliminates a major source of flaky e2e tests.

  4. regtest:setupregtest:start — Package.json scripts now use ./regtest/start-env.sh directly. The pnpm regtest composite command is gone; CI calls steps explicitly.

  5. Submodule branch — Tracking feat/shared-regtest-env-discovery. Same merge-order dependency.

Cross-repo

Part of the arkade-regtest unification. Depends on ArkLabsHQ/arkade-regtest#1.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 28, 2026

🔍 Arkana Review — wallet#492 (feat/use-arkade-regtest, 10a5ae3)

Summary: Replaces the wallet's bespoke regtest infrastructure (test.docker-compose.yml, custom Dockerfiles, cors config) with the shared arkade-regtest submodule. First consumer of arkade-regtest#1.

Architecture

  • regtest/ added as git submodule pointing to feat/shared-regtest-env-discovery branch
  • .env.regtest pins ARKD_IMAGE to v0.9.1 with wallet-specific config (SESSION_DURATION=10, LOG_LEVEL=6)
  • Nostr relay (nak) kept as a wallet-specific docker-compose.nak.yml overlay — correct decision since other SDK repos don't need it
  • setup.mjs dramatically simplified: ~300 lines removed, replaced with waitForService() checks

Findings

1. Submodule branch tracking:
.gitmodules points to branch feat/shared-regtest-env-discovery. This needs to be updated to master once arkade-regtest#1 is merged. Otherwise, future git submodule update won't track the default branch. Not a blocker for review, just a merge-order dependency.

2. setup.mjs simplification is well done:
The old setup had ~300 lines of infrastructure orchestration (wallet creation, LND channel setup, Boltz configuration, faucet logic). The new version is just three waitForService() calls:

  • arkd at localhost:7070/v1/info
  • boltz at localhost:9069/v2/swap/submarine
  • nak at localhost:10547

All the heavy lifting is now in regtest/start-env.sh. Clean separation of concerns.

3. execCommand refactored from async to sync:
The old async function execCommand() wrapping execSync in a Promise was unnecessary complexity. The new sync version is correct and simpler.

4. CI workflow changes:

  • Adds submodules: true to checkout ✅
  • Adds Go 1.23 setup (for nigiri build) ✅
  • Caches regtest/_build keyed on env files ✅
  • Adds docker log capture on failure ✅
  • Proper cleanup in always() block ✅

5. Deleted files (arkd.Dockerfile, arkdwallet.Dockerfile, cors.Dockerfile, cors.nginx.conf):
All infrastructure is now provided by arkade-regtest. Good cleanup — removes ~130 lines of Dockerfiles and nginx config.

6. package.json script changes:

regtest:start → ./regtest/start-env.sh + docker-compose nak
regtest:stop  → ./regtest/stop-env.sh + docker-compose nak down
regtest:clean → ./regtest/clean-env.sh + docker-compose nak down -v

The nak compose is correctly chained with the main start/stop/clean. The old regtest:build / regtest:up / regtest:down are removed.

Cross-repo dependency

This PR depends on ArkLabsHQ/arkade-regtest#1 being merged. The submodule commit (11654120) matches the current head of that PR's branch.

Verdict: Clean migration to shared infrastructure. The setup simplification is a big win. Just remember to update the submodule branch to master after arkade-regtest#1 merges.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 28, 2026

🔍 Arkana PR Review

Summary: Migrates the wallet repo from local Dockerfiles/docker-compose to the shared arkade-regtest submodule. Good consolidation of test infrastructure.

✅ Positives

  • Clean removal of redundant Dockerfiles (arkd.Dockerfile, arkdwallet.Dockerfile, cors.Dockerfile) and CORS nginx config
  • Simplified setup.mjs — replaced ~300 lines of manual wallet init/boltz setup with a clean waitForService() pattern that just verifies services are ready
  • CI now captures logs from all containers on failure and properly cleans up
  • .env.regtest uses pinned image versions (v0.9.1) — good for reproducibility
  • No secrets committed in config files

⚠️ Items to Address

  1. .gitmodules branch: Points to feat/shared-regtest-env-discovery — should be updated to main (or the default branch) before merge, otherwise submodule updates will track a feature branch that may be force-pushed or deleted.
  2. Missing nak compose in CI cleanup: The Cleanup step runs ./regtest/clean-env.sh but the nak relay is started separately via docker compose -f docker-compose.nak.yml up -d. The cleanup does call docker compose -f docker-compose.nak.yml down -v but it's outside the regtest scripts. Consider adding nak cleanup to the regtest scripts themselves for consistency.
  3. regtest:setup script removal: The old regtest npm script composed build+up+setup; now regtest:start and regtest:setup are separate. The package.json still has regtest:setup pointing to node src/test/setup.mjs — make sure CI and local dev docs are updated to reflect the new flow.

🔒 Security

  • No credentials or keys in committed files ✓
  • Docker images pulled from ghcr.io/arkade-os (org-controlled registry) ✓
  • No direct main branch pushes involved ✓

Overall a clean infrastructure improvement. The .gitmodules branch reference is the main item to fix.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.env.regtest (1)

2-3: ⚠️ Potential issue | 🟠 Major

Verify v0.9.1 image tags are published before merge.

These pinned tags can break regtest startup if not present in GHCR. Please confirm availability (or switch to known published tags).

#!/bin/bash
# Read-only verification of GHCR tags used in .env.regtest
set -euo pipefail

docker manifest inspect ghcr.io/arkade-os/arkd:v0.9.1 >/dev/null \
  && echo "OK: ghcr.io/arkade-os/arkd:v0.9.1 exists" \
  || echo "MISSING: ghcr.io/arkade-os/arkd:v0.9.1"

docker manifest inspect ghcr.io/arkade-os/arkd-wallet:v0.9.1 >/dev/null \
  && echo "OK: ghcr.io/arkade-os/arkd-wallet:v0.9.1 exists" \
  || echo "MISSING: ghcr.io/arkade-os/arkd-wallet:v0.9.1"

Based on learnings: ghcr.io/arkade-os/arkd:v0.8.7 and ghcr.io/arkade-os/arkd-wallet:v0.8.7 are confirmed available.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.env.regtest around lines 2 - 3, The pinned image tags in .env.regtest
(ARKD_IMAGE and ARKD_WALLET_IMAGE set to ghcr.io/arkade-os/arkd:v0.9.1 and
ghcr.io/arkade-os/arkd-wallet:v0.9.1) must be verified before merging; either
confirm those GHCR tags exist (using a manifest inspect or CI check) or update
ARKD_IMAGE and ARKD_WALLET_IMAGE to known-published tags (e.g., v0.8.7) so
regtest startup isn’t broken by missing images.
🧹 Nitpick comments (1)
.env.regtest (1)

6-9: Reorder ARKD keys to satisfy dotenv-linter warnings.

No runtime impact, but this removes lint noise and keeps env files consistent.

Suggested reorder
-ARKD_SCHEDULER_TYPE=gocron
 ARKD_BOARDING_EXIT_DELAY=1024
 ARKD_SESSION_DURATION=10
 ARKD_LOG_LEVEL=6
+ARKD_SCHEDULER_TYPE=gocron
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.env.regtest around lines 6 - 9, Reorder the environment variables in
.env.regtest to satisfy dotenv-linter by sorting or grouping the ARKD_* keys
consistently (e.g., alphabetically or by related purpose); specifically reorder
the lines ARKD_BOARDING_EXIT_DELAY, ARKD_LOG_LEVEL, ARKD_SCHEDULER_TYPE, and
ARKD_SESSION_DURATION into the linter-expected order used across other .env
files so the file matches project convention and removes dotenv-linter warnings.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.env.regtest:
- Around line 2-3: The pinned image tags in .env.regtest (ARKD_IMAGE and
ARKD_WALLET_IMAGE set to ghcr.io/arkade-os/arkd:v0.9.1 and
ghcr.io/arkade-os/arkd-wallet:v0.9.1) must be verified before merging; either
confirm those GHCR tags exist (using a manifest inspect or CI check) or update
ARKD_IMAGE and ARKD_WALLET_IMAGE to known-published tags (e.g., v0.8.7) so
regtest startup isn’t broken by missing images.

---

Nitpick comments:
In @.env.regtest:
- Around line 6-9: Reorder the environment variables in .env.regtest to satisfy
dotenv-linter by sorting or grouping the ARKD_* keys consistently (e.g.,
alphabetically or by related purpose); specifically reorder the lines
ARKD_BOARDING_EXIT_DELAY, ARKD_LOG_LEVEL, ARKD_SCHEDULER_TYPE, and
ARKD_SESSION_DURATION into the linter-expected order used across other .env
files so the file matches project convention and removes dotenv-linter warnings.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a3a9d5f5-7ed9-48fe-9429-b510b502a3a8

📥 Commits

Reviewing files that changed from the base of the PR and between 10a5ae3 and 3523403.

📒 Files selected for processing (2)
  • .env.regtest
  • regtest
✅ Files skipped from review due to trivial changes (1)
  • regtest

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 28, 2026

🔍 Iterative Review — New commit 35234037

Last commit switches from ARKD_SCHEDULER_TYPE=blockgocron and sets ALLOW_CSV_BLOCK_TYPE=false. Correct — wallet tests use seconds-based SESSION_DURATION=10 which requires gocron, not block-height.

✅ Overall

  • 293 lines deleted from setup.mjs → replaced with generic waitForService() checks against arkd, boltz, nak. Good simplification.
  • CI properly checks out submodules, caches nigiri build, captures logs on failure, and runs cleanup
  • Nostr relay kept as wallet-specific overlay (docker-compose.nak.yml) — correct, not shared infra

One note

  • .gitmodules points to branch = feat/shared-regtest-env-discovery — needs updating to master once ArkLabsHQ/arkade-regtest#1 merges

No blocking issues.

Fixes gRPC "not ready" by creating and unlocking wallet through
admin REST API before attempting ark CLI init.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 28, 2026

Review — iterative update (commit a4da5790)

Submodule bump regtest23c1be24 (arkade-regtest). The key change is in start-env.sh: wallet creation now goes through the admin REST API (/v1/admin/wallet/{seed,create,unlock,status}) before attempting ark init via CLI, fixing the gRPC "not ready" race condition.

What changed in the submodule:

  1. Seed → Create → Unlock via admin HTTP (port 7071) — correct sequencing that ensures the gRPC layer is only contacted after the wallet is fully initialized and synced.
  2. Sync wait loop added between unlock and CLI init (up to 60 attempts × 3s = 3 min timeout) — good tolerance for slow regtest indexing.
  3. Reduced diagnostic noise on CLI init failure — removed nbxplorer reachability checks that are no longer relevant since wallet creation is handled separately.

Observations:

  • The seed is generated and immediately used in the same script invocation — no persistence of the seed string beyond $seed shell variable. Fine for regtest, just noting it.
  • ARKD_PASSWORD is used in JSON payloads via shell string interpolation (\"{\\\"password\\\": \\\"$ARKD_PASSWORD\\\"}\") — works but could break if the password ever contained special JSON chars. Acceptable for regtest defaults.
  • The wallet status check pattern (jq -r '.initialized // false') with fallbacks is defensive and appropriate.

Clean iterative fix for a real CI flake. LGTM.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 29, 2026

🔍 Arkana PR Review — wallet#492

Scope: Replace wallet's custom test infrastructure with arkade-regtest submodule, pin arkd to v0.9.1.

Changes — Largest Infrastructure Cleanup

Removes 716 lines (Dockerfiles for arkd, arkd-wallet, cors proxy; full docker-compose; massive setup.mjs with wallet init, boltz setup, LND channel creation). Replaced by submodule + .env.regtest + slim verification script.

Key Observations

  1. Pins to arkd v0.9.1 (newest among the three SDK PRs) — wallet is closest to HEAD, makes sense.

  2. .env.regtest includes ARKD_SESSION_DURATION=10 and ARKD_LOG_LEVEL=6 — wallet-specific tuning for faster test cycles and verbose logging. These propagate through arkade-regtest's docker-compose.arkd-override.yml env interpolation correctly.

  3. docker-compose.nak.yml retained as overlay for the nostr relay (nak) — wallet-specific dependency not in arkade-regtest. This is the right approach: shared infra in the submodule, repo-specific services as local overlays. The name: nigiri + external: true network config ensures it joins the same Docker network.

  4. setup.mjs trimmed to 3 readiness checks (arkd, boltz pairs, nak relay). All the wallet creation, funding, note redemption, LND channel setup, and boltz configuration logic is gone — delegated to start-env.sh.

  5. CI additions: Proper log capture on failure for all relevant containers, always() cleanup with both nak overlay and regtest teardown.

Potential Issue

  • The nak relay check uses curl -sf http://localhost:10547 with only 10 retries at 1s intervals. If nak takes longer to build (it has a Dockerfile build step), this could flake. Consider bumping to 20 retries or 2s intervals.

Dependencies

  • Same branch pin dependency as the other SDK PRs.

Verdict

Well-executed. The nak overlay pattern is a good template for any repo that needs extra services beyond what arkade-regtest provides.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 29, 2026

Iterative review — new commit 4516f3b bumps the regtest submodule pointer (non-fatal redeem-notes fix in arkade-regtest).

Mechanical submodule update, no wallet code changes. LGTM on this increment.

Kukks added 2 commits April 3, 2026 22:45
Picks up lnurl-server + wallet services, fulmine v0.3.18 bump.
Playwright dev server uses port 3002; arkade-wallet container now uses 3003.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Apr 3, 2026

Iterative review (commits since last review):

75fe5021 / 8513ee4b: arkade-regtest submodule pointer bumps — the second avoids a port 3002 conflict.

Only change: regtest submodule ref update (+1/-1). No code changes, no new concerns. LGTM ✅

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Apr 3, 2026

Iterative review (commits since last review):

Submodule pointer bump only (regtest +1/-1). No wallet code changes. LGTM ✅

- Pin fulmine to v0.3.15 to avoid v0.3.18 ARK balance reporting issues
- Update regtest submodule: boltz-fulmine now serves delegator endpoint
  on port 7002, matching wallet's hardcoded regtest delegator URL
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Apr 4, 2026

🔍 Review: feat: use arkade-regtest for regtest environment

Net: −722 / +121 lines — big win for test infrastructure maintenance.

What Changed

Replaces the wallet's bespoke test infrastructure (test.docker-compose.yml, custom Dockerfiles, CORS proxy, 290-line setup.mjs) with the shared arkade-regtest submodule + a minimal nostr relay overlay.

Key Observations

Architecture — solid consolidation:

  • arkade-regtest submodule handles the full stack (nigiri, arkd, boltz, LND, fulmine) — wallet just provides overrides via .env.regtest
  • Nostr relay (nak) stays as a wallet-specific compose overlay, which makes sense since it's not needed by other repos
  • setup.mjs shrinks from ~290 lines of manual orchestration to ~30 lines of health checks — the submodule's start-env.sh owns the setup now

Version pinning in .env.regtest:

  • arkd/arkd-wallet pinned to v0.9.1
  • fulmine pinned to v0.3.15 with a clear comment about v0.3.18 balance reporting issues ✔
  • Zero fees make sense for faucetOffchain / wallet.settle() test flows

Container name change arkdark:

  • Consistently updated across fundedWallet.ts, send.test.ts, swap.test.ts — this aligns with arkade-regtest's naming convention ✔

CI workflow:

  • Build cache on regtest/_build keyed by env files — good for avoiding repeated nigiri builds
  • actions/setup-go@v5 with Go 1.23 added for building nigiri from source
  • Timeout bumped 30→45min to accommodate submodule setup
  • Log capture on failure (docker logs ark, boltz, etc.) — useful for debugging CI flakes ✔
  • Cleanup in if: always() block ✔
  • chmod +x on submodule scripts handles git not preserving exec bits ✔

One thing to verify:

  • The pnpm regtest:setup step in CI now only does health checks (not provisioning). If start-env.sh hasn't fully completed by that point (race between start-env.sh returning and services being ready), the waitForService retries in setup.mjs should handle it — but worth confirming the 30-retry / 2s-delay default is sufficient for CI runners.

Cross-repo

Parallel migration in boltz-swap#106 does the same arkade-regtest adoption — good alignment across repos.

LGTM — clean infrastructure consolidation.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Apr 4, 2026

Iterative review (commit c4a43b8)

Added delegator + nostr diagnostic logging to the CI failure step — checks both port 7002 and 7012 for delegator info, dumps boltz-fulmine env/logs, and nak relay status.

Good addition for debugging the delegator routing change from the previous commit (delegator now on boltz-fulmine at port 7002). Having both port 7002 and 7012 probed will help confirm which endpoint the wallet actually reaches.

No concerns — pure CI diagnostics, no runtime impact.

boltz-fulmine now correctly maps all 3 ports:
  7004→7000 (gRPC), 7003→7001 (API), 7002→7002 (HTTP/delegator)
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Apr 4, 2026

🔍 Arkana PR Review — wallet#492

feat: use arkade-regtest for regtest environment

Overall Assessment

Major infrastructure cleanup — replaces ~722 lines of custom Docker Compose, Dockerfiles, CORS proxy, and imperative setup scripts with the shared arkade-regtest submodule. This is a big win for consistency across repos.

✅ What looks good

  • Massive deletion of test.docker-compose.yml (286 lines), arkd.Dockerfile, arkdwallet.Dockerfile, cors.Dockerfile, cors.nginx.conf — all now handled by the shared submodule
  • Setup script simplified from ~293 lines of imperative orchestration to ~26 lines of readiness checks — much more maintainable
  • Container name change arkdark is correctly propagated through all e2e test files (fundedWallet.ts, send.test.ts, swap.test.ts)
  • CI improvements: Go setup for nigiri, build caching via regtest/_build, proper log capture on failure, deterministic cleanup
  • Nostr relay correctly kept as wallet-specific overlay via docker-compose.nak.yml
  • .env.regtest properly pins versions (arkd v0.9.1, fulmine v0.3.15) and sets zero fees for test compatibility
  • Timeout bumps on delegate and nostr tests (60s) — sensible for CI

⚠️ Observations

  1. Fulmine v0.3.15 pin with comment "v0.3.18 has ARK balance reporting issues with Boltz" — is this a known issue being tracked? If so, linking the issue would help future maintainers know when to unpin.

  2. ARKD_SESSION_DURATION=10 and ARKD_LOG_LEVEL=6 in .env.regtest — matches the old compose config, good. The ARKD_BOARDING_EXIT_DELAY=1024 also matches.

  3. CI timeout bumped to 45min — reasonable given the full stack setup, but monitor if this becomes flaky. The sleep 5 before Playwright tests is a smell — the regtest:setup healthchecks should be sufficient.

  4. Diagnostic step in CI dumps a lot of env info — useful for debugging but verbose. Consider making it conditional on a debug flag or moving it to the failure path only (like the log capture step).

  5. Submodule pinned to specific commit (246a8a13) — ensure the team has a process for bumping this when arkade-regtest updates.

Security

  • No protocol-level changes
  • Hardcoded signer key in old Dockerfiles was already test-only — removal is fine
  • No credentials leaked in the new setup
  • Zero-fee config is test-only ✅

Cross-repo impact

  • This PR and boltz-swap#106 both adopt arkade-regtest at the same submodule commit — good coordination
  • The shared submodule now becomes a dependency for CI in both repos

Verdict

Looks good to merge. Excellent cleanup. The shared regtest infrastructure will pay dividends as more repos adopt it.

Kukks added 6 commits April 4, 2026 09:00
- Add ARKD_ROUND_INTERVAL=3 to .env.regtest for faster test rounds
- Update regtest submodule with boltz ark.unilateralDelays config
With ARK_ONCHAIN_OUTPUT_FEE=0.0, the wallet prefers collaborative exit
over Boltz chain swap for onchain sends (cheaper). This breaks the
restore test which expects a Boltz chain swap entry for recovery.
Set to 250.0 (arkd default) so the wallet routes through Boltz.
ARK_ONCHAIN_OUTPUT_FEE=250.0 broke send tests (30s timeouts on
Google Chrome). Revert to 0.0 — the fee applies globally, not just
to collaborative exits.
Test Boltz API chain swap creation directly to debug why the
restore test's onchain send falls through to collaborative exit
instead of creating a Boltz chain swap.
The chain swap step silently falls back to collaborative exit,
causing the restore test to fail. This adds browser console
capture and a pre-restore verification check to identify why
createArkToBtcSwap() fails in this context.
Chain swap IS created (confirmed). Issue is restoreSwaps()
not finding chain swap after wallet restore. Broadened console
capture and added post-restore page content dump.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Apr 4, 2026

🔍 PR Review — Arkana

Overall: Looks good ✅ — Major infra cleanup replacing custom Docker setup with shared arkade-regtest submodule.

What this does

Replaces test.docker-compose.yml (286 lines), arkd.Dockerfile, arkdwallet.Dockerfile, cors.Dockerfile, and cors.nginx.conf with the shared arkade-regtest submodule. Wallet-specific config via .env.regtest. Nostr relay (nak) kept as a separate compose overlay since it's wallet-specific.

Review Notes

✅ Good standardization: Using arkade-regtest across repos (wallet + boltz-swap) means consistent test environments and one place to fix infra issues.

✅ Container name migration: All docker exec -t arkddocker exec -t ark references updated in test files (fundedWallet.ts, send.test.ts, swap.test.ts). Matches the container names from arkade-regtest.

.env.regtest config is sensible:

  • arkd v0.9.1 pinned (matches wallet's protocol expectations)
  • Fulmine pinned to v0.3.15 (comment explains v0.3.18 balance reporting issues)
  • Zero fees for test isolation
  • SESSION_DURATION=10, ROUND_INTERVAL=3 — fast rounds for test speed

✅ CI improvements: Timeout bumped 30→45min (realistic for submodule builds). Nigiri build cache keyed on env files. Comprehensive failure logging with per-container log dumps.

Observations:

  1. restore.test.ts debugging additions (lines 30-37, 90-136) — The extensive console log capture and IndexedDB state dump is clearly for CI debugging of the chain swap restore flakiness. Consider if this debug scaffolding should be cleaned up once the restore issue is stable, but fine for now.

  2. setup.mjs simplification — From ~290 lines of orchestration down to ~30 lines of readiness checks. The generic waitForService() pattern is much cleaner.

  3. Submodule pinned at 3a2c755 — Make sure this commit of arkade-regtest is stable and tested.

No security concerns. No protocol logic changes.

Chain swap restore is a Boltz API/library limitation (the restore
endpoint doesn't reliably return ARK chain swaps). Remove the chain
swap portion and diagnostic cruft — focus the test on what the
shared regtest infra actually needs to verify.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Apr 4, 2026

Iterative review (commit 1372119)

Clean simplification: removes the chain swap portion from the restore test after confirming it's a Boltz API limitation (restore endpoint doesn't reliably return ARK chain swaps). The diagnostic scaffolding (console capture, IndexedDB dumps, Boltz API probing) added in previous commits is also cleaned up.

The test now focuses on reverse + submarine swap restore, which is what the shared regtest infra needs to verify. Good call documenting the chain swap limitation in the commit message rather than leaving a flaky test.

.gitmodules now points to branch = master ✅ — the earlier concern about tracking a feature branch is resolved.

No concerns. LGTM on this increment.

Swap restore is a wallet/boltz-swap feature, not regtest infra.
The test has never passed in this PR and blocks the regtest
unification. Can be re-added once the underlying Boltz restore
behavior is addressed separately.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Apr 4, 2026

🔍 Iterative Review — 42f14ea1

New commit: test: remove restore test — not regtest infra concern

Removes src/test/e2e/restore.test.ts (92 lines). This was a comprehensive e2e test covering:

  • Reverse swap (Lightning → Arkade)
  • Submarine swap (Arkade → Lightning)
  • Chain swap (Arkade → on-chain)
  • Wallet reset + restore from backup phrase
  • Swap history verification after restore

Observation: The commit message frames this as "not regtest infra concern" — but this is a functional e2e test, not infra. It tests swap restore behavior which is a core wallet feature.

Is this test being moved elsewhere (e.g., a dedicated swap test suite), or is the restore flow already covered by the nostr backup test in nostr.test.ts? The nostr test covers config restore but not swap history recovery specifically.

If swap restore coverage is intentionally dropped, that's a regression risk worth flagging — the test verified that Boltz swap history survives a wallet reset, which is a real user scenario.

Everything else in the PR is unchanged from previous review — no issues.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Apr 4, 2026

🔍 Review — feat: use arkade-regtest for regtest environment

Major test infra cleanup: -722 lines of custom Docker/nginx config → shared arkade-regtest submodule.

What changed

  • Removed test.docker-compose.yml (286 lines), arkd.Dockerfile, arkdwallet.Dockerfile, cors.Dockerfile, cors.nginx.conf
  • Added regtest submodule pointing to ArkLabsHQ/arkade-regtest
  • .env.regtest provides wallet-specific overrides (arkd v0.9.1, gocron scheduler, zero fees, 3s round interval)
  • setup.mjs simplified from 300-line orchestrator to 30-line verification script
  • CI workflow updated: submodule checkout, Go setup for nigiri build, failure log capture
  • Nostr relay (nak) kept as wallet-specific docker-compose.nak.yml overlay — makes sense since it's wallet-specific

Latest commit (186b0a1)

Merge conflict resolution with master — keeps master's restore test intact. This is the right call since the restore test removal was a debugging artifact.

Key observations

Fulmine pinned to v0.3.15.env.regtest pins fulmine to avoid v0.3.18 ARK balance reporting issues. This should be tracked as a follow-up to unpin once the fulmine issue is resolved.

Zero fees config — All fee env vars set to 0.0 which makes test assertions deterministic. The ARK_ONCHAIN_OUTPUT_FEE=0.0 was reverted from 250.0 because it affected routing globally (not just collaborative exits). Good documentation in the commit messages about why.

CI timeout bumped 30m → 45m — The shared regtest stack has more containers. The per-test timeouts for delegate and nostr tests bumped to 60s are reasonable given the heavier infra.

Container name change arkdark — arkade-regtest names the container ark, not arkd. All docker exec commands in tests updated accordingly. ✔

Cross-repo note: This mirrors the same arkade-regtest migration done in boltz-swap#106. The shared submodule approach means infra fixes propagate to all repos via submodule bumps — good pattern for the test matrix.

Nigiri build cache — The actions/cache step keying on regtest/.env.defaults + .env.regtest is smart for avoiding redundant Go builds.

LGTM — clean infra consolidation with thorough iterative debugging documented in commit history.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Apr 4, 2026

🔍 Review Update — new commit d60a7fa (Boltz restore API diagnostic)

What changed: Added diagnostic code to restore.test.ts that:

  1. Reads swap data (public keys) from IndexedDB after initial wallet setup
  2. Calls the Boltz restore API (/v2/swap/restore) directly with those keys
  3. Logs the raw response to help debug why chain swap restore fails post-wallet-restore

Assessment: This is pure test diagnostic code — no production logic, no security surface. It probes the Boltz REST endpoint with public keys already stored client-side, which is the exact operation the wallet itself would perform.

The earlier test commit removed the restore test; this merge brought master's restore test back and adds debugging around the known chain swap restore limitation. Makes sense as an investigation step.

No concerns with this commit. The broader PR (shared arkade-regtest infra) was reviewed previously — the migration from per-repo docker-compose to shared submodule is solid.

The nginx proxy was missing CORS headers on /v2/swap/restore and
/v2/swap/rescue location blocks (proxied to Boltz Rust sidecar on
port 9005). Browser fetch() calls failed silently, preventing swap
restoration after wallet reset. Also remove diagnostic code from
restore test.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Apr 4, 2026

Followup review (commit d6f58a8)

Regtest submodule bump to 10b997d — adds CORS headers for /v2/swap/restore and /v2/swap/rescue on the Boltz nginx proxy. Without this, browser fetch() calls to the Boltz Rust sidecar (port 9005) fail silently due to missing Access-Control-Allow-Origin.

Also cleans up the diagnostic page.evaluate block from restore.test.ts — ~104 lines of IndexedDB introspection and manual Boltz API probing removed. Good cleanup; that code was useful for debugging but shouldn't ship.

LGTM for this increment. The CORS fix is the right layer (nginx proxy, not app code) and the test cleanup is straightforward.

@Kukks Kukks merged commit b9f53e1 into master Apr 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant