Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
Switch to Hyperledger Fabric v1.4.1 (resolves #88) (#94)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
  • Loading branch information
Simon Stone authored and cazfletch committed Apr 25, 2019
1 parent 97b7288 commit dc4bcb2
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion generators/chaincode/templates/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "<%= author %>",
"license": "<%= license %>",
"dependencies": {
"fabric-shim": "1.4.0"
"fabric-shim": "1.4.1"
},
"devDependencies": {
"chai": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion generators/chaincode/templates/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"author": "<%= author %>",
"license": "<%= license %>",
"dependencies": {
"fabric-shim": "1.4.0"
"fabric-shim": "1.4.1"
},
"devDependencies": {
"@types/chai": "^4.1.7",
Expand Down
16 changes: 8 additions & 8 deletions generators/network/templates/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ networks:
services:
orderer.example.com:
container_name: <%= dockerName %>_orderer.example.com
image: hyperledger/fabric-orderer:1.4.0
image: hyperledger/fabric-orderer:1.4.1
environment:
- ORDERER_GENERAL_LOGLEVEL=info
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
Expand All @@ -39,7 +39,7 @@ services:
- basic
peer0.org1.example.com:
container_name: <%= dockerName %>_peer0.org1.example.com
image: hyperledger/fabric-peer:1.4.0
image: hyperledger/fabric-peer:1.4.1
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.org1.example.com
Expand All @@ -58,10 +58,10 @@ services:
- CORE_PEER_LISTENADDRESS=0.0.0.0:<%= peerRequest %>
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:<%= peerChaincode %>
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:<%= peerRequest %>
- CORE_CHAINCODE_BUILDER=hyperledger/fabric-ccenv:1.4.0
- CORE_CHAINCODE_GOLANG_RUNTIME=hyperledger/fabric-baseos:0.4.14
- CORE_CHAINCODE_JAVA_RUNTIME=hyperledger/fabric-javaenv:1.4.0
- CORE_CHAINCODE_NODE_RUNTIME=hyperledger/fabric-baseimage:0.4.14
- CORE_CHAINCODE_BUILDER=hyperledger/fabric-ccenv:1.4.1
- CORE_CHAINCODE_GOLANG_RUNTIME=hyperledger/fabric-baseos:0.4.15
- CORE_CHAINCODE_JAVA_RUNTIME=hyperledger/fabric-javaenv:1.4.1
- CORE_CHAINCODE_NODE_RUNTIME=hyperledger/fabric-baseimage:0.4.15
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start
ports:
Expand All @@ -79,7 +79,7 @@ services:
networks:
- basic
ca.org1.example.com:
image: hyperledger/fabric-ca:1.4.0
image: hyperledger/fabric-ca:1.4.1
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.org1.example.com
Expand All @@ -97,7 +97,7 @@ services:
- basic
couchdb:
container_name: <%= dockerName %>_couchdb
image: hyperledger/fabric-couchdb:0.4.14
image: hyperledger/fabric-couchdb:0.4.15
environment:
- COUCHDB_USER=
- COUCHDB_PASSWORD=
Expand Down
10 changes: 5 additions & 5 deletions generators/network/templates/generate.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ for %%d in (admin-msp configtx crypto-config wallets\<%= name %>_wallet) do (
)

rem generate crypto material
docker run --rm -v %CD%:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.0 cryptogen generate --config=./crypto-config.yaml
docker run --rm -v %CD%:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.1 cryptogen generate --config=./crypto-config.yaml

rem rename the certificate authority private key
move /y .\crypto-config\peerOrganizations\org1.example.com\ca\*_sk .\crypto-config\peerOrganizations\org1.example.com\ca\ca.org1.example.com-key.pem
Expand All @@ -27,21 +27,21 @@ rem start the certificate authority
docker-compose -f docker-compose.yml up -d ca.org1.example.com

rem enroll the admin identity
docker run --network <%= dockerName %>_basic --rm -v %CD%:/etc/hyperledger/fabric hyperledger/fabric-ca:1.4.0 fabric-ca-client enroll -u http://admin:adminpw@ca.org1.example.com:<%= certificateAuthority %> -M /etc/hyperledger/fabric/admin-msp
docker run --network <%= dockerName %>_basic --rm -v %CD%:/etc/hyperledger/fabric hyperledger/fabric-ca:1.4.1 fabric-ca-client enroll -u http://admin:adminpw@ca.org1.example.com:<%= certificateAuthority %> -M /etc/hyperledger/fabric/admin-msp
copy /y admin-msp\signcerts\cert.pem crypto-config\peerOrganizations\org1.example.com\msp\admincerts\
copy /y admin-msp\signcerts\cert.pem crypto-config\peerOrganizations\org1.example.com\peers\peer0.org1.example.com\msp\admincerts\

rem stop the certificate authority
docker-compose -f docker-compose.yml stop ca.org1.example.com

rem generate genesis block for orderer
docker run --rm -v %CD%:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.0 configtxgen -profile OneOrgOrdererGenesis -outputBlock ./configtx/genesis.block
docker run --rm -v %CD%:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.1 configtxgen -profile OneOrgOrdererGenesis -outputBlock ./configtx/genesis.block

rem generate channel configuration transaction
docker run --rm -v %CD%:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.0 configtxgen -profile OneOrgChannel -outputCreateChannelTx ./configtx/channel.tx -channelID %CHANNEL_NAME%
docker run --rm -v %CD%:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.1 configtxgen -profile OneOrgChannel -outputCreateChannelTx ./configtx/channel.tx -channelID %CHANNEL_NAME%

rem generate anchor peer transaction
docker run --rm -v %CD%:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.0 configtxgen -profile OneOrgChannel -outputAnchorPeersUpdate ./configtx/Org1MSPanchors.tx -channelID %CHANNEL_NAME% -asOrg Org1MSP
docker run --rm -v %CD%:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.1 configtxgen -profile OneOrgChannel -outputAnchorPeersUpdate ./configtx/Org1MSPanchors.tx -channelID %CHANNEL_NAME% -asOrg Org1MSP

rem generate gateways, nodes, and wallets
node generate.js
12 changes: 6 additions & 6 deletions generators/network/templates/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ CHANNEL_NAME=mychannel
rm -fr admin-msp/* configtx/* crypto-config/* wallets/<%= name %>_wallet/*

fix_permissions () {
docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.0 chown -R $(id -u):$(id -g) ./configtx ./crypto-config ./admin-msp
docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.1 chown -R $(id -u):$(id -g) ./configtx ./crypto-config ./admin-msp
}

# generate crypto material
docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.0 cryptogen generate --config=./crypto-config.yaml
docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.1 cryptogen generate --config=./crypto-config.yaml
fix_permissions

# rename the certificate authority private key
Expand All @@ -30,7 +30,7 @@ mv ./crypto-config/peerOrganizations/org1.example.com/ca/*_sk ./crypto-config/pe
docker-compose -f docker-compose.yml up -d ca.org1.example.com

# enroll the admin identity
docker run --network <%= dockerName %>_basic --rm -v $PWD:/etc/hyperledger/fabric hyperledger/fabric-ca:1.4.0 fabric-ca-client enroll -u http://admin:adminpw@ca.org1.example.com:<%= certificateAuthority %> -M /etc/hyperledger/fabric/admin-msp
docker run --network <%= dockerName %>_basic --rm -v $PWD:/etc/hyperledger/fabric hyperledger/fabric-ca:1.4.1 fabric-ca-client enroll -u http://admin:adminpw@ca.org1.example.com:<%= certificateAuthority %> -M /etc/hyperledger/fabric/admin-msp
fix_permissions
cp -f admin-msp/signcerts/cert.pem crypto-config/peerOrganizations/org1.example.com/msp/admincerts/
cp -f admin-msp/signcerts/cert.pem crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/admincerts/
Expand All @@ -39,13 +39,13 @@ cp -f admin-msp/signcerts/cert.pem crypto-config/peerOrganizations/org1.example.
docker-compose -f docker-compose.yml stop ca.org1.example.com

# generate genesis block for orderer
docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.0 configtxgen -profile OneOrgOrdererGenesis -outputBlock ./configtx/genesis.block
docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.1 configtxgen -profile OneOrgOrdererGenesis -outputBlock ./configtx/genesis.block

# generate channel configuration transaction
docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.0 configtxgen -profile OneOrgChannel -outputCreateChannelTx ./configtx/channel.tx -channelID $CHANNEL_NAME
docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.1 configtxgen -profile OneOrgChannel -outputCreateChannelTx ./configtx/channel.tx -channelID $CHANNEL_NAME

# generate anchor peer transaction
docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.0 configtxgen -profile OneOrgChannel -outputAnchorPeersUpdate ./configtx/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP
docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.1 configtxgen -profile OneOrgChannel -outputAnchorPeersUpdate ./configtx/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP

# fix the ownership of all of the generated configuration
fix_permissions
Expand Down
8 changes: 4 additions & 4 deletions test/chaincode/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('Chaincode (JavaScript)', () => {
author: 'James Conga',
license: 'WTFPL',
dependencies: {
'fabric-shim': '1.4.0'
'fabric-shim': '1.4.1'
},
devDependencies: {
chai: '^4.2.0',
Expand Down Expand Up @@ -171,7 +171,7 @@ describe('Chaincode (JavaScript)', () => {
author: 'James Conga',
license: 'Apache-2.0',
dependencies: {
'fabric-shim': '1.4.0'
'fabric-shim': '1.4.1'
},
devDependencies: {
chai: '^4.2.0',
Expand Down Expand Up @@ -261,7 +261,7 @@ describe('Chaincode (JavaScript)', () => {
author: 'James Conga',
license: 'Apache-2.0',
dependencies: {
'fabric-shim': '1.4.0'
'fabric-shim': '1.4.1'
},
devDependencies: {
chai: '^4.2.0',
Expand Down Expand Up @@ -347,7 +347,7 @@ describe('Chaincode (JavaScript)', () => {
author: 'James Conga',
license: 'Apache-2.0',
dependencies: {
'fabric-shim': '1.4.0'
'fabric-shim': '1.4.1'
},
devDependencies: {
chai: '^4.2.0',
Expand Down
4 changes: 2 additions & 2 deletions test/chaincode/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('Chaincode (TypeScript)', () => {
author: 'James Conga',
license: 'WTFPL',
dependencies: {
'fabric-shim': '1.4.0'
'fabric-shim': '1.4.1'
},
devDependencies: {
'@types/chai': '^4.1.7',
Expand Down Expand Up @@ -207,7 +207,7 @@ describe('Chaincode (TypeScript)', () => {
author: 'James Conga',
license: 'Apache-2.0',
dependencies: {
'fabric-shim': '1.4.0'
'fabric-shim': '1.4.1'
},
devDependencies: {
'@types/chai': '^4.1.7',
Expand Down

0 comments on commit dc4bcb2

Please sign in to comment.