Skip to content

Commit

Permalink
Allow different channels for deploying the chaincode & use gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
dviejokfs committed Apr 14, 2022
1 parent fa254af commit daad665
Show file tree
Hide file tree
Showing 9 changed files with 742 additions and 412 deletions.
201 changes: 0 additions & 201 deletions cmd/generate-certs/generate-certs.go

This file was deleted.

7 changes: 3 additions & 4 deletions cmd/serve/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ func (c *serveCmd) run(conf *serveConfig) error {
fabsdk.WithUser(conf.Fabric.User),
fabsdk.WithOrg(conf.Fabric.Org),
)

embeddedBackend, err := configBackend()
if err != nil {
return err
Expand Down Expand Up @@ -239,12 +238,12 @@ type GatewayParams struct {
mspID string
}

func newIdentity(certificatePEM []byte) (*identity.X509Identity, error) {
func newIdentity(mspId string, certificatePEM []byte) (*identity.X509Identity, error) {
cert, err := identity.CertificateFromPEM(certificatePEM)
if err != nil {
return nil, err
}
id, err := identity.NewX509Identity("MEDIIOCHAINMSP", cert)
id, err := identity.NewX509Identity(mspId, cert)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -286,7 +285,7 @@ func newGrpcConnection(peerEndpoint string, tlsCert []byte) (*grpc.ClientConn, e
}
func getGateway(params GatewayParams, clientConnection *grpc.ClientConn) (*client.Gateway, error) {

id, err := newIdentity([]byte(params.adminCert))
id, err := newIdentity(params.mspID, []byte(params.adminCert))
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module github.com/kfsoftware/hlf-cc-dev
go 1.16

require (
github.com/99designs/gqlgen v0.14.0
github.com/99designs/gqlgen v0.17.1
github.com/VividCortex/gohistogram v1.0.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gosimple/slug v1.12.0
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
github.com/hyperledger/fabric-config v0.1.0
github.com/hyperledger/fabric-gateway v1.0.1
github.com/hyperledger/fabric-protos-go v0.0.0-20220315113721-7dc293e117f7
Expand All @@ -25,7 +25,7 @@ require (
github.com/slok/go-http-metrics v0.9.0
github.com/spf13/cobra v1.1.3
github.com/spf13/viper v1.7.0
github.com/vektah/gqlparser/v2 v2.2.0
github.com/vektah/gqlparser/v2 v2.4.0
google.golang.org/grpc v1.43.0
k8s.io/client-go v0.23.1
)
Expand Down
Loading

0 comments on commit daad665

Please sign in to comment.