-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-10568] endpoint config refactoring
-remove Network config Name,Description,Version -some minor cleanup Change-Id: Ic74766271e63e39556423418afa6f237575e30fd Signed-off-by: Sudesh Shetty <sudesh.shetty@securekey.com> Signed-off-by: Emir Heidinger <emir.heidinger@securekey.com>
- Loading branch information
1 parent
83bfc05
commit 68e4066
Showing
7 changed files
with
140 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package fab | ||
|
||
import ( | ||
"github.com/hyperledger/fabric-sdk-go/pkg/common/errors/retry" | ||
"github.com/hyperledger/fabric-sdk-go/pkg/core/config/endpoint" | ||
) | ||
|
||
//endpointConfigEntity contains endpoint config elements needed by endpointconfig | ||
type endpointConfigEntity struct { | ||
Client ClientConfig | ||
Channels map[string]ChannelEndpointConfig | ||
Organizations map[string]OrganizationConfig | ||
Orderers map[string]OrdererConfig | ||
Peers map[string]PeerConfig | ||
} | ||
|
||
//entityMatchers for endpoint configuration | ||
type entityMatchers struct { | ||
matchers map[string][]MatchConfig | ||
} | ||
|
||
// ClientConfig provides the definition of the client configuration | ||
type ClientConfig struct { | ||
Organization string | ||
TLSCerts ClientTLSConfig | ||
} | ||
|
||
// ClientTLSConfig contains the client TLS configuration | ||
type ClientTLSConfig struct { | ||
//Client TLS information | ||
Client endpoint.TLSKeyPair | ||
} | ||
|
||
// OrdererConfig defines an orderer configuration | ||
type OrdererConfig struct { | ||
URL string | ||
GRPCOptions map[string]interface{} | ||
TLSCACerts endpoint.TLSConfig | ||
} | ||
|
||
// PeerConfig defines a peer configuration | ||
type PeerConfig struct { | ||
URL string | ||
EventURL string | ||
GRPCOptions map[string]interface{} | ||
TLSCACerts endpoint.TLSConfig | ||
} | ||
|
||
// OrganizationConfig provides the definition of an organization in the network | ||
type OrganizationConfig struct { | ||
MSPID string | ||
CryptoPath string | ||
Users map[string]endpoint.TLSKeyPair | ||
Peers []string | ||
CertificateAuthorities []string | ||
} | ||
|
||
// ChannelEndpointConfig provides the definition of channels for the network | ||
type ChannelEndpointConfig struct { | ||
// Orderers list of ordering service nodes | ||
Orderers []string | ||
// Peers a list of peer-channels that are part of this organization | ||
// to get the real Peer config object, use the Name field and fetch NetworkConfig.Peers[Name] | ||
Peers map[string]PeerChannelConfig | ||
//Policies list of policies for channel | ||
Policies ChannelPolicies | ||
} | ||
|
||
//ChannelPolicies defines list of policies defined for a channel | ||
type ChannelPolicies struct { | ||
//Policy for querying channel block | ||
QueryChannelConfig QueryChannelConfigPolicy | ||
} | ||
|
||
//QueryChannelConfigPolicy defines opts for channelConfigBlock | ||
type QueryChannelConfigPolicy struct { | ||
MinResponses int | ||
MaxTargets int | ||
RetryOpts retry.Opts | ||
} | ||
|
||
// PeerChannelConfig defines the peer capabilities | ||
type PeerChannelConfig struct { | ||
EndorsingPeer bool | ||
ChaincodeQuery bool | ||
LedgerQuery bool | ||
EventSource bool | ||
} | ||
|
||
// MatchConfig contains match pattern and substitution pattern | ||
// for pattern matching of network configured hostnames or channel names with static config | ||
type MatchConfig struct { | ||
Pattern string | ||
|
||
// these are used for hostname mapping | ||
URLSubstitutionExp string | ||
EventURLSubstitutionExp string | ||
SSLTargetOverrideURLSubstitutionExp string | ||
MappedHost string | ||
|
||
// this is used for Name mapping instead of hostname mappings | ||
MappedName string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters