-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.go
72 lines (54 loc) · 1.41 KB
/
main.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package main
import (
"fmt"
"multiorgledger/blockchain/org"
"multiorgledger/web"
"multiorgledger/web/html"
"multiorgledger/web/rest"
"strings"
)
func main() {
fmt.Println(" Choose the following ")
fmt.Println(" 1. Deploy the network")
fmt.Println(" 2. Start the Rest Server (Listening (http://localhost:4000) ...)")
fmt.Println(" 3. Start the Html Web App (Listening (http://localhost:6000) ...)")
fmt.Println(" 4. Create Dummy Users")
var choose string
fmt.Scanln(&choose)
setup := &org.OrgSetup{}
_ = setup.Init(false)
if strings.EqualFold(choose, "1") {
fmt.Println(" Deployement of a network")
fmt.Println(" 1. Create Channel")
fmt.Println(" 2. Join Channel")
fmt.Println(" 3. Install Chaincode")
fmt.Println(" 4. Instantiate Chaincode")
fmt.Println(" 5. Test Invoke")
fmt.Println(" 6. Upgrade Chaincode")
fmt.Println(" 7. Query Installed Chaincode")
fmt.Println(" 8. Query Instantiate Chaincode")
fmt.Println(" 9. Affiliate an Org")
var cmd string
fmt.Scanln(&cmd)
err := DeployCMD(&org.OrgSetup{}, cmd)
if err != nil {
fmt.Println(" setup Failed " + err.Error())
return
}
}
if strings.EqualFold(choose, "2") {
app := &rest.RestApp{
Org: setup,
}
web.RestServe(app)
}
if strings.EqualFold(choose, "3") {
app := &html.HtmlApp{
Org: setup,
}
web.ServeWeb(app)
}
if strings.EqualFold(choose, "4") {
SampleUsers()
}
}