RPC operations exposed by the metrics

interface MetricsRPC {
    contentRouting: ContentRouting;
    peerRouting: PeerRouting;
    pubsub: {
        getSubscribers(component, topic): Promise<PeerId[]>;
        getTopics(component): Promise<string[]>;
        publish(component, topic, message): Promise<void>;
        subscribe(component, topic): Promise<void>;
        unsubscribe(component, topic): Promise<void>;
    };
    closeConnection(peerId, options?): Promise<void>;
    init(options?): Promise<{
        capabilities: Record<string, string[]>;
        debug: string;
        peers: Peer[];
        self: Peer;
    }>;
    openConnection(peerIdOrMultiaddr, options?): Promise<void>;
    setDebug(namespace?): Promise<void>;
}

Properties

contentRouting: ContentRouting

Make content routing queries

peerRouting: PeerRouting

Make peer routing queries

pubsub: {
    getSubscribers(component, topic): Promise<PeerId[]>;
    getTopics(component): Promise<string[]>;
    publish(component, topic, message): Promise<void>;
    subscribe(component, topic): Promise<void>;
    unsubscribe(component, topic): Promise<void>;
}

PubSub operations

Type declaration

  • getSubscribers:function
  • getTopics:function
    • Get the list of subscriptions for the current node

      Parameters

      • component: string

      Returns Promise<string[]>

  • publish:function
  • subscribe:function
    • Subscribe to a PubSub topic

      Parameters

      • component: string
      • topic: string

      Returns Promise<void>

  • unsubscribe:function
    • Unsubscribe from a PubSub topic

      Parameters

      • component: string
      • topic: string

      Returns Promise<void>

Methods

  • Called by DevTools on initial connect

    Parameters

    Returns Promise<{
        capabilities: Record<string, string[]>;
        debug: string;
        peers: Peer[];
        self: Peer;
    }>

  • Update the currently active debugging namespaces

    Parameters

    • Optional namespace: string

    Returns Promise<void>