-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathgenerator.go
43 lines (39 loc) · 1.66 KB
/
generator.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import "fmt"
func GenerateNetworkItems(configBytes []byte, baseOutputPath string) {
if !GenerateConfigTxGen(configBytes, baseOutputPath+"/configtx.yaml") {
fmt.Errorf("Error in generation of configtx.yaml")
}
fmt.Println("configtx.yaml generated ...")
if !GenerateCrytoConfig(configBytes, baseOutputPath+"/crypto-config.yaml") {
fmt.Errorf("Error in generation of crypto-config.yaml")
return
}
fmt.Println("crypto-config.yaml generated....")
if !GenerateDockerFiles(configBytes, baseOutputPath) {
fmt.Errorf("Error in generating the docker files")
}
fmt.Println("Generated docker-compose.yaml ..")
fmt.Println("setpeers.sh generation in progress ....")
if !GenerateSetPeer(configBytes, baseOutputPath+"/setpeer.sh") {
fmt.Errorf("Error in generating the setpeer.sh")
}
fmt.Println("generateartifacts.sh generation in progress ....")
if !GenerateGenerateArtifactsScript(configBytes, baseOutputPath+"/generateartifacts.sh") {
fmt.Errorf("Error in generating the generateartifacts.sh")
}
fmt.Println("buildandjoinchannel.sh generation in progress ....")
if !GenerateBuildAndJoinChannelScript(configBytes, baseOutputPath+"/buildandjoinchannel.sh") {
fmt.Println("Error in generating the buildandjoinchannel.sh")
}
fmt.Println("Generating misc scripts ....")
if !GenerateOtherScripts(configBytes, baseOutputPath+"/") {
fmt.Println("Error in generating misc scripts")
}
fmt.Println("Generating chaincode related scripts ....")
if !GenerateChainCodeScripts(configBytes, baseOutputPath+"/") {
fmt.Println("Error in generating chain code related scripts")
}
fmt.Println("Generating README.md")
GenerateReadme(configBytes, baseOutputPath+"/")
}