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

Commit e8fa23b

Browse files
author
Pavan Kappara
committed
[FAB-8442] map network hosts config with static-config
Unknown network hosts can be mapped to hosts from static config for peers and orderers through regular expression matching Change-Id: I2ca0068ec7136d90ddcc932d00611c41ef4e5de3 Signed-off-by: Pavan Kappara <pavan.kappara@securekey.com>
1 parent 151405c commit e8fa23b

File tree

20 files changed

+1542
-29
lines changed

20 files changed

+1542
-29
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ FIXTURE_DOCKER_REMOVE_FORCE ?= false
7373
# Options for exercising unit tests (overridable)
7474
FABRIC_SDK_DEPRECATED_UNITTEST ?= false
7575

76+
#config files
77+
INT_TESTS_LOCAL_CONFIG_FILE := config_test_local.yaml
78+
7679
# Code levels to exercise integration/e2e tests against (overridable)
7780
FABRIC_STABLE_INTTEST ?= true
7881
FABRIC_STABLE_PKCS11_INTTEST ?= false
@@ -290,7 +293,7 @@ endif
290293

291294
.PHONY: integration-tests-local
292295
integration-tests-local: temp-clean depend populate
293-
FABRIC_CRYPTOCONFIG_VERSION=$(FABRIC_CRYPTOCONFIG_VER) FABRIC_SDKGO_CODELEVEL_VER=$(FABRIC_CODELEVEL_VER) FABRIC_SDKGO_CODELEVEL_TAG=$(FABRIC_CODELEVEL_TAG) $(TEST_SCRIPTS_PATH)/integration.sh
296+
FABRIC_CRYPTOCONFIG_VERSION=$(FABRIC_CRYPTOCONFIG_VER) FABRIC_SDKGO_CODELEVEL_VER=$(FABRIC_CODELEVEL_VER) FABRIC_SDKGO_CODELEVEL_TAG=$(FABRIC_CODELEVEL_TAG) CONFIG_FILE=$(INT_TESTS_LOCAL_CONFIG_FILE) $(TEST_SCRIPTS_PATH)/integration.sh
294297

295298
.PHONY: dockerenv-prev-up
296299
dockerenv-prev-up: clean
@@ -395,7 +398,7 @@ populate-clean:
395398

396399
.PHONY: temp-clean
397400
temp-clean:
398-
-rm -Rf /tmp/enroll_user /tmp/msp /tmp/keyvaluestore /tmp/hfc-kvs /tmp/state
401+
-rm -Rf /tmp/enroll_user /tmp/msp /tmp/keyvaluestore /tmp/hfc-kvs /tmp/state /tmp/state-store
399402
-rm -f integration-report.xml report.xml
400403

401404
.PHONY: clean

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ You need:
125125
#### Enable local hostnames
126126

127127
You will need to set the following hosts to 127.0.0.1 (typically in /etc/hosts):
128-
ca.org1.example.com ca.org2.example.com peer0.org1.example.com peer1.org1.example.com peer0.org2.example.com peer1.org2.example.com orderer.example.com
128+
ca.org1.example.com ca.org2.example.com
129129

130130
#### Testing with Fabric Images at Docker Hub
131131

pkg/context/api/core/network.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type NetworkConfig struct {
2727
Orderers map[string]OrdererConfig
2828
Peers map[string]PeerConfig
2929
CertificateAuthorities map[string]CAConfig
30+
EntityMatchers map[string][]MatchConfig
3031
}
3132

3233
// ClientConfig provides the definition of the client configuration
@@ -207,3 +208,13 @@ type TLSKeyPair struct {
207208
Key TLSConfig
208209
Cert TLSConfig
209210
}
211+
212+
// MatchConfig contains match pattern and substitution pattern
213+
// for pattern matching of network configured hostnames with static config
214+
type MatchConfig struct {
215+
Pattern string
216+
URLSubstitutionExp string
217+
EventURLSubstitutionExp string
218+
SSLTargetOverrideURLSubstitutionExp string
219+
MappedHost string
220+
}

0 commit comments

Comments
 (0)