Skip to content

feat: use arkade-regtest for regtest environment#492

Open
Kukks wants to merge 34 commits intomasterfrom
feat/use-arkade-regtest
Open

feat: use arkade-regtest for regtest environment#492
Kukks wants to merge 34 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)
  • Nostr relay (nak) kept as wallet-specific docker-compose overlay

Test plan

  • Playwright e2e tests pass with new infrastructure setup
  • 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

Summary by CodeRabbit

  • Chores

    • Moved regtest orchestration to a dedicated submodule, added a regtest environment file, removed legacy local build artifacts and custom container definitions, and introduced a lightweight compose config for an auxiliary service.
    • Added new scripts to start/stop/clean the regtest environment.
  • CI

    • Updated CI to provision the regtest environment, start auxiliary services, capture logs on failure, and ensure deterministic cleanup.
  • Tests

    • Simplified test setup to perform concise service health verifications only.

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: 1d502cf
Status: ✅  Deploy successful!
Preview URL: https://b861268c.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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

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

✨ Finishing Touches
🧪 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: 1d502cf
Status: ✅  Deploy successful!
Preview URL: https://feeec952.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.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 29, 2026

Iterative review — new commit 3722613 (update regtest submodule — fund server wallet, not client boarding addr)

Picks up the arkade-regtest fix that funds the server wallet via admin API instead of the client boarding address. This ensures arkd has on-chain liquidity for processing rounds.

No wallet-specific changes in this commit. LGTM.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 29, 2026

🔍 Arkana PR Review — wallet#492

Scope: Replace custom test infrastructure with arkade-regtest submodule. Pin arkd v0.9.1. Keep nostr relay as wallet-specific overlay.

Changes — Largest Cleanup ✅

Removes 716 lines: arkd.Dockerfile, arkdwallet.Dockerfile, cors.Dockerfile, cors.nginx.conf (48 lines), test.docker-compose.yml (286 lines), and the majority of src/test/setup.mjs (293→26 lines).

Key Observations

1. Wallet-specific overlay: docker-compose.nak.yml
The nostr relay (nak) is kept as a wallet-specific docker-compose overlay, not pushed into arkade-regtest. Good separation — nak is specific to the wallet's nostr-based communication, not general regtest infrastructure.

2. Pins arkd v0.9.1 — newest across the three SDKs
Wallet is on the cutting edge. Makes sense as the primary consumer of new arkd features.

3. ARKD_SCHEDULER_TYPE=gocron (vs block in ts-sdk/boltz-swap)
Different scheduler type. This matches the wallet's existing config and is appropriate — the wallet app uses time-based rounds, not block-triggered ones.

4. CI captures logs from 6 containers on failure
Good debugging aid. Includes nak container which is wallet-specific.

5. BITCOIN_LOW_FEE=false
Comment: "Skip Bitcoin Core restart — avoids nbxplorer connection loss". Same pattern as boltz-swap. The wallet tests don't need very-low-fee transactions.

6. ARKD_SESSION_DURATION=10 and ARKD_LOG_LEVEL=6
Short session duration for faster test cycles. High log level for debugging. Both appropriate for test environments.

7. Nigiri build cache key

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

Caches the nigiri build based on env file hashes. Smart — avoids rebuilding nigiri on every CI run.

Minor Note

The setup.mjs still has some inline logic for service readiness checks. The approach is consistent with the other SDKs (ts-sdk, boltz-swap) — each keeps a thin setup layer for SDK-specific verification.

Verdict

Clean migration with appropriate wallet-specific customization (nak overlay, gocron scheduler, v0.9.1 pin). 👍

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 29, 2026

Follow-up review (new commits: 92e6b25..b7d4e0e)

Two submodule bumps — both tracking the latest arkade-regtest fixes:

  1. Fund Boltz wallet (513051f): After Boltz restart, finds its Bitcoin Core wallet and funds it with 5 BTC. Needed for on-chain swap operations (reverse/chain swaps).
  2. Increase server funding to 21 BTC (ff30d69eecb40e): 1 BTC × 21 txs gives both server liquidity and enough block history for Bitcoin Core fee estimation.

No wallet-specific code changes — just submodule pointer updates. LGTM.

Picks up ARK fee env var passthrough in docker-compose.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 29, 2026

🔍 Arkana PR Review — wallet#492

Summary: Migrates wallet regtest infra to shared arkade-regtest submodule. Removes 4 Dockerfiles + test.docker-compose.yml (~716 lines deleted), replaces with submodule + .env.regtest overrides. Keeps nak (nostr relay) as a wallet-specific docker-compose overlay.

✅ Looks Good

  • Massive simplification — setup.mjs drops from ~300 lines of orchestration to ~30 lines of readiness checks. The generic waitForService() helper is clean.
  • CI improvements — log capture on failure, deterministic cleanup with if: always(), nigiri build caching.
  • Clean separation — wallet-specific config (SESSION_DURATION=10, LOG_LEVEL=6, arkd v0.9.1) in .env.regtest, nak overlay in docker-compose.nak.yml.

📝 Notes

  1. Submodule branch: .gitmodules points to feat/shared-regtest-env-discovery — make sure arkade-regtest#1 merges first (or update to track main after merge), otherwise CI will break if that branch gets rebased/deleted.
  2. BITCOIN_LOW_FEE=false — good call to avoid nbxplorer connection loss from Bitcoin Core restart. Worth documenting this gotcha in the regtest repo README.
  3. setup.mjs is now sync-friendlyexecCommand was refactored from async Promise wrapper to plain sync function, but waitForService still uses await sleep(). That's fine — just noting the mixed sync/async is intentional and correct.
  4. CI: chmod +x in multiple steps — both "Start regtest" and "Cleanup" run chmod +x regtest/*.sh. Consider making the scripts executable in the submodule itself so consumers don't need to.

🔒 Security

  • No credential exposure. Hardcoded signer keys exist only in the regtest submodule (expected for test fixtures).
  • No production paths affected.

Verdict: Clean migration. No blockers.

Regtest environment setup (nigiri build + arkd + LND + Fulmine) takes
~5 minutes, leaving insufficient time for Playwright tests within the
old 30-minute limit.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 29, 2026

Iterative review — new commit: 346fc15a (ci: increase Playwright timeout to 45 minutes)

LGTM. The bump from 30→45 minutes is reasonable given arkade-regtest setup overhead (nigiri build, arkd, LND, Fulmine, wallet creation). The commit message explains the rationale clearly.

Worth noting: if setup time grows further, consider caching the built nigiri binary more aggressively or splitting the e2e suite into shards. The existing actions/cache on regtest/_build should help, but first cold run will still be slow.

Picks up missing env var exports for docker-compose interpolation.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 29, 2026

🔍 Iterative review — changes since 346fc15

New commit 59835c2: updates regtest submodule to 1a86cf5 for missing env var exports in docker-compose interpolation.

LGTM — this is a necessary fix for the env var passthrough. The submodule now matches across all three repos (wallet, boltz-swap, ts-sdk) which is good for consistency.

Cross-repo note: This PR, boltz-swap#106, and ts-sdk#386 all point to the same submodule commit (1a86cf5) on feat/shared-regtest-env-discovery. Once CI is green across all three, the submodule branch should be merged to main in arkade-regtest.

arkade-regtest names the arkd container 'ark', not 'arkd'. The docker
exec commands in tests were failing silently with "No such container".
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 29, 2026

🔍 Arkana PR Review — wallet#492

Summary: Replaces custom test infrastructure (Dockerfiles, docker-compose, CORS proxy) with shared arkade-regtest submodule. Pins arkd to v0.9.1 with gocron scheduler.

✅ Looks Good

  • Clean infrastructure consolidation — removes 3 Dockerfiles, CORS nginx config, and the monolithic test.docker-compose.yml in favor of the shared submodule
  • No secrets in committed files.env.regtest contains only configuration, no keys or credentials
  • Container name migration (arkdark) correctly applied across all test files (fundedWallet.ts, send.test.ts, swap.test.ts)
  • CI improvements — submodule checkout, Go setup for nigiri build, nigiri build caching, log capture on failure, deterministic cleanup
  • Wallet-specific overlay retained for nostr relay (docker-compose.nak.yml) — good separation of concerns

⚠️ Notes

  • CI timeout increased to 45 min — regtest setup (~5 min) plus Playwright is a long CI run. Consider whether the nigiri build cache meaningfully reduces this over time
  • Submodule pinned to feature branch (feat/shared-regtest-env-discovery) — should be updated to track main once arkade-regtest merges that branch
  • gocron scheduler is wallet-specific (vs block scheduler in ts-sdk/boltz-swap) — the commit history shows careful iteration around the scheduler/expiry interaction (BIP 112 ≥512 = seconds threshold). Final config looks correct

🔒 Security

  • No protocol code changes. Test-only infrastructure
  • Removed Dockerfiles were building from golang:1.25.5 with git clone at build time — the pre-built images from GHCR are a security improvement (pinned, reproducible)
  • ARKD_NO_MACAROONS=true is regtest-only (inherited from arkade-regtest defaults), not a concern

No blocking issues.

INTENT_INSUFFICIENT_FEE errors in all asset/swap tests because
faucetOffchain uses wallet.settle() without fee budget, but arkd
defaults charge 1% input fee (10,000 sats on 1M settle).

Also add diagnostic step to dump arkd env, fees, and container state.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 30, 2026

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

Overall: Clean infrastructure consolidation. +116/-722 is a great net reduction. Replacing the bespoke docker-compose + Dockerfiles with the shared arkade-regtest submodule is the right move for cross-repo consistency.

✅ What looks good

  1. Massive simplification of setup.mjs — From ~280 lines of imperative wallet-create/fund/channel-balance/boltz-setup to ~30 lines of health-check verification. The start-env.sh script in the submodule handles the heavy lifting now.
  2. CI improvements — Log capture on failure (docker logs ark, boltz, etc.) and if: always() cleanup are solid additions for debugging flaky CI runs.
  3. Consistent container renamearkdark updated across all test files (fundedWallet.ts, send.test.ts, swap.test.ts).
  4. Zero-fee config.env.regtest sets all fees to "0.0", which matches the existing test assumption that faucetOffchain/settle() works without a fee budget.
  5. Nostr relay kept as wallet-specific overlay — Good call keeping docker-compose.nak.yml separate since nak is wallet-specific, not shared infra.

⚠️ Minor observations

  1. Submodule branch: .gitmodules points to branch = feat/shared-regtest-env-discovery rather than main. This is fine while arkade-regtest#1 is in flight, but should be updated to main once that PR merges — otherwise git submodule update --remote will track a stale feature branch.

  2. CI timeout bump (30 → 45 min): Understandable given the heavier start-env.sh bootstrap, but worth monitoring. If regtest startup stabilizes, consider tightening this back.

  3. setup.mjs — async→sync refactor: execCommand was changed from async (returning a Promise) to synchronous. The function is still called with await in one test helper pattern, but since it now returns a plain value, the await is a no-op. Not a bug, but worth cleaning up for clarity if you revisit this file.

  4. regtest/_build cache key: The cache key uses hashFiles('regtest/.env.defaults', '.env.regtest'). If start-env.sh or scripts in regtest/helpers/ change the build logic without touching those env files, the cache won't invalidate. Consider adding regtest/start-env.sh to the hash.

🔒 Security

No concerns. This is test infrastructure only — no production keys, no mainnet paths, no credential handling changes. The hardcoded wallet password (secret) and Boltz private key are regtest-only fixtures inherited from the submodule.

Verdict: Looks good to merge once arkade-regtest#1 lands (to avoid a dangling submodule ref). The minor items above are non-blocking.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 30, 2026

Iterative review (commit 5dbc44b)

Single submodule bump: picks up conditional nbxplorer restart from arkade-regtest (9a409cd). This fixes the dotnet-sdk stack which lacks an nbxplorer container — the BITCOIN_LOW_FEE restart path now checks docker inspect before attempting to restart nbxplorer.

No concerns — purely inheriting an upstream fix via submodule pointer update.

The nbxplorer guard in start-env.sh handles missing containers
gracefully. Re-enable low fees for chain swap and send MAX tests.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 30, 2026

Follow-up review (new commits since last review)

Latest commits: regtest submodule pointed to master, BITCOIN_LOW_FEE re-enabled for chain swap / send MAX tests now that the nbxplorer guard handles missing containers gracefully.

Config (.env.regtest)

  • arkd v0.9.1, gocron scheduler, SESSION_DURATION=10, zero intent fees
  • BITCOIN_LOW_FEE=true — safe now with the nbxplorer guard in start-env.sh

Wallet-specific additions

  • docker-compose.nak.yml for nostr relay — correctly uses name: nigiri and external network to join the arkade-regtest stack
  • Container name references updated arkdark in fundedWallet.ts, send.test.ts, swap.test.ts

CI — Playwright timeout bumped to 45min (appropriate given ~5min regtest setup). Diagnostic step dumps arkd env/fees/container state on every run. Nostr relay lifecycle managed separately from regtest stack.

Cross-repo — Same submodule commit as ts-sdk#386, boltz-swap#106, dotnet-sdk#56.

No security concerns. Clean migration.

Bump per-test action/navigation timeout from 30s to 60s and job
timeout from 45m to 60m. The shared regtest environment has more
containers and slightly higher latency than the old dedicated
test.docker-compose.yml setup, causing borderline tests to miss
the 30s deadline.
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 30, 2026

Followup review (commit 15e24bf)

Timeout bump only — CI job 45→60min, Playwright action/nav timeouts 30s→60s. Reasonable given the heavier arkade-regtest setup. 👍

No protocol or security concerns.

@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 31, 2026

🔍 Arkana PR Review — arkade-os/wallet#492

PR: feat: use arkade-regtest for regtest environment
Author: @Kukks | +116 / -722 | 33 commits

Summary

Replaces the wallet repo's custom test infrastructure (286-line test.docker-compose.yml, 3 Dockerfiles, CORS proxy config) with the shared arkade-regtest submodule. setup.mjs drops from ~300 lines of orchestration to ~30 lines of verification-only checks. Good consolidation — single source of truth for regtest infra across repos.

✅ What looks good

  1. Massive simplification: Removes 722 lines of duplicated infrastructure. The old setup manually orchestrated arkd wallet creation, LND funding, channel balancing, Fulmine setup — all now handled by start-env.sh in the submodule.

  2. Container name fix: Correctly updates arkdark in test files (fundedWallet.ts, send.test.ts, swap.test.ts) to match arkade-regtest naming.

  3. CI improvements: Proper submodule checkout, Go setup for nigiri build, build cache via actions/cache, diagnostic logging on failure, and deterministic cleanup.

  4. Environment config: .env.regtest cleanly separates wallet-specific overrides (scheduler type, session duration, zero fees for test faucet).

  5. Nostr relay: Kept as wallet-specific overlay (docker-compose.nak.yml) — correct since it's not needed by other repos using arkade-regtest.

⚠️ Observations

  1. Submodule pinned to 0ddb42cf — not the master tip. This is fine for stability, but worth noting the submodule has been bumped many times during development (visible in the 33 commits). Ensure this final pin is the intended stable commit.

  2. CI timeout bumped 30m → 45m: The latest commit reverts the 60m timeout back and merges master. The 45m limit seems reasonable for the heavier shared environment, but worth monitoring — if tests consistently finish in <30m, tighten it back.

  3. Zero fees in .env.regtest: ARK_OFFCHAIN_INPUT_FEE="0.0" etc. — necessary for tests that settle without fee budget, but documents a test assumption. If arkd default fees change upstream, tests would need updating.

  4. docker-compose.nak.yml uses name: nigiri to join the nigiri network — correct pattern for external network attachment.

  5. Merge commit at HEAD: Last commit merges origin/master into the feature branch after reverting the timeout increase. Clean merge, no conflicts visible.

Security

  • No credential handling changes — the old hardcoded test passwords/keys were in the now-deleted test.docker-compose.yml. The submodule handles this internally.
  • Submodule URL points to https://github.com/ArkLabsHQ/arkade-regtest.git — correct org, HTTPS.
  • No production config changes. Test-only infrastructure.

Verdict

Clean infrastructure consolidation. No security concerns. The 33-commit iteration history shows thorough debugging of the regtest setup sequence (nbxplorer sync, chopsticks restart, fee estimation, container naming). Ready for human approval.

- Bump regtest to 6c5a540 which aligns Boltz reverse swap fee to
  0.4% (was 0.5%) matching wallet's expected amounts (1,992 sats)
- Add test.setTimeout(60000) to delegate and nostr save-config tests
  that were hitting the default 30s test timeout
@arkanaai
Copy link
Copy Markdown

arkanaai bot commented Mar 31, 2026

🔍 Incremental Review — 1d502cf (Boltz fee alignment + test timeouts)

Changes since last review (f351422): 1 commit

Regtest submodule bump (0ddb42c6c5a540)

Aligns Boltz reverse swap fee from 0.5% to 0.4%, matching the wallet's expected 1,992 sat amount in tests. Without this, amount mismatches would cause test failures.

Test timeout increases

delegate.test.ts and nostr.test.ts get test.setTimeout(60000) — up from the default 30s. Both tests involve multi-step flows (wallet creation + network ops) that can hit 30s under the heavier arkade-regtest stack.

No concerns. Targeted fixes for CI stability.

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