Fix output msg

pull/117/head
Baohua Yang 2018-01-18 13:31:00 +08:00
parent 636d561928
commit b4a4c23247
35 changed files with 24623 additions and 24379 deletions

View File

@ -57,7 +57,8 @@ ready: # create/join channel, install/instantiate cc
make test_qscc # test qscc operations make test_qscc # test qscc operations
make test_fetch_blocks # fetch block files make test_fetch_blocks # fetch block files
make test_config_update
#make test_config_update # not work with this version
#make test_channel_update # not work with this version #make test_channel_update # not work with this version
make logs_save make logs_save

View File

@ -20,7 +20,6 @@ services:
container_name: ca.org1.example.com container_name: ca.org1.example.com
hostname: ca.org1.example.com hostname: ca.org1.example.com
environment: environment:
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_CA_NAME=ca-org1 - FABRIC_CA_SERVER_CA_NAME=ca-org1
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/c843d3f021118963ce5d340e95286e8869bb7bd051454cd4166aa2887a2ad451_sk - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/c843d3f021118963ce5d340e95286e8869bb7bd051454cd4166aa2887a2ad451_sk
@ -37,7 +36,6 @@ services:
container_name: ca.org2.example.com container_name: ca.org2.example.com
hostname: ca.org2.example.com hostname: ca.org2.example.com
environment: environment:
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_CA_NAME=ca-org2 - FABRIC_CA_SERVER_CA_NAME=ca-org2
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/1ee551a8753171c0377366e96a1d7ec01afddb868c9483cc501b6f8ac7ae752f_sk - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/1ee551a8753171c0377366e96a1d7ec01afddb868c9483cc501b6f8ac7ae752f_sk
@ -47,22 +45,18 @@ services:
- ./solo/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config - ./solo/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/1ee551a8753171c0377366e96a1d7ec01afddb868c9483cc501b6f8ac7ae752f_sk -b admin:adminpw -d' command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/1ee551a8753171c0377366e96a1d7ec01afddb868c9483cc501b6f8ac7ae752f_sk -b admin:adminpw -d'
orderer.example.com: # orderer node for example org orderer.example.com: # orderer in solo mode
extends: extends:
file: base.yaml file: base.yaml
service: orderer-base service: orderer-base
container_name: orderer.example.com container_name: orderer.example.com
hostname: orderer.example.com hostname: orderer.example.com
environment:
- ORDERER_GENERAL_TLS_ENABLED=true
ports: ports:
- "7050:7050" - "7050:7050"
volumes: volumes:
- ./solo/channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block - ./solo/channel-artifacts/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ./solo/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp - ./solo/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp
- ./solo/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls - ./solo/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls
command: orderer start
## following are peer nodes ## ## following are peer nodes ##
@ -78,7 +72,6 @@ services:
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.example.com:7052 - CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051 - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP - CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_TLS_ENABLED=true
volumes: volumes:
- ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp - ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls - ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
@ -96,11 +89,10 @@ services:
environment: environment:
- CORE_PEER_ID=peer1.org1.example.com - CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051 - CORE_PEER_ADDRESS=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.org1.example.com:7052 - CORE_PEER_CHAINCODELISTENADDRESS=peer1.org1.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051 - CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP - CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_TLS_ENABLED=true
volumes: volumes:
- ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/msp - ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/etc/hyperledger/fabric/tls - ./solo/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/etc/hyperledger/fabric/tls
@ -118,11 +110,10 @@ services:
environment: environment:
- CORE_PEER_ID=peer0.org2.example.com - CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051 - CORE_PEER_ADDRESS=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org2.example.com:7052 - CORE_PEER_CHAINCODELISTENADDRESS=peer0.org2.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051 - CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP - CORE_PEER_LOCALMSPID=Org2MSP
- CORE_PEER_TLS_ENABLED=true
volumes: volumes:
- ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/etc/hyperledger/fabric/msp - ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/etc/hyperledger/fabric/msp
- ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls:/etc/hyperledger/fabric/tls - ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls:/etc/hyperledger/fabric/tls
@ -140,11 +131,10 @@ services:
environment: environment:
- CORE_PEER_ID=peer1.org2.example.com - CORE_PEER_ID=peer1.org2.example.com
- CORE_PEER_ADDRESS=peer1.org2.example.com:7051 - CORE_PEER_ADDRESS=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.org2.example.com:7052 - CORE_PEER_CHAINCODELISTENADDRESS=peer1.org2.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051 - CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP - CORE_PEER_LOCALMSPID=Org2MSP
- CORE_PEER_TLS_ENABLED=true
volumes: volumes:
- ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp:/etc/hyperledger/fabric/msp - ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp:/etc/hyperledger/fabric/msp
- ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls:/etc/hyperledger/fabric/tls - ./solo/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls:/etc/hyperledger/fabric/tls
@ -162,11 +152,10 @@ services:
environment: environment:
- CORE_PEER_ID=peer0.org3.example.com - CORE_PEER_ID=peer0.org3.example.com
- CORE_PEER_ADDRESS=peer0.org3.example.com:7051 - CORE_PEER_ADDRESS=peer0.org3.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org3.example.com:7052 - CORE_PEER_CHAINCODELISTENADDRESS=peer0.org3.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org3.example.com:7051 - CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org3.example.com:7051
- CORE_PEER_LOCALMSPID=Org3MSP - CORE_PEER_LOCALMSPID=Org3MSP
- CORE_PEER_TLS_ENABLED=true
volumes: volumes:
- ./solo/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/msp:/etc/hyperledger/fabric/msp - ./solo/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/msp:/etc/hyperledger/fabric/msp
- ./solo/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls:/etc/hyperledger/fabric/tls - ./solo/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls:/etc/hyperledger/fabric/tls
@ -181,26 +170,13 @@ services:
service: cli-base service: cli-base
container_name: fabric-cli container_name: fabric-cli
hostname: fabric-cli hostname: fabric-cli
tty: true
environment:
#- GOPATH=/opt/gopath
- CORE_PEER_ID=fabric-cli
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051 # default to operate on peer0.org1
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
- CORE_PEER_TLS_ENABLED=true # to enable TLS, change to true
volumes: volumes:
#- ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
- ./scripts:/tmp/scripts - ./scripts:/tmp/scripts
- ./solo/channel-artifacts:/tmp/channel-artifacts - ./solo/channel-artifacts:/tmp/channel-artifacts
- ./solo/configtx.yaml:/etc/hyperledger/fabric/configtx.yaml - ./solo/configtx.yaml:/etc/hyperledger/fabric/configtx.yaml
- ./solo/crypto-config.yaml:/etc/hyperledger/fabric/crypto-config.yaml - ./solo/crypto-config.yaml:/etc/hyperledger/fabric/crypto-config.yaml
- ./solo/crypto-config:/etc/hyperledger/fabric/crypto-config - ./solo/crypto-config:/etc/hyperledger/fabric/crypto-config
- ./examples:/opt/gopath/src/examples - ./examples:/opt/gopath/src/examples
#- ./examples:/opt/gopath/src/github.com/hyperledger/fabric/examples
event-listener: event-listener:
extends: extends:

View File

@ -1,10 +1,20 @@
# This is the default base file to config env and command # Contains the base template for all Hyperledger Fabric services
# All element in this file is abstract without knowing the org and consensus type # Never directly use services in this template, but inherent
# All services are abstract without any names, config or port mapping
# https://github.com/yeasy/docker-compose-files # https://github.com/yeasy/docker-compose-files
#
# * ca-base: base for fabric-ca
# * orderer-base: base for fabric-orderer
# * peer-base: base for fabric-peer
# * cli-base: base for fabric peer client
# * event-listener-base: base for fabric eventhub listener
# * kafka-base: base for kafka
# * zookeeper-base: base for fabric-zookeeper
# * couchdb-base: base for couchdb
# * explorer-base: base for Hyperledger blockchain-explorer
# * mysql-base: base for MySQL
# Depends on the hyperledger/fabric-peer image. version: '2' # compose v3 still doesn't support `extends`, shame!
version: '2'
services: services:
ca-base: ca-base:
@ -13,8 +23,7 @@ services:
restart: always restart: always
environment: environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_TLS_ENABLED=true - FABRIC_CA_SERVER_TLS_ENABLED=true # change to false to disable TLS
#- FABRIC_CA_SERVER_TLS_ENABLED=false
orderer-base: orderer-base:
#image: yeasy/hyperledger-fabric-orderer:1.0.2 #image: yeasy/hyperledger-fabric-orderer:1.0.2
@ -43,6 +52,7 @@ services:
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt] - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
expose: expose:
- "7050" # - "7050" #
#command: bash -c 'bash /tmp/orderer_build.sh; orderer start' # use this if to debug orderer
command: orderer start command: orderer start
peer-base: peer-base:
@ -54,8 +64,8 @@ services:
- CORE_LOGGING_LEVEL=DEBUG - CORE_LOGGING_LEVEL=DEBUG
- CORE_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message} - CORE_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message}
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=v102_default # uncomment this to use specific network - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=v102_default # uncomment this to use specific network
- CORE_PEER_GOSSIP_ORGLEADER=false # whether this node is the group leader, default to false
- CORE_PEER_GOSSIP_USELEADERELECTION=true - CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false # this node is the group leader, default to false
- CORE_PEER_PROFILE_ENABLED=false - CORE_PEER_PROFILE_ENABLED=false
- CORE_PEER_TLS_ENABLED=true - CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
@ -76,12 +86,10 @@ services:
- "7059" # tlsCAA - "7059" # tlsCAA
volumes: # docker.sock is mapped as the default CORE_VM_ENDPOINT volumes: # docker.sock is mapped as the default CORE_VM_ENDPOINT
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
#volumes:
# - /var/run/:/host/var/run/
command: peer node start command: peer node start
cli-base: cli-base:
#image: yeasy/hyperledger-fabric:1.0.2
image: hyperledger/fabric-tools:x86_64-1.0.2 image: hyperledger/fabric-tools:x86_64-1.0.2
restart: always restart: always
tty: true tty: true
@ -106,14 +114,6 @@ services:
#command: bash -c 'block-listener -events-address=peer0.org1.example.com:7053 -events-mspdir=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/ -events-mspid=Org1MSP' #command: bash -c 'block-listener -events-address=peer0.org1.example.com:7053 -events-mspdir=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/ -events-mspid=Org1MSP'
command: bash -c 'while true; do sleep 20170504; done' command: bash -c 'while true; do sleep 20170504; done'
couchdb-base:
#container_name: couchdb0
image: hyperledger/fabric-couchdb:x86_64-1.0.2
restart: always
tty: true
# Comment/Uncomment the port mapping if you want to hide/expose the CouchDB service,
# for example map it to utilize Fauxton User Interface in dev environments.
zookeeper-base: zookeeper-base:
image: hyperledger/fabric-zookeeper:x86_64-1.0.2 image: hyperledger/fabric-zookeeper:x86_64-1.0.2
restart: always restart: always
@ -136,3 +136,20 @@ services:
- KAFKA_LOG_RETENTION_MS=-1 - KAFKA_LOG_RETENTION_MS=-1
expose: expose:
- '9092' - '9092'
couchdb-base:
image: hyperledger/fabric-couchdb:x86_64-1.0.2
restart: always
tty: true
explorer-base:
image: yeasy/blockchain-explorer:0.1.0-preview # Till we have official image
expose:
- "8080" # HTTP port
command: bash -c 'sleep 10; node main.js'
mysql-base: # mysql service
image: mysql:8.0
restart: always
expose:
- "3306"

View File

@ -50,31 +50,32 @@ services:
service: peer1.org2.example.com service: peer1.org2.example.com
explorer: explorer:
image: yeasy/blockchain-explorer:latest extends:
file: base.yaml
service: explorer-base
container_name: explorer container_name: explorer
hostname: explorer hostname: explorer
depends_on: depends_on:
- mysql - mysql
volumes: volumes:
- ./explorer/config.json:/blockchain-explorer/config.json - ./explorer-artifacts/config.json:/blockchain-explorer/config.json
- ./solo/crypto-config:/blockchain-explorer/first-network/crypto-config - ./solo/crypto-config:/blockchain-explorer/first-network/crypto-config
ports: ports:
- "8080:8080" # HTTP port - "8080:8080" # HTTP port
command: bash -c 'sleep 10; node main.js'
mysql: # mysql service mysql: # mysql service
image: mysql:8.0 extends:
file: base.yaml
service: mysql-base
container_name: mysql container_name: mysql
hostname: mysql hostname: mysql
restart: always
environment: environment:
- MYSQL_ROOT_PASSWORD=root - MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=fabricexplorer - MYSQL_DATABASE=fabricexplorer
volumes: volumes:
- ./explorer/fabricexplorer.sql:/docker-entrypoint-initdb.d/fabricexplorer.sql - ./explorer-artifacts/fabricexplorer.sql:/docker-entrypoint-initdb.d/fabricexplorer.sql
expose:
- "3306"
#command: bash -c 'mysqld; sleep 1; mysql -uroot -proot < /tmp/fabricexplorer.sql; while true; do sleep 20171117; done' #command: bash -c 'mysqld; sleep 1; mysql -uroot -proot < /tmp/fabricexplorer.sql; while true; do sleep 20171117; done'
#networks: #networks:
# default: # default:
# external: # external:

View File

@ -0,0 +1,57 @@
{
"network-config": {
"org1": {
"name": "peerOrg1",
"mspid": "Org1MSP",
"peer1": {
"requests": "grpcs://peer0.org1.example.com:7051",
"events": "grpcs://peer0.org1.example.com:7053",
"server-hostname": "peer0.org1.example.com",
"tls_cacerts": "/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
},
"peer2": {
"requests": "grpcs://peer1.org1.example.com:7051",
"events": "grpcs://peer1.org1.example.com:7053",
"server-hostname": "peer1.org1.example.com",
"tls_cacerts": "/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
},
"admin": {
"key": "/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
"cert": "/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
}
},
"org2": {
"name": "peerOrg2",
"mspid": "Org2MSP",
"peer1": {
"requests": "grpcs://peer0.org2.example.com:7051",
"events": "grpcs://peer0.org2.example.com:7053",
"server-hostname": "peer0.org2.example.com",
"tls_cacerts": "/first-network/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt"
},
"peer2": {
"requests": "grpcs://peer1.org2.example.com:7051",
"events": "grpcs://peer1.org2.example.com:7053",
"server-hostname": "peer1.org2.example.com",
"tls_cacerts": "/first-network/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt"
},
"admin": {
"key": "/first-network/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore",
"cert": "/first-network/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts"
}
}
},
"host":"explorer",
"port":"8080",
"channel": "businesschannel",
"GOPATH":"/opt/gopath",
"keyValueStore":"/tmp/fabric-client-kvs",
"eventWaitTime":"30000",
"mysql":{
"host":"mysql",
"port":"3306",
"database":"fabricexplorer",
"username":"root",
"passwd":"root"
}
}

View File

@ -1,73 +0,0 @@
{
"network-config": {
"orderer": [
{
"url": "grpcs://orderer.example.com:7050",
"server-hostname": "orderer.example.com",
"tls_cacerts": "/first-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"
}
],
"org1": {
"name": "peerOrg1",
"mspid": "Org1MSP",
"peer1": {
"requests": "grpcs://peer0.org1.example.com:7051",
"events": "grpcs://peer0.org1.example.com:7053",
"server-hostname": "peer0.org1.example.com",
"tls_cacerts": "/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
},
"peer2": {
"requests": "grpcs://peer1.org1.example.com:7051",
"events": "grpcs://peer1.org1.example.com:7053",
"server-hostname": "peer1.org1.example.com",
"tls_cacerts": "/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
},
"admin": {
"key": "/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
"cert": "/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
}
},
"org2": {
"name": "peerOrg2",
"mspid": "Org2MSP",
"ca": "https://ca.org2.example.com:7054",
"peer1": {
"requests": "grpcs://peer0.org2.example.com:7051",
"events": "grpcs://peer0.org2.example.com:7053",
"server-hostname": "peer0.org2.example.com",
"tls_cacerts": "/first-network/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt"
},
"peer2": {
"requests": "grpcs://peer1.org2.example.com:7051",
"events": "grpcs://peer1.org2.example.com:7053",
"server-hostname": "peer1.org2.example.com",
"tls_cacerts": "/first-network/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt"
},
"admin": {
"key": "/first-network/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore",
"cert": "/first-network/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts"
}
}
},
"host":"explorer",
"port":"8080",
"channel": "businesschannel",
"GOPATH":"../artifacts",
"keyValueStore":"/tmp/fabric-client-kvs",
"eventWaitTime":"30000",
"peer":"peer1",
"org":["org1"],
"users":[
{
"username":"admin",
"secret":"adminpw"
}
],
"mysql":{
"host":"mysql",
"port":"3306",
"database":"fabricexplorer",
"username":"root",
"passwd":"root"
}
}

View File

@ -32,39 +32,44 @@ fi
# Verify $1 is not 0, then output error msg $2 and exit # Verify $1 is not 0, then output error msg $2 and exit
verifyResult () { verifyResult () {
if [ $1 -ne 0 ] ; then if [ $1 -ne 0 ] ; then
echo_b "$2" echo "$2"
echo_r "=== ERROR !!! FAILED to execute End-2-End Scenario ===" echo_r "=== ERROR !!! FAILED to execute End-2-End Scenario ==="
exit 1 exit 1
fi fi
} }
# set env to use orderOrg's identity
setOrdererEnvs () { setOrdererEnvs () {
CORE_PEER_LOCALMSPID="OrdererMSP" export CORE_PEER_LOCALMSPID="OrdererMSP"
CORE_PEER_MSPCONFIGPATH=${ORDERER_ADMIN_MSP} export CORE_PEER_MSPCONFIGPATH=${ORDERER_ADMIN_MSP}
CORE_PEER_TLS_ROOTCERT_FILE=${ORDERER_TLS_ROOTCERT} export CORE_PEER_TLS_ROOTCERT_FILE=${ORDERER_TLS_ROOTCERT}
#t="\${ORG${org}_PEER${peer}_URL}" && CORE_PEER_ADDRESS=`eval echo $t` #t="\${ORG${org}_PEER${peer}_URL}" && CORE_PEER_ADDRESS=`eval echo $t`
} }
# Set global env variables for fabric usage # Set global env variables for fabric cli, after seting:
# client is the admin as given org
# TLS root cert is configured to given peer's
# remote peer address is configured to given peer's
# Usage: setEnvs org peer # Usage: setEnvs org peer
setEnvs () { setEnvs () {
local org=$1 # 1 or 2 local org=$1 # 1 or 2
local peer=$2 # 0 or 1 local peer=$2 # 0 or 1
[ -z $org ] && [ -z $peer ] && echo_r "input param invalid" && exit -1
local t="" local t=""
CORE_PEER_LOCALMSPID="Org${org}MSP" export CORE_PEER_LOCALMSPID="Org${org}MSP"
#CORE_PEER_MSPCONFIGPATH=\$${ORG${org}_ADMIN_MSP} #CORE_PEER_MSPCONFIGPATH=\$${ORG${org}_ADMIN_MSP}
t="\${ORG${org}_ADMIN_MSP}" && CORE_PEER_MSPCONFIGPATH=`eval echo $t` t="\${ORG${org}_PEER${peer}_URL}" && export CORE_PEER_ADDRESS=`eval echo $t`
t="\${ORG${org}_PEER${peer}_TLS_ROOTCERT}" && CORE_PEER_TLS_ROOTCERT_FILE=`eval echo $t` t="\${ORG${org}_ADMIN_MSP}" && export CORE_PEER_MSPCONFIGPATH=`eval echo $t`
t="\${ORG${org}_PEER${peer}_URL}" && CORE_PEER_ADDRESS=`eval echo $t` t="\${ORG${org}_PEER${peer}_TLS_ROOTCERT}" && export CORE_PEER_TLS_ROOTCERT_FILE=`eval echo $t`
# env |grep CORE #env |grep CORE
} }
checkOSNAvailability() { checkOSNAvailability() {
#Use orderer's MSP for fetching system channel config block #Use orderer's MSP for fetching system channel config block
CORE_PEER_LOCALMSPID="OrdererMSP" export CORE_PEER_LOCALMSPID="OrdererMSP"
CORE_PEER_TLS_ROOTCERT_FILE=${ORDERER_TLS_CA} export CORE_PEER_TLS_ROOTCERT_FILE=${ORDERER_TLS_CA}
CORE_PEER_MSPCONFIGPATH=${ORDERER_MSP} export CORE_PEER_MSPCONFIGPATH=${ORDERER_MSP}
local rc=1 local rc=1
local starttime=$(date +%s) local starttime=$(date +%s)
@ -83,7 +88,7 @@ checkOSNAvailability() {
test $? -eq 0 && VALUE=$(cat log.txt | awk '/Received block/ {print $NF}') test $? -eq 0 && VALUE=$(cat log.txt | awk '/Received block/ {print $NF}')
test "$VALUE" = "0" && let rc=0 test "$VALUE" = "0" && let rc=0
done done
cat log.txt [ $rc -ne 0 ] && cat log.txt
verifyResult $rc "Ordering Service is not available, Please try again ..." verifyResult $rc "Ordering Service is not available, Please try again ..."
echo "=== Ordering Service is up and running === " echo "=== Ordering Service is up and running === "
echo echo
@ -117,26 +122,28 @@ channelCreateAction(){
# channelCreate APP_CHANNEL APP_CHANNEL.tx org peer # channelCreate APP_CHANNEL APP_CHANNEL.tx org peer
channelCreate() { channelCreate() {
local channel=$1 local channel=$1
local channel_tx=$2 local tx=$2
local org=$3 local org=$3
local peer=$4 local peer=$4
echo_b "=== Create Channel ${channel} by org $org peer $peer === " [ -z $channel ] && [ -z $tx ] && [ -z $org ] && [ -z $peer ] && echo_r "input param invalid" && exit -1
local counter=0
echo "=== Create Channel ${channel} by org $org peer $peer === "
setEnvs $org $peer setEnvs $org $peer
channelCreateAction "${channel}" "${channel_tx}" channelCreateAction "${channel}" "${tx}"
local res=$? local rc=$?
while [ ${counter} -lt ${MAX_RETRY} -a ${res} -ne 0 ]; do local counter=0
echo_b "Failed to create channel $channel, retry after 3s" while [ ${counter} -lt ${MAX_RETRY} -a ${rc} -ne 0 ]; do
echo "Failed to create channel $channel, retry after 3s"
sleep 3 sleep 3
channelCreateAction "${channel}" "${channel_tx}" channelCreateAction "${channel}" "${tx}"
res=$? rc=$?
let counter=${counter}+1 let counter=${counter}+1
#COUNTER=` expr $COUNTER + 1` #COUNTER=` expr $COUNTER + 1`
done done
cat log.txt [ $rc -ne 0 ] && cat log.txt
verifyResult ${res} "Channel ${channel} creation failed" verifyResult ${rc} "Channel ${channel} creation failed"
echo_g "=== Channel ${channel} is created. === " echo "=== Channel ${channel} is created. === "
} }
# called by channelJoinWithRetry # called by channelJoinWithRetry
@ -153,16 +160,16 @@ channelJoinWithRetry () {
local peer=$2 local peer=$2
local counter=0 local counter=0
channelJoinAction ${channel} channelJoinAction ${channel}
local res=$? local rc=$?
while [ ${counter} -lt ${MAX_RETRY} -a ${res} -ne 0 ]; do while [ ${counter} -lt ${MAX_RETRY} -a ${rc} -ne 0 ]; do
echo_b "peer${peer} failed to join channel ${channel}, retry after 2s" echo "peer${peer} failed to join channel ${channel}, retry after 2s"
sleep 2 sleep 2
channelJoinAction ${channel} channelJoinAction ${channel}
res=$? rc=$?
let counter=${counter}+1 let counter=${counter}+1
done done
cat log.txt [ $rc -ne 0 ] && cat log.txt
verifyResult ${res} "After $MAX_RETRY attempts, peer${peer} failed to Join the Channel" verifyResult ${rc} "After $MAX_RETRY attempts, peer${peer} failed to Join the Channel"
} }
# Join given (by default all) peers into the channel # Join given (by default all) peers into the channel
@ -171,17 +178,19 @@ channelJoin () {
local channel=$1 local channel=$1
local org=$2 local org=$2
local peer=$3 local peer=$3
[ -z $channel ] && [ -z $org ] && [ -z $peer ] && echo_r "input param invalid" && exit -1
echo_b "=== Join org$org/peer$peer into channel ${channel} === " echo "=== Join org$org/peer$peer into channel ${channel} === "
setEnvs $org $peer setEnvs $org $peer
channelJoinWithRetry ${channel} $peer channelJoinWithRetry ${channel} $peer
echo_g "=== org$org/peer$peer joined into channel ${channel} === " echo "=== org$org/peer$peer joined into channel ${channel} === "
} }
getShasum () { getShasum () {
[ ! $# -eq 1 ] && exit 1 [ ! $# -eq 1 ] && exit 1
shasum ${1} | awk '{print $1}' shasum ${1} | awk '{print $1}'
} }
# Fetch all blocks for a channel # Fetch all blocks for a channel
# Usage: channelFetchAll channel org peer # Usage: channelFetchAll channel org peer
channelFetchAll () { channelFetchAll () {
@ -189,27 +198,27 @@ channelFetchAll () {
local org=$2 local org=$2
local peer=$3 local peer=$3
echo_b "=== Fetch all block for channel $channel === " echo "=== Fetch all block for channel $channel === "
local block_file=/tmp/${channel}_newest.block local block_file=/tmp/${channel}_newest.block
channelFetch ${channel} $org $peer "newest" ${block_file} channelFetch ${channel} $org $peer "newest" ${block_file}
[ $? -ne 0 ] && exit 1 [ $? -ne 0 ] && exit 1
newest_block_shasum=$(getShasum ${block_file}) newest_block_shasum=$(getShasum ${block_file})
echo_b "fetch newest block ${block_file} with shasum=${newest_block_shasum}" echo "fetch newest block ${block_file} with shasum=${newest_block_shasum}"
block_file=${CHANNEL_ARTIFACTS}/${channel}_config.block block_file=${CHANNEL_ARTIFACTS}/${channel}_config.block
channelFetch ${channel} $org $peer "config" ${block_file} channelFetch ${channel} $org $peer "config" ${block_file}
[ $? -ne 0 ] && exit 1 [ $? -ne 0 ] && exit 1
echo_b "fetch config block ${block_file}" echo "fetch config block ${block_file}"
for i in $(seq 0 16); do # we at most fetch 16 blocks for i in $(seq 0 16); do # we at most fetch 16 blocks
block_file=${CHANNEL_ARTIFACTS}/${channel}_${i}.block block_file=${CHANNEL_ARTIFACTS}/${channel}_${i}.block
channelFetch ${channel} $org $peer $i ${block_file} channelFetch ${channel} $org $peer $i ${block_file}
[ $? -ne 0 ] && exit 1 [ $? -ne 0 ] && exit 1
[ -f $block_file ] || break [ -f $block_file ] || break
echo_b "fetch block $i and saved into ${block_file}" echo "fetch block $i and saved into ${block_file}"
block_shasum=$(getShasum ${block_file}) block_shasum=$(getShasum ${block_file})
[ ${block_shasum} = ${newest_block_shasum} ] && { echo_g "Block $i is the last one for channel $channel"; break; } [ ${block_shasum} = ${newest_block_shasum} ] && { echo "Block $i is the last one for channel $channel"; break; }
done done
} }
@ -220,10 +229,10 @@ channelFetch () {
local peer=$3 local peer=$3
local num=$4 local num=$4
local block_file=$5 local block_file=$5
echo_b "=== Fetch block $num of channel $channel === " echo "=== Fetch block $num of channel $channel === "
#setEnvs $org $peer #setEnvs $org $peer
setOrdererEnvs setOrdererEnvs # system channel required id from ordererOrg
# while 'peer chaincode' command can get the orderer endpoint from the peer (if join was successful), # while 'peer chaincode' command can get the orderer endpoint from the peer (if join was successful),
# lets supply it directly as we know it using the "-o" option # lets supply it directly as we know it using the "-o" option
if [ -z "${CORE_PEER_TLS_ENABLED}" ] || [ "${CORE_PEER_TLS_ENABLED}" = "false" ]; then if [ -z "${CORE_PEER_TLS_ENABLED}" ] || [ "${CORE_PEER_TLS_ENABLED}" = "false" ]; then
@ -244,7 +253,7 @@ channelFetch () {
echo_r "Fetch block $num of channel $channel failed" echo_r "Fetch block $num of channel $channel failed"
return 1 return 1
else else
echo_g "=== Fetch block $num of channel $channel is successful === " echo "=== Fetch block $num of channel $channel OK === "
return 0 return 0
fi fi
} }
@ -255,19 +264,20 @@ channelSignConfigTx () {
local channel=$1 local channel=$1
local org=$2 local org=$2
local peer=$3 local peer=$3
local txFile=$4 local tx=$4
echo_b "=== Sign channel config tx $txFile for channel $channel by org $org peer $peer === " [ -z $channel ] && [ -z $tx ] && [ -z $org ] && [ -z $peer ] && echo_r "input param invalid" && exit -1
[ -f ${CHANNEL_ARTIFACTS}/${txFile} ] || { echo_r "${txFile} not exist"; exit 1; } echo "=== Sign channel config tx $tx for channel $channel by org $org peer $peer === "
[ -f ${CHANNEL_ARTIFACTS}/${tx} ] || { echo_r "${tx} not exist"; exit 1; }
setEnvs $org $peer setEnvs $org $peer
peer channel signconfigtx -f ${CHANNEL_ARTIFACTS}/${txFile} >&log.txt peer channel signconfigtx -f ${CHANNEL_ARTIFACTS}/${tx} >&log.txt
res=$? rc=$?
cat log.txt [ $rc -ne 0 ] && cat log.txt
if [ $res -ne 0 ]; then if [ $rc -ne 0 ]; then
echo_r "Sign channel config tx for channel $channel by org $org peer $peer failed" echo_r "Sign channel config tx for channel $channel by org $org peer $peer failed"
else else
echo_g "=== Sign channel config tx channel $channel by org $org peer $peer is successful === " echo "=== Sign channel config tx channel $channel by org $org peer $peer is successful === "
fi fi
} }
@ -277,29 +287,31 @@ channelUpdate() {
local channel=$1 local channel=$1
local org=$2 local org=$2
local peer=$3 local peer=$3
local txFile=$4 local tx=$4
[ -z $channel ] && [ -z $tx ] && [ -z $org ] && [ -z $peer ] && echo_r "input param invalid" && exit -1
setEnvs $org $peer setEnvs $org $peer
echo_b "=== Update config on channel ${channel} === " echo "=== Update config on channel ${channel} === "
[ -f ${CHANNEL_ARTIFACTS}/${txFile} ] || { echo_r "${txFile} not exist"; exit 1; } [ -f ${CHANNEL_ARTIFACTS}/${tx} ] || { echo_r "${tx} not exist"; exit 1; }
if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then
peer channel update \ peer channel update \
-o ${ORDERER_URL} \ -o ${ORDERER_URL} \
-c ${channel} \ -c ${channel} \
-f ${CHANNEL_ARTIFACTS}/${txFile} \ -f ${CHANNEL_ARTIFACTS}/${tx} \
>&log.txt >&log.txt
else else
peer channel update \ peer channel update \
-o ${ORDERER_URL} \ -o ${ORDERER_URL} \
-c ${channel} \ -c ${channel} \
-f ${CHANNEL_ARTIFACTS}/${txFile} \ -f ${CHANNEL_ARTIFACTS}/${tx} \
--tls $CORE_PEER_TLS_ENABLED \ --tls $CORE_PEER_TLS_ENABLED \
--cafile ${ORDERER_TLS_CA} \ --cafile ${ORDERER_TLS_CA} \
>&log.txt >&log.txt
fi fi
res=$? rc=$?
cat log.txt [ $rc -ne 0 ] && cat log.txt
verifyResult $res "peer channel update failed" verifyResult $rc "peer channel update failed"
echo_g "=== Channel ${channel} is updated. === " echo "=== Channel ${channel} is updated. === "
sleep 2 sleep 2
} }
@ -311,17 +323,18 @@ chaincodeInstall () {
local name=$3 local name=$3
local version=$4 local version=$4
local path=$5 local path=$5
echo_b "=== Install Chaincode $name:$version ($path) on org${org} peer$peer === " [ -z $org ] && [ -z $peer ] && [ -z $name ] && [ -z $version ] && [ -z $path ] && echo_r "input param invalid" && exit -1
echo "=== Install Chaincode $name:$version ($path) on org${org} peer$peer === "
setEnvs $org $peer setEnvs $org $peer
peer chaincode install \ peer chaincode install \
-n ${name} \ -n ${name} \
-v $version \ -v $version \
-p ${path} \ -p ${path} \
>&log.txt >&log.txt
res=$? rc=$?
cat log.txt [ $rc -ne 0 ] && cat log.txt
verifyResult $res "Chaincode installation on remote peer$peer has Failed" verifyResult $rc "Chaincode installation on remote peer$peer has Failed"
echo_g "=== Chaincode is installed on remote peer$peer === " echo "=== Chaincode is installed on remote peer$peer === "
} }
# Instantiate chaincode on specifized peer node # Instantiate chaincode on specifized peer node
@ -333,8 +346,9 @@ chaincodeInstantiate () {
local name=$4 local name=$4
local version=$5 local version=$5
local args=$6 local args=$6
[ -z $channel ] && [ -z $org ] && [ -z $peer ] && [ -z $name ] && [ -z $version ] && [ -z $args ] && echo_r "input param invalid" && exit -1
setEnvs $org $peer setEnvs $org $peer
echo_b "=== chaincodeInstantiate for channel ${channel} on org $org peer $peer ====" echo "=== chaincodeInstantiate for channel ${channel} on org $org peer $peer ===="
# while 'peer chaincode' command can get the orderer endpoint from the peer (if join was successful), # while 'peer chaincode' command can get the orderer endpoint from the peer (if join was successful),
# lets supply it directly as we know it using the "-o" option # lets supply it directly as we know it using the "-o" option
if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then
@ -358,10 +372,10 @@ chaincodeInstantiate () {
--cafile ${ORDERER_TLS_CA} \ --cafile ${ORDERER_TLS_CA} \
>&log.txt >&log.txt
fi fi
res=$? rc=$?
cat log.txt [ $rc -ne 0 ] && cat log.txt
verifyResult $res "ChaincodeInstantiation on peer$peer in channel ${channel} failed" verifyResult $rc "ChaincodeInstantiation on peer$peer in channel ${channel} failed"
echo_g "=== Chaincode Instantiated in channel ${channel} by peer$peer ===" echo "=== Chaincode Instantiated in channel ${channel} by peer$peer ==="
} }
@ -372,7 +386,8 @@ chaincodeInvoke () {
local peer=$3 local peer=$3
local name=$4 local name=$4
local args=$5 local args=$5
echo_g "=== Invoke transaction on peer$peer in channel ${channel} === " [ -z $channel ] && [ -z $org ] && [ -z $peer ] && [ -z $name ] && [ -z $args ] && echo_r "input param invalid" && exit -1
echo "=== Invoke transaction on peer$peer in channel ${channel} === "
setEnvs $org $peer setEnvs $org $peer
# while 'peer chaincode' command can get the orderer endpoint from the peer (if join was successful), # while 'peer chaincode' command can get the orderer endpoint from the peer (if join was successful),
# lets supply it directly as we know it using the "-o" option # lets supply it directly as we know it using the "-o" option
@ -393,10 +408,10 @@ chaincodeInvoke () {
--cafile ${ORDERER_TLS_CA} \ --cafile ${ORDERER_TLS_CA} \
>&log.txt >&log.txt
fi fi
res=$? rc=$?
cat log.txt [ $rc -ne 0 ] && cat log.txt
verifyResult $res "Invoke execution on peer$peer failed " verifyResult $rc "Invoke execution on peer$peer failed "
echo_g "=== Invoke transaction on peer$peer in channel ${channel} is successful === " echo "=== Invoke transaction on peer$peer in channel ${channel} is successful === "
} }
# query channel peer name args expected_result # query channel peer name args expected_result
@ -406,15 +421,16 @@ chaincodeQuery () {
local peer=$3 local peer=$3
local name=$4 local name=$4
local args=$5 local args=$5
[ -z $channel ] && [ -z $org ] && [ -z $peer ] && [ -z $name ] && [ -z $args ] && echo_r "input param invalid" && exit -1
[ $# -gt 5 ] && local expected_result=$6 [ $# -gt 5 ] && local expected_result=$6
echo_b "=== Querying on org$org peer$peer in channel ${channel}... === " echo "=== Querying on org$org peer$peer in channel ${channel}... === "
local rc=1 local rc=1
local starttime=$(date +%s) local starttime=$(date +%s)
setEnvs $org $peer setEnvs $org $peer
# we either get a successful response, or reach TIMEOUT # we either get a successful response, or reach TIMEOUT
while [ "$(($(date +%s)-starttime))" -lt "$TIMEOUT" -a $rc -ne 0 ]; do while [ "$(($(date +%s)-starttime))" -lt "$TIMEOUT" -a $rc -ne 0 ]; do
echo_b "Attempting to Query peer${peer}.org${org} ...$(($(date +%s)-starttime)) secs" echo "Attempting to Query peer${peer}.org${org} ...$(($(date +%s)-starttime)) secs"
peer chaincode query \ peer chaincode query \
-C "${channel}" \ -C "${channel}" \
-n "${name}" \ -n "${name}" \
@ -425,13 +441,15 @@ chaincodeQuery () {
test $? -eq 0 && VALUE=$(cat log.txt | awk '/Query Result/ {print $NF}') test $? -eq 0 && VALUE=$(cat log.txt | awk '/Query Result/ {print $NF}')
test "$VALUE" = "${expected_result}" && let rc=0 test "$VALUE" = "${expected_result}" && let rc=0
fi fi
cat log.txt
if [ $rc -ne 0 ]; then if [ $rc -ne 0 ]; then
cat log.txt
sleep 2 sleep 2
fi fi
done done
# rc==0, or timeout
if [ $rc -eq 0 ]; then if [ $rc -eq 0 ]; then
echo_g "=== Query on peer$peer in channel ${channel} is successful === " echo "=== Query on peer$peer in channel ${channel} is successful === "
else else
echo_r "=== Query result on peer$peer is INVALID, run `make stop clean` to clean ===" echo_r "=== Query result on peer$peer is INVALID, run `make stop clean` to clean ==="
exit 1 exit 1
@ -444,18 +462,16 @@ chaincodeQuery () {
chaincodeStartDev () { chaincodeStartDev () {
local peer=$1 local peer=$1
local version=$2 local version=$2
#setEnvs $peer [ -z $peer ] && [ -z $version ] && echo_r "input param invalid" && exit -1
#setEnvs 1 0
setEnvs 1 0 setEnvs 1 0
CORE_CHAINCODE_LOGLEVEL=debug \ CORE_CHAINCODE_LOGLEVEL=debug \
CORE_PEER_ADDRESS=peer${peer}.org1.example.com:7052 \ CORE_PEER_ADDRESS=peer${peer}.org1.example.com:7052 \
CORE_CHAINCODE_ID_NAME=${CC_02_NAME}:${version} \ CORE_CHAINCODE_ID_NAME=${CC_02_NAME}:${version} \
nohup ./scripts/chaincode_example02 > chaincode_dev.log & nohup ./scripts/chaincode_example02 > chaincode_dev.log &
res=$? rc=$?
cat log.txt [ $rc -ne 0 ] && cat log.txt
verifyResult $res "Chaincode start in dev mode has Failed" verifyResult $rc "Chaincode start in dev mode has Failed"
echo_g "=== Chaincode started in dev mode === " echo "=== Chaincode started in dev mode === "
echo
} }
# chaincodeUpgrade channel peer name version args # chaincodeUpgrade channel peer name version args
@ -466,7 +482,8 @@ chaincodeUpgrade () {
local name=$4 local name=$4
local version=$5 local version=$5
local args=$6 local args=$6
echo_b "=== Upgrade chaincode to version $version on peer$peer in channel ${channel} === " [ -z $channel ] && [ -z $org ] && [ -z $peer ] && [ -z $name ] && [ -z $version ] && [ -z $args ] && echo_r "input param invalid" && exit -1
echo "=== Upgrade chaincode to version $version on peer$peer in channel ${channel} === "
setEnvs $org $peer setEnvs $org $peer
# while 'peer chaincode' command can get the orderer endpoint from the peer (if join was successful), # while 'peer chaincode' command can get the orderer endpoint from the peer (if join was successful),
@ -490,11 +507,10 @@ chaincodeUpgrade () {
--cafile ${ORDERER_TLS_CA} \ --cafile ${ORDERER_TLS_CA} \
>&log.txt >&log.txt
fi fi
res=$? rc=$?
cat log.txt [ $rc -ne 0 ] && cat log.txt
verifyResult $res "Upgrade execution on peer$peer failed " verifyResult $rc "Upgrade execution on peer$peer failed "
echo_g "=== Upgrade transaction on peer$peer in channel ${channel} is successful === " echo "=== Upgrade transaction on peer$peer in channel ${channel} is successful === "
echo
} }
# configtxlator encode json to pb # configtxlator encode json to pb
@ -504,7 +520,7 @@ configtxlatorEncode() {
local input=$2 local input=$2
local output=$3 local output=$3
echo_b "Encode $input --> $output using type $msgType" echo "Encode $input --> $output using type $msgType"
curl -sX POST \ curl -sX POST \
--data-binary @${input} \ --data-binary @${input} \
${CTL_ENCODE_URL}/${msgType} \ ${CTL_ENCODE_URL}/${msgType} \
@ -518,7 +534,7 @@ configtxlatorDecode() {
local input=$2 local input=$2
local output=$3 local output=$3
echo_b "Config Decode $input --> $output using type $msgType" echo "Config Decode $input --> $output using type $msgType"
if [ ! -f $input ]; then if [ ! -f $input ]; then
echo_r "input file not found" echo_r "input file not found"
exit 1 exit 1
@ -538,7 +554,7 @@ configtxlatorCompare() {
local updated=$3 local updated=$3
local output=$4 local output=$4
echo_b "Config Compare $origin vs $updated > ${output} in channel $channel" echo "Config Compare $origin vs $updated > ${output} in channel $channel"
if [ ! -f $origin ] || [ ! -f $updated ]; then if [ ! -f $origin ] || [ ! -f $updated ]; then
echo_r "input file not found" echo_r "input file not found"
exit 1 exit 1

View File

@ -10,10 +10,16 @@ fi
## Install chaincode on all peers ## Install chaincode on all peers
CC_NAME=${CC_02_NAME} CC_NAME=${CC_02_NAME}
CC_PATH=${CC_02_PATH} CC_PATH=${CC_02_PATH}
echo_b "Installing chaincode ${CC_NAME} on all 4 peers..." echo_b "=== Installing chaincode ${CC_NAME} on all 4 peers... ==="
chaincodeInstall 1 0 ${CC_NAME} ${CC_INIT_VERSION} ${CC_PATH}
chaincodeInstall 1 1 ${CC_NAME} ${CC_INIT_VERSION} ${CC_PATH}
chaincodeInstall 2 0 ${CC_NAME} ${CC_INIT_VERSION} ${CC_PATH}
chaincodeInstall 2 1 ${CC_NAME} ${CC_INIT_VERSION} ${CC_PATH}
echo_g "=== Install chaincode done ===" for org in "${ORGS[@]}"
do
for peer in "${PEERS[@]}"
do
chaincodeInstall $org $peer ${CC_NAME} ${CC_INIT_VERSION} ${CC_PATH}
done
done
echo_g "=== Install chaincode done ==="
echo

View File

@ -10,8 +10,13 @@ fi
# Instantiate chaincode in the channel, executed once on any node is enough # Instantiate chaincode in the channel, executed once on any node is enough
CC_NAME=${CC_02_NAME} CC_NAME=${CC_02_NAME}
CC_INIT_ARGS=${CC_02_INIT_ARGS} CC_INIT_ARGS=${CC_02_INIT_ARGS}
echo_b "Instantiating chaincode on channel ${APP_CHANNEL} (once for each channel is enough, we make it concurrent here)..."
# (once for each channel is enough, we make it concurrent here)
echo_b "=== Instantiating chaincode on channel ${APP_CHANNEL}... ==="
chaincodeInstantiate "${APP_CHANNEL}" 1 0 ${CC_NAME} ${CC_INIT_VERSION} ${CC_INIT_ARGS} chaincodeInstantiate "${APP_CHANNEL}" 1 0 ${CC_NAME} ${CC_INIT_VERSION} ${CC_INIT_ARGS}
chaincodeInstantiate "${APP_CHANNEL}" 2 0 ${CC_NAME} ${CC_INIT_VERSION} ${CC_INIT_ARGS} chaincodeInstantiate "${APP_CHANNEL}" 2 0 ${CC_NAME} ${CC_INIT_VERSION} ${CC_INIT_ARGS}
echo_g "=== Instantiate chaincode done ===" echo_g "=== Instantiate chaincode on channel ${APP_CHANNEL} done ==="
echo

View File

@ -11,6 +11,8 @@ CC_NAME=${CC_02_NAME}
CC_INVOKE_ARGS=${CC_02_INVOKE_ARGS} CC_INVOKE_ARGS=${CC_02_INVOKE_ARGS}
CC_QUERY_ARGS=${CC_02_QUERY_ARGS} CC_QUERY_ARGS=${CC_02_QUERY_ARGS}
#Query on chaincode on Peer0/Org1 #Query on chaincode on Peer0/Org1
echo_g "=== Testing Chaincode invoke/query ==="
echo_b "Querying chaincode ${CC_NAME} on peer org2/peer0..." echo_b "Querying chaincode ${CC_NAME} on peer org2/peer0..."
chaincodeQuery ${APP_CHANNEL} 2 1 ${CC_NAME} ${CC_QUERY_ARGS} 100 chaincodeQuery ${APP_CHANNEL} 2 1 ${CC_NAME} ${CC_QUERY_ARGS} 100
@ -32,4 +34,6 @@ echo_b "Querying chaincode on all 4peers..."
chaincodeQuery ${APP_CHANNEL} 1 0 ${CC_NAME} ${CC_QUERY_ARGS} 80 chaincodeQuery ${APP_CHANNEL} 1 0 ${CC_NAME} ${CC_QUERY_ARGS} 80
chaincodeQuery ${APP_CHANNEL} 2 0 ${CC_NAME} ${CC_QUERY_ARGS} 80 chaincodeQuery ${APP_CHANNEL} 2 0 ${CC_NAME} ${CC_QUERY_ARGS} 80
echo_g "=== All GOOD, chaincode invoke/query completed ===" echo_g "=== Chaincode invoke/query completed ==="
echo

View File

@ -11,7 +11,8 @@ CC_NAME=${CC_02_NAME}
CC_PATH=${CC_02_PATH} CC_PATH=${CC_02_PATH}
CC_UPGRADE_ARGS=${CC_02_UPGRADE_ARGS} CC_UPGRADE_ARGS=${CC_02_UPGRADE_ARGS}
#Upgrade to new version #Upgrade to new version
echo_b "Upgrade chaincode ${CC_NAME} to new version..." echo_b "=== Upgrade chaincode ${CC_NAME} to new version... ==="
chaincodeInstall 1 0 "${CC_NAME}" "${CC_UPGRADE_VERSION}" "${CC_PATH}" chaincodeInstall 1 0 "${CC_NAME}" "${CC_UPGRADE_VERSION}" "${CC_PATH}"
chaincodeInstall 1 1 "${CC_NAME}" "${CC_UPGRADE_VERSION}" "${CC_PATH}" chaincodeInstall 1 1 "${CC_NAME}" "${CC_UPGRADE_VERSION}" "${CC_PATH}"
chaincodeInstall 2 0 "${CC_NAME}" "${CC_UPGRADE_VERSION}" "${CC_PATH}" chaincodeInstall 2 0 "${CC_NAME}" "${CC_UPGRADE_VERSION}" "${CC_PATH}"
@ -24,4 +25,6 @@ chaincodeUpgrade ${APP_CHANNEL} 1 0 "${CC_NAME}" "${CC_UPGRADE_VERSION}" "${CC_U
chaincodeQuery ${APP_CHANNEL} 1 0 "${CC_NAME}" "${CC_QUERY_ARGS}" 100 chaincodeQuery ${APP_CHANNEL} 1 0 "${CC_NAME}" "${CC_QUERY_ARGS}" 100
chaincodeQuery ${APP_CHANNEL} 2 1 "${CC_NAME}" "${CC_QUERY_ARGS}" 100 chaincodeQuery ${APP_CHANNEL} 2 1 "${CC_NAME}" "${CC_QUERY_ARGS}" 100
echo_g "=== All GOOD, chaincode Upgrade completed ===" echo_g "=== chaincode ${CC_NAME} Upgrade completed ==="
echo

View File

@ -8,5 +8,10 @@ elif [ -f scripts/func.sh ]; then
fi fi
## Create channel ## Create channel
echo_b "Creating channel ${APP_CHANNEL} with ${APP_CHANNEL_TX}..." echo_b "=== Creating channel ${APP_CHANNEL} with ${APP_CHANNEL_TX}... ==="
channelCreate "${APP_CHANNEL}" "${APP_CHANNEL_TX}" 1 0 channelCreate "${APP_CHANNEL}" "${APP_CHANNEL_TX}" 1 0
echo_g "=== Created channel ${APP_CHANNEL} with ${APP_CHANNEL_TX} ==="
echo

View File

@ -8,7 +8,7 @@ elif [ -f scripts/func.sh ]; then
fi fi
## Join all the peers to the channel ## Join all the peers to the channel
echo_b "Update the channel ${APP_CHANNEL} by adding new Org..." echo_b "=== Join peers ${PEERS} from org ${ORGS} into ${APP_CHANNEL}... ==="
for org in "${ORGS[@]}" for org in "${ORGS[@]}"
do do
@ -17,3 +17,7 @@ do
channelJoin ${APP_CHANNEL} $org $peer channelJoin ${APP_CHANNEL} $org $peer
done done
done done
echo_g "=== Join peers ${PEERS} from org ${ORGS} into ${APP_CHANNEL} Complete ==="
echo

View File

@ -8,7 +8,7 @@ elif [ -f scripts/func.sh ]; then
fi fi
## Join all the peers to the channel ## Join all the peers to the channel
echo_b "Having all peers join the channel ${APP_CHANNEL}..." echo_b "=== Updating config of channel ${APP_CHANNEL}... ==="
echo_b "Sign the channel update tx by Org1/Peer0 and Org2/Peer0" echo_b "Sign the channel update tx by Org1/Peer0 and Org2/Peer0"
channelSignConfigTx ${APP_CHANNEL} "1" "0" "${CFG_DELTA_ENV_PB}" channelSignConfigTx ${APP_CHANNEL} "1" "0" "${CFG_DELTA_ENV_PB}"
@ -33,3 +33,7 @@ fi
# Now new org is valid to join the channel # Now new org is valid to join the channel
# channelJoin ${APP_CHANNEL} "3" "0" # channelJoin ${APP_CHANNEL} "3" "0"
echo_g "=== Updated config of channel ${APP_CHANNEL}... ==="
echo

View File

@ -12,10 +12,12 @@ fi
org=1 org=1
peer=0 peer=0
echo_b "=== Fetching blocks ===" echo_b "=== Fetching blocks of channel ${APP_CHANNEL} and ${SYS_CHANNEL} ==="
channelFetchAll ${APP_CHANNEL} $org $peer channelFetchAll ${APP_CHANNEL} $org $peer
channelFetchAll ${SYS_CHANNEL} $org $peer channelFetchAll ${SYS_CHANNEL} $org $peer
echo_g "Block fetching done!" echo_g "=== Fetched Blocks from channels done! ==="
echo

View File

@ -20,6 +20,7 @@ peer=0
#--cafile ${ORDERER_TLS_CA} \ #--cafile ${ORDERER_TLS_CA} \
CC_NAME=${CC_02_NAME} CC_NAME=${CC_02_NAME}
echo_b "LSCC Get id" echo_b "LSCC Get id"
chaincodeQuery "${APP_CHANNEL}" $org $peer lscc '{"Args":["getid","'${APP_CHANNEL}'", "'${CC_NAME}'"]}' chaincodeQuery "${APP_CHANNEL}" $org $peer lscc '{"Args":["getid","'${APP_CHANNEL}'", "'${CC_NAME}'"]}'
@ -61,4 +62,6 @@ chaincodeQuery "${APP_CHANNEL}" $org $peer lscc '{"Args":["getchaincodes"]}'
# -n lscc \ # -n lscc \
# -c '{"Args":["getchaincodes"]}' # -c '{"Args":["getchaincodes"]}'
echo_g "LSCC testing done!" echo_g "LSCC testing done!"
echo

View File

@ -30,4 +30,6 @@ chaincodeQuery ${APP_CHANNEL} $org $peer qscc '{"Args":["GetBlockByNumber","'${A
# -n qscc \ # -n qscc \
# -c '{"Args":["GetBlockByNumber","'${APP_CHANNEL}'","2"]}' # -c '{"Args":["GetBlockByNumber","'${APP_CHANNEL}'","2"]}'
echo_g "QSCC testing done!" echo_g "QSCC testing done!"
echo

View File

@ -8,8 +8,12 @@ elif [ -f scripts/func.sh ]; then
fi fi
## Set the anchor peers for each org in the channel ## Set the anchor peers for each org in the channel
echo_b "Updating anchor peers for org1..." echo_b "=== Updating anchor peers to peer0 for org1... ==="
channelUpdate ${APP_CHANNEL} 1 0 Org1MSPanchors.tx channelUpdate ${APP_CHANNEL} 1 0 Org1MSPanchors.tx
echo_b "Updating anchor peers for org2..." echo_b "=== Updating anchor peers to peer0 for org2... ==="
channelUpdate ${APP_CHANNEL} 2 0 Org2MSPanchors.tx channelUpdate ${APP_CHANNEL} 2 0 Org2MSPanchors.tx
echo_b "=== Updated anchor peers ==="
echo

View File

@ -5,7 +5,6 @@
# Name of app channel, need to align with the gen_artifacts.sh # Name of app channel, need to align with the gen_artifacts.sh
SYS_CHANNEL="testchainid" SYS_CHANNEL="testchainid"
APP_CHANNEL="businesschannel" APP_CHANNEL="businesschannel"
#APP_CHANNEL="appchannel"
# Client cmd execute timeout and retry times # Client cmd execute timeout and retry times
TIMEOUT="30" TIMEOUT="30"
@ -14,6 +13,8 @@ MAX_RETRY=5
# Organization and peers # Organization and peers
ORGS=( 1 2 ) ORGS=( 1 2 )
PEERS=( 0 1 ) PEERS=( 0 1 )
#: "${ORGS:=( 1 2 )}"
#: "${PEERS:=( 0 1 )}"
# MSP related paths # MSP related paths
ORDERER_TLS_CA=/etc/hyperledger/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem ORDERER_TLS_CA=/etc/hyperledger/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

View File

@ -674,13 +674,13 @@
}, },
"signatures": [ "signatures": [
{ {
"signature": "MEUCIQCBmOeHd8S/jdhmNGxCszPbEfcv4p/1EEBWyoHsCrsbfgIgQHn7HSg8z/6xFQdDD+/OoQ0JDUXOJbmxEvIo/qZ4n4A=", "signature": "MEQCIATVJZUaxHzrjS/+PeqVTKl6gyiOF6R+N0TSOHZ16V60AiASFdWxHyV+2xGwOxAycBShDfO8QtGwvTn3QK1yryAgkw==",
"signature_header": { "signature_header": {
"creator": { "creator": {
"id_bytes": "LS0tLS1CRUdJTiAtLS0tLQpNSUlDR2pDQ0FjQ2dBd0lCQWdJUkFOMnVKZDJueE1VVE9XOXdLTm9YZHhnd0NnWUlLb1pJemowRUF3SXdjekVMCk1Ba0dBMVVFQmhNQ1ZWTXhFekFSQmdOVkJBZ1RDa05oYkdsbWIzSnVhV0V4RmpBVUJnTlZCQWNURFZOaGJpQkcKY21GdVkybHpZMjh4R1RBWEJnTlZCQW9URUc5eVp6SXVaWGhoYlhCc1pTNWpiMjB4SERBYUJnTlZCQU1URTJOaApMbTl5WnpJdVpYaGhiWEJzWlM1amIyMHdIaGNOTVRnd01UQXpNVE13T1RVMVdoY05Namd3TVRBeE1UTXdPVFUxCldqQmJNUXN3Q1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0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yRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU4KVTJGdUlFWnlZVzVqYVhOamJ6RWZNQjBHQTFVRUF3d1dRV1J0YVc1QWIzSm5NaTVsZUdGdGNHeGxMbU52YlRCWgpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDlBd0VIQTBJQUJKR1N4RlpFN3NvcDZVbWVkcnZmWDNCQ0RVRUpJdTg0Cm1RTk1jYWQzMXpUNmR3Sm0zaHJBL1h6dk1uMzUvS25sWXpkS2hMMmNPWHdVbERHWXFqR2p4UTZqVFRCTE1BNEcKQTFVZER3RUIvd1FFQXdJSGdEQU1CZ05WSFJNQkFmOEVBakFBTUNzR0ExVWRJd1FrTUNLQUlIWXdDTmNFK0ZmcgpaWHFaSTRKTFA4WVhqelRmcU9WUWs5MmI0NC9kVTVUdU1Bb0dDQ3FHU000OUJBTUNBMGdBTUVVQ0lRQ2JKaWRRCjg0Qzh4aGpVbVJwb2lsSEtsNUZDSXdVQnc2OURaUU8vN1p6ZVB3SWdCcENRY2dLRDRGbk5WWStHczRTNVN2UlMKQVhZeFVMWnBYWURRWHQxS2FMST0KLS0tLS1FTkQgLS0tLS0K",
"mspid": "Org2MSP" "mspid": "Org2MSP"
}, },
"nonce": "OKB2Q4Xj9oeXmeukVzgAu2EtbGY+Qn3J" "nonce": "5DBHiQFaIv3E6cEhSyfP3E55qQXxaWlY"
} }
} }
] ]
@ -689,7 +689,7 @@
"channel_header": { "channel_header": {
"channel_id": "businesschannel", "channel_id": "businesschannel",
"epoch": "0", "epoch": "0",
"timestamp": "2018-01-14T11:45:36.000Z", "timestamp": "2018-01-18T01:29:45.000Z",
"tx_id": "", "tx_id": "",
"type": 2, "type": 2,
"version": 0 "version": 0
@ -699,18 +699,18 @@
"id_bytes": "LS0tLS1CRUdJTiAtLS0tLQpNSUlDR2pDQ0FjQ2dBd0lCQWdJUkFOMnVKZDJueE1VVE9XOXdLTm9YZHhnd0NnWUlLb1pJemowRUF3SXdjekVMCk1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/GF7sfHvpEsdV5LFT5nUkJ/SimHQnTYHRRz/9n7/AIgbRde4Vg77eiZntFYGd3Rx4qJjaLWEgrr4AmKNhSgBzo=" "signature": "MEUCIQCy9WnpV1J4BerR6Tc1BLyrpHMcJjwq/VYycFXZC+K/DQIgNriKA6oVyKna8TJ6f8QnCNbSTWst+sykaUOBKGBWKvU="
} }
}, },
"header": { "header": {
"channel_header": { "channel_header": {
"channel_id": "businesschannel", "channel_id": "businesschannel",
"epoch": "0", "epoch": "0",
"timestamp": "2018-01-14T11:45:36.000Z", "timestamp": "2018-01-18T01:29:45.000Z",
"tx_id": "", "tx_id": "",
"type": 1, "type": 1,
"version": 0 "version": 0
@ -720,23 +720,23 @@
"id_bytes": "LS0tLS1CRUdJTiAtLS0tLQpNSUlDRERDQ0FiS2dBd0lCQWdJUU1GdzVRaFZmd2tkdnJCMytZZllmcHpBS0JnZ3Foa2pPUFFRREFqQnBNUXN3CkNRWURWUVFHRXdKVlV6RVRNQkVHQTFVRUNCTUtRMkZzYVdadmNtNXBZVEVXTUJRR0ExVUVCeE1OVTJGdUlFWnkKWVc1amFYTmpiekVVTUJJR0ExVUVDaE1MWlhoaGJYQnNaUzVqYjIweEZ6QVZCZ05WQkFNVERtTmhMbVY0WVcxdwpiR1V1WTI5dE1CNFhEVEU0TURFd016RXpNRGsxTlZvWERUSTRNREV3TVRFek1EazFOVm93V0RFTE1Ba0dBMVVFCkJoTUNWVk14RXpBUkJnTlZCQWdUQ2tOaGJHbG1iM0p1YVdFeEZqQVVCZ05WQkFjVERWTmhiaUJHY21GdVkybHoKWTI4eEhEQWFCZ05WQkFNVEUyOXlaR1Z5WlhJdVpYaGhiWEJzWlM1amIyMHdXVEFUQmdjcWhrak9QUUlCQmdncQpoa2pPUFFNQkJ3TkNBQVJpY2tSZ0dUcW91QmFPK0lWTDkrVzBjMDBTdTd4MTZyWDhJak5Ham82Z1prVUFZanB6Ck1LbUIxQ1JXM2VvVTJ0VWQ2cklCTVhqNE1RRlVS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MFRBUUgvQkFJd0FEQXJCZ05WSFNNRUpEQWlnQ0FaSHlhaE5iK3BLb2VpMGg0SWlnMjh4WFBieENtTgpSdlpOTGErMUs4dU5xakFLQmdncWhrak9QUVFEQWdOSUFEQkZBaUVBdlRySTNCeTRNUnArM0oxQldPa3VhOEhICi80VndZRjY0am4yT0xJbE4vLzBDSUQ2OVNuOHJzR25qeHI0U2pGNGs3M3NIbzBkM2RXWTlYcG43TU1HcEQrdmwKLS0tLS1FTkQgLS0tLS0K",
"mspid": "OrdererMSP" "mspid": "OrdererMSP"
}, },
"nonce": "tUlDKUlpk4HBahFWeSTuwOumb24UQxqa" "nonce": "HPaOwejSJxDaz9X9hZjB4sep+iuD0qgh"
} }
} }
}, },
"signature": "MEUCIQCRJEqEKXS0zswR9VV9iW3PDNBTyx++e1EIv8DGGNjVUAIgFPGqH96kvWpY7nTS+emhjRyFnNyqHfIz71U4T9dVGiU=" "signature": "MEQCIEMy/GrtVEG2Xhg+I91Za6QqKqtsBVC1NMDIn3L+REMRAiAVfyH6BwF2fTXZ/KuYknL2Efwr2dKULDu7Lp9n4L6s5Q=="
} }
] ]
}, },
"header": { "header": {
"data_hash": "MBpB+KXoUXIfx7Uvi+pu3Nw4yNE4gCsJgzyThQpamw8=", "data_hash": "A7IbIktTeUSbEcyCAf5gh4Wm8W8f3dIQqZ5Fvp9i6L4=",
"number": "2", "number": "2",
"previous_hash": "ayiaxilXZ5mAzVqkxjG7rSFaXhv6gOdo8WBb3ZACjL0=" "previous_hash": "eqjMGWfLZssm7nf+o2eJaDcav9WV+v4wQslk4hyzYUI="
}, },
"metadata": { "metadata": {
"metadata": [ "metadata": [
"EuIGCpcGCvoFCgpPcmRlcmVyTVNQEusFLS0tLS1CRUdJTiAtLS0tLQpNSUlDRERDQ0FiS2dBd0lCQWdJUU1GdzVRaFZmd2tkdnJCMytZZllmcHpBS0JnZ3Foa2pPUFFRREFqQnBNUXN3CkNRWURWUVFHRXdKVlV6RVRNQkVHQTFVRUNC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Y2NGpuMk9MSWxOLy8wQ0lENjlTbjhyc0duanhyNFNqRjRrNzNzSG8wZDNkV1k5WHBuN01NR3BEK3ZsCi0tLS0tRU5EIC0tLS0tChIYYey91RlzZwjLw+ZxOL9rU63c2Cnz9aYqEkYwRAIgc1gVJxHbQXuS/XtPPUJnXuOiWMpeslVCttAcF3RBwbYCIDbpiujFgtgtRGBSz7BCmUumYoiZN1TekmML6BIhY7LJ",
"", "",
"" ""
] ]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff