interface Registrar {
    getHandler(protocol): StreamHandlerRecord;
    getProtocols(): string[];
    getTopologies(protocol): Topology[];
    handle(protocol, handler, options?): Promise<void>;
    register(protocol, topology): Promise<string>;
    unhandle(protocol): Promise<void>;
    unregister(id): void;
}

Methods

  • Register a topology handler for a protocol - the topology will be invoked when peers are discovered on the network that support the passed protocol.

    An id will be returned that can later be used to unregister the topology.

    Parameters

    Returns Promise<string>