-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathNetwork Setup Instructions.txt
executable file
·142 lines (88 loc) · 9.61 KB
/
Network Setup Instructions.txt
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
1. Command to generate the crypto-materials:
./fabricNetwork.sh generate
2. Command to start the network
./fabricNetwork.sh up
3. Command to kill the network
./fabricNetwork.sh down
4. Command to install and instantiate the chaincode on the network
./fabricNetwork.sh install
1. Command to generate the crypto-materials:
./fabricNetwork.sh generate
2. Command to start the network
./fabricNetwork.sh up
3. Command to kill the network
./fabricNetwork.sh down
4. Command to install and instantiate the chaincode on the network
./fabricNetwork.sh install
ssh upgrad@127.0.0.1 -p 2222
/home/upgrad/Desktop/shared-workspace/certification-network
docker ps -a
docker-compose -f ./docker-compose.yml up -d
#Log in to the CLI Container
docker exec -it cli /bin/bash
#Creating the Channel
peer channel create -o orderer.certification-network.com:7050 -c certificationchannel -f ./channel-artifacts/channel.tx
# Peer Joining
peer channel join -b certificationchannel.block
CORE_PEER_ADDRESS=peer1.iit.certification-network.com:8051
peer channel join -b certificationchannel.block
CORE_PEER_LOCALMSPID="mhrdMSP"
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/mhrd.certification-network.com/users/Admin@mhrd.certification-network.com/msp
CORE_PEER_ADDRESS=peer0.mhrd.certification-network.com:9051
peer channel join -b certificationchannel.block
CORE_PEER_ADDRESS=peer1.mhrd.certification-network.com:10051
peer channel join -b certificationchannel.block
CORE_PEER_LOCALMSPID="upgradMSP"
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/upgrad.certification-network.com/users/Admin@upgrad.certification-network.com/msp
CORE_PEER_ADDRESS=peer0.upgrad.certification-network.com:11051
peer channel join -b certificationchannel.block
CORE_PEER_ADDRESS=peer1.upgrad.certification-network.com:12051
peer channel join -b certificationchannel.block
#Anchor Peer Updates
CORE_PEER_LOCALMSPID="iitMSP"
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/iit.certification-network.com/users/Admin@iit.certification-network.com/msp
CORE_PEER_ADDRESS=peer0.iit.certification-network.com:7051
peer channel update -o orderer.certification-network.com:7050 -c certificationchannel -f ./channel-artifacts/iitMSPanchors.tx
CORE_PEER_LOCALMSPID="mhrdMSP"
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/mhrd.certification-network.com/users/Admin@mhrd.certification-network.com/msp
CORE_PEER_ADDRESS=peer0.mhrd.certification-network.com:9051
peer channel update -o orderer.certification-network.com:7050 -c certificationchannel -f ./channel-artifacts/mhrdMSPanchors.tx
CORE_PEER_LOCALMSPID="upgradMSP"
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/upgrad.certification-network.com/users/Admin@upgrad.certification-network.com/msp
CORE_PEER_ADDRESS=peer0.upgrad.certification-network.com:11051
peer channel update -o orderer.certification-network.com:7050 -c certificationchannel -f ./channel-artifacts/upgradMSPanchors.tx
docker exec -it cli /bin/bash
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C $CHANNEL_NAME -n regnet $PEER_CONN_PARMS -c '{"Args":["org.property-registration-network.regnet:createStudent","0001","Aakash Bansal","Rajesh.Gadiparti@gmail.com","15"]}' >&log.txt
peer chaincode instantiate -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -l node -v 1.1 -c '{"Args":["org.property-registration-network.regnet:instantiate"]}' -P 'OR ('\''registrarMSP.member'\'','\''usersMSP.member'\'')'
peer chaincode instantiate -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -l node -v 1.1 -c '{"Args":["org.property-registration-network.regnet:instantiate"]}' -P 'OR ('\''registrarMSP.member'\'','\''usersMSP.member'\'')
docker exec -it cli /bin/bash
export CORE_PEER_LOCALMSPID=usersMSP
export CORE_PEER_ADDRESS=peer0.users.property-registration-network.com:9051
export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/users.property-registration-network.com/users/Admin@users.property-registration-network.com/msp
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:requestNewUser","Rajesh","v4u2chat@gmail.com","9866776600","0000-0000-0000"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:requestNewUser","Prashanthi","prshanthi@gmail.com","9866776699","1111-1111-1111"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:rechargeUserAccount","Rajesh","0000-0000-0000","upg1000"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:rechargeUserAccount","Prashanthi","1111-1111-1111","upg1000"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:viewUser","Rajesh","0000-0000-0000"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:viewUser","Prashanthi","1111-1111-1111"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:propertyRegistrationRequest","1","500","requested","Rajesh","0000-0000-0000"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:propertyRegistrationRequest","2","50000","requested","Rajesh","0000-0000-0000"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:viewProperty","1"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:updateProperty","1","onSale","Rajesh","0000-0000-0000"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:updateProperty","1","onSale","Prashanthi","1111-1111-1111"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.usercontract:purchaseProperty","1","Prashanthi","1111-1111-1111"]}'
docker exec -it cli /bin/bash
CORE_PEER_LOCALMSPID="registrarMSP"
CORE_PEER_ADDRESS=peer0.registrar.property-registration-network.com:7051
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/crypto/peerOrganizations/registrar.property-registration-network.com/users/Admin@registrar.property-registration-network.com/msp
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet:approveNewUser","Rajesh","0000-0000-0000"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet:approveNewUser","Prashanthi","1111-1111-1111"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet:viewUser","Rajesh","0000-0000-0000"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet:approvePropertyRegistration","1"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet:viewProperty","1"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet:approvePropertyRegistration","1"]}'
peer chaincode upgrade -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -l node -v 1.1 -p /opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode/ -c '{"Args":["org.property-registration-network.regnet.usercontract:instantiate"]}' -P "OR ('registrarMSP.member','usersMSP.member','upgradMSP.member')" >&log.txt
peer chaincode invoke -o orderer.certification-network.com:7050 -C certificationchannel -n certnet -c '{"Args":["org.certification-network.certnet:createStudent","0001","Aakash Bansal","connect@aakashbansal.com"]}'
peer chaincode invoke -o orderer.property-registration-network.com:7050 -C registrationchannel -n regnet -c '{"Args":["org.property-registration-network.regnet.user:requestNewUser","Rajesh","v4u2chat@gmail.com","9866776600","0000-0000-0000"]}'
peer chaincode invoke -o orderer.certification-network.com:7050 -C certificationchannel -n certnet -c '{"Args":["org.certification-network.certnet:createStudent","0001","Aakash Bansal","connect@aakashbansal.com"]}'
peer chaincode invoke -o orderer.certification-network.com:7050 -C certificationchannel -n certnet -c '{"Args":["org.certification-network.certnet:getStudent","0001"]}'