Skip to content

Commit

Permalink
Speed up HLF v1.0 system tests by altering orderer config (hyperledge…
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Stone authored Apr 5, 2017
1 parent 2f2c79b commit aa893fb
Show file tree
Hide file tree
Showing 41 changed files with 205 additions and 12 deletions.
191 changes: 191 additions & 0 deletions packages/composer-systests/hlfv1/configtx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
---
################################################################################
#
# Profile - meant to be used with docker-2orgs-2peerseach-e2e.yml
#
# - Different configuration profiles may be encoded here to be specified
# as parameters to the configtxgen tool
#
################################################################################
Profiles:

TwoOrgs:
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Application:
<<: *ApplicationDefaults
Organizations:
- *Org0
- *Org1

################################################################################
#
# Section: Organizations
#
# - This section defines the different organizational identities which will
# be referenced later in the configuration.
#
################################################################################
Organizations:

# SampleOrg defines an MSP using the sampleconfig. It should never be used
# in production but may be used as a template for other definitions
- &OrdererOrg
# DefaultOrg defines the organization which is used in the sampleconfig
# of the fabric.git development environment
Name: OrdererMSP

# ID to load the MSP definition as
ID: OrdererMSP

# MSPDir is the filesystem path which contains the MSP configuration
#########################################################################
# FIXME: this path needs to be fixed to point to the actual location of #
# the project 'fabric-sdk-node' in the file system #
#########################################################################
MSPDir: /Users/sstone1/go/src/github.com/hyperledger/fabric-sdk-node/test/fixtures/channel/crypto-config/ordererOrganizations/ordererOrg1/msp

# BCCSP (Blockchain crypto provider): Select which crypto implementation or
# library to use
BCCSP:
Default: SW
SW:
Hash: SHA2
Security: 256
# Location of Key Store. If this is unset, a location will
# be chosen using 'MSPDir'/keystore
FileKeyStore:
KeyStore:

- &Org0
# DefaultOrg defines the organization which is used in the sampleconfig
# of the fabric.git development environment
Name: Org1MSP

# ID to load the MSP definition as
ID: Org1MSP

# MSPDir is the filesystem path which contains the MSP configuration
#########################################################################
# FIXME: this path needs to be fixed to point to the actual location of #
# the project 'fabric-sdk-node' in the file system #
#########################################################################
MSPDir: /Users/sstone1/go/src/github.com/hyperledger/fabric-sdk-node/test/fixtures/channel/crypto-config/peerOrganizations/peerOrg1/msp/

# BCCSP (Blockchain crypto provider): Select which crypto implementation or
# library to use
BCCSP:
Default: SW
SW:
Hash: SHA2
Security: 256
# Location of Key Store. If this is unset, a location will
# be chosen using 'MSPDir'/keystore
FileKeyStore:
KeyStore:

AnchorPeers:
# AnchorPeers defines the location of peers which can be used
# for cross org gossip communication. Note, this value is only
# encoded in the genesis block in the Application section context
- Host: peer0
Port: 7051
- Host: peer1
Port: 7056

- &Org1
# DefaultOrg defines the organization which is used in the sampleconfig
# of the fabric.git development environment
Name: Org2MSP

# ID to load the MSP definition as
ID: Org2MSP

# MSPDir is the filesystem path which contains the MSP configuration
#########################################################################
# FIXME: this path needs to be fixed to point to the actual location of #
# the project 'fabric-sdk-node' in the file system #
#########################################################################
MSPDir: /Users/sstone1/go/src/github.com/hyperledger/fabric-sdk-node/test/fixtures/channel/crypto-config/peerOrganizations/peerOrg2/msp/

# BCCSP (Blockchain crypto provider): Select which crypto implementation or
# library to use
BCCSP:
Default: SW
SW:
Hash: SHA2
Security: 256
# Location of Key Store. If this is unset, a location will
# be chosen using 'MSPDir'/keystore
FileKeyStore:
KeyStore:

AnchorPeers:
# AnchorPeers defines the location of peers which can be used
# for cross org gossip communication. Note, this value is only
# encoded in the genesis block in the Application section context
- Host: peer2
Port: 8051
- Host: peer3
Port: 8056

################################################################################
#
# SECTION: Orderer
#
# - This section defines the values to encode into a config transaction or
# genesis block for orderer related parameters
#
################################################################################
Orderer: &OrdererDefaults

# Orderer Type: The orderer implementation to start
# Available types are "solo" and "kafka"
OrdererType: solo

Addresses:
- orderer0:7050

# Batch Timeout: The amount of time to wait before creating a batch
BatchTimeout: 250ms

# Batch Size: Controls the number of messages batched into a block
BatchSize:

# Max Message Count: The maximum number of messages to permit in a batch
MaxMessageCount: 10

# Absolute Max Bytes: The absolute maximum number of bytes allowed for
# the serialized messages in a batch.
AbsoluteMaxBytes: 99 MB

# Preferred Max Bytes: The preferred maximum number of bytes allowed for
# the serialized messages in a batch. A message larger than the preferred
# max bytes will result in a batch larger than preferred max bytes.
PreferredMaxBytes: 512 KB

Kafka:
# Brokers: A list of Kafka brokers to which the orderer connects
# NOTE: Use IP:port notation
Brokers:
- orderer0:9092

# Organizations is the list of orgs which are defined as participants on
# the orderer side of the network
Organizations:

################################################################################
#
# SECTION: Application
#
# - This section defines the values to encode into a config transaction or
# genesis block for application related parameters
#
################################################################################
Application: &ApplicationDefaults

# Organizations is the list of orgs which are defined as participants on
# the application side of the network
Organizations:
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ services:
# the following setting starts chaincode containers on the same
# bridge network as the peers
# https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=systestv1_default
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=hlfv1_default
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start --peer-defaultchain=false
ports:
Expand Down Expand Up @@ -98,7 +98,7 @@ services:
# the following setting starts chaincode containers on the same
# bridge network as the peers
# https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=systestv1_default
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=hlfv1_default
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start --peer-defaultchain=false
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ services:
# the following setting starts chaincode containers on the same
# bridge network as the peers
# https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=systestv1_default
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=hlfv1_default
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start --peer-defaultchain=false
ports:
Expand Down Expand Up @@ -94,7 +94,7 @@ services:
# the following setting starts chaincode containers on the same
# bridge network as the peers
# https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=systestv1_default
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=hlfv1_default
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start --peer-defaultchain=false
ports:
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions packages/composer-systests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"test": "exit 0",
"systest:embedded": "mocha -t 0 systest",
"systest:hlf": "mocha -t 0 systest",
"systest:hlfv1": "mocha -t 0 systest",
"systest:hlfv1_tls": "mocha -t 0 systest",
"systest:hlfv1-1": "mocha -t 0 systest/[a-p]*.js systest/setup.js",
"systest:hlfv1-2": "mocha -t 0 systest/[q-z]*.js systest/setup.js",
"systest:hlfv1-1_tls": "mocha -t 0 systest/[a-p]*.js systest/setup.js",
Expand Down
10 changes: 5 additions & 5 deletions packages/composer-systests/scripts/run-system-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export CONCERTO_DEPLOY_WAIT_SECS=500

# Pull any required Docker images.
if [ "${SYSTEST}" = "hlf" -a "${SYSTEST_HLF}" = "hlf" ]; then
DOCKER_FILE=${DIR}/hlf-docker-compose.yml
DOCKER_FILE=${DIR}/hlf/hlf-docker-compose.yml
docker pull hyperledger/fabric-membersrvc:x86_64-0.6.1-preview
docker tag hyperledger/fabric-membersrvc:x86_64-0.6.1-preview hyperledger/fabric-membersrvc:latest
docker pull hyperledger/fabric-peer:x86_64-0.6.1-preview
Expand All @@ -33,9 +33,9 @@ if [ "${SYSTEST}" = "hlf" -a "${SYSTEST_HLF}" = "hlf" ]; then
docker tag hyperledger/fabric-baseimage:x86_64-0.2.0 hyperledger/fabric-baseimage:latest
elif [[ ${SYSTEST} == hlfv1* && "${SYSTEST_HLF}" = "hlf" ]]; then
if [[ ${SYSTEST} == *tls ]]; then
DOCKER_FILE=${DIR}/systestv1/hlfv1_alpha-docker-compose.tls.yml
DOCKER_FILE=${DIR}/hlfv1/hlfv1_alpha-docker-compose.tls.yml
else
DOCKER_FILE=${DIR}/systestv1/hlfv1_alpha-docker-compose.yml
DOCKER_FILE=${DIR}/hlfv1/hlfv1_alpha-docker-compose.yml
fi
docker pull hyperledger/fabric-peer:x86_64-1.0.0-alpha
docker pull hyperledger/fabric-ca:x86_64-1.0.0-alpha
Expand All @@ -45,7 +45,7 @@ elif [[ ${SYSTEST} == hlfv1* && "${SYSTEST_HLF}" = "hlf" ]]; then
elif [ "${SYSTEST}" = "hlf" ] && [ "${SYSTEST_HLF}" = "ibm" ]; then

if [ "${TRAVIS_EVENT_TYPE}" = "cron" ]; then
DOCKER_FILE=${DIR}/ibm-docker-compose.yml
DOCKER_FILE=${DIR}/hlf/ibm-docker-compose.yml
docker pull ibmblockchain/fabric-membersrvc:x86_64-0.6.1-preview
docker tag ibmblockchain/fabric-membersrvc:x86_64-0.6.1-preview ibmblockchain/fabric-membersrvc:latest
docker pull ibmblockchain/fabric-peer:x86_64-0.6.1-preview
Expand Down Expand Up @@ -78,7 +78,7 @@ rm -rf ${HOME}/.concerto-credentials/concerto-systests
# configure v1 to run the tests
if [[ ${SYSTEST} == hlfv1* && "${SYSTEST_HLF}" = "hlf" ]]; then
sleep 10
cd systestv1
cd hlfv1
node create-channel.js
node join-channel.js
cd ..
Expand Down
6 changes: 3 additions & 3 deletions packages/composer-systests/systest/testutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class TestUtil {
orderers: [
{
url: 'grpcs://localhost:7050',
cert: './systestv1/tls/orderer/ca-cert.pem',
cert: './hlfv1/tls/orderer/ca-cert.pem',
hostnameOverride: 'orderer0'
}
],
Expand All @@ -172,13 +172,13 @@ class TestUtil {
{
requestURL: 'grpcs://localhost:7051',
eventURL: 'grpcs://localhost:7053',
cert: './systestv1/tls/peers/peer0/ca-cert.pem',
cert: './hlfv1/tls/peers/peer0/ca-cert.pem',
hostnameOverride: 'peer0'
},
{
requestURL: 'grpcs://localhost:7056',
eventURL: 'grpcs://localhost:7058',
cert: './systestv1/tls/peers/peer1/ca-cert.pem',
cert: './hlfv1/tls/peers/peer1/ca-cert.pem',
hostnameOverride: 'peer1'
}
],
Expand Down

0 comments on commit aa893fb

Please sign in to comment.