-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
34 lines (27 loc) · 922 Bytes
/
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
/*
* SPDX-License-Identifier: Apache-2.0
*/
package main
import (
"github.com/hyperledger/fabric-contract-api-go/contractapi"
"github.com/hyperledger/fabric-contract-api-go/metadata"
)
func main() {
workshopContract := new(WorkshopContract)
workshopContract.Info.Version = "0.0.1"
workshopContract.Info.Description = "My Smart Contract"
workshopContract.Info.License = new(metadata.LicenseMetadata)
workshopContract.Info.License.Name = "Apache-2.0"
workshopContract.Info.Contact = new(metadata.ContactMetadata)
workshopContract.Info.Contact.Name = "John Doe"
chaincode, err := contractapi.NewChaincode(workshopContract)
chaincode.Info.Title = "fabric_e-workshop chaincode"
chaincode.Info.Version = "0.0.1"
if err != nil {
panic("Could not create chaincode from WorkshopContract." + err.Error())
}
err = chaincode.Start()
if err != nil {
panic("Failed to start chaincode. " + err.Error())
}
}