forked from yeasy/docker-hyperledger
-
Notifications
You must be signed in to change notification settings - Fork 2
/
startnet-secure.sh
executable file
·69 lines (60 loc) · 2.16 KB
/
startnet-secure.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
docker stop vp0
docker stop vp1
docker stop ca
docker rm vp0
docker rm vp1
docker rm ca
docker run joequant/hyperledger echo
docker run --name=ca \
-p 50051:50051 \
--hostname=ca \
-v $SCRIPT_DIR:/local-dev \
-v $SCRIPT_DIR/git/fabric:/usr/lib/go-1.6/src/github.com/hyperledger/fabric \
-i \
joequant/hyperledger \
./membersrvc --logging-level=debug >& ca.log &
sleep 5
docker run --name=vp0 \
--hostname=vp0 \
--link ca:ca \
-v $SCRIPT_DIR:/local-dev \
-v $SCRIPT_DIR/git/fabric:/usr/lib/go-1.6/src/github.com/hyperledger/fabric \
-p 5000:5000 \
-p 30303:30303 \
-e CORE_PEER_ID=vp0 \
-e CORE_VM_ENDPOINT=http://172.17.0.1:2375 \
-e CORE_PEER_ADDRESSAUTODETECT=true \
-e CORE_SECURITY_ENABLED=true \
-e CORE_SECURITY_PRIVACY=true \
-e CORE_PEER_PKI_ECA_PADDR=ca:50051 \
-e CORE_PEER_PKI_TCA_PADDR=ca:50051 \
-e CORE_PEER_PKI_TLSCA_PADDR=ca:50051 \
-e CORE_SECURITY_ENROLLID=vp0 \
-e CORE_SECURITY_ENROLLSECRET=vp0_secret \
-e FABRIC_ARGS="-u jim" \
joequant/hyperledger peer node start --logging-level=debug >& vp0.log &
sleep 5
docker run --name=vp1 \
--hostname=vp1 \
-v $SCRIPT_DIR:/local-dev \
-v $SCRIPT_DIR/git/fabric:/usr/lib/go-1.6/src/github.com/hyperledger/fabric \
-i \
--link vp0:vp0 \
--link ca:ca \
-e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e \
CORE_PEER_ID=vp1 -e CORE_PEER_ADDRESSAUTODETECT=true \
-e CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 \
-e CORE_SECURITY_ENABLED=true \
-e CORE_SECURITY_PRIVACY=true \
-e CORE_PEER_PKI_ECA_PADDR=ca:50051 \
-e CORE_PEER_PKI_TCA_PADDR=ca:50051 \
-e CORE_PEER_PKI_TLSCA_PADDR=ca:50051 \
-e CORE_SECURITY_ENROLLID=vp1 \
-e CORE_SECURITY_ENROLLSECRET=vp1_secret \
-e FABRIC_ARGS="-u jim" \
joequant/hyperledger \
peer node start --logging-level=debug >& vp1.log &
echo "Get the password from config/membersrvc.yaml"
docker exec -it vp0 /local-dev/scripts/login.sh