Add hyperledger cluster

pull/1/head
Baohua Yang 2016-04-15 16:45:57 +08:00
parent 544293aefb
commit 6db52f9528
3 changed files with 84 additions and 0 deletions

View File

@ -28,6 +28,21 @@ docker-compose scale es=3
## [haproxy_web](haproxy_web)
A simple haproxy and web applications cluster.
## [hyperledger](hyperledger)
Demo the hyperledger cluster with 4 validator nodes. This refers the example
from the [hyperledger](https://github.com/hyperledger/fabric) project.
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
```
After the cluster is synced, you can validate from the container or from the
host. See [hyperledger-peer](https://github .com/yeasy/docker-hyperledger-peer).
## [mongo_cluster](mongo_cluster)
Start 3 mongo instance to make a replica set.

View File

@ -0,0 +1,19 @@
# 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
# validating node as a root
vp:
image: yeasy/hyperledger-peer:latest
restart: unless-stopped
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
#- CORE_PEER_VALIDATOR_CONSENSUS=obcpbft
expose:
- "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

View File

@ -0,0 +1,50 @@
# 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_VM_ENDPOINT=tcp://172.17.42.1:2375
vp1:
extends:
service: vp0
hostname: vp1
environment:
- CORE_PEER_ID=vp1
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303
links:
- vp0
vp2:
extends:
service: vp0
hostname: vp2
environment:
- CORE_PEER_ID=vp2
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303
links:
- vp0
vp3: # vp3 will be used for client interactive operations
extends:
service: vp0
container_name: vp3
hostname: vp3
ports:
- "5000:5000"
- "30303:30303"
environment:
- CORE_PEER_ID=vp3
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303
links:
- vp0