SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
Hyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code Analysis
Jongseok Choi
SmartM2M
January 9, 2018
Outline
1 Hyperledger Introduction
Preliminaries
Basic Concepts
Architecture
2 Code Hierarchy
Source Line Analysis
3 Command Composition
Fabric Architecture
Peer
Orderer
4 Peer Details
Node
5 Block
Implementation
6 Conclusion
Summary
Future Works
2/37
Preliminaries
1. Programming
• Go
2. Database
• LevelDB
• CouchDB
3. RPC
• gRPC or thrift
• Protobuf
4. Cryptography
• X.509
• ECDSA
• TLS
5. Infra
• Kafka
Hyperledger IntroductionIPreliminaries
3/37
A Distributed Ledger
An append-only system of record or log of transactions.
• ]¥x@ ƒ}(promises),pò(trades), ∏ú≠XÒX
lpt0| 0]X0 ⌅t⌧ ¨© ⇠ àL.
• π $∏Ãl¡–⌧ ¯Ï¡⇠‡, ⌅lò t˘ $∏Ãl–
8Ï` ⇠ àƒ] h.
• Ñ∞–•@ ⌘Y ‡∞ xùê ∆î ‰ê⌅ pt0†t§
• ]¥xX ⌧⌧Ù•D µt⌧ ∏ú≠Xt ò¨î Ét Ñ∞
–•D X¯h.
Hyperledger IntroductionIBasic Concepts
4/37
Blockchain 2.0
Encompasses both distributed ledgers and smart contracts.
Hyperledger IntroductionIBasic Concepts
5/37
Distributed Ledgers in Action
1. π )– àî ®‡ ¨åt ¥§ ‘∏¨ 8ú⇠»D L,
tât|Xî ©]t àî ED ¿‡ à‰.
2. ⌅p XòX Dt à8| Ätt, ‰x ¨å‰@ ®‹
D î‰.
3. ¯¨‡ò⌧, PÖ@ Ÿ‹– ⌧ ‰x Dt à8| Äx‰.
4. Ï0⌧ Ω¡D t⌧ t4 ¨å É@ D ‡, ƒ¨å@ ‰‹
‹ƒXÏ à8| Äx‰.
5. ®‡ ¨å‰t t˘ ‘∏¨– ŸXXt, ‰L ledger| ¯ ⇠
à‰.
6. t |(X ë≈‰t ¥ê ƒ ‹®X $∏Ãl–⌧
|¥òê– Ñ∞–• Ÿë –¨| ∞ ‰.
Hyperledger IntroductionIBasic Concepts
6/37
Blockchain Technologies
Smart contract
• The code or any complex program stored and executed on a
blockchain.
I Smart contractî Ñ∞ –• 0 ⌅X XòX ƒ5< l1(.
I Ñ∞–•@ ‰ê⌅ ı ⌧ pt0†t§| –à D»|, ‰ê⌅
D¿»§ ¡Ñ.
Blockchain 6= Cryptocurrency
• Cryptocurrency is an application that sits on top of blockchain.
Not the other way around.
I Blockchain and cryptocurrencies are often discussed in similar
contexts, but they are not one in the same.
I Distributed ledgers do not require a cryptocurrency to work.
Hyperledger IntroductionIBasic Concepts
7/37
Business Aspects
All over the global market there are ledgers that organizations
and individuals alike must trust.
• Permissioned blockchains di↵er from what you’ll find in Bitcoin
or Ethereum.
I ÄÑX ‘0⌅|tà ]¥x Q©–⌧î ‰⌧ ‡∞ ƒ–
0⇠XÏ, ]¥x ‹§–⌧ƒ å 0⇠X 8Ïê|
l1Xî ÉD © h.
I t˘ $∏Ãl–⌧ p x%D ‰t¿ J‡ƒ T í@ ÙHD
0⇠< pt0| ı h.
Hyperledger IntroductionIBasic Concepts
8/37
Modular Approach
Hyperledger
• Hyperledgerî ¡ Ñ|/‹®ò iXL‡¨ò– 0|⌧
ÑX(.
Hyperledger IntroductionIArchitecture
9/37
Architecture
Hyperledger IntroductionIArchitecture
Components
Platform-agnostic
• Language : Go
• gRPC over HTTP/2
Peers
• xù⌧ <¥ : Consensus L‡¨ò ⇠â
• xù⇠¿ J@ <¥ : Consensus L‡¨ò ⇠âX¿ JL
Transactions
• Deploy new chaincode
• Invoke an operation
• Read states
State
• a key-value store
Hyperledger IntroductionIArchitecture
11/37
Components
Membership service
• Peer–å xù⌧| ⌧
xù⌧ ÖX
1. Enrollment certificates
I E-CAÄ0 ⌧ ⇠p E-Cert|‡ ÄÑ
I x‹–å ›ƒê| ÄÏX‡, ∏ú≠XD ›1X0 ⌅ åD
ÄÏh
2. Transaction certificates
I T-CAÄ0 ⌧ ⇠p T-Cert|‡ ÄÑ
I Xòt¡X ∏ú≠XD ⌧ X0 ⌅t ¨©
I T-CA| ⌧x x‹î E-Cert@ ¡l| t⌧` ⇠ àL.
Pseudonumous transaction authorization
• Peer º»ò Œ@ ∏ú≠XD Ÿ| T-Cert ⌧tXî
| ⌧¥
Hyperledger IntroductionIArchitecture
12/37
Consensus Algorithms
Hyperledgerî PBFT| ¨©
• Hyperledger Fabric V1.0–⌧ Ä0î Endorser@ Consensus
x‹ Ѩ(
• X chaincodeî ‰x endorsers| –.
• Consensus x‹î ∏ú≠XD ⌧⌧| Ù•t¸î Ì`à ⇠â
Hyperledger IntroductionIArchitecture
13/37
Consensus Algorithms
Hyperledger IntroductionIArchitecture
14/37
Consensus Algorithms
Hyperledger IntroductionIArchitecture
15/37
Directories
Name Description
bccsp Blockchain Cryptographic Service Provider
common core@ ÏÏ ¿ 4–⌧ ¨© ⇠ àî 0¯ 0•
core Blockchain uÏ |t Ϩ
events t§∏ Pub/Sub 0•
gossip Gossip ⌅†
gotools Go build ƒl
idemix Identity Mixer l⌅
msp Membership Service Provider
orderer Ordering ans consensus
peer Peer
protos GRPC© Protobuf ®L
Code HierarchyISource Line Analysis
16/37
Source Lines
Code HierarchyISource Line Analysis
17/37
Fabric Architecture
Command CompositionIFabric Architecture
18/37
Peer Commands
Peerî 5⌧X î Ö9¥| ¿‡ àL
• version : peer build ✏ base image Ñ⌅
• node : peer x‹ ⇠â
• chaincode : chaincode x‹ ⇠â
• logging : CLIX Log level $ ✏ ¨
• channel : Channel ¨
Peerî Cobra (§¿| t©XÏ Ö9¥
✏ ò¯ X
Command CompositionIPeer
19/37
Peer Commands
1 var mainCmd = &cobra.Command{
2 Use: "peer",
3 PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
4 loggingSpec := viper.GetString("logging.level")
5 flogging.InitFromSpec(loggingSpec)
6
7 return nil
8 },
9 Run: func(cmd *cobra.Command, args []string) {
10 if versionFlag {
11 fmt.Print(version.GetInfo())
12 } else {
13 cmd.HelpFunc()(cmd, args)
14 }
15 },
16 }
Code 1: peer/main.go
1 mainCmd.AddCommand(version.Cmd())
2 mainCmd.AddCommand(node.Cmd())
3 mainCmd.AddCommand(chaincode.Cmd(nil))
4 mainCmd.AddCommand(clilogging.Cmd(nil))
5 mainCmd.AddCommand(channel.Cmd(nil))
Code 2: peer/main.go
Command CompositionIPeer
20/37
Peer-Node Commands
1 func Cmd() *cobra.Command {
2 nodeCmd.AddCommand(startCmd())
3 nodeCmd.AddCommand(statusCmd())
4
5 return nodeCmd
6 }
Code 3: peer/node/node.go
1 var nodeStartCmd = &cobra.Command{
2 Use: "start",
3 Short: "Starts the node.",
4 Long: ‘Starts a node that interacts with the network.‘,
5 RunE: func(cmd *cobra.Command, args []string) error {
6 return serve(args)
7 },
8 }
Code 4: peer/node/start.go
Command CompositionIPeer
21/37
Peer-Chaincode Commands
1 func Cmd(cf *ChaincodeCmdFactory) *cobra.Command {
2 addFlags(chaincodeCmd)
3
4 chaincodeCmd.AddCommand(installCmd(cf))
5 chaincodeCmd.AddCommand(instantiateCmd(cf))
6 chaincodeCmd.AddCommand(invokeCmd(cf))
7 chaincodeCmd.AddCommand(packageCmd(cf, nil))
8 chaincodeCmd.AddCommand(queryCmd(cf))
9 chaincodeCmd.AddCommand(signpackageCmd(cf))
10 chaincodeCmd.AddCommand(upgradeCmd(cf))
11 chaincodeCmd.AddCommand(listCmd(cf))
12
13 return chaincodeCmd
14 }
Code 5: peer/chaincode/chaincode.go
Command CompositionIPeer
22/37
Peer-Channel Commands
1 func Cmd(cf *ChannelCmdFactory) *cobra.Command {
2 AddFlags(channelCmd)
3
4 channelCmd.AddCommand(createCmd(cf))
5 channelCmd.AddCommand(fetchCmd(cf))
6 channelCmd.AddCommand(joinCmd(cf))
7 channelCmd.AddCommand(listCmd(cf))
8 channelCmd.AddCommand(updateCmd(cf))
9 channelCmd.AddCommand(signconfigtxCmd(cf))
10 channelCmd.AddCommand(getinfoCmd(cf))
11
12 return channelCmd
13 }
Code 6: peer/channel/channel.go
Command CompositionIPeer
23/37
Orderer Commands
Ordererî kingpin (§¿| t©XÏ Ö9¥@ ò¯ X
• kingpin (§¿î cobra (§¿@ Ϩ ¡¡ Condition<
Ñ0| h.
1 var (
2 app = kingpin.New("orderer", "Hyperledger Fabric orderer
node")
3
4 start = app.Command("start", "Start the orderer node").
Default()
5 version = app.Command("version", "Show version information
")
6 )
Code 7: orderer/common/server/main.go
Command CompositionIOrderer
24/37
Orderer-start Commands
1 case start.FullCommand():
2 logger.Infof("Starting %s", metadata.GetVersionInfo())
3 conf := config.Load()
4 initializeLoggingLevel(conf)
5 initializeProfilingService(conf)
6 grpcServer := initializeGrpcServer(conf)
7 initializeLocalMsp(conf)
8 signer := localmsp.NewSigner()
9 manager := initializeMultiChainManager(conf, signer)
10 server := NewServer(manager, signer)
11 ab.RegisterAtomicBroadcastServer(grpcServer.Server(),
server)
12 logger.Info("Beginning to serve requests")
13 grpcServer.Start()
Code 8: orderer/common/server/main.go
Command CompositionIOrderer
25/37
Node
ledgermgmt.Initialize
peer.CacheConfiguration
peer.GetPeerEndpoint
peer.GetSecureConfig
peer.CreatePeerServer
createEventHubServer
ccprovider
.EnableCCInfoCache
createChaincodeServerregisterChaincodeSupport pb.RegisterAdminServer
endorser
.NewEndorserServer
pb
.RegisterEndorserServer
mgmt
.GetLocalSigningIdentity()
.Serialize()
peergossip.NewMCS
peergossip
.NewSecurityAdvisor
service
.InitGossipService
initSysCCs peer.Initialize go peerServer.Start
go
ehubGrpcServer.Start
profiling is enabled?
go
http.ListenAndServe
Yes
End
No
Start
Peer DetailsINode
26/37
Basic Server Settings
3⌧X GRPC ⌧Ñ| lŸ
• Peer server
I XΩ$ |¯0 : peer.listenAddress
I 0¯ Ï∏ : 7051
• Chaincode server
I XΩ$ |¯0 : peer.chaincodeListenAddress
I 0¯ Ï∏ : 7052
• Event hub server
I XΩ$ |¯0 : peer.events.address
I 0¯ Ï∏ : 7053
Peer DetailsINode
27/37
Ledger Initialization
Ledger 0T–⌧î Ledger| •` pt0†t§| 0T
Xî ¸
• LevelDB : Chain/Ledger ID •D ⌅ KV pt0†t§
• CouchDB : Binary| •X0 ⌅ §†¨¿ DB ¨©
1 func NewProvider() (ledger.PeerLedgerProvider, error) {
2 idStore := openIDStore(ledgerconfig.GetLedgerProviderPath())
3
4 ledgerStoreProvider := ledgerstorage.NewProvider()
5
6 vdbProvider, err := privacyenabledstate.NewCommonStorageDBProvider()
7 if err != nil {
8 return nil, err
9 }
10
11 var historydbProvider historydb.HistoryDBProvider
12 historydbProvider = historyleveldb.NewHistoryDBProvider()
13
14 provider := &Provider{idStore, ledgerStoreProvider, vdbProvider,
historydbProvider}
15 provider.recoverUnderConstructionLedger()
16 return provider, nil
17 }
Code 9: core/ledger/kbledger/kv ledger provider.go
Peer DetailsINode
28/37
GRPC Server
GRPCServer x0òt§|
†t§ ¨©
• Interface– Ïh h⇠Ã
0
• TLS µ‡ ( ✏ CA
xù⌧ ( $ D Ïh
grpcServerImpl lp¥î
Private< ¨©X‡,
xÄ–î x0òt§|
µt⌧ ¨©
• ⌧ÑX XΩ$ ✏
|¯0| Ïh
1 type GRPCServer interface {
2 Address() string
3 Start() error
4 Stop()
5 Server() *grpc.Server
6 Listener() net.Listener
7 ServerCertificate() tls.Certificate
8 TLSEnabled() bool
9 MutualTLSRequired() bool
10 AppendClientRootCAs(clientRoots [][]byte) error
11 RemoveClientRootCAs(clientRoots [][]byte) error
12 SetClientRootCAs(clientRoots [][]byte) error
13 SetServerCertificate(tls.Certificate)
14 }
Code 10: core/comm/server.go
1 type grpcServerImpl struct {
2 address string
3 listener net.Listener
4 server *grpc.Server
5 serverCertificate atomic.Value
6 serverKeyPEM []byte
7 serverRootCAs []tls.Certificate
8 lock *sync.Mutex
9 clientRootCAs map[string]*x509.Certificate
10 tlsConfig *tls.Config
11 tlsEnabled bool
12 mutualTLSRequired bool
13 }
Code 11: core/comm/server.go
Peer DetailsINode
29/37
Chaincode Server
Chaincodeî GRPC ⌧Ñ| lŸ
• GRPC| ⌅t⌧ ¨©⇠î chaincodesî 6⌧ l1(.
I core/scc/importsysccs.go T‹ 8p
Name Chaincode Package
cscc &cscc.PeerConfiger{} core/scc/cscc
lscc lscc.NewLifeCycleSysCC core/scc/lscc
escc &escc.EndorserOneValidSignature{} core/scc/escc
vscc &vscc.ValidatorOneValidSignature{} core/scc/vscc
qscc &qscc.LedgerQuerier{} core/chaincode/qscc
rscc rscc.NewRscc core/chaincode/rscc
Peer DetailsINode
30/37
Peer Server
Peer ⌧Ñî GRPC ⌧Ñ| lŸ
• AtomicBroadcast, Admin, Endorser 3⌧X RPC| ⌧ı
• Transaction ò¨î core/endorser/endorser lp¥ 8‡
I ‰» x EndorserServer Ì`D ⇠âh.
1 func CreatePeerServer(listenAddress string,
2 serverConfig comm.ServerConfig) (comm.GRPCServer, error) {
3
4 var err error
5 peerServer, err = comm.NewGRPCServer(listenAddress, serverConfig)
6 abServer := peer.NewAtomicBroadcastServer(timeWindow, mutualTLS)
7 ab.RegisterAtomicBroadcastServer(peerServer.Server(), abServer)
8 pb.RegisterAdminServer(peerServer.Server(), core.NewAdminServer())
9 serverEndorser := endorser.NewEndorserServer(privDataDist, &endorser.SupportImpl{})
10 auth := authHandler.ChainFilters(serverEndorser, authFilters...)
11 pb.RegisterEndorserServer(peerServer.Server(), auth)
12 go peerServer.Start()
13
14 return peerServer, nil
15 }
Code 12: peer/node/start.go
Peer DetailsINode
31/37
Event Hub Server
Event » î 1⌧X GRPC Protobuf| Ïh
• Events
1 grpcServer, err := comm.NewGRPCServerFromListener(lis, serverConfig)
2 if err != nil {
3 logger.Errorf("Failed to return new GRPC server: %s", err)
4 return nil, err
5 }
6
7 ehConfig := &producer.EventsServerConfig{BufferSize: uint(viper.GetInt("peer.events.
buffersize")), Timeout: viper.GetDuration("peer.events.timeout"), TimeWindow: viper
.GetDuration("peer.events.timewindow")}
8 ehServer := producer.NewEventsServer(ehConfig)
9 pb.RegisterEventsServer(grpcServer.Server(), ehServer)
10
11 go grpcServer.Start()
Code 13: peer/node/start.go
Peer DetailsINode
32/37
Block Structure
¥x›1
• core/peer T‹ 8‡
1 type Block struct {
2 Header *BlockHeader ‘protobuf:"bytes,1,opt,name=header"
json:"header,omitempty"‘
3 Data *BlockData ‘protobuf:"bytes,2,opt,name=data" json:"
data,omitempty"‘
4 Metadata *BlockMetadata ‘protobuf:"bytes,3,opt,name=
metadata" json:"metadata,omitempty"‘
5 }
BlockIImplementation
33/37
Block Data
1 type BlockHeader struct {
2 Number uint64 ‘protobuf:"varint,1,opt,name=number" json:"
number,omitempty"‘
3 PreviousHash []byte ‘protobuf:"bytes,2,opt,name=
previous_hash,json=previousHash,proto3" json:"
previous_hash,omitempty"‘
4 DataHash []byte ‘protobuf:"bytes,3,opt,name=data_hash,json
=dataHash,proto3" json:"data_hash,omitempty"‘
5 }
1 type BlockData struct {
2 Data [][]byte ‘protobuf:"bytes,1,rep,name=data,proto3"
json:"data,omitempty"‘
3 }
4
5 type BlockMetadata struct {
6 Metadata [][]byte ‘protobuf:"bytes,1,rep,name=metadata,
proto3" json:"metadata,omitempty"‘
7 }
BlockIImplementation
34/37
Summary
⌅¥ x ⌅†@ GRPC| 0⇠< h.
• Hyperledger Ñ ✏ tt| ⌅t⌧î RPC–  tt ‰∞
⌘îh
• ⌅¥ x Ñ D `tå X0 ⌅t⌧î Protobuf Ñ ¸ GRPC
lp| Ñ
Hyperledger| L§∏ ⇣î Ÿ
• GRPC| ¨©XÏ Peer– ∏ú≠XD ›1
• GRPCî ⌅¨ Œ@ ∏¥| ¿–X‡ à0 L8–, ®| ✏
Web 8X1t D¸ íL
ConclusionISummary
35/37
Hyperledger Code Analysis Reveals Fabric Architecture and Peer Details

Weitere ähnliche Inhalte

Was ist angesagt?

PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...Rouven Weßling
 
Php 5.6 vs Php 7 performance comparison
Php 5.6 vs Php 7 performance comparisonPhp 5.6 vs Php 7 performance comparison
Php 5.6 vs Php 7 performance comparisonTu Pham
 
Php 7.2 compliance workshop php benelux
Php 7.2 compliance workshop php beneluxPhp 7.2 compliance workshop php benelux
Php 7.2 compliance workshop php beneluxDamien Seguy
 
Runtime Symbol Resolution
Runtime Symbol ResolutionRuntime Symbol Resolution
Runtime Symbol ResolutionKen Kawamoto
 
Review unknown code with static analysis - bredaphp
Review unknown code with static analysis - bredaphpReview unknown code with static analysis - bredaphp
Review unknown code with static analysis - bredaphpDamien Seguy
 
The why and how of moving to php 5.4/5.5
The why and how of moving to php 5.4/5.5The why and how of moving to php 5.4/5.5
The why and how of moving to php 5.4/5.5Wim Godden
 
Csphtp1 18
Csphtp1 18Csphtp1 18
Csphtp1 18HUST
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6Wim Godden
 
Perly Parsing with Regexp::Grammars
Perly Parsing with Regexp::GrammarsPerly Parsing with Regexp::Grammars
Perly Parsing with Regexp::GrammarsWorkhorse Computing
 
Php 7 compliance workshop singapore
Php 7 compliance workshop singaporePhp 7 compliance workshop singapore
Php 7 compliance workshop singaporeDamien Seguy
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Wim Godden
 
Clean code and refactoring
Clean code and refactoringClean code and refactoring
Clean code and refactoringYuriy Gerasimov
 

Was ist angesagt? (20)

PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
 
API
APIAPI
API
 
Php 5.6 vs Php 7 performance comparison
Php 5.6 vs Php 7 performance comparisonPhp 5.6 vs Php 7 performance comparison
Php 5.6 vs Php 7 performance comparison
 
Php 7.2 compliance workshop php benelux
Php 7.2 compliance workshop php beneluxPhp 7.2 compliance workshop php benelux
Php 7.2 compliance workshop php benelux
 
Runtime Symbol Resolution
Runtime Symbol ResolutionRuntime Symbol Resolution
Runtime Symbol Resolution
 
Review unknown code with static analysis - bredaphp
Review unknown code with static analysis - bredaphpReview unknown code with static analysis - bredaphp
Review unknown code with static analysis - bredaphp
 
Clean code
Clean codeClean code
Clean code
 
The why and how of moving to php 5.4/5.5
The why and how of moving to php 5.4/5.5The why and how of moving to php 5.4/5.5
The why and how of moving to php 5.4/5.5
 
Csphtp1 18
Csphtp1 18Csphtp1 18
Csphtp1 18
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
 
Php NotesBeginner
Php NotesBeginnerPhp NotesBeginner
Php NotesBeginner
 
Unix
UnixUnix
Unix
 
C Programming Project
C Programming ProjectC Programming Project
C Programming Project
 
Perly Parsing with Regexp::Grammars
Perly Parsing with Regexp::GrammarsPerly Parsing with Regexp::Grammars
Perly Parsing with Regexp::Grammars
 
Php 7 compliance workshop singapore
Php 7 compliance workshop singaporePhp 7 compliance workshop singapore
Php 7 compliance workshop singapore
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011
 
Klee introduction
Klee  introductionKlee  introduction
Klee introduction
 
Clean code and refactoring
Clean code and refactoringClean code and refactoring
Clean code and refactoring
 
Clean code
Clean codeClean code
Clean code
 
Best practices tekx
Best practices tekxBest practices tekx
Best practices tekx
 

Ähnlich wie Hyperledger Code Analysis Reveals Fabric Architecture and Peer Details

Building a Dynamic Rules Engine with Kafka Streams
Building a Dynamic Rules Engine with Kafka StreamsBuilding a Dynamic Rules Engine with Kafka Streams
Building a Dynamic Rules Engine with Kafka StreamsHostedbyConfluent
 
How to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinHow to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinSigma Software
 
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발 [Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발 Yunho Maeng
 
Developing with the Go client for Apache Kafka
Developing with the Go client for Apache KafkaDeveloping with the Go client for Apache Kafka
Developing with the Go client for Apache KafkaJoe Stein
 
Kubecon seattle 2018 workshop slides
Kubecon seattle 2018 workshop slidesKubecon seattle 2018 workshop slides
Kubecon seattle 2018 workshop slidesWeaveworks
 
Grabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the TrunkGrabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the TrunkHarold Giménez
 
Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek PROIDEA
 
Docker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackDocker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackJakub Hajek
 
P4_tutorial.pdf
P4_tutorial.pdfP4_tutorial.pdf
P4_tutorial.pdfPramodhN3
 
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey GordeychikCODE BLUE
 
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...Databricks
 
A microservice architecture based on golang
A microservice architecture based on golangA microservice architecture based on golang
A microservice architecture based on golangGianfranco Reppucci
 
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios
 
Practical C++ Generative Programming
Practical C++ Generative ProgrammingPractical C++ Generative Programming
Practical C++ Generative ProgrammingSchalk Cronjé
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務Mu Chun Wang
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and ArchitectureSidney Chen
 
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022HostedbyConfluent
 
OFI Overview 2019 Webinar
OFI Overview 2019 WebinarOFI Overview 2019 Webinar
OFI Overview 2019 Webinarseanhefty
 

Ähnlich wie Hyperledger Code Analysis Reveals Fabric Architecture and Peer Details (20)

Building a Dynamic Rules Engine with Kafka Streams
Building a Dynamic Rules Engine with Kafka StreamsBuilding a Dynamic Rules Engine with Kafka Streams
Building a Dynamic Rules Engine with Kafka Streams
 
How to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinHow to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita Galkin
 
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발 [Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
 
Developing with the Go client for Apache Kafka
Developing with the Go client for Apache KafkaDeveloping with the Go client for Apache Kafka
Developing with the Go client for Apache Kafka
 
Grails 101
Grails 101Grails 101
Grails 101
 
Kubecon seattle 2018 workshop slides
Kubecon seattle 2018 workshop slidesKubecon seattle 2018 workshop slides
Kubecon seattle 2018 workshop slides
 
Grabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the TrunkGrabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the Trunk
 
Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek
 
Docker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackDocker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic Stack
 
More about PHP
More about PHPMore about PHP
More about PHP
 
P4_tutorial.pdf
P4_tutorial.pdfP4_tutorial.pdf
P4_tutorial.pdf
 
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
 
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...
 
A microservice architecture based on golang
A microservice architecture based on golangA microservice architecture based on golang
A microservice architecture based on golang
 
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
 
Practical C++ Generative Programming
Practical C++ Generative ProgrammingPractical C++ Generative Programming
Practical C++ Generative Programming
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and Architecture
 
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
 
OFI Overview 2019 Webinar
OFI Overview 2019 WebinarOFI Overview 2019 Webinar
OFI Overview 2019 Webinar
 

Mehr von Jongseok Choi

Blockchain trends and research
Blockchain trends and researchBlockchain trends and research
Blockchain trends and researchJongseok Choi
 
Bitcoin and Ethereum
Bitcoin and EthereumBitcoin and Ethereum
Bitcoin and EthereumJongseok Choi
 
oneM2M security summary
oneM2M security summaryoneM2M security summary
oneM2M security summaryJongseok Choi
 
Case Study on Intelligent IoT Platform
Case Study on Intelligent IoT PlatformCase Study on Intelligent IoT Platform
Case Study on Intelligent IoT PlatformJongseok Choi
 
oneM2M Introduction and security
oneM2M Introduction and securityoneM2M Introduction and security
oneM2M Introduction and securityJongseok Choi
 
IoT Introduction and Security
IoT Introduction and SecurityIoT Introduction and Security
IoT Introduction and SecurityJongseok Choi
 
Basic of Exploitation
Basic of ExploitationBasic of Exploitation
Basic of ExploitationJongseok Choi
 
Trend briefs security
Trend briefs securityTrend briefs security
Trend briefs securityJongseok Choi
 
wordpress with nginx on virtualization, jail
wordpress with nginx on virtualization, jailwordpress with nginx on virtualization, jail
wordpress with nginx on virtualization, jailJongseok Choi
 

Mehr von Jongseok Choi (17)

Blockchain trends and research
Blockchain trends and researchBlockchain trends and research
Blockchain trends and research
 
블록체인 개요
블록체인 개요블록체인 개요
블록체인 개요
 
Bitcoin and Ethereum
Bitcoin and EthereumBitcoin and Ethereum
Bitcoin and Ethereum
 
oneM2M security summary
oneM2M security summaryoneM2M security summary
oneM2M security summary
 
Case Study on Intelligent IoT Platform
Case Study on Intelligent IoT PlatformCase Study on Intelligent IoT Platform
Case Study on Intelligent IoT Platform
 
oneM2M Introduction and security
oneM2M Introduction and securityoneM2M Introduction and security
oneM2M Introduction and security
 
IoT Introduction and Security
IoT Introduction and SecurityIoT Introduction and Security
IoT Introduction and Security
 
Gitlab.key
Gitlab.keyGitlab.key
Gitlab.key
 
Usage of GDB
Usage of GDBUsage of GDB
Usage of GDB
 
Basic of Exploitation
Basic of ExploitationBasic of Exploitation
Basic of Exploitation
 
Web penetration
Web penetrationWeb penetration
Web penetration
 
Svn
SvnSvn
Svn
 
Trend briefs security
Trend briefs securityTrend briefs security
Trend briefs security
 
wordpress with nginx on virtualization, jail
wordpress with nginx on virtualization, jailwordpress with nginx on virtualization, jail
wordpress with nginx on virtualization, jail
 
Web hacking 개요
Web hacking 개요Web hacking 개요
Web hacking 개요
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Forensic 2
Forensic 2Forensic 2
Forensic 2
 

Kürzlich hochgeladen

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROmotivationalword821
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 

Kürzlich hochgeladen (20)

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTRO
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 

Hyperledger Code Analysis Reveals Fabric Architecture and Peer Details

  • 1. Hyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code AnalysisHyperledger Code Analysis Jongseok Choi SmartM2M January 9, 2018
  • 2. Outline 1 Hyperledger Introduction Preliminaries Basic Concepts Architecture 2 Code Hierarchy Source Line Analysis 3 Command Composition Fabric Architecture Peer Orderer 4 Peer Details Node 5 Block Implementation 6 Conclusion Summary Future Works 2/37
  • 3. Preliminaries 1. Programming • Go 2. Database • LevelDB • CouchDB 3. RPC • gRPC or thrift • Protobuf 4. Cryptography • X.509 • ECDSA • TLS 5. Infra • Kafka Hyperledger IntroductionIPreliminaries 3/37
  • 4. A Distributed Ledger An append-only system of record or log of transactions. • ]¥x@ ƒ}(promises),pò(trades), ∏ú≠XÒX lpt0| 0]X0 ⌅t⌧ ¨© ⇠ àL. • π $∏Ãl¡–⌧ ¯Ï¡⇠‡, ⌅lò t˘ $∏Ãl– 8Ï` ⇠ àƒ] h. • Ñ∞–•@ ⌘Y ‡∞ xùê ∆î ‰ê⌅ pt0†t§ • ]¥xX ⌧⌧Ù•D µt⌧ ∏ú≠Xt ò¨î Ét Ñ∞ –•D X¯h. Hyperledger IntroductionIBasic Concepts 4/37
  • 5. Blockchain 2.0 Encompasses both distributed ledgers and smart contracts. Hyperledger IntroductionIBasic Concepts 5/37
  • 6. Distributed Ledgers in Action 1. π )– àî ®‡ ¨åt ¥§ ‘∏¨ 8ú⇠»D L, tât|Xî ©]t àî ED ¿‡ à‰. 2. ⌅p XòX Dt à8| Ätt, ‰x ¨å‰@ ®‹ D î‰. 3. ¯¨‡ò⌧, PÖ@ Ÿ‹– ⌧ ‰x Dt à8| Äx‰. 4. Ï0⌧ Ω¡D t⌧ t4 ¨å É@ D ‡, ƒ¨å@ ‰‹ ‹ƒXÏ à8| Äx‰. 5. ®‡ ¨å‰t t˘ ‘∏¨– ŸXXt, ‰L ledger| ¯ ⇠ à‰. 6. t |(X ë≈‰t ¥ê ƒ ‹®X $∏Ãl–⌧ |¥òê– Ñ∞–• Ÿë –¨| ∞ ‰. Hyperledger IntroductionIBasic Concepts 6/37
  • 7. Blockchain Technologies Smart contract • The code or any complex program stored and executed on a blockchain. I Smart contractî Ñ∞ –• 0 ⌅X XòX ƒ5< l1(. I Ñ∞–•@ ‰ê⌅ ı ⌧ pt0†t§| –à D»|, ‰ê⌅ D¿»§ ¡Ñ. Blockchain 6= Cryptocurrency • Cryptocurrency is an application that sits on top of blockchain. Not the other way around. I Blockchain and cryptocurrencies are often discussed in similar contexts, but they are not one in the same. I Distributed ledgers do not require a cryptocurrency to work. Hyperledger IntroductionIBasic Concepts 7/37
  • 8. Business Aspects All over the global market there are ledgers that organizations and individuals alike must trust. • Permissioned blockchains di↵er from what you’ll find in Bitcoin or Ethereum. I ÄÑX ‘0⌅|tà ]¥x Q©–⌧î ‰⌧ ‡∞ ƒ– 0⇠XÏ, ]¥x ‹§–⌧ƒ å 0⇠X 8Ïê| l1Xî ÉD © h. I t˘ $∏Ãl–⌧ p x%D ‰t¿ J‡ƒ T í@ ÙHD 0⇠< pt0| ı h. Hyperledger IntroductionIBasic Concepts 8/37
  • 9. Modular Approach Hyperledger • Hyperledgerî ¡ Ñ|/‹®ò iXL‡¨ò– 0|⌧ ÑX(. Hyperledger IntroductionIArchitecture 9/37
  • 11. Components Platform-agnostic • Language : Go • gRPC over HTTP/2 Peers • xù⌧ <¥ : Consensus L‡¨ò ⇠â • xù⇠¿ J@ <¥ : Consensus L‡¨ò ⇠âX¿ JL Transactions • Deploy new chaincode • Invoke an operation • Read states State • a key-value store Hyperledger IntroductionIArchitecture 11/37
  • 12. Components Membership service • Peer–å xù⌧| ⌧ xù⌧ ÖX 1. Enrollment certificates I E-CAÄ0 ⌧ ⇠p E-Cert|‡ ÄÑ I x‹–å ›ƒê| ÄÏX‡, ∏ú≠XD ›1X0 ⌅ åD ÄÏh 2. Transaction certificates I T-CAÄ0 ⌧ ⇠p T-Cert|‡ ÄÑ I Xòt¡X ∏ú≠XD ⌧ X0 ⌅t ¨© I T-CA| ⌧x x‹î E-Cert@ ¡l| t⌧` ⇠ àL. Pseudonumous transaction authorization • Peer º»ò Œ@ ∏ú≠XD Ÿ| T-Cert ⌧tXî | ⌧¥ Hyperledger IntroductionIArchitecture 12/37
  • 13. Consensus Algorithms Hyperledgerî PBFT| ¨© • Hyperledger Fabric V1.0–⌧ Ä0î Endorser@ Consensus x‹ Ѩ( • X chaincodeî ‰x endorsers| –. • Consensus x‹î ∏ú≠XD ⌧⌧| Ù•t¸î Ì`à ⇠â Hyperledger IntroductionIArchitecture 13/37
  • 16. Directories Name Description bccsp Blockchain Cryptographic Service Provider common core@ ÏÏ ¿ 4–⌧ ¨© ⇠ àî 0¯ 0• core Blockchain uÏ |t Ϩ events t§∏ Pub/Sub 0• gossip Gossip ⌅† gotools Go build ƒl idemix Identity Mixer l⌅ msp Membership Service Provider orderer Ordering ans consensus peer Peer protos GRPC© Protobuf ®L Code HierarchyISource Line Analysis 16/37
  • 17. Source Lines Code HierarchyISource Line Analysis 17/37
  • 19. Peer Commands Peerî 5⌧X î Ö9¥| ¿‡ àL • version : peer build ✏ base image Ñ⌅ • node : peer x‹ ⇠â • chaincode : chaincode x‹ ⇠â • logging : CLIX Log level $ ✏ ¨ • channel : Channel ¨ Peerî Cobra (§¿| t©XÏ Ö9¥ ✏ ò¯ X Command CompositionIPeer 19/37
  • 20. Peer Commands 1 var mainCmd = &cobra.Command{ 2 Use: "peer", 3 PersistentPreRunE: func(cmd *cobra.Command, args []string) error { 4 loggingSpec := viper.GetString("logging.level") 5 flogging.InitFromSpec(loggingSpec) 6 7 return nil 8 }, 9 Run: func(cmd *cobra.Command, args []string) { 10 if versionFlag { 11 fmt.Print(version.GetInfo()) 12 } else { 13 cmd.HelpFunc()(cmd, args) 14 } 15 }, 16 } Code 1: peer/main.go 1 mainCmd.AddCommand(version.Cmd()) 2 mainCmd.AddCommand(node.Cmd()) 3 mainCmd.AddCommand(chaincode.Cmd(nil)) 4 mainCmd.AddCommand(clilogging.Cmd(nil)) 5 mainCmd.AddCommand(channel.Cmd(nil)) Code 2: peer/main.go Command CompositionIPeer 20/37
  • 21. Peer-Node Commands 1 func Cmd() *cobra.Command { 2 nodeCmd.AddCommand(startCmd()) 3 nodeCmd.AddCommand(statusCmd()) 4 5 return nodeCmd 6 } Code 3: peer/node/node.go 1 var nodeStartCmd = &cobra.Command{ 2 Use: "start", 3 Short: "Starts the node.", 4 Long: ‘Starts a node that interacts with the network.‘, 5 RunE: func(cmd *cobra.Command, args []string) error { 6 return serve(args) 7 }, 8 } Code 4: peer/node/start.go Command CompositionIPeer 21/37
  • 22. Peer-Chaincode Commands 1 func Cmd(cf *ChaincodeCmdFactory) *cobra.Command { 2 addFlags(chaincodeCmd) 3 4 chaincodeCmd.AddCommand(installCmd(cf)) 5 chaincodeCmd.AddCommand(instantiateCmd(cf)) 6 chaincodeCmd.AddCommand(invokeCmd(cf)) 7 chaincodeCmd.AddCommand(packageCmd(cf, nil)) 8 chaincodeCmd.AddCommand(queryCmd(cf)) 9 chaincodeCmd.AddCommand(signpackageCmd(cf)) 10 chaincodeCmd.AddCommand(upgradeCmd(cf)) 11 chaincodeCmd.AddCommand(listCmd(cf)) 12 13 return chaincodeCmd 14 } Code 5: peer/chaincode/chaincode.go Command CompositionIPeer 22/37
  • 23. Peer-Channel Commands 1 func Cmd(cf *ChannelCmdFactory) *cobra.Command { 2 AddFlags(channelCmd) 3 4 channelCmd.AddCommand(createCmd(cf)) 5 channelCmd.AddCommand(fetchCmd(cf)) 6 channelCmd.AddCommand(joinCmd(cf)) 7 channelCmd.AddCommand(listCmd(cf)) 8 channelCmd.AddCommand(updateCmd(cf)) 9 channelCmd.AddCommand(signconfigtxCmd(cf)) 10 channelCmd.AddCommand(getinfoCmd(cf)) 11 12 return channelCmd 13 } Code 6: peer/channel/channel.go Command CompositionIPeer 23/37
  • 24. Orderer Commands Ordererî kingpin (§¿| t©XÏ Ö9¥@ ò¯ X • kingpin (§¿î cobra (§¿@ Ϩ ¡¡ Condition< Ñ0| h. 1 var ( 2 app = kingpin.New("orderer", "Hyperledger Fabric orderer node") 3 4 start = app.Command("start", "Start the orderer node"). Default() 5 version = app.Command("version", "Show version information ") 6 ) Code 7: orderer/common/server/main.go Command CompositionIOrderer 24/37
  • 25. Orderer-start Commands 1 case start.FullCommand(): 2 logger.Infof("Starting %s", metadata.GetVersionInfo()) 3 conf := config.Load() 4 initializeLoggingLevel(conf) 5 initializeProfilingService(conf) 6 grpcServer := initializeGrpcServer(conf) 7 initializeLocalMsp(conf) 8 signer := localmsp.NewSigner() 9 manager := initializeMultiChainManager(conf, signer) 10 server := NewServer(manager, signer) 11 ab.RegisterAtomicBroadcastServer(grpcServer.Server(), server) 12 logger.Info("Beginning to serve requests") 13 grpcServer.Start() Code 8: orderer/common/server/main.go Command CompositionIOrderer 25/37
  • 27. Basic Server Settings 3⌧X GRPC ⌧Ñ| lŸ • Peer server I XΩ$ |¯0 : peer.listenAddress I 0¯ Ï∏ : 7051 • Chaincode server I XΩ$ |¯0 : peer.chaincodeListenAddress I 0¯ Ï∏ : 7052 • Event hub server I XΩ$ |¯0 : peer.events.address I 0¯ Ï∏ : 7053 Peer DetailsINode 27/37
  • 28. Ledger Initialization Ledger 0T–⌧î Ledger| •` pt0†t§| 0T Xî ¸ • LevelDB : Chain/Ledger ID •D ⌅ KV pt0†t§ • CouchDB : Binary| •X0 ⌅ §†¨¿ DB ¨© 1 func NewProvider() (ledger.PeerLedgerProvider, error) { 2 idStore := openIDStore(ledgerconfig.GetLedgerProviderPath()) 3 4 ledgerStoreProvider := ledgerstorage.NewProvider() 5 6 vdbProvider, err := privacyenabledstate.NewCommonStorageDBProvider() 7 if err != nil { 8 return nil, err 9 } 10 11 var historydbProvider historydb.HistoryDBProvider 12 historydbProvider = historyleveldb.NewHistoryDBProvider() 13 14 provider := &Provider{idStore, ledgerStoreProvider, vdbProvider, historydbProvider} 15 provider.recoverUnderConstructionLedger() 16 return provider, nil 17 } Code 9: core/ledger/kbledger/kv ledger provider.go Peer DetailsINode 28/37
  • 29. GRPC Server GRPCServer x0òt§| †t§ ¨© • Interface– Ïh h⇠à 0 • TLS µ‡ ( ✏ CA xù⌧ ( $ D Ïh grpcServerImpl lp¥î Private< ¨©X‡, xÄ–î x0òt§| µt⌧ ¨© • ⌧ÑX XΩ$ ✏ |¯0| Ïh 1 type GRPCServer interface { 2 Address() string 3 Start() error 4 Stop() 5 Server() *grpc.Server 6 Listener() net.Listener 7 ServerCertificate() tls.Certificate 8 TLSEnabled() bool 9 MutualTLSRequired() bool 10 AppendClientRootCAs(clientRoots [][]byte) error 11 RemoveClientRootCAs(clientRoots [][]byte) error 12 SetClientRootCAs(clientRoots [][]byte) error 13 SetServerCertificate(tls.Certificate) 14 } Code 10: core/comm/server.go 1 type grpcServerImpl struct { 2 address string 3 listener net.Listener 4 server *grpc.Server 5 serverCertificate atomic.Value 6 serverKeyPEM []byte 7 serverRootCAs []tls.Certificate 8 lock *sync.Mutex 9 clientRootCAs map[string]*x509.Certificate 10 tlsConfig *tls.Config 11 tlsEnabled bool 12 mutualTLSRequired bool 13 } Code 11: core/comm/server.go Peer DetailsINode 29/37
  • 30. Chaincode Server Chaincodeî GRPC ⌧Ñ| lŸ • GRPC| ⌅t⌧ ¨©⇠î chaincodesî 6⌧ l1(. I core/scc/importsysccs.go T‹ 8p Name Chaincode Package cscc &cscc.PeerConfiger{} core/scc/cscc lscc lscc.NewLifeCycleSysCC core/scc/lscc escc &escc.EndorserOneValidSignature{} core/scc/escc vscc &vscc.ValidatorOneValidSignature{} core/scc/vscc qscc &qscc.LedgerQuerier{} core/chaincode/qscc rscc rscc.NewRscc core/chaincode/rscc Peer DetailsINode 30/37
  • 31. Peer Server Peer ⌧Ñî GRPC ⌧Ñ| lŸ • AtomicBroadcast, Admin, Endorser 3⌧X RPC| ⌧ı • Transaction ò¨î core/endorser/endorser lp¥ 8‡ I ‰» x EndorserServer Ì`D ⇠âh. 1 func CreatePeerServer(listenAddress string, 2 serverConfig comm.ServerConfig) (comm.GRPCServer, error) { 3 4 var err error 5 peerServer, err = comm.NewGRPCServer(listenAddress, serverConfig) 6 abServer := peer.NewAtomicBroadcastServer(timeWindow, mutualTLS) 7 ab.RegisterAtomicBroadcastServer(peerServer.Server(), abServer) 8 pb.RegisterAdminServer(peerServer.Server(), core.NewAdminServer()) 9 serverEndorser := endorser.NewEndorserServer(privDataDist, &endorser.SupportImpl{}) 10 auth := authHandler.ChainFilters(serverEndorser, authFilters...) 11 pb.RegisterEndorserServer(peerServer.Server(), auth) 12 go peerServer.Start() 13 14 return peerServer, nil 15 } Code 12: peer/node/start.go Peer DetailsINode 31/37
  • 32. Event Hub Server Event » î 1⌧X GRPC Protobuf| Ïh • Events 1 grpcServer, err := comm.NewGRPCServerFromListener(lis, serverConfig) 2 if err != nil { 3 logger.Errorf("Failed to return new GRPC server: %s", err) 4 return nil, err 5 } 6 7 ehConfig := &producer.EventsServerConfig{BufferSize: uint(viper.GetInt("peer.events. buffersize")), Timeout: viper.GetDuration("peer.events.timeout"), TimeWindow: viper .GetDuration("peer.events.timewindow")} 8 ehServer := producer.NewEventsServer(ehConfig) 9 pb.RegisterEventsServer(grpcServer.Server(), ehServer) 10 11 go grpcServer.Start() Code 13: peer/node/start.go Peer DetailsINode 32/37
  • 33. Block Structure ¥x›1 • core/peer T‹ 8‡ 1 type Block struct { 2 Header *BlockHeader ‘protobuf:"bytes,1,opt,name=header" json:"header,omitempty"‘ 3 Data *BlockData ‘protobuf:"bytes,2,opt,name=data" json:" data,omitempty"‘ 4 Metadata *BlockMetadata ‘protobuf:"bytes,3,opt,name= metadata" json:"metadata,omitempty"‘ 5 } BlockIImplementation 33/37
  • 34. Block Data 1 type BlockHeader struct { 2 Number uint64 ‘protobuf:"varint,1,opt,name=number" json:" number,omitempty"‘ 3 PreviousHash []byte ‘protobuf:"bytes,2,opt,name= previous_hash,json=previousHash,proto3" json:" previous_hash,omitempty"‘ 4 DataHash []byte ‘protobuf:"bytes,3,opt,name=data_hash,json =dataHash,proto3" json:"data_hash,omitempty"‘ 5 } 1 type BlockData struct { 2 Data [][]byte ‘protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"‘ 3 } 4 5 type BlockMetadata struct { 6 Metadata [][]byte ‘protobuf:"bytes,1,rep,name=metadata, proto3" json:"metadata,omitempty"‘ 7 } BlockIImplementation 34/37
  • 35. Summary ⌅¥ x ⌅†@ GRPC| 0⇠< h. • Hyperledger Ñ ✏ tt| ⌅t⌧î RPC– tt ‰∞ ⌘îh • ⌅¥ x Ñ D `tå X0 ⌅t⌧î Protobuf Ñ ¸ GRPC lp| Ñ Hyperledger| L§∏ ⇣î Ÿ • GRPC| ¨©XÏ Peer– ∏ú≠XD ›1 • GRPCî ⌅¨ Œ@ ∏¥| ¿–X‡ à0 L8–, ®| ✏ Web 8X1t D¸ íL ConclusionISummary 35/37