-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-3-org2-admin-enroll-participants.sh
31 lines (26 loc) · 1.26 KB
/
run-3-org2-admin-enroll-participants.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
cd ../test-network
export PATH=${PWD}/../bin:${PWD}:$PATH
export FABRIC_CFG_PATH=$PWD/../config/
export FABRIC_CA_CLIENT_HOME=${PWD}/organizations/peerOrganizations/org2.example.com/
echo "== As CA for Org2 register particpants and provide identities =="
sleep 3
for n in surveyor planner clerk citizen1 citizen2 citizen3
do
fabric-ca-client register --caname ca-org2 --id.name ${n} --id.secret ${n}pw --id.type client --tls.certfiles ${PWD}/organizations/fabric-ca/org2/tls-cert.pem
done
echo ""
echo "== As CA for Org2 enroll the particpants with Org2 MSP =="
sleep 3
for n in surveyor planner clerk citizen1 citizen2 citizen3
do
fabric-ca-client enroll -u https://${n}:${n}pw@localhost:8054 --caname ca-org2 -M ${PWD}/organizations/peerOrganizations/org2.example.com/users/${n}@org2.example.com/msp --tls.certfiles ${PWD}/organizations/fabric-ca/org2/tls-cert.pem
done
echo ""
echo "== Provide a copy of the MSP config to the particpants =="
for n in surveyor planner clerk citizen1 citizen2 citizen3
do
cp ${PWD}/organizations/peerOrganizations/org2.example.com/msp/config.yaml ${PWD}/organizations/peerOrganizations/org2.example.com/users/${n}@org2.example.com/msp/config.yaml
done
echo "----------------------------------------------------------------"
echo ""
sleep 3