From 5fef78ba41952071598c38a3f5f6831ded4d95fc Mon Sep 17 00:00:00 2001 From: Baohua Yang Date: Wed, 7 Jun 2017 15:53:15 +0800 Subject: [PATCH] Update code structures --- hyperledger/1.0/README.md | 4 +- .../add-org.sh | 0 .../artifacts_generation.md} | 0 .../configtx.yaml | 0 .../crypto-config.yaml | 0 .../docker-compose-2orgs.yml | 0 .../artifacts_generation/generateArtifacts.sh | 103 +++++++++++++++++ .../peer-base.yml | 4 +- .../test-5-peers.sh} | 0 ...-channel.yml => docker-compose-1peer.yaml} | 4 +- ...s.yml => docker-compose-2orgs-4peers.yaml} | 56 +++++---- ...peer-base.yml => docker-compose-base.yaml} | 104 +++++++---------- ...ompose-dev.yml => docker-compose-dev.yaml} | 0 ...docker-compose.yml => docker-compose.yaml} | 4 +- .../1.0/e2e_cli/base/docker-compose-base.yaml | 108 ++++++++++++++++++ hyperledger/1.0/e2e_cli/base/peer-base.yaml | 27 +++++ .../1.0/e2e_cli/channel-artifacts/.gitkeep | 0 ...er_genesis.block => orderer.genesis.block} | Bin hyperledger/1.0/e2e_cli/configtx.yaml | 41 +------ hyperledger/1.0/e2e_cli/crypto-config.yaml | 5 + .../1.0/e2e_cli/crypto/orderer/channel.tx | Bin 10601 -> 0 bytes .../1.0/e2e_cli/crypto/orderer/orderer.block | Bin 10648 -> 0 bytes .../1.0/e2e_cli/docker-compose-cli.yaml | 69 +++++++++++ .../1.0/e2e_cli/docker-compose-couch.yaml | 67 +++++++++++ .../e2e_cli/docker-compose-e2e-template.yaml | 67 +++++++++++ .../1.0/e2e_cli/docker-compose-e2e.yaml | 67 +++++++++++ hyperledger/1.0/orderer-base.yaml | 32 ++++++ .../1.0/{peer-dev.yml => peer-base-dev.yaml} | 17 ++- hyperledger/1.0/{peer.yml => peer-base.yaml} | 18 ++- hyperledger/1.0/scripts/download_images.sh | 14 ++- hyperledger/1.0/scripts/start_fabric.sh | 4 +- ...new-channel-auto-test.sh => test_1peer.sh} | 0 ...el-auto-test-4-peers.sh => test_4peers.sh} | 22 ++-- 33 files changed, 661 insertions(+), 176 deletions(-) rename hyperledger/1.0/{example2 => artifacts_generation}/add-org.sh (100%) mode change 100755 => 100644 rename hyperledger/1.0/{GenerateArtifacts.md => artifacts_generation/artifacts_generation.md} (100%) rename hyperledger/1.0/{example2 => artifacts_generation}/configtx.yaml (100%) mode change 100755 => 100644 rename hyperledger/1.0/{example2 => artifacts_generation}/crypto-config.yaml (100%) mode change 100755 => 100644 rename hyperledger/1.0/{example2 => artifacts_generation}/docker-compose-2orgs.yml (100%) mode change 100755 => 100644 create mode 100644 hyperledger/1.0/artifacts_generation/generateArtifacts.sh rename hyperledger/1.0/{example2 => artifacts_generation}/peer-base.yml (97%) mode change 100755 => 100644 rename hyperledger/1.0/{example2/new-channel-auto-test-5-peers.sh => artifacts_generation/test-5-peers.sh} (100%) mode change 100755 => 100644 rename hyperledger/1.0/{docker-compose-new-channel.yml => docker-compose-1peer.yaml} (96%) rename hyperledger/1.0/{docker-compose-2orgs.yml => docker-compose-2orgs-4peers.yaml} (75%) rename hyperledger/1.0/{peer-base.yml => docker-compose-base.yaml} (53%) rename hyperledger/1.0/{docker-compose-dev.yml => docker-compose-dev.yaml} (100%) rename hyperledger/1.0/{docker-compose.yml => docker-compose.yaml} (92%) create mode 100644 hyperledger/1.0/e2e_cli/base/docker-compose-base.yaml create mode 100644 hyperledger/1.0/e2e_cli/base/peer-base.yaml delete mode 100644 hyperledger/1.0/e2e_cli/channel-artifacts/.gitkeep rename hyperledger/1.0/e2e_cli/channel-artifacts/{orderer_genesis.block => orderer.genesis.block} (100%) delete mode 100644 hyperledger/1.0/e2e_cli/crypto/orderer/channel.tx delete mode 100644 hyperledger/1.0/e2e_cli/crypto/orderer/orderer.block create mode 100644 hyperledger/1.0/e2e_cli/docker-compose-cli.yaml create mode 100644 hyperledger/1.0/e2e_cli/docker-compose-couch.yaml create mode 100644 hyperledger/1.0/e2e_cli/docker-compose-e2e-template.yaml create mode 100644 hyperledger/1.0/e2e_cli/docker-compose-e2e.yaml create mode 100644 hyperledger/1.0/orderer-base.yaml rename hyperledger/1.0/{peer-dev.yml => peer-base-dev.yaml} (74%) rename hyperledger/1.0/{peer.yml => peer-base.yaml} (72%) rename hyperledger/1.0/scripts/{new-channel-auto-test.sh => test_1peer.sh} (100%) mode change 100755 => 100644 rename hyperledger/1.0/scripts/{new-channel-auto-test-4-peers.sh => test_4peers.sh} (90%) diff --git a/hyperledger/1.0/README.md b/hyperledger/1.0/README.md index 56c9e1ef..16944868 100644 --- a/hyperledger/1.0/README.md +++ b/hyperledger/1.0/README.md @@ -206,9 +206,9 @@ $ ./peer/scripts/new-channel-auto-test.sh ### Manually create artifacts (optional) -**Skip this step**, as we already put the needed artifacts `orderer_genesis.block` and `channel.tx` under `e2e_cli/channel-artifacts/`. +**Skip this step**, as we already put the needed artifacts `orderer.genesis.block` and `channel.tx` under `e2e_cli/channel-artifacts/`. -Detailed steps in [GenerateArtifacts](./GenerateArtifacts.md) explains the creation of `orderer_genesis.block` (needed by orderer to bootup) and `channel.tx` (needed by cli to create new channel) and crypto related configuration files. +Detailed steps in [GenerateArtifacts](artifacts_generation.md) explains the creation of `orderer.genesis.block` (needed by orderer to bootup) and `channel.tx` (needed by cli to create new channel) and crypto related configuration files. ### Create new channel diff --git a/hyperledger/1.0/example2/add-org.sh b/hyperledger/1.0/artifacts_generation/add-org.sh old mode 100755 new mode 100644 similarity index 100% rename from hyperledger/1.0/example2/add-org.sh rename to hyperledger/1.0/artifacts_generation/add-org.sh diff --git a/hyperledger/1.0/GenerateArtifacts.md b/hyperledger/1.0/artifacts_generation/artifacts_generation.md similarity index 100% rename from hyperledger/1.0/GenerateArtifacts.md rename to hyperledger/1.0/artifacts_generation/artifacts_generation.md diff --git a/hyperledger/1.0/example2/configtx.yaml b/hyperledger/1.0/artifacts_generation/configtx.yaml old mode 100755 new mode 100644 similarity index 100% rename from hyperledger/1.0/example2/configtx.yaml rename to hyperledger/1.0/artifacts_generation/configtx.yaml diff --git a/hyperledger/1.0/example2/crypto-config.yaml b/hyperledger/1.0/artifacts_generation/crypto-config.yaml old mode 100755 new mode 100644 similarity index 100% rename from hyperledger/1.0/example2/crypto-config.yaml rename to hyperledger/1.0/artifacts_generation/crypto-config.yaml diff --git a/hyperledger/1.0/example2/docker-compose-2orgs.yml b/hyperledger/1.0/artifacts_generation/docker-compose-2orgs.yml old mode 100755 new mode 100644 similarity index 100% rename from hyperledger/1.0/example2/docker-compose-2orgs.yml rename to hyperledger/1.0/artifacts_generation/docker-compose-2orgs.yml diff --git a/hyperledger/1.0/artifacts_generation/generateArtifacts.sh b/hyperledger/1.0/artifacts_generation/generateArtifacts.sh new file mode 100644 index 00000000..c78bff00 --- /dev/null +++ b/hyperledger/1.0/artifacts_generation/generateArtifacts.sh @@ -0,0 +1,103 @@ +#!/bin/bash +x +# +# Copyright IBM Corp. All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + + +#set -e + +CHANNEL_NAME=$1 +: ${CHANNEL_NAME:="mychannel"} +echo $CHANNEL_NAME + +export FABRIC_ROOT=$PWD/../.. +export FABRIC_CFG_PATH=$PWD +echo + +OS_ARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')" | awk '{print tolower($0)}') + +## Using docker-compose template replace private key file names with constants +function replacePrivateKey () { + ARCH=`uname -s | grep Darwin` + if [ "$ARCH" == "Darwin" ]; then + OPTS="-it" + else + OPTS="-i" + fi + + cp docker-compose-e2e-template.yaml docker-compose-e2e.yaml + + CURRENT_DIR=$PWD + cd crypto-config/peerOrganizations/org1.example.com/ca/ + PRIV_KEY=$(ls *_sk) + cd $CURRENT_DIR + sed $OPTS "s/CA1_PRIVATE_KEY/${PRIV_KEY}/g" docker-compose-e2e.yaml + cd crypto-config/peerOrganizations/org2.example.com/ca/ + PRIV_KEY=$(ls *_sk) + cd $CURRENT_DIR + sed $OPTS "s/CA2_PRIVATE_KEY/${PRIV_KEY}/g" docker-compose-e2e.yaml +} + +## Generates Org certs using cryptogen tool +function generateCerts (){ + CRYPTOGEN=$FABRIC_ROOT/release/$OS_ARCH/bin/cryptogen + + if [ -f "$CRYPTOGEN" ]; then + echo "Using cryptogen -> $CRYPTOGEN" + else + echo "Building cryptogen" + make -C $FABRIC_ROOT release + fi + + echo + echo "##########################################################" + echo "##### Generate certificates using cryptogen tool #########" + echo "##########################################################" + $CRYPTOGEN generate --config=./crypto-config.yaml + echo +} + +## Generate orderer genesis block , channel configuration transaction and anchor peer update transactions +function generateChannelArtifacts() { + + CONFIGTXGEN=$FABRIC_ROOT/release/$OS_ARCH/bin/configtxgen + if [ -f "$CONFIGTXGEN" ]; then + echo "Using configtxgen -> $CONFIGTXGEN" + else + echo "Building configtxgen" + make -C $FABRIC_ROOT release + fi + + echo "##########################################################" + echo "######### Generating Orderer Genesis block ##############" + echo "##########################################################" + # Note: For some unknown reason (at least for now) the block file can't be + # named orderer.genesis.block or the orderer will fail to launch! + $CONFIGTXGEN -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block + + echo + echo "#################################################################" + echo "### Generating channel configuration transaction 'channel.tx' ###" + echo "#################################################################" + $CONFIGTXGEN -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME + + echo + echo "#################################################################" + echo "####### Generating anchor peer update for Org1MSP ##########" + echo "#################################################################" + $CONFIGTXGEN -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP + + echo + echo "#################################################################" + echo "####### Generating anchor peer update for Org2MSP ##########" + echo "#################################################################" + $CONFIGTXGEN -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org2MSP + echo +} + +generateCerts +replacePrivateKey +generateChannelArtifacts + diff --git a/hyperledger/1.0/example2/peer-base.yml b/hyperledger/1.0/artifacts_generation/peer-base.yml old mode 100755 new mode 100644 similarity index 97% rename from hyperledger/1.0/example2/peer-base.yml rename to hyperledger/1.0/artifacts_generation/peer-base.yml index c7566567..f8845e69 --- a/hyperledger/1.0/example2/peer-base.yml +++ b/hyperledger/1.0/artifacts_generation/peer-base.yml @@ -10,7 +10,7 @@ services: - ORDERER_GENERAL_LOGLEVEL=INFO - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 - ORDERER_GENERAL_GENESISMETHOD=file - - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer_genesis.block #Need to be confirm orderer.block + - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block #Need to be confirm orderer.block - ORDERER_GENERAL_LOCALMSPID=OrdererMSP - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp - ORDERER_GENERAL_LEDGERTYPE=ram @@ -26,7 +26,7 @@ services: ports: - "7050:7050" volumes: - - ./e2e_cli/channel-artifacts/orderer_genesis.block:/var/hyperledger/orderer/orderer_genesis.block + - ./e2e_cli/channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block - ./e2e_cli/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp - ./e2e_cli/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls command: orderer diff --git a/hyperledger/1.0/example2/new-channel-auto-test-5-peers.sh b/hyperledger/1.0/artifacts_generation/test-5-peers.sh old mode 100755 new mode 100644 similarity index 100% rename from hyperledger/1.0/example2/new-channel-auto-test-5-peers.sh rename to hyperledger/1.0/artifacts_generation/test-5-peers.sh diff --git a/hyperledger/1.0/docker-compose-new-channel.yml b/hyperledger/1.0/docker-compose-1peer.yaml similarity index 96% rename from hyperledger/1.0/docker-compose-new-channel.yml rename to hyperledger/1.0/docker-compose-1peer.yaml index 6f02afaf..4dcd606b 100644 --- a/hyperledger/1.0/docker-compose-new-channel.yml +++ b/hyperledger/1.0/docker-compose-1peer.yaml @@ -25,7 +25,7 @@ services: - ORDERER_GENERAL_LOGLEVEL=INFO - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 - ORDERER_GENERAL_GENESISMETHOD=file - - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer_genesis.block #Need to be confirm orderer.block + - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block #Need to be confirm orderer.block - ORDERER_GENERAL_LOCALMSPID=OrdererMSP - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp - ORDERER_GENERAL_LEDGERTYPE=ram @@ -41,7 +41,7 @@ services: ports: - "7050:7050" volumes: - - ./e2e_cli/channel-artifacts/orderer_genesis.block:/var/hyperledger/orderer/orderer_genesis.block + - ./e2e_cli/channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block - ./e2e_cli/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp - ./e2e_cli/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls command: orderer diff --git a/hyperledger/1.0/docker-compose-2orgs.yml b/hyperledger/1.0/docker-compose-2orgs-4peers.yaml similarity index 75% rename from hyperledger/1.0/docker-compose-2orgs.yml rename to hyperledger/1.0/docker-compose-2orgs-4peers.yaml index fd58590b..47e3a66b 100644 --- a/hyperledger/1.0/docker-compose-2orgs.yml +++ b/hyperledger/1.0/docker-compose-2orgs-4peers.yaml @@ -1,9 +1,9 @@ # https://github.com/yeasy/docker-compose-files/tree/master/hyperledger # This compose file will start a Hyperledger Fabric 1.0 MVE, including -# * ca -# * orderer -# * peer -# * sdk for testing +# * 1 ca +# * 1 orderer +# * 4 peers in 2 orgs +# * cli for testing version: '2.0' @@ -18,70 +18,66 @@ services: command: fabric-ca-server start -b admin:adminpw orderer.example.com: # There can be multiple orderers - container_name: orderer.example.com extends: - file: peer-base.yml + file: docker-compose-base.yaml service: orderer.example.com peer0.org1.example.com: extends: - file: peer-base.yml + file: docker-compose-base.yaml service: peer0.org1.example.com - container_name: peer0.org1.example.com peer1.org1.example.com: extends: - file: peer-base.yml + file: docker-compose-base.yaml service: peer1.org1.example.com - container_name: peer1.org1.example.com peer0.org2.example.com: extends: - file: peer-base.yml + file: docker-compose-base.yaml service: peer0.org2.example.com - container_name: peer0.org2.example.com peer1.org2.example.com: extends: - file: peer-base.yml + file: docker-compose-base.yaml service: peer1.org2.example.com - container_name: peer1.org2.example.com cli: - extends: - file: peer.yml - service: peer container_name: fabric-cli - hostname: cli + hostname: fabric-cli + image: hyperledger/fabric-tools + tty: true environment: - - CORE_PEER_ID=cli - - CORE_PEER_ADDRESS=peer0.org1.example.com:7051 + - CORE_PEER_ID=fabric-cli + - CORE_LOGGING_LEVEL=DEBUG + - CORE_PEER_ADDRESS=peer0.org1.example.com:7051 # default to operate on peer0.org1 - CORE_PEER_LOCALMSPID=Org1MSP - - CORE_PEER_TLS_ENABLED=false # to enable TLS, change to true + - CORE_PEER_TLS_ENABLED=true # to enable TLS, change to true - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp - links: - - orderer.example.com - - peer0.org1.example.com - - peer1.org1.example.com - - peer0.org2.example.com - - peer1.org2.example.com volumes: #- ./e2e_cli/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples - ./e2e_cli/crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ - - ./e2e_cli/crypto-config:/etc/hyperledger/fabric/crypto-config - ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/ - ./e2e_cli/channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts - - ./e2e_cli/configtx.yaml:/opt/gopath/src/github.com/hyperledger/fabric/peer/configtx.yaml - - ./e2e_cli/crypto-config.yaml:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto-config.yaml + - ./e2e_cli/crypto-config:/etc/hyperledger/fabric/crypto-config + - ./e2e_cli/configtx.yaml:/etc/hyperledger/fabric/peer/configtx.yaml + - ./e2e_cli/crypto-config.yaml:/etc/hyperledger/fabric/peer/crypto-config.yaml depends_on: - orderer.example.com - peer0.org1.example.com - peer1.org1.example.com - peer0.org2.example.com - peer1.org2.example.com + links: + - orderer.example.com + - peer0.org1.example.com + - peer1.org1.example.com + - peer0.org2.example.com + - peer1.org2.example.com + working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer command: bash -c 'while true; do sleep 20170504; done' #networks: diff --git a/hyperledger/1.0/peer-base.yml b/hyperledger/1.0/docker-compose-base.yaml similarity index 53% rename from hyperledger/1.0/peer-base.yml rename to hyperledger/1.0/docker-compose-base.yaml index a9ad4b01..2454cf3f 100644 --- a/hyperledger/1.0/peer-base.yml +++ b/hyperledger/1.0/docker-compose-base.yaml @@ -1,64 +1,53 @@ -version: '2' +# Base compose files for: + +# orderer.example.com +# peer0.org1.example.com +# peer1.org1.example.com +# peer0.org2.example.com +# peer1.org2.example.com + + +version: '2' # v3 does not support 'extends' yet services: orderer.example.com: # There can be multiple orderers - image: hyperledger/fabric-orderer + extends: + file: orderer-base.yaml + service: orderer-base container_name: orderer.example.com hostname: orderer.example.com - environment: - - ORDERER_GENERAL_LOGLEVEL=INFO - - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 - - ORDERER_GENERAL_GENESISMETHOD=file - - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer_genesis.block #Need to be confirm orderer.block - - ORDERER_GENERAL_LOCALMSPID=OrdererMSP - - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp - - ORDERER_GENERAL_LEDGERTYPE=file - - ORDERER_GENERAL_BATCHTIMEOUT=10s - - ORDERER_GENERAL_MAXMESSAGECOUNT=10 - - ORDERER_GENERAL_MAXWINDOWSIZE=1000 - - ORDERER_GENERAL_LISTENPORT=7050 - - ORDERER_RAMLEDGER_HISTORY_SIZE=100 - - ORDERER_GENERAL_TLS_ENABLED=false # to enable TLS, make this 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] ports: - "7050:7050" volumes: - - ./e2e_cli/channel-artifacts/orderer_genesis.block:/var/hyperledger/orderer/orderer_genesis.block + - ./e2e_cli/channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block - ./e2e_cli/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp - ./e2e_cli/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls - command: orderer + command: orderer start peer0.org1.example.com: extends: - file: peer.yml - service: peer + file: peer-base.yaml + service: peer-base container_name: peer0.org1.example.com hostname: peer0.org1.example.com 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_GOSSIP_ORGLEADER=true - # - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer.example.com:7050 - CORE_PEER_LOCALMSPID=Org1MSP - - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt - - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key - - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt - ports: - - 7051:7051 - - 7053:7053 volumes: - ./e2e_cli/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp - ./e2e_cli/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls - command: peer node start --peer-defaultchain=false + ports: + - 7051:7051 + - 7053:7053 + command: peer node start peer1.org1.example.com: extends: - file: peer.yml - service: peer + file: peer-base.yaml + service: peer-base container_name: peer1.org1.example.com hostname: peer1.org1.example.com environment: @@ -67,23 +56,18 @@ services: - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051 - CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051 - CORE_PEER_LOCALMSPID=Org1MSP - - CORE_PEER_GOSSIP_ORGLEADER=true - # - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer.example.com:7050 - - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt - - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key - - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt - ports: - - 8051:7051 - - 8053:7053 volumes: - ./e2e_cli/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/msp - ./e2e_cli/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/etc/hyperledger/fabric/tls - command: peer node start --peer-defaultchain=false + ports: + - 8051:7051 + - 8053:7053 + command: peer node start peer0.org2.example.com: extends: - file: peer.yml - service: peer + file: peer-base.yaml + service: peer-base container_name: peer0.org2.example.com hostname: peer0.org2.example.com environment: @@ -92,23 +76,18 @@ services: - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051 - CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051 - CORE_PEER_LOCALMSPID=Org2MSP - - CORE_PEER_GOSSIP_ORGLEADER=true - # - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer.example.com:7050 - - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt - - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key - - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt - ports: - - 9051:7051 - - 9053:7053 volumes: - ./e2e_cli/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/etc/hyperledger/fabric/msp - ./e2e_cli/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls:/etc/hyperledger/fabric/tls - command: peer node start --peer-defaultchain=false + ports: + - 9051:7051 + - 9053:7053 + command: peer node start peer1.org2.example.com: extends: - file: peer.yml - service: peer + file: peer-base.yaml + service: peer-base container_name: peer1.org2.example.com hostname: peer1.org2.example.com environment: @@ -117,15 +96,10 @@ services: - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051 - CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:7051 - CORE_PEER_LOCALMSPID=Org2MSP - - CORE_PEER_GOSSIP_ORGLEADER=true - # - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer.example.com:7050 - - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt - - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key - - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt - ports: - - 10051:7051 - - 10053:7053 volumes: - ./e2e_cli/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp:/etc/hyperledger/fabric/msp - ./e2e_cli/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls:/etc/hyperledger/fabric/tls - command: peer node start --peer-defaultchain=false + ports: + - 10051:7051 + - 10053:7053 + command: peer node start diff --git a/hyperledger/1.0/docker-compose-dev.yml b/hyperledger/1.0/docker-compose-dev.yaml similarity index 100% rename from hyperledger/1.0/docker-compose-dev.yml rename to hyperledger/1.0/docker-compose-dev.yaml diff --git a/hyperledger/1.0/docker-compose.yml b/hyperledger/1.0/docker-compose.yaml similarity index 92% rename from hyperledger/1.0/docker-compose.yml rename to hyperledger/1.0/docker-compose.yaml index 1168aa4f..ac800b7c 100644 --- a/hyperledger/1.0/docker-compose.yml +++ b/hyperledger/1.0/docker-compose.yaml @@ -24,7 +24,7 @@ services: container_name: fabric-orderer0 hostname: orderer0 environment: - - ORDERER_GENERAL_LEDGERTYPE=ram + - ORDERER_GENERAL_LEDGERTYPE=file - ORDERER_GENERAL_BATCHTIMEOUT=10s - ORDERER_GENERAL_MAXMESSAGECOUNT=10 - ORDERER_GENERAL_MAXWINDOWSIZE=1000 @@ -45,7 +45,6 @@ services: environment: - CORE_PEER_ID=peer0 - CORE_PEER_GOSSIP_ORGLEADER=true - # - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer0:7050 links: - orderer0 ports: @@ -64,7 +63,6 @@ services: - CORE_PEER_ID=cli - CORE_PEER_ADDRESS=peer0:7051 #- CORE_PEER_LOCALMSPID=Org0MSP - #- CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 links: - peer0 - orderer0 diff --git a/hyperledger/1.0/e2e_cli/base/docker-compose-base.yaml b/hyperledger/1.0/e2e_cli/base/docker-compose-base.yaml new file mode 100644 index 00000000..7a97e718 --- /dev/null +++ b/hyperledger/1.0/e2e_cli/base/docker-compose-base.yaml @@ -0,0 +1,108 @@ +# Copyright IBM Corp. All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + +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/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 + + 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 + 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 + + 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 + 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 + + 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 + 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 + + 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 + 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 diff --git a/hyperledger/1.0/e2e_cli/base/peer-base.yaml b/hyperledger/1.0/e2e_cli/base/peer-base.yaml new file mode 100644 index 00000000..9a3a3fb6 --- /dev/null +++ b/hyperledger/1.0/e2e_cli/base/peer-base.yaml @@ -0,0 +1,27 @@ +# Copyright IBM Corp. All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + +version: '2' +services: + peer-base: + image: hyperledger/fabric-peer + environment: + - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock + # 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=e2ecli_default + #- CORE_LOGGING_LEVEL=ERROR + - CORE_LOGGING_LEVEL=DEBUG + - CORE_PEER_TLS_ENABLED=true + - CORE_PEER_ENDORSER_ENABLED=true + - CORE_PEER_GOSSIP_USELEADERELECTION=true + - CORE_PEER_GOSSIP_ORGLEADER=false + - CORE_PEER_PROFILE_ENABLED=true + - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt + - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key + - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt + working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer + command: peer node start diff --git a/hyperledger/1.0/e2e_cli/channel-artifacts/.gitkeep b/hyperledger/1.0/e2e_cli/channel-artifacts/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/hyperledger/1.0/e2e_cli/channel-artifacts/orderer_genesis.block b/hyperledger/1.0/e2e_cli/channel-artifacts/orderer.genesis.block similarity index 100% rename from hyperledger/1.0/e2e_cli/channel-artifacts/orderer_genesis.block rename to hyperledger/1.0/e2e_cli/channel-artifacts/orderer.genesis.block diff --git a/hyperledger/1.0/e2e_cli/configtx.yaml b/hyperledger/1.0/e2e_cli/configtx.yaml index 85d0fe89..e60d789e 100644 --- a/hyperledger/1.0/e2e_cli/configtx.yaml +++ b/hyperledger/1.0/e2e_cli/configtx.yaml @@ -1,3 +1,8 @@ +# Copyright IBM Corp. All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + --- ################################################################################ # @@ -50,18 +55,6 @@ Organizations: # MSPDir is the filesystem path which contains the MSP configuration MSPDir: crypto-config/ordererOrganizations/example.com/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: - - &Org1 # DefaultOrg defines the organization which is used in the sampleconfig # of the fabric.git development environment @@ -72,18 +65,6 @@ Organizations: MSPDir: crypto-config/peerOrganizations/org1.example.com/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 @@ -101,18 +82,6 @@ Organizations: MSPDir: crypto-config/peerOrganizations/org2.example.com/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 diff --git a/hyperledger/1.0/e2e_cli/crypto-config.yaml b/hyperledger/1.0/e2e_cli/crypto-config.yaml index 9c9c30bc..06ad8185 100644 --- a/hyperledger/1.0/e2e_cli/crypto-config.yaml +++ b/hyperledger/1.0/e2e_cli/crypto-config.yaml @@ -1,3 +1,8 @@ +# Copyright IBM Corp. All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + # --------------------------------------------------------------------------- # "OrdererOrgs" - Definition of organizations managing orderer nodes # --------------------------------------------------------------------------- diff --git a/hyperledger/1.0/e2e_cli/crypto/orderer/channel.tx b/hyperledger/1.0/e2e_cli/crypto/orderer/channel.tx deleted file mode 100644 index 8db454ceaebee4f07a6355f917bd5bfda895f502..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10601 zcmeHNTaW8j6>d*Y&zae$XU^1xUZ!w3j8s}Rs(edghl|AaEpZaZvEw+2A1XPH<2Z5R z#7@RZK|$Z3-i(jA^x+Y1_sKqS?%(EgHk9R*P&~bUKry2`Yuzm_;Fvz-`M8#>k6r|L$3+ z{_AUhd-~1j@AYqI`Y-?Ey+6J7%gpDH4;Ao^0*;;T{76B5b|2i8gO(lG0rJE9$R7a! zhlg_DAio7WKi&jSNtH74gH7b^P2{c3<@v?nZ*IS__%M7{EInd*RTBk~g&My<3M5fv ztS-w!)pcMbGVu=!6HdfB4YA-G;=GIT@mM5u`KrW-S%_ETRhpEW2Ili3nRmisy#ZbT2s9(jP^j6mjt~&*Gan4)w|45oGm`$88lKv z2{stmrdg=OVJh)utC-9%4PIb%vp3lrfhlhl=wU-@qq&Igg!WXGG>M@XH>)K^N<(5y zcw~H$Es&tUjFEv73o!>ue3caywqJL+imJ_~!%8nvt~;1e@)}0c?P_{daEiT#-tk*t zZj{>tM|9-m3>%U{h&rV(-v|P~V46B-XHuy`P#&UkD%EXp1<0X(;~QWf0ep!&kBZ$j zXx5;)E@+r7aJ!O&1afEbJC)wK16zG}5bl!Tu4pJ z=a6T?187gmv9vj}4)Os6_uz0C-@pTh??dDlj~2}3U<)4l>7$*$JUrm3KR-l%{}6fq;ql3z ze=JEgxdllTt|Tdb&Z`pK-**=zC0beCTksROCP8VE%12yuKu{d)M8K$Bhn(_l&O%ws zbaSdZ)UpI*Kq1wJSW(VYWUo19Gfl(l7JYOY7V#7{OpppgR&{}N#?+t}IZ}vDJW}XX zctPtCyk7DIfGh0v$VpJ<6Gg>Uql_v8lmR7foUNGjAZeG-bL4c!_>}D-H-QBipCTtX z$tF-?Mou&NI^=LP5W)#*4B0}n?$(WBR-nr1Y~Q5aFa=#6f?-7&s#a^#o7&0wp4C?S zC8jGiOT`-N*SuUsfkc-}Q?!!huOcVp#=*j0C!4tfEZPd0OrEGDs(UlR5sXGLJ+gv= z59Tw9DD^B+Ogo>y%;*a=gw=*m={$2h$d(^K`vD==2Lrtyt(_W^0hn7OKW@ z)&~7%;d)?!iYMt|-791zzE*C7f+R_4MTeDvS3U=pGsdTEF9l03NJ1`MpOR{NF0kRA zElPu$>1V1TO{3T(oAb3KU+haAi0^}CHgDIfsZnl7PMJK;1O++kQh2qm7)WC{2s;(B1=JF@GE zvn))JLB{ZboXRR?OsyD}f}aD+8RJv7mx4v%5@>3krtK(i2JTdH8i9jK(M*$~I_36Q zlXa>otwcywysU^0Q0zp{3r1;Ho`(Iv8nd3BPS(1~c_*vM9n;9-vl5Y%>yw^x6LSkO3<@tM zWUXN}nCa1$zBtZ$2;Gf5jR2kt%__ihMD4@zMzw_mO)`7sooxky?Nsss)z^L!1ca zVo_m#jT_&8*JOQ4C^-8swL)gM78NdjMRG-Ew-yzSUyrOsg|(;LrIMu%<>-Q>jD)wK2iUDMH1MRVQ{<;HN=97VT>o zsK64g`)wB*y?}HYgVrSD_&LK)MtUb>U#&W=^OW_=k5ylO+dQBrq)ITu)#)HRBU%TUe!?V&@I8 zeb{jaTdlwjLpzKGjR)Yqf6$hPeU-ve*ikS$Ujf@WGwiqn2YQYlcd>N(2!d>YGmSCv zvM=p-X>jJ)Je*J&2NP>N3HF;uHvS!d9vm$jU+J=sX4!=CUo>j067lXU=lWk35yU#q zZR8g6#L*=oZ-8Y>;|ITf{;!zv7XNNy>pS23`mgl)-3Nbo^`kc>k@z?(V DT1t0~ diff --git a/hyperledger/1.0/e2e_cli/crypto/orderer/orderer.block b/hyperledger/1.0/e2e_cli/crypto/orderer/orderer.block deleted file mode 100644 index b541e4bee53ae02953b2c6093b16e964cf9360d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10648 zcmeHNU5w*a6>hiFZT4guf^Z^+ZTWN+RtKJTOTUvH=q5{GrxWLgBKrU_wIb{)!sk8 z^L6Ay75qg7e^$X9d^7g=&g1dxvDg0k&$pi3y*aUhiP<%rq0_$q4H8R}hGC>T9V3mm z2!d*v*_K5a1ldZPREH$UY|BVxNfJvE7-^==j6qRJEK6poWHy6mkT`PZ*Ri(wyZ7RM zY`*=&Z~f^jy>0c?fBoSnufO|kLt)7Z_OO_FI7{2(;N_7^pfn z3_s=0?P6)r8PNS2BPUq2g%X0K6W!@NQAhL4tilt7nW^Wz zLQ7pJW__Xz>UeRidtt3lrB!pLb@=ff=y4*iH5M94ReD;FUhT8Zg&d8BiXg%!4LcMA zm1vtvblWN>({z*L8O`WV_r_qxnMG>U6gy}>q`HAMQ^l%CQ_I6@3!%~!X#=i|&$9(0 z^p5sOLy>`)4MncT2nsW3*lb0u&S#@aKT&Sj7%#a^J?ZqST3ED8{ifFS+F+rVJ40Kr z<>VY2k$iyKQc!66zE?C1jkU6=RM9VwP&t+AHQ6F$QLp)Ru#W&vV$Y&tcLSOYXf6vH z`WD!#k(2iwbK-cz z0Ew*(;~8)#GH`~BZyC$JvgbPHTrvh$fV_Zw2Hb|GX^ke(bq{)u2EGWknP@6&7)*oe zd}JXz$aSz4c&>M3vI}m|M#L-?XJH|qMQ+Bx&VvWP!S6hHaPP?GE_iz1rs@nVZ#qG4 zAzR=Y5v=-mcOM?~bI5k=3FO96!*QF{xgOaZHXO5A9pfG3Rx}M*9qZ1uBb)o+Htl+5 zUo%{%y?+|Wqvl&3F!FZ@Zo<(hI<$iU??dE`drNM!@g-CJ{9gRMy9Z46&Ryj9cagX6 zKJ5I(N77h}UD81oGQY7&%C5D!OUsylEJ_wDXc20T*!t86vo1C2=w}8=&R6S zO_VVWC$BoAYL0+3D5g3PE6Lf4?6xLMwxyfBl84TM5}wM85~MT5mRh6oQ7V?@tJZuH!vtCNI{2#U{p~?s@b0QXI65t zXLi(qMEAs&RH`#x-OX1NNc7lrhEj6eMf8PSIas*M#5)&&rMgC}Qy?md+TNVEdA(Um zk4?YmfyF#SNPQDk6>VYTS|?=4Mn*A*c}}CJ%%WxB!&#fvII2+|b_YeeUMhAmqdiRL ziZy*S?|?z8csZ~@#TB)n;TCfuS1)%!Q540rqQT10EuR6)DdQ8ij|5BJPeL}`n2~CF z!85_0C5Xei;bm(9MWNUvtQsexHoY4iG_KR}P$>6ntqHAHj zBNJ&s>dws0h=KMe3l`x#u*}X0j%W2AyZ|h{HNcW5h0s!pI4rbHjpTVEV*pz!cIP-L zEeP43E`mX=Ri{#DW~5ry5Y`s~mGwC|$~U~ixHgd%ZM|cZ`sSDyOinJPQWCIbmEaovingi*BwecMUy<&m|%$H>Q2% zBCzcK^do7gxrk^;8GKwCI@hy23M`7KBtsUiXh=JtA#oj`l=Qjha3+cwRddp(s`+Am zqEL0f6Ew`>dp4c!&#DQtW|W3pp5WZ9RNYgXz5Jjzro4riO`s}K(55Dr(=8VY%B;wy zMvZ9?)L2>;VYr|C9A;3A2v22BY}?}t>7K*5Vp-M#X_hkjPB6*hfd|e2WDRd}oO!@u z=9CFxRi7thG*c7Gi;5#w8j?*H8KX+nQmI4}wJ_eyD}2R^0K&|R+{_t=I zpjf&hmmN7JCjx4eAC6ifjhDtcI4lAi0tVGG&OipD7d0ZxEqjo4l5fh`wt&Mpl zmkjo@bB)A7-K?v8N9E_!j7L^8M1Sm*bbQ!nrv<847cP{QHgU@4>BhQGH?BSr+{7uL znmFa^!Lo@{J~eU5$50KhML5CvOB@XJ|v$_M-Zi?f^lM z7&ui@6HWX4e)R=wOpL<;m5Dz!CsTjFxFq)P=yiKF?f&log.txt + peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx >&log.txt else - peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./peer/channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA >&log.txt + peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA >&log.txt fi res=$? cat log.txt @@ -72,9 +72,9 @@ updateAnchorPeers() { setGlobals $PEER if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then - peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./peer/channel-artifacts/${CORE_PEER_LOCALMSPID}anchors.tx >&log.txt + peer channel update -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/${CORE_PEER_LOCALMSPID}anchors.tx >&log.txt else - peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./peer/channel-artifacts/${CORE_PEER_LOCALMSPID}anchors.tx --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA >&log.txt + peer channel update -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/${CORE_PEER_LOCALMSPID}anchors.tx --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA >&log.txt fi res=$? cat log.txt @@ -192,15 +192,15 @@ echo "Having all peers join the channel..." joinChannel ## Set the anchor peers for each org in the channel -echo "Updating anchor peers using peer0/org1(peer0) for org1..." +echo "Updating anchor peers for org1..." updateAnchorPeers 0 -echo "Updating anchor peers using peer0/org2(peer2) for org2..." +echo "Updating anchor peers for org2..." updateAnchorPeers 2 -## Install chaincode on Peer0/Org1 and Peer0/Org2 -echo "Installing chaincode on peer0/org1..." +## Install chaincode on Peer0/Org1 and Peer2/Org2 +echo "Installing chaincode on org1/peer0..." installChaincode 0 -echo "Install chaincode on peer0/org2.." +echo "Install chaincode on org2/peer2..." installChaincode 2 #Instantiate chaincode on Peer0/Org2 @@ -208,11 +208,11 @@ echo "Instantiating chaincode on peer0/org2..." instantiateChaincode 2 #Query on chaincode on Peer0/Org1 -echo "Querying chaincode on peer0/org1..." +echo "Querying chaincode on org1/peer0..." chaincodeQuery 0 100 #Invoke on chaincode on Peer0/Org1 -echo "Sending invoke transaction on peer0/org1..." +echo "Sending invoke transaction on org1/peer0..." chaincodeInvoke 0 ## Install chaincode on Peer1/Org2