-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass 9.txt
183 lines (86 loc) · 3.53 KB
/
class 9.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
Read Write set:
----------------
1. Txn to chnage the ownership from Joe to Kavin
tnx1 --> (assetid (1234), joe, kavin)
tnx2 --> (assetid (1234), joe, carol)
endorsing peer --->
1234 ----> joe
read set (key-1234, version -1, value - joe)
write set (key-1234, version -1, value - kavin)
post RW validation --> (key- 1234, value - kavin, version-2)
endorsing peer --->
1234 ----> joe
read set (key-1234, version -1, value - joe)
write set (key-1234, version -1, value - carol)
read write ---> fail ---> double
RAFT ---> [ 1 2 3 4 5 ]
leader election ---> R1 --> [ 3 ] ----> gets chance to form blocks
log replication ----> [3] ---> [ t1 t2 t3 t4 ] ---> B1
leader elction ----> R2 --> [5] --->
CFT ---> 2n+1
1 crash ----> 3 nodes
2 crash ----> 5 nodes ( 3 nodes are active and 2 nodes are not active)
3 crash ----> 7 nodes
Ordering service ----> cluster --- [ 1 2 3 4 5]
leader node wil be 1 for every round ---> L1
Prerequisites:
------------------
sudo apt-get install curl
curl --version
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash
sudo apt-get update
sudo apt-get install nodejs
sudo node --version
sudo apt-get install git
git --version
sudo apt-get install python
python --version
sudo apt-get install libltdl-dev
wget https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_17.06.2~ce-0~ubuntu_amd64.deb
sudo dpkg -i docker-ce_17.06.2~ce-0~ubuntu_amd64.deb
docker --version
sudo apt-get install python3-pip
pip3 --version
sudo pip3 install docker-compose
docker-compose version
Clone and download Fabric repositiry from github:
--------------------------------------------------
sudo chmod 666 /var/run/docker.sock
sudo systemctl restart docker
sudo curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.2.2 1.4.9
cd fabric-samples/
Componnets of Fabric:
----------------------
1. CA
2. PEER
3. ORDERER
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
sudo systemctl restart docker.socket docker.service
sudo ./network.sh up
sudo docker ps
docker exec peer0.org1.example.com peer channel list
Test network:
--------------
2 peers (org1, org2)
1 orderer
sudo rm /usr/local/bin/docker-compose
sudo apt remove docker-compose
sudo apt autoremove
sudo apt update
sudo apt install curl -y
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
test network: 2 orgs, 1 orderer
options : CA, couchdb
options : create channel
network.sh ----> to start the fabric test network
sudo docker ps ---> to check the list of docker process/containers running
docker exec peer0.org1.example.com peer channel list ---> to check the channels the peer is installed on
sudo ./network.sh createChannel -c testchannel ---> to start test network with channel and name is 'testchannel'
sudo ./network.sh up -ca ----> to start network with cerrificate authority
sudo ./network.sh up -s couchdb ---> start test newrok with couchdb as statedatabase
sudo ./network.sh up -ca -s couchdb ---> ideaway of starting network
Fabric Network admin -----> Devops/CHFA