Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit d177ebb

Browse files
author
Pavan Kappara
committed
[FAB-9169] remove unused options in config
Change-Id: Ie1f6b76f2f74ca89a63283b5230cc3d2f7a964fa Signed-off-by: Pavan Kappara <pavan.kappara@securekey.com>
1 parent b02be7a commit d177ebb

30 files changed

+553
-602
lines changed

pkg/client/msp/testdata/config_test.yaml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@
88
# blockchain network that are necessary for the applications to interact with it. These are all
99
# knowledge that must be acquired from out-of-band sources. This file provides such a source.
1010
#
11-
name: "global-trade-network"
1211

13-
#
14-
# Describe what the target network is/does.
15-
#
16-
description: "The network to be in if you want to stay in the global trade business"
1712

1813
#
1914
# Schema version of the content. Used by the SDK to apply the corresponding parsing rules.
@@ -79,9 +74,6 @@ client:
7974
# Specific to the underlying KeyValueStore that backs the crypto key store.
8075
path: /tmp/idtestkeystore
8176

82-
# [Optional]. Specific to Composer environment. Not used by SDK Go.
83-
#wallet: wallet-name
84-
8577
# BCCSP config for the client. Used by GO SDK.
8678
BCCSP:
8779
security:
@@ -139,14 +131,6 @@ channels:
139131
# Default: true
140132
eventSource: true
141133

142-
# [Optional]. what chaincodes are expected to exist on this channel? The application can use
143-
# this information to validate that the target peers are in the expected state by comparing
144-
# this list with the query results of getInstalledChaincodes() and getInstantiatedChaincodes()
145-
chaincodes:
146-
# the format follows the "canonical name" of chaincodes by fabric code
147-
- example02:v1
148-
- marbles:1.0
149-
150134
# multi-org test channel
151135
orgchannel:
152136

@@ -187,18 +171,6 @@ organizations:
187171
certificateAuthorities:
188172
- ca.org1.example.com
189173

190-
# [Optional]. If the application is going to make requests that are reserved to organization
191-
# administrators, including creating/updating channels, installing/instantiating chaincodes, it
192-
# must have access to the admin identity represented by the private key and signing certificate.
193-
# Both properties can be the PEM string or local path to the PEM file. Note that this is mainly for
194-
# convenience in development mode, production systems should not expose sensitive information
195-
# this way. The SDK should allow applications to set the org admin identity via APIs, and only use
196-
# this route as an alternative when it exists.
197-
adminPrivateKey:
198-
pem: "-----BEGIN PRIVATE KEY----- <etc>"
199-
signedCert:
200-
path: "/tmp/somepath/signed-cert.pem"
201-
202174
# the profile will contain public information about organizations other than the one it belongs to.
203175
# These are necessary information to make transaction lifecycles work, including MSP IDs and
204176
# peers with a public URL to send transaction proposals. The file will not contain private
@@ -309,10 +281,6 @@ peers:
309281
certificateAuthorities:
310282
ca.org1.example.com:
311283
url: "http://localhost:8050"
312-
# the properties specified under this object are passed to the 'http' client verbatim when
313-
# making the request to the Fabric-CA server
314-
httpOptions:
315-
verify: true
316284
tlsCACerts:
317285
# Comma-Separated list of paths
318286
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/ca_root.pem
@@ -332,10 +300,6 @@ certificateAuthorities:
332300
caName: ca.org1.example.com
333301
ca.org2.example.com:
334302
url: "http://localhost:8050"
335-
# the properties specified under this object are passed to the 'http' client verbatim when
336-
# making the request to the Fabric-CA server
337-
httpOptions:
338-
verify: true
339303
tlsCACerts:
340304
# Comma-Separated list of paths
341305
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/ca_root.pem

pkg/client/resmgmt/testdata/ccproposal_test.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
# blockchain network that are necessary for the applications to interact with it. These are all
99
# knowledge that must be acquired from out-of-band sources. This file provides such a source.
1010
#
11-
name: "global-trade-network"
12-
13-
14-
description: "The network to be in if you want to stay in the global trade business"
1511
version: 1.0.0
1612

1713
client:

pkg/client/resmgmt/testdata/event_source_missing_test.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
# blockchain network that are necessary for the applications to interact with it. These are all
99
# knowledge that must be acquired from out-of-band sources. This file provides such a source.
1010
#
11-
name: "global-trade-network"
12-
13-
14-
description: "The network to be in if you want to stay in the global trade business"
1511
version: 1.0.0
1612

1713
client:

pkg/client/resmgmt/testdata/invalidchorderer_test.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# SPDX-License-Identifier: Apache-2.0
55
#
66

7-
name: "global-trade-network"
87

98
description: "Test Invalid Channel Orderer Error"
109
version: 1.0.0

pkg/client/resmgmt/testdata/invalidorderer_test.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# SPDX-License-Identifier: Apache-2.0
55
#
66

7-
name: "global-trade-network"
87

98
description: "Test Invalid Channel Orderer Error"
109
version: 1.0.0

pkg/client/resmgmt/testdata/noorderer_test.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# SPDX-License-Identifier: Apache-2.0
55
#
66

7-
name: "global-trade-network"
87

98
description: "Test No Orderer Error"
109
version: 1.0.0

pkg/common/providers/core/network.go

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
// NetworkConfig provides a static definition of a Hyperledger Fabric network
1515
type NetworkConfig struct {
1616
Name string
17-
Xtype string
1817
Description string
1918
Version string
2019
Client ClientConfig
@@ -31,7 +30,6 @@ type ClientConfig struct {
3130
Organization string
3231
Logging LoggingType
3332
CryptoConfig CCType
34-
TLS TLSType
3533
TLSCerts MutualTLSConfig
3634
CredentialStore CredentialStoreType
3735
}
@@ -46,18 +44,12 @@ type CCType struct {
4644
Path string
4745
}
4846

49-
// TLSType defines whether or not TLS is enabled
50-
type TLSType struct {
51-
Enabled bool
52-
}
53-
5447
// CredentialStoreType defines pluggable KV store properties
5548
type CredentialStoreType struct {
5649
Path string
5750
CryptoStore struct {
5851
Path string
5952
}
60-
Wallet string
6153
}
6254

6355
// ChannelConfig provides the definition of channels for the network
@@ -67,8 +59,6 @@ type ChannelConfig struct {
6759
// Peers a list of peer-channels that are part of this organization
6860
// to get the real Peer config object, use the Name field and fetch NetworkConfig.Peers[Name]
6961
Peers map[string]PeerChannelConfig
70-
// Chaincodes list of services
71-
Chaincodes []string
7262
//Policies list of policies for channel
7363
Policies ChannelPolicies
7464
}
@@ -113,8 +103,6 @@ type OrganizationConfig struct {
113103
Users map[string]TLSKeyPair
114104
Peers []string
115105
CertificateAuthorities []string
116-
AdminPrivateKey endpoint.TLSConfig
117-
SignedCert endpoint.TLSConfig
118106
}
119107

120108
// OrdererConfig defines an orderer configuration
@@ -134,11 +122,10 @@ type PeerConfig struct {
134122

135123
// CAConfig defines a CA configuration
136124
type CAConfig struct {
137-
URL string
138-
HTTPOptions map[string]interface{}
139-
TLSCACerts MutualTLSConfig
140-
Registrar EnrollCredentials
141-
CAName string
125+
URL string
126+
TLSCACerts MutualTLSConfig
127+
Registrar EnrollCredentials
128+
CAName string
142129
}
143130

144131
// EnrollCredentials holds credentials used for enrollment

pkg/common/providers/core/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ type Config interface {
5656
TLSClientCerts() ([]tls.Certificate, error)
5757
CredentialStorePath() string
5858
EventServiceType() EventServiceType
59+
Lookup(key string) (interface{}, bool)
5960
}
6061

6162
// ConfigProvider enables creation of a Config instance

pkg/common/providers/test/mockcore/mockcore.gen.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/core/config/config.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,15 @@ func (c *Config) EventServiceType() core.EventServiceType {
550550
}
551551
}
552552

553+
// Lookup gets the Value from config file by Key
554+
func (c *Config) Lookup(key string) (interface{}, bool) {
555+
value := c.configViper.Get(key)
556+
if value != nil {
557+
return value, true
558+
}
559+
return nil, false
560+
}
561+
553562
func (c *Config) getTimeout(tType core.TimeoutType) time.Duration {
554563
var timeout time.Duration
555564
switch tType {
@@ -621,7 +630,6 @@ func (c *Config) MSPID(org string) (string, error) {
621630
func (c *Config) cacheNetworkConfiguration() error {
622631
networkConfig := core.NetworkConfig{}
623632
networkConfig.Name = c.configViper.GetString("name")
624-
networkConfig.Xtype = c.configViper.GetString("x-type")
625633
networkConfig.Description = c.configViper.GetString("description")
626634
networkConfig.Version = c.configViper.GetString("version")
627635

0 commit comments

Comments
 (0)