Documentation
    Preparing search index...

    Interface CoordinatedRelayOptions

    Options for creating a coordinated relay service.

    const relay = createCoordinatedRelay({
    relayPool: {
    subscribe: (f, cb, urls) => pool.subscribe(f, cb, urls),
    publish: (e) => pool.publish(e),
    selectRelayTier: (f) => pool.selectRelays(f),
    isAvailable: () => pool.connected,
    },
    cache: {
    query: (f) => db.query(f),
    store: (e) => db.store(e),
    isAvailable: () => db.ready,
    },
    });
    runtime.registerService('relay', relay);
    interface CoordinatedRelayOptions {
        cache: CacheServiceOptions;
        eoseTimeoutMs?: number;
        relayPool: RelayPoolServiceOptions;
    }
    Index

    Properties

    Local cache implementation. Uses the same interface as CacheServiceOptions.

    eoseTimeoutMs?: number

    EOSE fallback timeout in milliseconds. Sent if relay pool doesn't respond within this time. Default: 15000 (15 seconds).

    Relay pool implementation. Uses the same interface as RelayPoolServiceOptions.