-
Notifications
You must be signed in to change notification settings - Fork 0
/
startOrg1.sh
executable file
·78 lines (60 loc) · 3.26 KB
/
startOrg1.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
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
docker-compose -p fabric-2.3 up -d tlsca.Org1.com
sleep 5
mkdir $PWD/Org1/client
mkdir $PWD/Org1/msp
cp $PWD/Org1/server/tls-ca/crypto/ca-cert.pem $PWD/Org1/client/tls-ca-cert.pem
export FABRIC_CA_CLIENT_HOME=$PWD/Org1/client
export FABRIC_CA_CLIENT_TLS_CERTFILES=$PWD/Org1/client/tls-ca-cert.pem
set -x
fabric-ca-client enroll -u https://tls-ca-admin:[email protected]:8052 -M tls-ca/admin/msp --csr.hosts '0.0.0.0,*.Org1.com' --enrollment.profile tls
{ set +x; } 2>/dev/null
set -x
fabric-ca-client register --id.name org-ca-admin --id.secret org-ca-adminpw --id.type admin -u https://0.0.0.0:8052 -M tls-ca/admin/msp
{ set +x; } 2>/dev/null
set -x
fabric-ca-client register --id.name peer1 --id.secret peer1pw --id.type peer -u https://0.0.0.0:8052 -M tls-ca/admin/msp
{ set +x; } 2>/dev/null
set -x
fabric-ca-client enroll -u https://org-ca-admin:[email protected]:8052 -M tls-ca/orgadmin/msp --csr.hosts '0.0.0.0,*.Org1.com' --enrollment.profile tls
{ set +x; } 2>/dev/null
set -x
fabric-ca-client enroll -u https://peer1:[email protected]:8052 -M tls-ca/peer1/msp --csr.hosts '0.0.0.0,*.Org1.com' --enrollment.profile tls
{ set +x; } 2>/dev/null
mkdir -p $PWD/Org1/server/org-ca/tls
mv $PWD/Org1/client/tls-ca/orgadmin/msp/keystore/*_sk $PWD/Org1/client/tls-ca/orgadmin/msp/keystore/key.pem
cp $PWD/Org1/client/tls-ca/orgadmin/msp/signcerts/cert.pem $PWD/Org1/server/org-ca/tls/
cp $PWD/Org1/client/tls-ca/orgadmin/msp/keystore/key.pem $PWD/Org1/server/org-ca/tls/
docker-compose -p fabric-2.3 up -d orgca.Org1.com
sleep 5
set -x
fabric-ca-client enroll -u https://org-ca-admin:[email protected]:8053 -M org-ca/admin/msp --csr.hosts '0.0.0.0,*.Org1.com'
{ set +x; } 2>/dev/null
set -x
fabric-ca-client register --id.name peer1 --id.secret peer1pw --id.type peer -u https://0.0.0.0:8053 -M org-ca/admin/msp
{ set +x; } 2>/dev/null
set -x
fabric-ca-client register --id.name org-admin --id.secret org-adminpw --id.type admin -u https://0.0.0.0:8053 -M org-ca/admin/msp
{ set +x; } 2>/dev/null
set -x
fabric-ca-client enroll -u https://org-admin:[email protected]:8053 -M org-ca/orgadmin/msp --csr.hosts '0.0.0.0,*.Org1.com'
{ set +x; } 2>/dev/null
set -x
fabric-ca-client enroll -u https://peer1:[email protected]:8053 -M org-ca/peer1/msp --csr.hosts '0.0.0.0,*.Org1.com'
{ set +x; } 2>/dev/null
mkdir $PWD/Org1/msp/tlscacerts
mkdir $PWD/Org1/msp/cacerts
cp $PWD/Org1/client/tls-ca-cert.pem $PWD/Org1/msp/tlscacerts/
cp $PWD/config.yaml $PWD/Org1/msp/
cp $PWD/Org1/client/org-ca/peer1/msp/cacerts/0-0-0-0-8053.pem $PWD/Org1/msp/cacerts/
mv $PWD/Org1/client/tls-ca/peer1/msp/keystore/*_sk $PWD/Org1/client/tls-ca/peer1/msp/keystore/key.pem
mv $PWD/Org1/client/org-ca/peer1/msp/keystore/*_sk $PWD/Org1/client/org-ca/peer1/msp/keystore/key.pem
mkdir -p $PWD/Org1/peer1/tls
cp $PWD/Org1/client/tls-ca-cert.pem $PWD/Org1/peer1/tls/tls-ca-cert.pem
mkdir $PWD/Org1/peer1/localMsp
cp -r $PWD/Org1/client/org-ca/peer1/msp/* $PWD/Org1/peer1/localMsp/
cp $PWD/config.yaml $PWD/Org1/peer1/localMsp
cp $PWD/Org1/client/tls-ca/peer1/msp/signcerts/cert.pem $PWD/Org1/peer1/tls/Org1-peer1-tls-cert.pem
cp $PWD/Org1/client/tls-ca/peer1/msp/keystore/key.pem $PWD/Org1/peer1/tls/Org1-peer1-tls-key.pem
docker-compose -p fabric-2.3 up -d peer1.Org1.com
docker-compose -p fabric-2.3 up -d cli.peer1.Org1.com