public static constructNodes()

in src/node.ts [83:96]


  public static constructNodes(scope: network.HyperledgerFabricNetwork, nodeProps?: Array<HyperledgerFabricNodeProps>) {
    // If no node configurations are provided, create one; the empty object
    // will be populated with defaults when passed to the node constructor
    if (typeof nodeProps === 'undefined') nodeProps = [{}];
    const starter = scope.networkEdition === network.NetworkEdition.STARTER;
    if (starter && nodeProps.length > 2) {
      throw new Error('A starter network can have at most 2 nodes per member.');
    }
    if (!starter && nodeProps.length > 3) {
      throw new Error('A standard network can have at most 3 nodes per member.');
    }
    // Construct the node list, using an index value in the identifier
    return Array.from(nodeProps.entries()).map(e => new HyperledgerFabricNode(scope, `Node${e[0]}`, e[1]));
  }