B4: chain tables, HD index assignment and signing key reserved to the worker (DAT-81..84, ARC-78)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
davideandClaude Sonnet 5.5 committed 2026-11-16 15:53:50 +01:00
1 parent 0092596b07
commit f1d09075a1
18 files changed
+741 -8

No files matched your search

@@ -0,0 +1,22 @@
from pathlib import Path
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from apps.lottery.keys import generate_keys
class Command(BaseCommand):
help = "One-off: create the master key and its encryption key (0600) and print the account's public key (ARC-78)."
def add_arguments(self, parser):
parser.add_argument("directory", help="where to write master.key and master.encryption.key")
def handle(self, *args, **options):
try:
xpub = generate_keys(Path(options["directory"]), settings.PLM_PROFILE)
except FileExistsError as error:
raise CommandError(str(error)) from error
self.stdout.write(f"Keys written to {options['directory']} for {settings.PLM_NETWORK}.")
self.stdout.write("Put this public key in .env (the web process needs nothing else):")
self.stdout.write(f"PLM_ACCOUNT_XPUB={xpub}")