diff --git a/src/instance/bdkFile.ts b/src/instance/bdkFile.ts index 749b4a7c..a243e3a5 100644 --- a/src/instance/bdkFile.ts +++ b/src/instance/bdkFile.ts @@ -223,7 +223,7 @@ export default class BdkFile { fs.writeFileSync(`${this.bdkPath}/config-yaml/${channelName}Channel/configtx.yaml`, configtxYaml.getYamlString()) } - public createChannelArtifact (channelName: string) { + public createChannelArtifactFolder (channelName: string) { fs.mkdirSync(`${this.bdkPath}/channel-artifacts/${channelName}`, { recursive: true }) } diff --git a/src/service/channel.ts b/src/service/channel.ts index 6d51a9cd..6869a018 100644 --- a/src/service/channel.ts +++ b/src/service/channel.ts @@ -33,8 +33,8 @@ export default class Channel extends AbstractService { return { createChannelArtifact: async (data: ChannelCreateType) => { this.generateChannelConfigtxYaml(data) + this.bdkFile.createChannelArtifactFolder(data.channelName) await (new FabricTools(this.config, this.infra)).convertChannelConfigtxToTx(data.channelName) - this.bdkFile.createChannelArtifact(data.channelName) }, createOnInstance: async (data: ChannelCreateType): Promise => { return await (new FabricInstance(this.config, this.infra)).createChannel(data.channelName, data.orderer) @@ -88,7 +88,7 @@ export default class Channel extends AbstractService { logger.debug(`Channel Update Anchor Peer: fetch ${ChannelConfigEnum.CONFIG_BLOCK} block in ${channelName}`) - this.bdkFile.createChannelArtifact(channelName) + this.bdkFile.createChannelArtifactFolder(channelName) return await this.fetchChannelConfig(channelName, signType) }, computeUpdateConfigTx: async (dto: ChannelUpdateAnchorPeerType) => { @@ -165,19 +165,19 @@ export default class Channel extends AbstractService { fetchChannelNewestBlock: async (data: ChannelFetchBlockType): Promise => { const { orderer, outputFileName, orgType, channelName } = data - this.bdkFile.createChannelArtifact(channelName) + this.bdkFile.createChannelArtifactFolder(channelName) return await (new FabricInstance(this.config, this.infra)).fetchChannelNewestBlock(channelName, outputFileName, 'block', orderer, orgType || this.config.orgType) }, fetchChannelGenesisBlock: async (data: ChannelFetchBlockType): Promise => { const { orderer, outputFileName, channelName, orgType } = data - this.bdkFile.createChannelArtifact(channelName) + this.bdkFile.createChannelArtifactFolder(channelName) return await (new FabricInstance(this.config, this.infra)).fetchChannelBlock0(channelName, outputFileName, 'block', orderer, orgType || this.config.orgType) }, fetchChannelConfig: async (data: ChannelFetchBlockType): Promise => { const { orderer, channelName, outputFileName, orgType } = data - this.bdkFile.createChannelArtifact(channelName) + this.bdkFile.createChannelArtifactFolder(channelName) return await (new FabricInstance(this.config, this.infra)).fetchChannelConfig(channelName, outputFileName, 'block', orderer, orgType || this.config.orgType) }, }