Skip to content

Commit 1d3e267

Browse files
committed
Redirect samples to fabric-{chaincode,protos}-go
FAB-16401 #done Change-Id: I9e6c3857cf1842ccf43d7fa0d25ff64dbeae12d0 Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
1 parent 398a5b1 commit 1d3e267

File tree

26 files changed

+345
-1389
lines changed

26 files changed

+345
-1389
lines changed

chaincode/abac/go/abac.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import (
2020
"fmt"
2121
"strconv"
2222

23-
"github.com/hyperledger/fabric/core/chaincode/shim/ext/cid"
24-
"github.com/hyperledger/fabric/core/chaincode/shim"
25-
pb "github.com/hyperledger/fabric/protos/peer"
23+
"github.com/hyperledger/fabric-chaincode-go/pkg/cid"
24+
"github.com/hyperledger/fabric-chaincode-go/shim"
25+
pb "github.com/hyperledger/fabric-protos-go/peer"
2626
)
2727

2828
// SimpleChaincode example simple Chaincode implementation

chaincode/abac/go/abac_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import (
1010
"fmt"
1111
"testing"
1212

13-
"github.com/golang/protobuf/proto"
14-
"github.com/hyperledger/fabric/core/chaincode/shim"
15-
"github.com/hyperledger/fabric/core/chaincode/shim/shimtest"
16-
"github.com/hyperledger/fabric/protos/msp"
13+
"github.com/gogo/protobuf/proto"
14+
"github.com/hyperledger/fabric-chaincode-go/shim"
15+
"github.com/hyperledger/fabric-chaincode-go/shimtest"
16+
"github.com/hyperledger/fabric-protos-go/msp"
1717
)
1818

1919
// Cert with attribute. "abac.init":"true"

chaincode/abac/go/go.mod

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@ module github.com/hyperledger/fabric-samples/chaincode/abac/go
33
go 1.12
44

55
require (
6-
github.com/Knetic/govaluate v3.0.0+incompatible // indirect
7-
github.com/Shopify/sarama v1.22.1 // indirect
8-
github.com/golang/protobuf v1.3.1
9-
github.com/hashicorp/go-version v1.2.0 // indirect
10-
github.com/hyperledger/fabric v2.0.0-alpha.0.20190624224950-f2b8fef8859c+incompatible
11-
github.com/hyperledger/fabric-amcl v0.0.0-20181230093703-5ccba6eab8d6 // indirect
12-
github.com/miekg/pkcs11 v1.0.2 // indirect
13-
github.com/onsi/ginkgo v1.8.0 // indirect
14-
github.com/onsi/gomega v1.5.0 // indirect
15-
github.com/spf13/viper v1.4.0 // indirect
16-
github.com/sykesm/zap-logfmt v0.0.2 // indirect
17-
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 // indirect
18-
google.golang.org/grpc v1.21.1 // indirect
6+
github.com/gogo/protobuf v1.2.1
7+
github.com/hyperledger/fabric-chaincode-go v0.0.0-20190823162523-04390e015b85
8+
github.com/hyperledger/fabric-protos-go v0.0.0-20190821214336-621b908d5022
9+
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 // indirect
10+
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
11+
golang.org/x/text v0.3.2 // indirect
12+
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
1913
)

chaincode/abac/go/go.sum

Lines changed: 31 additions & 158 deletions
Large diffs are not rendered by default.

chaincode/abstore/go/abstore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020
"fmt"
2121
"strconv"
2222

23-
"github.com/hyperledger/fabric/core/chaincode/shim"
24-
pb "github.com/hyperledger/fabric/protos/peer"
23+
"github.com/hyperledger/fabric-chaincode-go/shim"
24+
pb "github.com/hyperledger/fabric-protos-go/peer"
2525
)
2626

2727
// ABstore Chaincode implementation

chaincode/abstore/go/go.mod

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@ module github.com/hyperledger/fabric-samples/chaincode/abstore/go
33
go 1.12
44

55
require (
6-
github.com/Knetic/govaluate v3.0.0+incompatible // indirect
7-
github.com/Shopify/sarama v1.22.1 // indirect
8-
github.com/hashicorp/go-version v1.2.0 // indirect
9-
github.com/hyperledger/fabric v2.0.0-alpha.0.20190624224950-f2b8fef8859c+incompatible
10-
github.com/hyperledger/fabric-amcl v0.0.0-20181230093703-5ccba6eab8d6 // indirect
11-
github.com/miekg/pkcs11 v1.0.2 // indirect
12-
github.com/onsi/ginkgo v1.8.0 // indirect
13-
github.com/onsi/gomega v1.5.0 // indirect
14-
github.com/spf13/viper v1.4.0 // indirect
15-
github.com/sykesm/zap-logfmt v0.0.2 // indirect
16-
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 // indirect
17-
google.golang.org/grpc v1.21.1 // indirect
6+
github.com/hyperledger/fabric-chaincode-go v0.0.0-20190823162523-04390e015b85
7+
github.com/hyperledger/fabric-protos-go v0.0.0-20190821214336-621b908d5022
8+
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 // indirect
9+
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
10+
golang.org/x/text v0.3.2 // indirect
11+
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
1812
)

chaincode/abstore/go/go.sum

Lines changed: 31 additions & 164 deletions
Large diffs are not rendered by default.

chaincode/fabcar/go/fabcar.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ import (
3434
"fmt"
3535
"strconv"
3636

37-
"github.com/hyperledger/fabric/core/chaincode/shim"
38-
sc "github.com/hyperledger/fabric/protos/peer"
37+
"github.com/hyperledger/fabric-chaincode-go/shim"
38+
pb "github.com/hyperledger/fabric-protos-go/peer"
3939
)
4040

4141
// Define the Smart Contract structure
@@ -54,15 +54,15 @@ type Car struct {
5454
* The Init method is called when the Smart Contract "fabcar" is instantiated by the blockchain network
5555
* Best practice is to have any Ledger initialization in separate function -- see initLedger()
5656
*/
57-
func (s *SmartContract) Init(APIstub shim.ChaincodeStubInterface) sc.Response {
57+
func (s *SmartContract) Init(APIstub shim.ChaincodeStubInterface) pb.Response {
5858
return shim.Success(nil)
5959
}
6060

6161
/*
6262
* The Invoke method is called as a result of an application request to run the Smart Contract "fabcar"
6363
* The calling application program has also specified the particular smart contract function to be called, with arguments
6464
*/
65-
func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {
65+
func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) pb.Response {
6666

6767
// Retrieve the requested Smart Contract function and arguments
6868
function, args := APIstub.GetFunctionAndParameters()
@@ -82,7 +82,7 @@ func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response
8282
return shim.Error("Invalid Smart Contract function name.")
8383
}
8484

85-
func (s *SmartContract) queryCar(APIstub shim.ChaincodeStubInterface, args []string) sc.Response {
85+
func (s *SmartContract) queryCar(APIstub shim.ChaincodeStubInterface, args []string) pb.Response {
8686

8787
if len(args) != 1 {
8888
return shim.Error("Incorrect number of arguments. Expecting 1")
@@ -92,7 +92,7 @@ func (s *SmartContract) queryCar(APIstub shim.ChaincodeStubInterface, args []str
9292
return shim.Success(carAsBytes)
9393
}
9494

95-
func (s *SmartContract) initLedger(APIstub shim.ChaincodeStubInterface) sc.Response {
95+
func (s *SmartContract) initLedger(APIstub shim.ChaincodeStubInterface) pb.Response {
9696
cars := []Car{
9797
Car{Make: "Toyota", Model: "Prius", Colour: "blue", Owner: "Tomoko"},
9898
Car{Make: "Ford", Model: "Mustang", Colour: "red", Owner: "Brad"},
@@ -116,7 +116,7 @@ func (s *SmartContract) initLedger(APIstub shim.ChaincodeStubInterface) sc.Respo
116116
return shim.Success(nil)
117117
}
118118

119-
func (s *SmartContract) createCar(APIstub shim.ChaincodeStubInterface, args []string) sc.Response {
119+
func (s *SmartContract) createCar(APIstub shim.ChaincodeStubInterface, args []string) pb.Response {
120120

121121
if len(args) != 5 {
122122
return shim.Error("Incorrect number of arguments. Expecting 5")
@@ -130,7 +130,7 @@ func (s *SmartContract) createCar(APIstub shim.ChaincodeStubInterface, args []st
130130
return shim.Success(nil)
131131
}
132132

133-
func (s *SmartContract) queryAllCars(APIstub shim.ChaincodeStubInterface) sc.Response {
133+
func (s *SmartContract) queryAllCars(APIstub shim.ChaincodeStubInterface) pb.Response {
134134

135135
startKey := "CAR0"
136136
endKey := "CAR999"
@@ -173,7 +173,7 @@ func (s *SmartContract) queryAllCars(APIstub shim.ChaincodeStubInterface) sc.Res
173173
return shim.Success(buffer.Bytes())
174174
}
175175

176-
func (s *SmartContract) changeCarOwner(APIstub shim.ChaincodeStubInterface, args []string) sc.Response {
176+
func (s *SmartContract) changeCarOwner(APIstub shim.ChaincodeStubInterface, args []string) pb.Response {
177177

178178
if len(args) != 2 {
179179
return shim.Error("Incorrect number of arguments. Expecting 2")

chaincode/fabcar/go/go.mod

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@ module github.com/hyperledger/fabric-samples/chaincode/fabcar/go
33
go 1.12
44

55
require (
6-
github.com/Knetic/govaluate v3.0.0+incompatible // indirect
7-
github.com/Shopify/sarama v1.22.1 // indirect
8-
github.com/hashicorp/go-version v1.2.0 // indirect
9-
github.com/hyperledger/fabric v2.0.0-alpha.0.20190624224950-f2b8fef8859c+incompatible
10-
github.com/hyperledger/fabric-amcl v0.0.0-20181230093703-5ccba6eab8d6 // indirect
11-
github.com/miekg/pkcs11 v1.0.2 // indirect
12-
github.com/onsi/ginkgo v1.8.0 // indirect
13-
github.com/onsi/gomega v1.5.0 // indirect
14-
github.com/spf13/viper v1.4.0 // indirect
15-
github.com/sykesm/zap-logfmt v0.0.2 // indirect
16-
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 // indirect
17-
google.golang.org/grpc v1.21.1 // indirect
6+
github.com/hyperledger/fabric-chaincode-go v0.0.0-20190823162523-04390e015b85
7+
github.com/hyperledger/fabric-protos-go v0.0.0-20190821214336-621b908d5022
8+
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 // indirect
9+
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
10+
golang.org/x/text v0.3.2 // indirect
11+
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
1812
)

0 commit comments

Comments
 (0)