kernl API
    Preparing search index...

    Function createRelayDirectory

    • Create a directory of servers from NIP-66 monitors' reports (kind 30166).

      start() streams reports newer than maxAgeSeconds for the clearnet network from the monitor servers; a browser cannot dial the other networks, and NIP-66 says a report SHOULD carry its network, so the filter asks the servers to leave the rest out. A server that ignores the filter is re-checked here: a report naming another network is dropped, one naming none is kept. Each monitor's newest report per server counts; listings fold them across monitors. NIP-66 warns that a monitor may be wrong or hostile, so the directory only ranks, completes and suggests: it never removes a server the person chose, and with no report at all suggest answers from the fallback (D-029).

      Parameters

      Returns RelayDirectory

      A directory; call start() to begin streaming.

      const directory = createRelayDirectory({ pool });
      directory.start();
      directory.search('damus');
      directory.suggest({ purpose: 'inbox', exclude: current });