Skip to content

build: add cli-up, cli-stop and cli-clear for the terminal-only path - #54

Open
Dunsin-cyber wants to merge 2 commits into
BitspendPayment:mainfrom
Dunsin-cyber:build/cli-up-target
Open

Dunsin-cyber wants to merge 2 commits into
BitspendPayment:mainfrom
Dunsin-cyber:build/cli-up-target

Conversation

@Dunsin-cyber

Copy link
Copy Markdown

There is a Rust CLI for driving the wallet, but no way to start a stack it can talk to without the Android toolchain: make up builds the Android FFI, and make runtime-run starts the cosigner without ASP_URL or WEBAUTH_TOKEN_SECRET, which leaves a server that looks healthy but rejects every Ark call.

  • make cli-up: regtest, arkd, a funded ASP, a mine loop, and the cosigner with the environment it actually needs, in the foreground
  • make cli-stop: pause, keeping the chain, arkd's records, the cosigner database and your wallets. Uses docker compose stop rather than down, because arkd and arkd-wallet mount no volume and down would delete their VTXO records while leaving the chain intact
  • make cli-clear: clean slate. Containers, volumes, cosigner SQLite and CLI keystore. Does not reuse down, which sudo-prompts for root-owned paths this flow never creates, and whose pkill -f patterns match and kill their own shell
  • README: adds cli/ to the component tree and a short section on the CLI workflow, after the app one
  • Fixes the CLI comment, which pointed at make regtest-ark, a target that never starts a cosigner

Verified end to end on regtest: DKG onboarding, boarding 100k sats, a 25k off-chain send to a second wallet, contacts, and a payment request through approve.

Driving the wallet from the CLI had no working entry point. `up` builds the
Android FFI, so it needs the NDK at ~/Android/Sdk/ndk/<version> and ends by
telling you to run Flutter. `runtime-run` skips the NDK but starts the cosigner
without ASP_URL or WEBAUTH_TOKEN_SECRET: without the first, every Ark call comes
back UNAVAILABLE; without the second, the runtime rejects the session tokens the
CLI mints for the group-key-authenticated ark/* routes. Neither failure names its
cause, so you get a server that looks healthy and refuses everything.

cli-up brings up regtest and arkd, funds the ASP, mines every 10s, and runs the
cosigner in the foreground with the environment it actually needs.

cli-stop pauses. It uses `docker compose stop` rather than `down` because arkd
and arkd-wallet mount no volume, so their data lives in the container's writable
layer. `down` would delete arkd's VTXO records while leaving the chain intact,
which is worse than a clean wipe: the keystore and the cosigner would still
believe in coins arkd has no record of.

cli-clear is the clean slate: containers, volumes, the cosigner's SQLite and the
CLI keystore. It does not reuse `down`, which sudo-prompts to delete root-owned
paths this flow never creates, and whose `pkill -f "bitcoin.sh mine"` matches the
shell running it and kills itself, surfacing as "Terminated (ignored)". The
bracketed first letter avoids the self-match.

Also points the CLI comment at cli-up rather than regtest-ark, which is
`runtime-stop arkd-up bitcoin-init arkd-init` and never starts a cosigner at all.
@Dunsin-cyber

Copy link
Copy Markdown
Author

is this good to go? @aruokhai

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