Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dviejokfs committed Apr 4, 2022
1 parent 8b97267 commit f63520b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
21 changes: 3 additions & 18 deletions cmd/generate-certs/generate-certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package generate_certs

import (
"context"
"github.com/hashicorp/yamux"
"github.com/kfsoftware/getout/pkg/tunnel"
"github.com/kfsoftware/hlf-cc-dev/gql/models"
"github.com/kfsoftware/hlf-cc-dev/log"
"github.com/kfsoftware/getout/pkg/tunnel"
"github.com/pkg/errors"
"github.com/shurcooL/graphql"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -107,7 +106,6 @@ func (c startCmd) run() error {
ctx := context.Background()
input := models.DeployChaincodeInput{
Name: c.chaincode,
TenantID: c.tenant,
ChaincodeAddress: c.chaincodeAddress,
}
var m struct {
Expand Down Expand Up @@ -158,23 +156,10 @@ func (c startCmd) run() error {
return err
}
func startTunnel(tunnelAddr string, localAddress string, sni string) error {
conn, err := net.Dial("tcp", tunnelAddr)
if err != nil {
panic(err)
}
session, err := yamux.Client(conn, nil)
if err != nil {
panic(err)
}
tunnelCli := tunnel.NewTunnelClient(
session,
localAddress,
tunnelAddr,
)
err = tunnelCli.StartTlsTunnel(sni)
if err != nil {
return err
}
err = tunnelCli.Start()
err := tunnelCli.StartTlsTunnel(sni, localAddress)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type startCmd struct {

func (c startCmd) validate() error {
if c.tunnelAddress == "" {
return errors.New("--tunnel-addr is required")
return errors.New("--tunnelAddress is required")
}
if c.signaturePolicy == "" {
return errors.New("--signaturePolicy is required")
Expand Down Expand Up @@ -126,7 +126,7 @@ func (c startCmd) run() error {
tunnelCFGItem, err := tunnelConfig.Get(tunnelKey)
if err != nil {
return errors.Wrapf(err, `failed to get tunnel config, run the following command
hlf-cc-dev listen --forward-to=%s --tunnel-addr="xxx:8082"
hlf-cc-dev listen --forward-to=%s --tunnelAddress="xxx:8082"
`, c.localChaincodeAddress)
}

Expand Down Expand Up @@ -306,7 +306,7 @@ func NewStartCmd() *cobra.Command {
f := cmd.Flags()
f.StringVar(&c.chaincode, "chaincode", "", "chaincode name within the channel")
f.StringVar(&c.localChaincodeAddress, "localChaincode", "", "address of the local chaincode server, example: localhost:9999")
f.StringVar(&c.tunnelAddress, "tunnel-addr", "", "remote tunnel address, example: localhost:9999")
f.StringVar(&c.tunnelAddress, "tunnelAddress", "", "remote tunnel address, example: localhost:9999")
f.StringVar(&c.apiUrl, "apiUrl", "", "apiUrl to interact with the peers")
f.StringVar(&c.pdcFile, "pdc", "", "pdc file json, see examples/pdc.json")
f.StringVar(&c.accessToken, "accessToken", "", "access token")
Expand Down

0 comments on commit f63520b

Please sign in to comment.