-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (37 loc) · 1.04 KB
/
main.go
File metadata and controls
46 lines (37 loc) · 1.04 KB
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
package main
import (
"fmt"
"os"
"github.com/tramsyck/fabric-tutorial/blockchain"
"github.com/tramsyck/fabric-tutorial/web"
"github.com/tramsyck/fabric-tutorial/web/controllers"
)
func main() {
fSetup := blockchain.FabricSetup{
OrdererID: "orderer.example.com",
ChannelID: "samplechannel",
ChannelConfig: os.Getenv("GOPATH") + "/src/github.com/tramsyck/fabric-tutorial/fixtures/channel-artifacts/samplechannel.tx",
ChainCodeID: "samplechannel",
ChaincodeGoPath: os.Getenv("GOPATH"),
ChaincodePath: "github.com/tramsyck/fabric-tutorial/chaincode",
OrgAdmin: "Admin",
OrgName: "Org1",
ConfigFile: "config.yaml",
UserName: "User1",
}
err := fSetup.Initialize()
if err != nil {
fmt.Printf("Unable to initialize the Fabric SDK:%v\n", err)
return
}
defer fSetup.CloseSDK()
err = fSetup.InstallAndInstantiateCC()
if err != nil {
fmt.Printf("Unable to install and instantiate the chaincode:%v\n", err)
return
}
app := &controllers.Application{
Fabric: &fSetup,
}
web.Serve(app)
}