Wire up the FastAPI app and master-key bootstrap script
app/main.py assembles the lifespan-managed background tasks (Electrum listener, round scheduler, confirmation poller, RBF bumper) and mounts all routers behind a /health check. generate_master_key.py is the one-time ops script that creates and Fernet-encrypts the server's master xprv before first launch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
"""One-time ops bootstrap: generate and encrypt the server's master xprv.
|
||||
|
||||
Usage:
|
||||
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
|
||||
# put that value in XPRV_ENCRYPTION_KEY (.env), then:
|
||||
python scripts/generate_master_key.py
|
||||
"""
|
||||
|
||||
from app.config import settings
|
||||
from app.wallet.hd import generate_master_key
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not settings.xprv_encryption_key:
|
||||
raise SystemExit("XPRV_ENCRYPTION_KEY is not set")
|
||||
generate_master_key()
|
||||
print(f"Master key written (encrypted) to {settings.master_key_path}")
|
||||
Reference in New Issue
Block a user