From 1d74a14666f64cc44474a7c0dcb701a8a41f8c55 Mon Sep 17 00:00:00 2001 From: Baohua Yang Date: Wed, 20 Apr 2016 14:58:38 +0800 Subject: [PATCH] Add member service support --- README.md | 1 + hyperledger/compose-defaults.yml | 20 +++-- .../docker-compose-with-membersrvc.yml | 78 +++++++++++++++++++ hyperledger/docker-compose.yml | 22 ++++-- 4 files changed, 108 insertions(+), 13 deletions(-) create mode 100644 hyperledger/docker-compose-with-membersrvc.yml diff --git a/README.md b/README.md index 06916fe5..4b0f65ab 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ easiest way to do so is: $ docker pull yeasy/hyperledger:latest $ docker tag yeasy/hyperledger:latest openblockchain/baseimage:latest $ docker pull yeasy/hyperledger-peer:latest +$ docker pull yeasy/hyperledger-membersrvc:latest ``` Then you can start a 4 nodes hyperledger cluster with diff --git a/hyperledger/compose-defaults.yml b/hyperledger/compose-defaults.yml index 3d50bac4..c90dd7ea 100644 --- a/hyperledger/compose-defaults.yml +++ b/hyperledger/compose-defaults.yml @@ -5,18 +5,28 @@ # If you want enable consensus, just uncomment the # CORE_PEER_VALIDATOR_CONSENSUE=obcpbft line # See https://github.com/hyperledger/fabric/blob/master/docs/dev-setup/devnet-setup.md#using-consensus-plugin for more details. + vp: image: yeasy/hyperledger-peer:latest restart: unless-stopped environment: - CORE_PEER_ADDRESSAUTODETECT=true - CORE_PEER_NETWORKID=dev - - CORE_LOGGING_LEVEL=warning - - CORE_PEER_VALIDATOR_CONSENSUS=obcpbft + - CORE_LOGGING_LEVEL=debug #critical, error, warning, notice, info, debug + # The following section enables bpft consensus + - CORE_PEER_VALIDATOR_CONSENSUS=obcpbft # noops, obcpbft, pbft + - CORE_PBFT_GENERAL_MODE=classic # batch, classic, sieve + - CORE_PBFT_GENERAL_N=4 + - CORE_PBFT_GENERAL_TIMEOUT_REQUEST=10s + # The following section enable member authentication, set follow to True + - CORE_SECURITY_ENABLED=false + - CORE_PEER_PKI_ECA_PADDR=membersrvc:50051 + - CORE_PEER_PKI_TCA_PADDR=membersrvc:50051 + - CORE_PEER_PKI_TLSCA_PADDR=membersrvc:50051 expose: - - "30303" - - "30304" - - "31315" + - "30303" + - "30304" + - "31315" volumes: # docker.sock is mapped as the default CORE_VM_ENDPOINT - /var/run/docker.sock:/var/run/docker.sock command: fabric peer diff --git a/hyperledger/docker-compose-with-membersrvc.yml b/hyperledger/docker-compose-with-membersrvc.yml new file mode 100644 index 00000000..80852891 --- /dev/null +++ b/hyperledger/docker-compose-with-membersrvc.yml @@ -0,0 +1,78 @@ +# This compose file will 4 hyperledger peer nodes for testing +# vp0: validating node as root +# vp1: validating node as peer +# vp2: validating node as peer +# vp3: validating node as peer +# https://github.com/yeasy/docker-compose-files + +# validating node as the root +vp0: + extends: + file: compose-defaults.yml + service: vp + hostname: vp0 + environment: + - CORE_PEER_ID=vp0 + - CORE_SECURITY_ENROLLID=test_vp0 + - CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT + links: + - membersrvc + +vp1: + extends: + file: compose-defaults.yml + service: vp + hostname: vp1 + environment: + - CORE_PEER_ID=vp1 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_SECURITY_ENROLLID=test_vp1 + - CORE_SECURITY_ENROLLSECRET=5wgHK9qqYaPy + links: + - membersrvc + - vp0 + +vp2: + extends: + file: compose-defaults.yml + service: vp + hostname: vp2 + environment: + - CORE_PEER_ID=vp2 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_SECURITY_ENROLLID=test_vp2 + - CORE_SECURITY_ENROLLSECRET=vQelbRvja7cJ + links: + - membersrvc + - vp0 + + +# vp3 will be used for client interactive operations +# If you want to run fabric command on the host, then map 30303:30303 to host +# port, or use like `CORE_PEER_ADDRESS=172.17.0.2:30303` to specify peer addr. +vp3: + extends: + file: compose-defaults.yml + service: vp + hostname: vp3 + environment: + - CORE_PEER_ID=vp3 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_SECURITY_ENROLLID=test_vp3 + - CORE_SECURITY_ENROLLSECRET=9LKqKH5peurL + links: + - membersrvc + - vp0 + ports: + - "5000:5000" + #- "30303:30303" + +membersrvc: + image: yeasy/hyperledger-membersrvc:latest + restart: unless-stopped + expose: + - "50051" + volumes: # docker.sock is mapped as the default CORE_VM_ENDPOINT + - /var/run/docker.sock:/var/run/docker.sock + command: membersrvc + diff --git a/hyperledger/docker-compose.yml b/hyperledger/docker-compose.yml index 054def97..30ef7bab 100644 --- a/hyperledger/docker-compose.yml +++ b/hyperledger/docker-compose.yml @@ -16,7 +16,8 @@ vp0: vp1: extends: - service: vp0 + file: compose-defaults.yml + service: vp hostname: vp1 environment: - CORE_PEER_ID=vp1 @@ -26,7 +27,8 @@ vp1: vp2: extends: - service: vp0 + file: compose-defaults.yml + service: vp hostname: vp2 environment: - CORE_PEER_ID=vp2 @@ -34,16 +36,20 @@ vp2: links: - vp0 -vp3: # vp3 will be used for client interactive operations + +# vp3 will be used for client interactive operations +# If you want to run fabric command on the host, then map 30303:30303 to host +# port, or use like `CORE_PEER_ADDRESS=172.17.0.2:30303` to specify peer addr. +vp3: extends: - service: vp0 - container_name: vp3 + file: compose-defaults.yml + service: vp hostname: vp3 - ports: - - "5000:5000" - - "30303:30303" environment: - CORE_PEER_ID=vp3 - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 links: - vp0 + ports: + - "5000:5000" + #- "30303:30303"