multi-party-computation-controller-api
    Preparing search index...

    Persistence service for key metadata.

    After a successful GenerateKey gRPC call, the worker stores the publicKeyPackage, algorithm, threshold, and participants values here, indexed by keyIdentifier. The signing processor retrieves these values to reconstruct the exact parameters required by the engine.

    Storage backend: Redis (same instance as BullMQ, separate key namespace).

    Implements

    • OnModuleDestroy
    Index

    Constructors

    Properties

    configService: AppConfigService
    logger: Logger = ...
    redis: Redis

    Methods

    • Closes the Redis connection gracefully when the NestJS module is torn down. Ensures in-flight commands are flushed before the connection is released.

      Returns Promise<void>

    • Retrieves key metadata by identifier.

      Parameters

      • keyIdentifier: string

        Application-assigned stable key identifier.

      Returns ResultAsync<Metadata | null, Error>

      The stored Metadata, or null if not found or expired. Errors when the stored value cannot be parsed (corrupted entry).

    • Persists key metadata in Redis under metadata:{keyIdentifier}.

      Overwrites any existing entry for the same identifier (re-key generation scenario). The TTL is reset on each write.

      Parameters

      • keyIdentifier: string

        Application-assigned stable key identifier.

      • metadata: Metadata

        Metadata produced by the key-generation processor.

      Returns Promise<void>