-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-3604] e2e_cli sample improvements
Covers the following : 1. Use cryptogen tool to generate org certificates for each run. 2. Make a generic docker-compose base file a. A docker-compose-cli.yaml extends the base and includes a cli container to run e2e test b. A docker-compose-e2e.yaml extends the base and includes fabric-ca container.(can be used for SDK or other tests) 3. A timer flag in docker-compose CLI container to stop killing CLI container NOTE: A docker-compose-e2e-template.yaml also included. This is required to generate docker-compose-e2e.yaml, as we need to replace the private key dyamically. USAGE: ./network_setup.sh <up|down|restart> [channel] [CLI timeout in sec] Ex: ./network_setup.sh up mychannel 10 This starts CLI with channelname mychannel, CLI timeout set to 10s ./network_setup.sh down Shutdown the network and clear all the artifacts. ./network_setup.sh restart xyz 10 restarts the network. Change-Id: I9bc80c0ad0e4dc259383038e7f69e3239a9409f3 Signed-off-by: ratnakar <asara.ratnakar@gmail.com>
- Loading branch information
1 parent
eff8380
commit 9937c36
Showing
57 changed files
with
628 additions
and
853 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
version: '2' | ||
|
||
services: | ||
|
||
orderer.example.com: | ||
container_name: orderer.example.com | ||
image: hyperledger/fabric-orderer | ||
environment: | ||
- ORDERER_GENERAL_LOGLEVEL=debug | ||
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 | ||
- ORDERER_GENERAL_GENESISMETHOD=file | ||
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block | ||
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP | ||
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp | ||
# enabled TLS | ||
- ORDERER_GENERAL_TLS_ENABLED=true | ||
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key | ||
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt | ||
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt] | ||
working_dir: /opt/gopath/src/github.com/hyperledger/fabric | ||
command: orderer | ||
volumes: | ||
- ../channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block | ||
- ../crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp | ||
- ../crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls | ||
ports: | ||
- 7050:7050 | ||
|
||
## To enable CouchDB as state database, uncomment the following sections of this file: | ||
## 1) couchdb containers | ||
## 2) peer environment variables CORE_LEDGER_STATE_STATEDATABASE and | ||
## CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS | ||
## 3) couch container names in "depends_on" section | ||
|
||
# couchdb0: | ||
# container_name: couchdb0 | ||
# image: hyperledger/fabric-couchdb | ||
## Uncomment the port mapping if you want to expose the CouchDB service, | ||
## for example to utilize Fauxton User Interface in dev environments. | ||
# ports: | ||
# - "5984:5984" | ||
|
||
peer0.org1.example.com: | ||
container_name: peer0.org1.example.com | ||
extends: | ||
file: peer-base.yaml | ||
service: peer-base | ||
environment: | ||
- CORE_PEER_ID=peer0.org1.example.com | ||
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051 | ||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051 | ||
- CORE_PEER_LOCALMSPID=Org1MSP | ||
# - CORE_LEDGER_STATE_STATEDATABASE=CouchDB | ||
# - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984 | ||
volumes: | ||
- /var/run/:/host/var/run/ | ||
- ../crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp | ||
- ../crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls | ||
ports: | ||
- 7051:7051 | ||
- 7053:7053 | ||
#depends_on: | ||
# - couchdb0 | ||
|
||
# couchdb1: | ||
# container_name: couchdb1 | ||
# image: hyperledger/fabric-couchdb | ||
## Uncomment the port mapping if you want to expose the CouchDB service, | ||
## for example to utilize Fauxton User Interface in dev environments. | ||
# ports: | ||
# - "6984:5984" | ||
|
||
peer1.org1.example.com: | ||
container_name: peer1.org1.example.com | ||
extends: | ||
file: peer-base.yaml | ||
service: peer-base | ||
environment: | ||
- CORE_PEER_ID=peer1.org1.example.com | ||
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051 | ||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051 | ||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051 | ||
- CORE_PEER_LOCALMSPID=Org1MSP | ||
# - CORE_LEDGER_STATE_STATEDATABASE=CouchDB | ||
# - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb1:5984 | ||
volumes: | ||
- /var/run/:/host/var/run/ | ||
- ../crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/msp | ||
- ../crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/etc/hyperledger/fabric/tls | ||
|
||
ports: | ||
- 8051:7051 | ||
- 8053:7053 | ||
#depends_on: | ||
# - couchdb1 | ||
|
||
# couchdb2: | ||
# container_name: couchdb2 | ||
# image: hyperledger/fabric-couchdb | ||
## Uncomment the port mapping if you want to expose the CouchDB service, | ||
## for example to utilize Fauxton User Interface in dev environments. | ||
# ports: | ||
# - "7984:5984" | ||
|
||
peer0.org2.example.com: | ||
container_name: peer0.org2.example.com | ||
extends: | ||
file: peer-base.yaml | ||
service: peer-base | ||
environment: | ||
- CORE_PEER_ID=peer0.org2.example.com | ||
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051 | ||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051 | ||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051 | ||
- CORE_PEER_LOCALMSPID=Org2MSP | ||
# - CORE_LEDGER_STATE_STATEDATABASE=CouchDB | ||
# - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb2:5984 | ||
volumes: | ||
- /var/run/:/host/var/run/ | ||
- ../crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/etc/hyperledger/fabric/msp | ||
- ../crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls:/etc/hyperledger/fabric/tls | ||
ports: | ||
- 9051:7051 | ||
- 9053:7053 | ||
#depends_on: | ||
# - couchdb2 | ||
|
||
# couchdb3: | ||
# container_name: couchdb3 | ||
# image: hyperledger/fabric-couchdb | ||
## Uncomment the port mapping if you want to expose the CouchDB service, | ||
## for example to utilize Fauxton User Interface in dev environments. | ||
# ports: | ||
# - "8984:5984" | ||
|
||
peer1.org2.example.com: | ||
container_name: peer1.org2.example.com | ||
extends: | ||
file: peer-base.yaml | ||
service: peer-base | ||
environment: | ||
- CORE_PEER_ID=peer1.org2.example.com | ||
- CORE_PEER_ADDRESS=peer1.org2.example.com:7051 | ||
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051 | ||
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:7051 | ||
- CORE_PEER_LOCALMSPID=Org2MSP | ||
# - CORE_LEDGER_STATE_STATEDATABASE=CouchDB | ||
# - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb3:5984 | ||
volumes: | ||
- /var/run/:/host/var/run/ | ||
- ../crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp:/etc/hyperledger/fabric/msp | ||
- ../crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls:/etc/hyperledger/fabric/tls | ||
ports: | ||
- 10051:7051 | ||
- 10053:7053 | ||
#depends_on: | ||
# - couchdb3 |
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
Empty file.
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,76 @@ | ||
# --------------------------------------------------------------------------- | ||
# "OrdererOrgs" - Definition of organizations managing orderer nodes | ||
# --------------------------------------------------------------------------- | ||
OrdererOrgs: | ||
# --------------------------------------------------------------------------- | ||
# Orderer | ||
# --------------------------------------------------------------------------- | ||
- Name: Orderer | ||
Domain: example.com | ||
# --------------------------------------------------------------------------- | ||
# "Specs" - See PeerOrgs below for complete description | ||
# --------------------------------------------------------------------------- | ||
Specs: | ||
- Hostname: orderer | ||
# --------------------------------------------------------------------------- | ||
# "PeerOrgs" - Definition of organizations managing peer nodes | ||
# --------------------------------------------------------------------------- | ||
PeerOrgs: | ||
# --------------------------------------------------------------------------- | ||
# Org1 | ||
# --------------------------------------------------------------------------- | ||
- Name: Org1 | ||
Domain: org1.example.com | ||
# --------------------------------------------------------------------------- | ||
# "Specs" | ||
# --------------------------------------------------------------------------- | ||
# Uncomment this section to enable the explicit definition of hosts in your | ||
# configuration. Most users will want to use Template, below | ||
# | ||
# Specs is an array of Spec entries. Each Spec entry consists of two fields: | ||
# - Hostname: (Required) The desired hostname, sans the domain. | ||
# - CommonName: (Optional) Specifies the template or explicit override for | ||
# the CN. By default, this is the template: | ||
# | ||
# "{{.Hostname}}.{{.Domain}}" | ||
# | ||
# which obtains its values from the Spec.Hostname and | ||
# Org.Domain, respectively. | ||
# --------------------------------------------------------------------------- | ||
# Specs: | ||
# - Hostname: foo # implicitly "foo.org1.example.com" | ||
# CommonName: foo27.org5.example.com # overrides Hostname-based FQDN set above | ||
# - Hostname: bar | ||
# - Hostname: baz | ||
# --------------------------------------------------------------------------- | ||
# "Template" | ||
# --------------------------------------------------------------------------- | ||
# Allows for the definition of 1 or more hosts that are created sequentially | ||
# from a template. By default, this looks like "peer%d" from 0 to Count-1. | ||
# You may override the number of nodes (Count), the starting index (Start) | ||
# or the template used to construct the name (Hostname). | ||
# | ||
# Note: Template and Specs are not mutually exclusive. You may define both | ||
# sections and the aggregate nodes will be created for you. Take care with | ||
# name collisions | ||
# --------------------------------------------------------------------------- | ||
Template: | ||
Count: 2 | ||
# Start: 5 | ||
# Hostname: {{.Prefix}}{{.Index}} # default | ||
# --------------------------------------------------------------------------- | ||
# "Users" | ||
# --------------------------------------------------------------------------- | ||
# Count: The number of user accounts _in addition_ to Admin | ||
# --------------------------------------------------------------------------- | ||
Users: | ||
Count: 1 | ||
# --------------------------------------------------------------------------- | ||
# Org2: See "Org1" for full specification | ||
# --------------------------------------------------------------------------- | ||
- Name: Org2 | ||
Domain: org2.example.com | ||
Template: | ||
Count: 2 | ||
Users: | ||
Count: 1 |
10 changes: 0 additions & 10 deletions
10
examples/e2e_cli/crypto/orderer/localMspConfig/admincerts/ordererOrg0.pem
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
examples/e2e_cli/crypto/orderer/localMspConfig/cacerts/ordererOrg0.pem
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
examples/e2e_cli/crypto/orderer/localMspConfig/keystore/ordererSigner.pem
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.