UNPKG

@decaf-ts/fabric-weaver

Version:
54 lines (53 loc) 2.6 kB
import { Logger } from "@decaf-ts/logging"; import { AdminConfig, BCCSPConfig, BootstrapConfig, ChannelParticipationConfig, ClusterConfig, ConsensusConfig, DebugConfig, KafkaConfig, KeepAliveConfig, MetricsConfig, MSGSizeConfig, MSPConfig, OperationsConfig, ProfileConfig, TLSConfig } from "../interfaces/fabric/orderer-config"; export declare class FabricOrdererConfigBuilder { private log; private config; constructor(logger?: Logger); setKafka(kafka?: KafkaConfig): this; setFileLedgerLocation(fileLedgerLocation?: string): this; setAuthWindow(authWindow?: string): this; setBCCSP(bccsp?: BCCSPConfig): this; setDebug(debug?: DebugConfig): this; setOperations(operations?: OperationsConfig): this; setMetrics(metrics?: MetricsConfig): this; setProfile(profile?: ProfileConfig): this; setLocalMSP(msp?: MSPConfig): this; setBootstrap(boot?: BootstrapConfig): this; setCluster(cluster?: ClusterConfig): this; setMSGSize(cfg?: MSGSizeConfig): this; setKeepAlive(keepAlive?: KeepAliveConfig): this; setListenAddress(address?: string): this; setPort(port?: number): this; setTLS(tls?: TLSConfig): this; setAdmin(cfg?: AdminConfig): this; setChannelParticipation(channelParticipation?: ChannelParticipationConfig): this; setConsensus(consensus?: ConsensusConfig): this; /** * @description Saves the current configuration to a file. * @summary Writes the current Fabric CA Server configuration to a YAML file at the specified path. If the directory doesn't exist, it will be created. * @param {string} cpath - The path where the configuration file should be saved. * @return {this} The current instance of the builder for method chaining. * @example * const builder = new FabricCAServerCommandBuilder(); * builder.save('/path/to/config/fabric-ca-server.yaml'); * * @mermaid * sequenceDiagram * participant Client * participant Builder as FabricCAServerCommandBuilder * participant FileSystem as File System * Client->>Builder: saveConfig('/path/to/config/fabric-ca-server.yaml') * Builder->>Builder: Check if cpath is defined * alt cpath is defined * Builder->>FileSystem: Check if directory exists * alt Directory doesn't exist * Builder->>FileSystem: Create directory * end * Builder->>Builder: Log debug message * Builder->>FileSystem: Write YAML configuration to file * end * Builder-->>Client: Return this */ save(cpath?: string): this; }