subscribeNetwork(network) {
    /**
     * @type {Array<SubgraphContext>}
     */
    const contexts = [];
    network.on('start', () => {
      const ctx = {
        activated: false,
        deactivated: false,
        result: {},
      };
      contexts.push(ctx);
      this.activate(ctx);
    });
    network.on('end', () => {
      const ctx = contexts.pop();
      if (!ctx) { return; }
      this.deactivate(ctx);
    });
  }
@param {import("../lib/Network").Network} network