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

Commit 3701453

Browse files
committed
[FAB-11063] IgnoreEndpoint in peer/orderer/ca config
If marked `IgnoreEndpoint: true` then config for, peer excluded in org peers peer excluded in network peers peer excluded in peer search by name peer excluded in peer search by URL orderer excluded in orderers list orderer excluded in orderer search by name orderer excluded in orderer search by URL peer/orderer excluded in networkconfig CA will be excluded in ca config list Change-Id: I8485b1f7becaaf1f2b172858b5c842e1cf7563bb Signed-off-by: Sudesh Shetty <sudesh.shetty@securekey.com>
1 parent d489eba commit 3701453

File tree

10 files changed

+715
-140
lines changed

10 files changed

+715
-140
lines changed

pkg/core/config/testdata/config_test_entity_matchers.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@ entityMatchers:
393393
sslTargetOverrideUrlSubstitutionExp: peer0.org1.example.com
394394
mappedHost: local.peer0.org1.example.com
395395

396+
- pattern: (\w+).example5.(\w+)
397+
ignoreEndpoint: true
398+
399+
- pattern: (\w+).example5.(\w+):(\d+)
400+
ignoreEndpoint: true
401+
396402
orderer:
397403
- pattern: (\w+).example2.(\w+)
398404
urlSubstitutionExp: localhost:7050
@@ -414,6 +420,12 @@ entityMatchers:
414420
sslTargetOverrideUrlSubstitutionExp: $1.example.$2
415421
mappedHost: local.orderer.example.com
416422

423+
- pattern: (\w+).example5.(\w+)
424+
ignoreEndpoint: true
425+
426+
- pattern: (\w+).example5.(\w+):(\d+)
427+
ignoreEndpoint: true
428+
417429
certificateAuthority:
418430
- pattern: (\w+).org1.example.(\w+)
419431
urlSubstitutionExp: https://ca.org1.example.com:7054
@@ -423,6 +435,10 @@ entityMatchers:
423435
urlSubstitutionExp: https://ca.org2.example.com:8054
424436
mappedHost: local.ca.org2.example.com
425437

438+
- pattern: (\w+).org2.example2.(\w+)
439+
ignoreEndpoint: true
440+
441+
426442
channel:
427443
- pattern: ^(sample)(\w*)(channel)$
428444
mappedName: ch1
Lines changed: 307 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,307 @@
1+
#
2+
# Copyright SecureKey Technologies Inc. All Rights Reserved.
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
#
7+
# The network connection profile provides client applications the information about the target
8+
# blockchain network that are necessary for the applications to interact with it. These are all
9+
# knowledge that must be acquired from out-of-band sources. This file provides such a source.
10+
#
11+
#
12+
# [Optional]. But most apps would have this section so that channel objects can be constructed
13+
# based on the content below. If an app is creating channels, then it likely will not need this
14+
# section.
15+
#
16+
channels:
17+
# test channel
18+
matcherchannel:
19+
20+
orderers:
21+
- orderer.example.com
22+
- orderer.exclude.example.com
23+
24+
peers:
25+
peer0.org1.example.com:
26+
endorsingPeer: true
27+
chaincodeQuery: true
28+
ledgerQuery: true
29+
eventSource: true
30+
31+
peer0.org2.example.com:
32+
endorsingPeer: true
33+
chaincodeQuery: true
34+
ledgerQuery: true
35+
eventSource: true
36+
37+
peer1.org1.example.com:
38+
endorsingPeer: true
39+
chaincodeQuery: true
40+
ledgerQuery: true
41+
eventSource: true
42+
43+
peer1.org2.example.com:
44+
endorsingPeer: true
45+
chaincodeQuery: true
46+
ledgerQuery: true
47+
eventSource: true
48+
49+
50+
51+
organizations:
52+
org1:
53+
mspid: Org1MSP
54+
55+
# This org's MSP store (absolute path or relative to client.cryptoconfig)
56+
cryptoPath: peerOrganizations/org1.example.com/users/{username}@org1.example.com/msp
57+
58+
peers:
59+
- peer0.org1.example.com
60+
- peer1.org1.example.com
61+
62+
# [Optional]. Certificate Authorities issue certificates for identification purposes in a Fabric based
63+
# network. Typically certificates provisioning is done in a separate process outside of the
64+
# runtime network. Fabric-CA is a special certificate authority that provides a REST APIs for
65+
# dynamic certificate management (enroll, revoke, re-enroll). The following section is only for
66+
# Fabric-CA servers.
67+
certificateAuthorities:
68+
- ca.org1.example.com
69+
70+
# the profile will contain public information about organizations other than the one it belongs to.
71+
# These are necessary information to make transaction lifecycles work, including MSP IDs and
72+
# peers with a public URL to send transaction proposals. The file will not contain private
73+
# information reserved for members of the organization, such as admin key and certificate,
74+
# fabric-ca registrar enroll ID and secret, etc.
75+
org2:
76+
mspid: Org2MSP
77+
78+
# This org's MSP store (absolute path or relative to client.cryptoconfig)
79+
cryptoPath: peerOrganizations/org2.example.com/users/{username}@org2.example.com/msp
80+
81+
peers:
82+
- peer0.org2.example.com
83+
- peer1.org2.example.com
84+
85+
certificateAuthorities:
86+
- ca.org2.example.com
87+
88+
# Orderer Org name
89+
ordererorg:
90+
# Membership Service Provider ID for this organization
91+
mspID: "OrdererOrg"
92+
93+
# Needed to load users crypto keys and certs for this org (absolute path or relative to global crypto path, DEV mode)
94+
cryptoPath: ordererOrganizations/example.com/users/{username}@example.com/msp
95+
96+
orderers:
97+
default:
98+
# these are standard properties defined by the gRPC library
99+
# they will be passed in as-is to gRPC client constructor
100+
grpcOptions:
101+
# These parameters should be set in coordination with the keepalive policy on the server,
102+
# as incompatible settings can result in closing of connection.
103+
# When duration of the 'keep-alive-time' is set to 0 or less the keep alive client parameters are disabled
104+
keep-alive-time: 1s
105+
keep-alive-timeout: 21s
106+
keep-alive-permit: true
107+
fail-fast: true
108+
#will be taken into consideration if address has no protocol defined, if true then grpc or else grpcs
109+
allow-insecure: true
110+
111+
tlsCACerts:
112+
# Certificate location absolute path
113+
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/${CRYPTOCONFIG_FIXTURES_PATH}/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem
114+
115+
orderer.example.com:
116+
url: orderer.example.com:7050
117+
118+
# these are standard properties defined by the gRPC library
119+
# they will be passed in as-is to gRPC client constructor
120+
grpcOptions:
121+
ssl-target-name-override: orderer.example.com
122+
123+
orderer.exclude.example.com:
124+
url: orderer.exclude.example.com:8050
125+
126+
# these are standard properties defined by the gRPC library
127+
# they will be passed in as-is to gRPC client constructor
128+
grpcOptions:
129+
ssl-target-name-override: orderer.example.com
130+
131+
peers:
132+
default:
133+
grpcOptions:
134+
# These parameters should be set in coordination with the keepalive policy on the server,
135+
# as incompatible settings can result in closing of connection.
136+
# When duration of the 'keep-alive-time' is set to 0 or less the keep alive client parameters are disabled
137+
keep-alive-time: 1s
138+
keep-alive-timeout: 21s
139+
keep-alive-permit: true
140+
fail-fast: true
141+
#will be taken into consideration if address has no protocol defined, if true then grpc or else grpcs
142+
allow-insecure: true
143+
144+
tlsCACerts:
145+
# Certificate location absolute path
146+
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/${CRYPTOCONFIG_FIXTURES_PATH}/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem
147+
148+
peer0.org1.example.com:
149+
# this URL is used to send endorsement and query requests
150+
url: peer0.org1.example.com:7051
151+
152+
# this URL is used to connect the EventHub and registering event listeners
153+
eventUrl: peer0.org1.example.com:7053
154+
155+
grpcOptions:
156+
ssl-target-name-override: peer0.org1.example.com
157+
158+
peer1.org1.example.com:
159+
# this URL is used to send endorsement and query requests
160+
url: peer1.org1.example.com:7151
161+
162+
# this URL is used to connect the EventHub and registering event listeners
163+
eventUrl: peer1.org1.example.com:7153
164+
165+
grpcOptions:
166+
ssl-target-name-override: peer1.org1.example.com
167+
168+
peer0.org2.example.com:
169+
# this URL is used to send endorsement and query requests
170+
url: peer0.org2.example.com:8051
171+
172+
# this URL is used to connect the EventHub and registering event listeners
173+
eventUrl: peer0.org2.example.com:8053
174+
175+
grpcOptions:
176+
ssl-target-name-override: peer0.org2.example.com
177+
178+
peer1.org2.example.com:
179+
# this URL is used to send endorsement and query requests
180+
url: peer1.org2.example.com:8151
181+
182+
# this URL is used to connect the EventHub and registering event listeners
183+
eventUrl: peer1.org2.example.com:8153
184+
185+
grpcOptions:
186+
ssl-target-name-override: peer1.org2.example.com
187+
188+
#
189+
# Fabric-CA is a special kind of Certificate Authority provided by Hyperledger Fabric which allows
190+
# certificate management to be done via REST APIs. Application may choose to use a standard
191+
# Certificate Authority instead of Fabric-CA, in which case this section would not be specified.
192+
#
193+
certificateAuthorities:
194+
ca.org1.example.com:
195+
url: https://ca.org1.example.com:7054
196+
tlsCACerts:
197+
# Comma-Separated list of paths
198+
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/ca_root.pem
199+
# Client key and cert for SSL handshake with Fabric CA
200+
client:
201+
key:
202+
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/client/client_fabric_client-key.pem
203+
cert:
204+
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/client/client_fabric_client.pem
205+
206+
# Fabric-CA supports dynamic user enrollment via REST APIs. A "root" user, a.k.a registrar, is
207+
# needed to enroll and invoke new users.
208+
registrar:
209+
enrollId: admin
210+
enrollSecret: adminpw
211+
# [Optional] The optional name of the CA.
212+
caName: ca.org1.example.com
213+
214+
ca.org2.example.com:
215+
url: https://ca.org2.example.com:8054
216+
tlsCACerts:
217+
# Comma-Separated list of paths
218+
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/ca_root.pem
219+
# Client key and cert for SSL handshake with Fabric CA
220+
client:
221+
key:
222+
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/client/client_fabric_client-key.pem
223+
cert:
224+
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/client/client_fabric_client.pem
225+
226+
# Fabric-CA supports dynamic user enrollment via REST APIs. A "root" user, a.k.a registrar, is
227+
# needed to enroll and invoke new users.
228+
registrar:
229+
enrollId: admin
230+
enrollSecret: adminpw
231+
# [Optional] The optional name of the CA.
232+
caName: ca.org2.example.com
233+
234+
# EntityMatchers enable substitution of network hostnames with static configurations
235+
# so that properties can be mapped. Regex can be used for this purpose
236+
# UrlSubstitutionExp can be empty which means the same network hostname will be used
237+
# UrlSubstitutionExp can be given same as mapped peer url, so that mapped peer url can be used
238+
# UrlSubstitutionExp can have golang regex matchers like $1.local.example.$2:$3 for pattern
239+
# like peer0.org1.example.com:1234 which converts peer0.org1.example.com to peer0.org1.local.example.com:1234
240+
# EventUrlSubstitutionExp and sslTargetOverrideUrlSubstitutionExp follow in the same lines as
241+
# SubstitutionExp for the fields eventUrl and gprcOptions.ssl-target-name-override respectively
242+
# In any case mappedHost's config will be used, so mapped host cannot be empty, if entityMatchers are used
243+
entityMatchers:
244+
peer:
245+
246+
- pattern: (\w+).org.example.(\w+)
247+
urlSubstitutionExp: peer0.org1.example.com:8888
248+
eventUrlSubstitutionExp: peer0.org1.example.com:9999
249+
sslTargetOverrideUrlSubstitutionExp: peer0.org1.override.com
250+
mappedHost: peer0.org1.example.com
251+
252+
- pattern: (\w+).replace.example.(\w+):(\d+)
253+
urlSubstitutionExp: $1.org1.example.$2:$3
254+
eventUrlSubstitutionExp: $1.org1.example.$2:$3
255+
sslTargetOverrideUrlSubstitutionExp: $1.org1.override.$2
256+
mappedHost: $1.org1.example.$2
257+
258+
- pattern: (\w+).missing.example.(\w+)
259+
urlSubstitutionExp: peer0.org1.example.com:8888
260+
eventUrlSubstitutionExp: peer0.org1.example.com:9999
261+
sslTargetOverrideUrlSubstitutionExp: peer0.org1.override.com
262+
263+
- pattern: (\w+).random.example.(\w+)
264+
urlSubstitutionExp: peer0.org1.example.com:8888
265+
eventUrlSubstitutionExp: peer0.org1.example.com:9999
266+
sslTargetOverrideUrlSubstitutionExp: peer0.org1.override.com
267+
mappedHost: random.mappedhost.com
268+
269+
- pattern: peer1.(\w+).example.(\w+)
270+
ignoreEndpoint: true
271+
272+
- pattern: peer1.(\w+).example.(\w+):(\d+)
273+
ignoreEndpoint: true
274+
275+
orderer:
276+
- pattern: (\w+).org.example.(\w+)
277+
urlSubstitutionExp: orderer.example.com:8888
278+
sslTargetOverrideUrlSubstitutionExp: orderer.override.com
279+
mappedHost: orderer.example.com
280+
281+
- pattern: (\w+).replace.example.(\w+):(\d+)
282+
urlSubstitutionExp: $1.example.com:$3
283+
sslTargetOverrideUrlSubstitutionExp: $1.override.$2
284+
mappedHost: $1.example.$2
285+
286+
- pattern: (\w+).missing.example.(\w+)
287+
urlSubstitutionExp: orderer.example.com:8888
288+
sslTargetOverrideUrlSubstitutionExp: orderer.override.com
289+
290+
- pattern: (\w+).random.example.(\w+)
291+
urlSubstitutionExp: orderer.example.com:8888
292+
sslTargetOverrideUrlSubstitutionExp: orderer.override.com
293+
mappedHost: random.mappedhost.com
294+
295+
- pattern: (\w+).exclude.example.(\w+)
296+
ignoreEndpoint: true
297+
298+
- pattern: (\w+).exclude.example.(\w+):(\d+)
299+
ignoreEndpoint: true
300+
301+
certificateAuthority:
302+
- pattern: (\w+).org1.example.(\w+)
303+
urlSubstitutionExp: https://ca.org1.example.com:7054
304+
mappedHost: ca.org1.example.com
305+
306+
- pattern: (\w+).org2.example.(\w+)
307+
ignoreEndpoint: true

0 commit comments

Comments
 (0)