From a175c5c9cc395d18afef355fde6cd2a7b7d9ab01 Mon Sep 17 00:00:00 2001 From: Baohua Yang Date: Fri, 6 May 2016 16:11:14 +0800 Subject: [PATCH] Add vairous consensus support --- README.md | 4 ++-- hyperledger/compose-defaults.noops.yml | 27 ++++++++++++++++++++++++++ hyperledger/compose-defaults.yml | 3 +-- 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 hyperledger/compose-defaults.noops.yml diff --git a/README.md b/README.md index 4b0f65ab..97442feb 100644 --- a/README.md +++ b/README.md @@ -29,14 +29,14 @@ docker-compose scale es=3 A simple haproxy and web applications cluster. ## [hyperledger](hyperledger) -Quickly bootup a hyperledger cluster with several validator nodes, without vagrant or any local configuration. +Quickly bootup a hyperledger cluster with several validator nodes, without vagrant or any manual configuration. By default, the cluster enables PBFT as the consensus. Note, currently you should manually create an `openblockchain/baseimage:latest` first. The easiest way to do so is: ```sh $ docker pull yeasy/hyperledger:latest $ docker tag yeasy/hyperledger:latest openblockchain/baseimage:latest -$ docker pull yeasy/hyperledger-peer:latest +$ docker pull yeasy/hyperledger-peer:pbft $ docker pull yeasy/hyperledger-membersrvc:latest ``` diff --git a/hyperledger/compose-defaults.noops.yml b/hyperledger/compose-defaults.noops.yml new file mode 100644 index 00000000..269ca56f --- /dev/null +++ b/hyperledger/compose-defaults.noops.yml @@ -0,0 +1,27 @@ +# This is the default base file to config env and command +# Notice that chaincode is executed inside docker in default net mode +# https://github.com/yeasy/docker-compose-files + +# Depends on the yeasy/hyperledger-peer:noops image + +# This utilizes the noops as consensus +# 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:pbft + restart: unless-stopped + environment: + - CORE_PEER_ADDRESSAUTODETECT=true + - CORE_PEER_NETWORKID=dev + - CORE_LOGGING_LEVEL=debug #critical, error, warning, notice, info, debug + # The following section enables pbft consensus + - CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=noops # noops, obcpbft, pbft + - CORE_NOOPS_BLOCK_TIMEOUT=10s + expose: + - "30303" + - "30304" + - "31315" + volumes: # docker.sock is mapped as the default CORE_VM_ENDPOINT + - /var/run/docker.sock:/var/run/docker.sock + command: peer peer + diff --git a/hyperledger/compose-defaults.yml b/hyperledger/compose-defaults.yml index ac0b0020..95d36552 100644 --- a/hyperledger/compose-defaults.yml +++ b/hyperledger/compose-defaults.yml @@ -4,8 +4,7 @@ # Depends on the yeasy/hyperledger-peer:pbft image -# If you want enable consensus, just uncomment the -# CORE_PEER_VALIDATOR_CONSENSUE=obcpbft line +# This utilized the pbft as consensus # See https://github.com/hyperledger/fabric/blob/master/docs/dev-setup/devnet-setup.md#using-consensus-plugin for more details. vp: