antlion-lacewing - v2.0.1
    Preparing search index...

    Interface ReplayStore

    Where each accepted proof is remembered, so it is accepted once.

    addIfAbsent must check and record in one atomic step: resolve true if this call recorded the key, false if it was already there. A read followed by a write lets two copies of one proof both through. RedisReplayStore (antlion-lacewing/redis) and PostgresReplayStore (antlion-lacewing/postgres) implement it for a fleet.

    Throwing, rejecting, or resolving anything but a boolean refuses the request. Keys are at most 87 characters of base64url and one :.

    interface ReplayStore {
        addIfAbsent(key: string, ttlSeconds: number): Promise<boolean>;
    }

    Implemented by

    Index
    • Parameters

      • key: string
      • ttlSeconds: number

      Returns Promise<boolean>