Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions integration/nwo/fsc/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ package fsc
import (
"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fsc/node"
node2 "github.com/hyperledger-labs/fabric-smart-client/pkg/node"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/comm/host/libp2p"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/comm/host/rest"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/tracing"
)

Expand All @@ -25,8 +27,8 @@ type Logging struct {
type P2PCommunicationType = string

const (
LibP2P P2PCommunicationType = "libp2p"
WebSocket P2PCommunicationType = "websocket"
LibP2P P2PCommunicationType = libp2p.P2PCommunicationType
WebSocket P2PCommunicationType = rest.P2PCommunicationType
)

type Topology struct {
Expand Down
3 changes: 3 additions & 0 deletions platform/view/services/comm/host/libp2p/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import (
"github.com/hyperledger-labs/fabric-smart-client/platform/view/view"
)

// P2PCommunicationType is a string identifier for the libp2p implementation of the p2p comm stack.
const P2PCommunicationType = "libp2p"

type libp2pConfig interface {
PrivateKeyPath() string
Bootstrap() bool
Expand Down
3 changes: 3 additions & 0 deletions platform/view/services/comm/host/rest/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import (
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/id"
)

// P2PCommunicationType is a string identifier for the websocket implementation of the p2p comm stack.
const P2PCommunicationType = "websocket"

type pkiExtractor interface {
ExtractPKI(id []byte) []byte
}
Expand Down
3 changes: 1 addition & 2 deletions platform/view/services/comm/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package provider
import (
"strings"

"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fsc"
"github.com/hyperledger-labs/fabric-smart-client/platform/common/driver"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/comm"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/comm/host"
Expand All @@ -32,7 +31,7 @@ func NewHostProvider(
return nil, err
}

if p2pCommType := config.GetString("fsc.p2p.type"); strings.EqualFold(p2pCommType, fsc.WebSocket) {
if p2pCommType := config.GetString("fsc.p2p.type"); strings.EqualFold(p2pCommType, rest.P2PCommunicationType) {
return NewWebSocketHostProvider(config, endpointService, tracerProvider, metricsProvider)
} else {
return NewLibP2PHostProvider(config, endpointService, metricsProvider), nil
Expand Down
Loading