BO v AN H6A, THE THAO v Anu qcH
Cl)C BAN QUY~N TAC GIA
GIAY CHUNG N ~
'tJ
,
?
;
DANG KY QlIY£N~TAC GIA
A
.
11~\
Tac ph~m:
Bai vii
Hyperl
Tac gia:
Nguyen ,~
-
oai hinh:
·11
\,
Thon Tien
HaiDuO'ltg
Chu
s« hfru:
NguylnDuy
sa 29 - TT l f"'-!]_T Va
Q. Ha Dong,Ha~ p
-~=:::::::::====:?
Da dang ky quyin-tacgia t~i
• ;a,.,'°ft; ,/,'
,
,
Tac phlzm vi t
ViftNam
0300980006 8
11/04/2021
0190840004 0
10/04/2021
\JC Ban quyin Tac gia
Ha N9i, ngay 30 thang 01 niim 2023
KT. Cl)C TRUONG
UONG
ã
SB: 0549/2023/QTG
CĐp cho Chu s& hfru
Ph~m Thj Kim Oanh
TAC GIA: NGUYEN VAN
uoc
CHU SO Hfru: NGUYEN DUY HA
(I I
cov
sa'tMng ky .. Cl]i.f.fj
BAI VIET:
Ngay 3.91.41. .107.-)
NGIDEN cUU VE CONG NGHE•
HYPERLEDGERFABRIC
I
1. Hyperledger la gi?
Hyperledger la m9t open source blockchain platform, so huu Mi Linux foundation. V 6i
H~perledger, Linux Foundation nhim m\lC dich ~o ra moi trucmg de cac nha phattrien phfui
me1? ph6i hgp de xay d1,Illg cac framework blockchain. Hyperledger duqc contribute bm nit
nhieu hang cong nghe 16n, nf>i b~t nhAt la IBM
Khac v6i cac platform blockchain nhu Bitcoin, Ethereum, Hyperledger khong c6
cryptocurrency rieng va cilng khong c6 y djnh phat trien cryptocurrency
2. Myc dich cua Hyperledger
Hyperledger ra doi v6i m\lc dich:
•
•
•
•
T~o ra m9t framework ma ngubn ma, sb cai phan tan de h6 trq cac giao djchbusiness
Cung cAp co so h~ tfuig trung l~p, cm mo duqc h6 trq b6i c(>ng d6ng cong ngh~
Giao d\lc cong chung v8 co h(>i thi trucmg cho cong nghe blockchain
Xay d\Illg c(>ng d6ng cong ngh~ de phat rien blockchain va cac use cases POC v8blockchain
Hyperledger phat trien m(>t chi6n luge gQi la Hyperledger umbrella v6i nhi8u di! an khac nhau:
•
Sawtooth: M9t platform blockchain do Intel phat trien, sir d\lllg thu~t toan d6ng thu~
Proof of Elapsed Time (PoeT)
•
Iroha: DI! an duqc contributed v6i Hitachi, NTT Data, sir d\lllg thu~t toan d6ng thu~
Byzantine Fault Tolenrant
•
Fabric: 0uqc contributed bm IBM, m(>t platform cho phep cac components nhu thu~t
toan d6ng tht$1, membership service c6 th€ d€ dang plug and play,~ hi€u la c6 th€thay the
cac th~t toan d6ng th~
Hyperledger Fabric s~ d\lllg cong ngh~ container~~ luu tru cac hgp d6ng thong minh dugcg9i
la "chaincode" bao gom logic ung d\lllg cua M thong.
3. Ki~n true cua Hyperledger
•
Membership : cung cAp cac djch V\l quan ly danh tinh, quy8n rieng tu, bao m~t vaki~m
toan tren m~g.
•
ChainCode: Hyperledger luu cac smartcontract du6i d~g cac chaincod~ (ngon ng~l~~
trinh d~ phat tri~n smartcontract), chaincode_ duqc sir d~g n:ong ,Hy~erle?ger lag?l~g. _co the
hi€u chaincode la mot decentralize application, ch~y tren cac nut xacnh~ hgp l
dugc dong g6i trong cac docker
,I
•
Blockchain Services: Cac dich V\l Blockchain bao gf>m ba thanh ph~n chinh: giao thuc
peer-to-peer (P2P) d\fa tren HTTP / 2, s6 k8 toan phan ph6i va trinh quan ly df>ng thu~
•
Transactions: Cac giao dich dugc th\fc hi~n va luu tru tren blockchain
4. Hyperledger Fabric
Du6i day la mo hinh 1 ml;Ulg blockchain Hyperledger Fabric:
•
Fabric CA la Fabric Certificate Authority cung cdp authentication cho cac participant
trong ml;Ulg Hyperledger. Bdt ky participant nao tham gia ml;Ulg blockchain phai dugcdang ki
v6i CA truck Qua trinh nay gQi la enrollment.
•
Peer la cac computer node, luu tru ban copy cua blockchain va th\lc hi~n qua trinh
consensus.
•
Ordering service kiem tra permission cua clien, validate cac transaction d8n tir client.
5. Cai ttijt Hyperledger Fabric
5.1.
Pre-requisites
•
Operating Systems: Ubuntu Linux 14.04 / 16.04 LTS (both 64-bit)
•
Docker Engine: Version 17 .03 or higher
•
Docker-Compose: Version 1.8 or higher
•
Node: 8.9 or higher (note version 9 and higher is not supported)
•
npm:v5.x
•
git: 2.9.x or higher
•
Python: 2. 7 .x
•
A code editor of your choice, we recommend VSCode.
Tren Ubuntu, dB tai nhung di8u ki~n tien quy8t nay su d\filg cau l~nh:
curl -0 hub.;o/co1DPOBer/lateat/prereqs-ubuntu.sh
chmod u+x prereqs-ubuntu.sh
Hinh 7. L¢nh dowload aiiu kiÂn tien quyit
5.2.
ã
Cai i/ij,t moi trirung phat triln
Cac cong C\l CLI c~ thi8t:
Copy
npa install -g composer-cli@6,28
Copy
•
Ti~n ich d~ ch~y REST SERVER tren may cua b~ d~ hi~n tht cac m~g doanh nghi~p
cua b~ du6i d~ng cac RESTful APis:
npm install -g composer-rest-server@e,28
•
Copy
Ti~n ich hfru ich d~ t~o tai san ung di,mg:
npm install -g generator-hyperledger-composer@8,28
Copy
•
Yeoman la m<)t cong C\l d~ ~o cac (mg d\lilg, sir d\lilg trinh so~ thaohyperledgercompoder:
npm install -g yo
5.3.
Copy
Cai i/9,t Hyper/edger Fabric
0~ tai Hyperledger Fabric ch~y cau l~nh :
mkdir -/fabric-dev-servera
&&
cd -/fsbric-dev-servers
curl -0 https://raw.g;thubusercontent.com/hyperledger/composertools/master/packsges/fabric-dev-servers/fabric-dev-servers.tar.gz
tar -xvf fabric-dev-servers.tar.gz
cd -/fabric-dev-servers
export FABRIC_VERSIOH=hlfvl2
./downloadFabric,sh
Copy
Ta dugc danh sach Fabric nhu sau:
nguyenuoc@nguyenuoc:-/fabric-dev-servers$ ls
car-training
fabric-scripts stopFabric.sh
createConposerProfile.sh housing-Market teardownAllOocker.sh
createPeerAdninCard.sh
housing-network teardownFabric.sh
OevServer_connection.json _loader.sh
test.txt
downloadFabric.sh
package.json
tutorial-network
fabric -dev - se r ve r s . tar . gz startFabric.sh
nguyenuoc@nguyenuoc:-/fabric-dev-servers$ I
lfinh 4. Danh sach Fabric
Lful ddu tien bi\t ddu m<)t thoi gian ch~y m6i, b~ se cful ch~y ~p l~nh hilt ddu, sau d6 t~o the
PeerAdmin:
cd ã/fabric-dev-servers
export FABRIC_VERSION=hlfvl2
./startfabric.sh
./createPeerAdminCerd.sh
Copy
Ã
nguyenuocânguyenuoc:-/ f abric-dev-servers$ ./startFabric.sh
DevelopMent only script for Hyperledger Fabric control
Running 'startFabric.sh'
FABRIC_VERSION is unset, assuMing hlfv12
FABRIC_START_TIMEOUT is unset, assuMing 15 (seconds)
ReMoving peerO.orgl.exaMple.coM ••• done
ReMoving couchdb ••• done
ReMoving orderer.exaMple.coM ••• done
ReMoving ca.orgl.exaMple.coM ••• done
ReMoving network coMposer_default
creating net~10rk "coMposer _default" with the default driver
Creating ca.orgl.exaMple.coM
Creating orderer.exaMple.coM
Creating couchdb .••
Creating orderer.exaMple.coM
Creating ca.orgl.exaMple.coM
Creating couchdb ••• done
creating peerO.orgl.exaMple.coM
creating peerO.orgt.exaMple.coM
done
sleeping for 15 seconds to wait for fabric to coMplete start up
I
Hinh 5. Khai tJ9ng Hyper/edger Fabric
Cuf>i cung, chi.iy l~nh docker ps d~ th!y cac fabric instance nhu ca, peer, ordering dang chi.iy:
0 JO\n c: anne
nguyenuocenguyenuoc::-/fobric
-dcv•scrvcr5$ docker ps
CONT.UIJER ID
IMAGE
COJIMAllD
CREATED
STATUS
PORTS
NAIIES
csgf
ea
hypertedger/fabric•peer:1.2,1
"peer node star t"
42 seconds ego
93
7394
UP
second~
o.o.o.o: 7os1->70Sl/tcp, o.o , o.o:70S3->70S3/tcp peero.org1.excnpte.co:1
34 e
hypertedger/fabric•couchdb:0.4.10 "tini •· / docker•ent-•
57 seconds ego
89284799437
UP
seconds
/tcp, 9100/tcp, o.o.e.o:S984•>5984/tcp
couchdb
4369
43
bfc f
,
hypertedger/fcbric-co:1.2.1
"sh •C 'fcbrtc-ce•se-• S7 seconds ego
40Up67428
43 seconds
o.o.0.0:70S4•>70S4/tcp
c:a .orgl.exa~ple.co.~
bScec dlZ
hyperledger/fcbr tc-orderer11.2.1
"orderer "
57 seconds coo
60 Up96
45 seconds
o.o.o.8:7058•>7050/tcp
orderer.~xaAple.coA
nguyenuocenguyenuoc: - / fobric •d~v - ~ervers$
I
Hinh 6. Cac Fabric instance dang chr;1y