Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ classDef subgraph_padding fill:none,stroke:none

subgraph channel_my_channel1 [Channel: my-channel1]
subgraph channel_my_channel1_padding [ ]
chaincode_chaincode1[[Chaincode: chaincode1]]
chaincode_chaincode1_my_channel1[[Chaincode: chaincode1]]
end
class channel_my_channel1_padding subgraph_padding
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3567,7 +3567,7 @@ classDef subgraph_padding fill:none,stroke:none

subgraph channel_my_channel1 [Channel: my-channel1]
subgraph channel_my_channel1_padding [ ]
chaincode_chaincode1[[Chaincode: chaincode1]]
chaincode_chaincode1_my_channel1[[Chaincode: chaincode1]]
end
class channel_my_channel1_padding subgraph_padding
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3629,7 +3629,7 @@ classDef subgraph_padding fill:none,stroke:none

subgraph channel_my_channel1 [Channel: my-channel1]
subgraph channel_my_channel1_padding [ ]
chaincode_chaincode1[[Chaincode: chaincode1]]
chaincode_chaincode1_my_channel1[[Chaincode: chaincode1]]
end
class channel_my_channel1_padding subgraph_padding
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3813,14 +3813,14 @@ classDef subgraph_padding fill:none,stroke:none

subgraph channel_my_channel1 [Channel: my-channel1]
subgraph channel_my_channel1_padding [ ]
chaincode_chaincode1[[Chaincode: chaincode1]]
chaincode_chaincode1_my_channel1[[Chaincode: chaincode1]]
end
class channel_my_channel1_padding subgraph_padding
end

subgraph channel_my_channel2 [Channel: my-channel2]
subgraph channel_my_channel2_padding [ ]
chaincode_chaincode1[[Chaincode: chaincode1]]
chaincode_chaincode1_my_channel2[[Chaincode: chaincode1]]
end
class channel_my_channel2_padding subgraph_padding
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4595,8 +4595,8 @@ classDef subgraph_padding fill:none,stroke:none

subgraph channel_my_channel1 [Channel: my-channel1]
subgraph channel_my_channel1_padding [ ]
chaincode_or_policy_chaincode[[Chaincode: or-policy-chaincode]]
chaincode_and_policy_chaincode[[Chaincode: and-policy-chaincode]]
chaincode_or_policy_chaincode_my_channel1[[Chaincode: or-policy-chaincode]]
chaincode_and_policy_chaincode_my_channel1[[Chaincode: and-policy-chaincode]]
end
class channel_my_channel1_padding subgraph_padding
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6579,7 +6579,7 @@ classDef subgraph_padding fill:none,stroke:none

subgraph channel_my_channel1 [Channel: my-channel1]
subgraph channel_my_channel1_padding [ ]
chaincode_chaincode1[[Chaincode: chaincode1]]
chaincode_chaincode1_my_channel1[[Chaincode: chaincode1]]
end
class channel_my_channel1_padding subgraph_padding
end
Expand All @@ -6594,7 +6594,7 @@ classDef subgraph_padding fill:none,stroke:none

subgraph channel_my_channel3 [Channel: my-channel3]
subgraph channel_my_channel3_padding [ ]
chaincode_chaincode2[[Chaincode: chaincode2]]
chaincode_chaincode2_my_channel3[[Chaincode: chaincode2]]
end
class channel_my_channel3_padding subgraph_padding
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7193,7 +7193,7 @@ classDef subgraph_padding fill:none,stroke:none

subgraph channel_my_channel1 [Channel: my-channel1]
subgraph channel_my_channel1_padding [ ]
chaincode_chaincode1[[Chaincode: chaincode1]]
chaincode_chaincode1_my_channel1[[Chaincode: chaincode1]]
end
class channel_my_channel1_padding subgraph_padding
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4029,7 +4029,7 @@ classDef subgraph_padding fill:none,stroke:none

subgraph channel_my_channel1 [Channel: my-channel1]
subgraph channel_my_channel1_padding [ ]
chaincode_chaincode1[[Chaincode: chaincode1]]
chaincode_chaincode1_my_channel1[[Chaincode: chaincode1]]
end
class channel_my_channel1_padding subgraph_padding
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4054,7 +4054,7 @@ classDef subgraph_padding fill:none,stroke:none

subgraph channel_my_channel1 [Channel: my-channel1]
subgraph channel_my_channel1_padding [ ]
chaincode_chaincode1[[Chaincode: chaincode1]]
chaincode_chaincode1_my_channel1[[Chaincode: chaincode1]]
end
class channel_my_channel1_padding subgraph_padding
end
Expand Down
4 changes: 2 additions & 2 deletions src/export-network-topology/generateMermaidDiagram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FabloConfigExtended, OrdererGroup } from "../types/FabloConfigExtended"
const safeId = (id: string): string => id.replace(/[^a-zA-Z0-9_]/g, "_");
const ordererGroupId = (g: OrdererGroup): string => safeId(`ord_group_${g.name}_${g.orderers?.[0].address}`);
const channelId = (channelName: string): string => safeId(`channel_${channelName}`);
const chaincodeId = (ccName: string): string => safeId(`chaincode_${ccName}`);
const chaincodeId = (ccName: string, channelName: string): string => safeId(`chaincode_${ccName}_${channelName}`);

export function generateMermaidDiagram(config: FabloConfigExtended): string {
const lines: string[] = ["graph LR"];
Expand Down Expand Up @@ -64,7 +64,7 @@ export function generateMermaidDiagram(config: FabloConfigExtended): string {
// Add chaincodes for this channel (using cylinder shape)
const channelChaincodes = config.chaincodes?.filter((cc) => cc.channel?.name === channel.name) ?? [];
channelChaincodes.forEach((cc) => {
lines.push(` ${chaincodeId(cc.name)}[[Chaincode: ${cc.name}]]`);
lines.push(` ${chaincodeId(cc.name, channel.name)}[[Chaincode: ${cc.name}]]`);
});

// Add dummy invisible node for empty channels to ensure visibility
Expand Down
Loading