Skip to content

feat: replace docker setup with arkade-regtest submodule#168

Closed
Dunsin-cyber wants to merge 4 commits into
arkade-os:masterfrom
Dunsin-cyber:feat/use-regtest-setup
Closed

feat: replace docker setup with arkade-regtest submodule#168
Dunsin-cyber wants to merge 4 commits into
arkade-os:masterfrom
Dunsin-cyber:feat/use-regtest-setup

Conversation

@Dunsin-cyber
Copy link
Copy Markdown

@Dunsin-cyber Dunsin-cyber commented May 7, 2026

fixes #163 removes the dependency on an externally running Nigiri instance and lets arkade-regtest manage the full stack (Nigiri + arkd + wallet) in one place

Summary by CodeRabbit

  • Chores
    • Updated regtest environment configuration with new timing and fee parameters
    • Refactored integration testing workflow and regtest environment setup
    • Added regtest as a git submodule for improved modularity

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Warning

Rate limit exceeded

@Dunsin-cyber has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 51 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b2e804f0-94ea-4e13-b062-903f13fa8474

📥 Commits

Reviewing files that changed from the base of the PR and between 0a4a60f and 742f29d.

📒 Files selected for processing (5)
  • .env.regtest
  • .github/workflows/integration.yaml
  • Makefile
  • README.md
  • regtest

Walkthrough

The pull request migrates the regtest environment setup from a test/docker docker-compose-based system to an external arkade-regtest submodule. Configuration variables, Makefile targets, and CI workflows are updated accordingly. Legacy docker files are removed.

Changes

Regtest Infrastructure Migration

Layer / File(s) Summary
Submodule Integration
.gitmodules, regtest
New regtest submodule is registered and pointed to https://github.com/ArkLabsHQ/arkade-regtest at commit 1a10171ead42248d8e8183244ea398e78c47f940.
Environment Configuration
.env.regtest
Regtest environment variables are defined: Docker image tags (ARKD_IMAGE, ARKD_WALLET_IMAGE), timing parameters for vtxo/exit delays and session duration, and zero-fee offchain/onchain input/output fees.
Build System Updates
Makefile
Regtest targets are refactored: regtest now runs ./regtest/start-env.sh, regtestdown runs ./regtest/stop-env.sh, and new regtestclean target runs ./regtest/clean-env.sh. Prior docker-compose and test/docker/setup.go invocations are removed.
CI Workflow Updates
.github/workflows/integration.yaml
Integration test job now checks out submodules, caches regtest/_build using .env.regtest as a key, runs go mod tidy, invokes make regtest to start the environment, and executes make regtestclean cleanup with if: always().
Legacy Infrastructure Removal
test/docker/docker-compose.yml, test/docker/server.Dockerfile, test/docker/wallet.Dockerfile, test/docker/setup.go
Previous docker-compose service definitions and Dockerfiles for arkd and wallet images, as well as the Go setup script, are deleted as their functionality is now provided by the arkade-regtest submodule.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: replace docker setup with arkade-regtest submodule' clearly and concisely summarizes the main change: replacing the Docker setup with the arkade-regtest submodule integration.
Linked Issues check ✅ Passed The PR successfully implements the core requirements from issue #163: adopts arkade-regtest as the regtest environment provider, removes the external Nigiri dependency, and consolidates the stack into a single submodule.
Out of Scope Changes check ✅ Passed All changes are directly related to integrating arkade-regtest: configuration updates, workflow changes, submodule additions, Makefile modifications, and removal of legacy Docker setup files are all in scope.
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

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

@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: 2

🧹 Nitpick comments (1)
Makefile (1)

50-60: ⚡ Quick win

Add a preflight guard for missing regtest scripts.

Direct script invocation is fine, but a missing/uninitialized submodule gives a cryptic failure. Add a quick existence check for clearer errors.

Suggested change
 regtest:
 	`@echo` "Starting regtest..."
+	`@test` -x ./regtest/start-env.sh || (echo "regtest submodule is missing. Run: git submodule update --init --recursive" && exit 1)
 	@./regtest/start-env.sh

 regtestdown:
 	`@echo` "Stopping regtest..."
+	`@test` -x ./regtest/stop-env.sh || (echo "regtest submodule is missing. Run: git submodule update --init --recursive" && exit 1)
 	@./regtest/stop-env.sh

 regtestclean:
 	`@echo` "Cleaning regtest..."
+	`@test` -x ./regtest/clean-env.sh || (echo "regtest submodule is missing. Run: git submodule update --init --recursive" && exit 1)
 	@./regtest/clean-env.sh
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 50 - 60, Make each regtest target (regtest,
regtestdown, regtestclean) first check that the referenced script exists and is
executable (e.g., verify ./regtest/start-env.sh, ./regtest/stop-env.sh,
./regtest/clean-env.sh) and print a clear error and exit non‑zero if missing;
update the targets to run a short shell guard (test -x or [ -f ... ] && ...)
before invoking the script so missing/uninitialized submodules produce an
explicit message and fail early instead of a cryptic error.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.env.regtest:
- Around line 1-2: The ARKD_IMAGE and ARKD_WALLET_IMAGE entries currently use
floating "latest" tags making regtest non-deterministic; replace both with
immutable references (specific version tags like vX.Y.Z or image digests e.g.
`@sha256`:...) for ARKD_IMAGE and ARKD_WALLET_IMAGE in .env.regtest, updating each
value to the chosen tag/digest (obtain the exact digest or stable tag from
ghcr.io/arkade-os/arkd and ghcr.io/arkade-os/arkd-wallet manifests) so the
regtest environment is reproducible.

In @.github/workflows/integration.yaml:
- Around line 27-32: The cache key in the "Cache nigiri build" step currently
uses only hashFiles('regtest/.env.defaults', '.env.regtest') and therefore
misses changes to the regtest repository content; add a step to capture the
regtest revision (e.g., run git -C regtest rev-parse HEAD and export it to
GITHUB_ENV or an output) and include that revision in the cache key (replace
key: nigiri-${{ hashFiles(...) }} with something like nigiri-${{ env.REGTEST_REV
}}-${{ hashFiles(...) }}) so the cache invalidates when regtest code changes;
update references to the key string and ensure the git command step runs before
the "Cache nigiri build" step.

---

Nitpick comments:
In `@Makefile`:
- Around line 50-60: Make each regtest target (regtest, regtestdown,
regtestclean) first check that the referenced script exists and is executable
(e.g., verify ./regtest/start-env.sh, ./regtest/stop-env.sh,
./regtest/clean-env.sh) and print a clear error and exit non‑zero if missing;
update the targets to run a short shell guard (test -x or [ -f ... ] && ...)
before invoking the script so missing/uninitialized submodules produce an
explicit message and fail early instead of a cryptic error.
🪄 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: fc49ab71-5d6e-4f39-9efd-10a609877872

📥 Commits

Reviewing files that changed from the base of the PR and between c8dbced and 0a4a60f.

📒 Files selected for processing (9)
  • .env.regtest
  • .github/workflows/integration.yaml
  • .gitmodules
  • Makefile
  • regtest
  • test/docker/docker-compose.yml
  • test/docker/server.Dockerfile
  • test/docker/setup.go
  • test/docker/wallet.Dockerfile
💤 Files with no reviewable changes (4)
  • test/docker/docker-compose.yml
  • test/docker/setup.go
  • test/docker/server.Dockerfile
  • test/docker/wallet.Dockerfile

Comment thread .env.regtest Outdated
Comment on lines +27 to +32
- name: Cache nigiri build
uses: actions/cache@v4
with:
path: regtest/_build
key: nigiri-${{ hashFiles('regtest/.env.defaults', '.env.regtest') }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Cache key misses regtest revision changes, risking stale _build reuse.

Current key ignores submodule commit changes, so Line 30 artifacts can be restored even when regtest code changed.

Suggested change
-      - name: Cache nigiri build
+      - name: Cache regtest build
         uses: actions/cache@v4
         with:
           path: regtest/_build
-          key: nigiri-${{ hashFiles('regtest/.env.defaults', '.env.regtest') }}
+          key: regtest-${{ runner.os }}-${{ github.sha }}-${{ hashFiles('regtest/.env.defaults', '.env.regtest') }}
+          restore-keys: |
+            regtest-${{ runner.os }}-
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/integration.yaml around lines 27 - 32, The cache key in
the "Cache nigiri build" step currently uses only
hashFiles('regtest/.env.defaults', '.env.regtest') and therefore misses changes
to the regtest repository content; add a step to capture the regtest revision
(e.g., run git -C regtest rev-parse HEAD and export it to GITHUB_ENV or an
output) and include that revision in the cache key (replace key: nigiri-${{
hashFiles(...) }} with something like nigiri-${{ env.REGTEST_REV }}-${{
hashFiles(...) }}) so the cache invalidates when regtest code changes; update
references to the key string and ensure the git command step runs before the
"Cache nigiri build" step.

Copy link
Copy Markdown

@arkanaai arkanaai Bot left a comment

Choose a reason for hiding this comment

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

Arkana Code Review — feat: replace docker setup with arkade-regtest submodule

Scope: Test infrastructure only. No protocol-critical code touched — no VTXO handling, signing, forfeit paths, or exit logic changed.

✅ What looks good

  1. Clean migration. Old inline docker-compose + Dockerfiles + setup.go replaced by the shared arkade-regtest submodule. Less code to maintain, consistent across SDKs.

  2. Config override mechanism works correctly. regtest/lib/env.sh auto-discovers $SCRIPT_DIR/../.env.regtest, so the override file at repo root will be picked up without needing --env flag. Verified the load order: .env.defaults.env.regtest.

  3. Critical timing values preserved. The .env.regtest correctly overrides arkade-regtest's much larger defaults back to the values the go-sdk e2e tests expect:

    • ARKD_VTXO_TREE_EXPIRY=20 (default 1024)
    • ARKD_UNILATERAL_EXIT_DELAY=10 (default 512)
    • ARKD_BOARDING_EXIT_DELAY=30 (default 2048)
    • ARKD_SESSION_DURATION=10 (default 30)
  4. Hardcoded infra vars handled by arkade-regtest. ARKD_NO_MACAROONS, ARKD_WALLET_ADDR, ARKD_ESPLORA_URL, ARKD_VTXO_MIN_AMOUNT=1, ARKD_DB_TYPE=sqlite, ARKD_EVENT_DB_TYPE=badger are all hardcoded in docker-compose.arkd-override.yml. No regression.

  5. CI improvements. Failure log capture (docker logs arkd), explicit cleanup step, and nigiri build cache are all good additions.

⚠️ Minor issues

  1. .github/workflows/integration.yaml — missing trailing newline (last line is run: make regtestclean with no \n). POSIX compliance and diff noise. Same for the old file, but since you're editing it anyway, add the newline.

  2. ARKD_LOG_LEVEL not overridden in .env.regtest. Old setup used 5 (DEBUG), arkade-regtest defaults to 4 (INFO). Not a correctness issue, but you'll get less diagnostic output when tests fail. Consider adding ARKD_LOG_LEVEL=5 to .env.regtest to match old behavior.

  3. Pinned to submodule commit 1a10171. This is fine for reproducibility, but document somewhere (or in CI) how to bump the submodule when arkade-regtest updates. A stale pin could cause confusion later.

  4. CI hasn't run yet (action_required on all workflow runs). The config looks correct, but the proof is in the green build. Maintainers should approve the CI run and verify tests pass before merging.

📋 Verdict

No blocking issues. This is a straightforward infra migration with no protocol impact. The config mapping is correct and complete. Ship it after addressing the trailing newline and confirming CI passes.

Copy link
Copy Markdown

@arkanaai arkanaai Bot left a comment

Choose a reason for hiding this comment

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

Arkana Follow-up Review — new commits 043da49..742f29d

All three issues from my previous review have been addressed:

Previous finding Status
Missing trailing newline in integration.yaml ✅ Fixed
ARKD_LOG_LEVEL=5 not in .env.regtest ✅ Added
No documented way to bump submodule make bump-regtest target + README section

Additional improvements in these commits

  • Images pinned to v0.9.4 (.env.regtest:1-2) — good, avoids silent breakage from :latest drift.
  • chmod +x on regtest scripts in CI (integration.yaml:34) — necessary since git submodules don't always preserve execute bits.
  • Failure log capture (integration.yaml:40-43) — captures arkd and ark-wallet logs on test failure. Helpful for debugging.
  • Submodule bumped 1a101716333e4b — verified commit exists in ArkLabsHQ/arkade-regtest (pins lnurl-server to 0.1.0).

One note

CI status for 742f29d is still action_required — maintainer needs to approve the workflow run before merge to confirm tests pass.

LGTM. No protocol-critical code involved. Ship it once CI is green. ✅

@altafan
Copy link
Copy Markdown
Contributor

altafan commented May 13, 2026

we're not going for this until the regtest env is polished

@altafan altafan closed this May 13, 2026
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.

Switch to arkade-regtest setup

2 participants