feat(machine): consume get_machine_config over the transport (#70 P1 client) #74
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/machine-config-consumer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements #71 (the client half of #70 P1). Server RPC: aiolabs/spirekeeper#41 (+ its PR).
What
Source the operator pubkey + fee config from LNbits via the
get_machine_configkind-21000 RPC right afterlist_wallets, instead of the operator pubkey coming only fromVITE_OPERATOR_PUBKEYS(env). A seed-only machine had an empty operator allowlist → the fees/operator-config services disabled themselves → permanent "awaiting configuration". Now it configures itself over the authenticated channel with zero per-machine provisioning.How
LnbitsClient.getMachineConfig()→sendRpc('get_machine_config')+ theMachineConfigResponse/FeeConfigWiretypes.lightning.ts, only whenVITE_OPERATOR_PUBKEYSis empty (env override still wins): setoperatorPubkeysfromoperator_pubkey(re-enables the services), and persistfee_configvia the existingapplyFeeConfigIPC (mapping snake_case → the IPC's camelCase) soatm.ts's awaiting-fees gate clears immediately — robust to the replaceable kind-30078 not being fetchable from the relay. The live kind-30078 subscription still handles mid-run updates.Validated on hardware
A Sintra at "awaiting configuration" (P0 baseline, no provisioned operator pubkey), after this deploy:
Reached
idlevia the synchronous RPC ~2.5 min before the kind-30078 push arrived (which then also applied — dual-run intact).lnbits + machine typecheck clean; lnbits suite 29 pass.
🤖 Generated with Claude Code
Source the operator pubkey + fee config from LNbits via the get_machine_config kind-21000 RPC (spirekeeper#41) right after list_wallets, instead of the operator pubkey coming only from VITE_OPERATOR_PUBKEYS (env). A seed-only machine (blank .env) had an empty operator allowlist → the fees/operator-config services disabled themselves → permanent "awaiting configuration". Now it pulls its config over the already-authenticated channel and configures itself with zero per-machine provisioning — closing bitspire#70 P1. - LnbitsClient.getMachineConfig() → sendRpc('get_machine_config') + the MachineConfigResponse / FeeConfigWire types. - lightning.ts, only when VITE_OPERATOR_PUBKEYS is empty (env override still wins): set CONFIG.operatorPubkeys from operator_pubkey (re-enables the services), and persist fee_config via the existing applyFeeConfig IPC (mapping snake_case → camelCase) so atm.ts's awaiting-fees gate clears immediately — robust to the replaceable kind-30078 not being fetchable from the relay. The live kind-30078 subscription still handles mid-run fee updates. - Soft-fail: older spirekeeper (no RPC) or a transport error falls back to the env/kind-30078 path. lnbits + machine typecheck clean; lnbits suite 29 pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>9d0e8d8featofdb9a507c2