Mais conteúdo relacionado
Semelhante a blockchain workshop - hyperledger and oabcs - technical (20)
Mais de Juarez Junior (20)
blockchain workshop - hyperledger and oabcs - technical
- 2. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Hyperledger Fabric
and the Oracle
Autonomous
Blockchain Cloud
Service
October 2018
Juarez Barbosa Junior
Principal Developer Advocate
@juarezjunior
- 3. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
- 4. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Why Hyperledger Fabric?
• Fabric project – open-source platform for distributed ledger solutions that is intended
as a foundation for developing blockchain solutions
– Provides a permissioned blockchain model with membership services
– No cryptocurrency required!
– Offers a modular architecture allowing components, such as consensus and membership services,
to be plug-and-play
– Programmable – leverages containers to host smart contracts for automating business processes
– Focuses on a scalable implementation with confidentiality/privacy provisions
– Enables pluggable data store, consensus protocols, and multiple providers of membership services
• Open-governed community for enterprise blockchain hosted by The Linux Foundation
– Governance model broadly accepted within industry
4
Permissioned, Enterprise, Autonomous, B2B
- 5. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
What is Hyperledger Fabric?
• Fabric – open-source platform for distributed ledger solutions that is
intended as a foundation for developing blockchain solutions
– Provides a permissioned blockchain model with membership
services
– Designed with modular architecture allowing components, such as
consensus and membership services, to be plug-and-play
– Programmable – leverages containers to host smart contracts for
automating business processes
– Focuses on a scalable implementation by separating smart contract
execution from block creation
– Provides private channels for conducting confidential/private
transactions with invited members
– Enables pluggable data store, consensus protocols, and multiple
providers of membership services
– No cryptocurrency required!
Permissioned, Enterprise, Autonomous, B2B
- 6. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Why Oracle Picked Hyperledger Fabric as Starting Point?
• Open-governed community for enterprise blockchain hosted by The Linux Foundation
– Governance model broadly accepted within industry
– Oracle as a member has a voice in decisions and participates in technical committees
• Fabric project – open-source platform for distributed ledger solutions that is intended
as a foundation for developing blockchain solutions
– Other projects as part of Hyperledger Foundation ecosystem (Indy, Iroha, Sawtooth)
Linux Foundation
- 7. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Architecture
Hyperledger Fabric
7
- 8. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
IDENTITY
Pluggable, Membership,
Privacy and Auditability of
transactions.
LEDGER | TRANSACTIONS
Distributed transactional
ledger whose state is updated
by consensus of stakeholders
SMART-CONTRACT
“Programmable Ledger”,
provide ability to run business
logic against the blockchain
(aka smart contract)
APIs, Events, SDKs
Multi-language native SDKs
allow developers to write DLT
apps
8
Hyperledger Fabric Reference Architecture
Distributed Ledger Technology Services
APIs, Events, SDKs
SMART CONTRACT
Chain-code
Services
AP
Membership
Services
Enrollment
Attributes
Consensus Services
Distributed
Ledger
Ordering Service
Network
Protocol
Endorsement
Validation
Secure
Container
Secure
Registry
TRANSACTIONSLEDGERIDENTITY
Security and Crypto Services
- 9. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Components of a HyperLedger Fabric Blockchain
9
Peers
Maintain the state of the
network and a copy of the
ledger
• Endorsers: simulate and endorse
transactions
• Committers: verify endorsements
and validate transaction results, prior to
commiting transactions to the blockchain.
- 10. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Components of a HyperLedger Fabric Blockchain
10
Peers
Ledger
(World State)
A shared, permissioned ledger that is an
append-only system of records and serves
as a single source of truth.
• Chain: transaction log. structured as hash-linked blocks,
where each block contains a sequence of N transactions. The
block header includes a hash of the block’s transactions, as
well as a hash of the prior block’s header.
• State DB: ‘World State’ is modeled as a versioned
key/value store (KVS). It reflects the current data about all the
assets in the network. This data is stored in a database for
efficient access. (LevelDB and/or CouchDB).
✓ Keys are simple names or composite, i.e., constructed
keys.
✓ Values are arbitrary blobs, JSON often used.
• History DB: Maintains a history of the values of a key
Currently in Fabric just a pointer into ledger.
- 11. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Components of a HyperLedger Fabric Blockchain
11
Peers
Smart Contracts
Ledger
(World State)
Business Logic to execute a
transaction. A Transaction could
be either CRUD. assets. Written
in:
• Go
• NodeJS
• Java
- 12. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Components of a HyperLedger Fabric Blockchain
12
Peers
Consensus
Smart Contracts
Ledger
(World State)
The process of reaching agreement on
the next set of transactions to be
added to the ledger:
• Transaction endorsement
• Ordering
• Validation and commitment
- 13. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Components of a HyperLedger Fabric Blockchain
13
Peers
Consensus
Smart Contracts
Ledger
(World State)
Membership
Service
Controls enrollment of network
members (organizations) and provides
related cryptographic services.
Implements a CA architecture with
Root CA and intermediate CAs
– Enrollment (ECerts).
– TLS (TCerts).
- 14. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Components of a HyperLedger Fabric Blockchain
14
Peers
Consensus
Smart Contracts
Ledger
(World State)
Applications
(D-apps)
Membership
Service
Clients are applications that act
on behalf of a person to propose
transactions on the network:
• Java SDK
• NodeJS SDK
• Go SDK
- 15. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 16
Propose Transaction
- 16. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 17
Execute Proposal
- 17. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Key Value RW Set Version
Tamer 500 V2
Loic 400 V5
Transfer 100 from Tamer to Loic:
• Read Tamer Balance.
• Read Loic Balance.
• Deduct 100 From Tamer Balance.
• Add 100 to Loic Balance.
18
RW Set Simulation
Read Set:
• Tamer, V2
• Loic, V5
Write Set:
• Tamer, 400
• Loic, 500
Note: Only RW Set is calculated, but no changes are reflected on ledger/world state DB.
Ledger
400
500
- 18. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 19
Execute Proposal
- 19. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 20
Proposal Response
- 20. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 21
Order Transaction
- 21. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 22
Deliver Transaction
- 22. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 23
Validate Transaction
- 23. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Key Value RW Set Version
Tamer 500 V2
Loic 400 V5
Validate
Current Ledger Asset
Version = Read Set Asset
Version
Commit
• Reflect Assets Values
from Write Set to Ledger
• Update versions
24
Validate & Commit
Read Set:
• Tamer, V2
• Loic, V5
Write Set:
• Tamer, 400
• Loic, 500
400
500
Benefits
• Detect Phantom Writes.
• Eliminate Double Spending.
V3
V6
Ledger
- 24. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 25
Notify Transaction
- 25. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Emerging Technologies: Blockchain
Juarez Barbosa Junior
Principal Developer Advocate, Oracle EMEA
juarez.barbosa@oracle.com
https://www.linkedin.com/in/jujunior/
October 2018
- 26. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Transaction Flow
Client Application
Fabric SDK
Keys
Membership Service
Peers
Endorser
Simulates TX
World
State
Committer
Applies changes
Ordering Service
Certificate
Authority
Federated
Identity
4.0 - Deliver TX Batch
Validate Signatures
and Authorization
Membership
Services container
Peer container
Orderer container
Orders TXs into
batches
according to
consensus
Container
Legend
Customer Code
3.0 - Submit Endorsed TX
Includes RWset and endorser
signatures
Ledger
5.0 – Writes ledger block
5.1 - Updates State
6.0 – Commit Notification
Fabric Code
Smart contract container
Smart Contract
(Chaincode)
- 28. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
What about Oracle Blockchain?
29
- 29. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Oracle Autonomous Blockchain Cloud Service ‘OABCS’
30
Validating Nodes /
Peers
Ordering Service
Smart Contract/
Chaincode
Ledger
(World State)
Applications
REST Proxy
Membership
Service
Admin Console
REST
Proxy
Users and
ApplicationsUsers and
ApplicationsApplications
(SDK based)
Users and
ApplicationsUsers and
ApplicationsApplications
(REST API)
Managed PaaS
Peer Node
Smart
Contract
Ordering Service
Distributed
Ledger
Membership
Service
Blockchain
Network
Console
Smart
Contract
Peer Node
Gateway
- 30. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Ledger
X
• Collaborative network of organizations
using a common blockchain
– Oracle cloud or heterogeneous nodes
• Create a new network or add to an
existing network
• Ensure privacy by creating channels with
distinct policies and data access
spanning multiple orgs
BCS Interactions – Creating Business Network
BCS A BCS B BCS C
Org
A
Org
B
Org
C
P P P P P P P
P P P P
Consortium: X (A+B+C); Channel: CH1
Consortium: Y (A+C+D); Channel: CH2
P PLedger
Y
O
O
O O
O O
HLF D
Org
D
P P
P
Oracle Public Cloud
On Premises
- 31. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Oracle Blockchain Service Architecture
32
Industrialized Blockchain cloud platform for enterprise
Infrastructure and PaaS Services
Application Container CS (Managed Docker Containers), Identity CS (identity and key mgmt),
Event Hub CS (Kafka service), Management Service
Blockchain Nodes & Containers
Peer Nodes, Smart Contract Containers,
Membership Services, Ordering Service, REST Proxy
REST APIs
for Integrations
Data Services
Object Store CS
Administration
Dynamic Configuration,
Monitoring and Troubleshooting
Pre-assembled Managed service Production-ready Public or private cloud
On Premises
PaaS
SaaS
Public Cloud/BMCS
IaaS, SaaS, PaaS
REST
gRPCREST
gRPC
- 32. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Oracle Cloud PaaS/IaaS Integrated in OABCS
33
REST
Proxy
Peer Node
Smart
Contract
Ordering Service
Distributed
Ledger
Membership
Service
Blockchain
Network
Console
Smart
Contract
Peer Node
Gateway
Identity Mgmt. CS
Event Hub CS
(Kafka)
Object
Store CS
Mgmt & Log
Analysis CS
Application
Container CS
• User/role management
• Authentication for BCS
Console, REST Proxy, CAFault-tolerant cluster-
based ordering
• Continuous
configuration backup
and dynamic update
• Continuous ledger
blocks archiving
Elastic scaling, load
balancing, autonomous
health monitoring and
recovery
Oracle management,
monitoring, and
recovery
- 33. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
OABCS Deployment Architecture
34
Service Instance
Smart Contract
Containers
(created by Peers)
Go
Smart ContractGo
Smart ContractGo
Smart Contract
Go
Smart ContractGo
Smart ContractJava
Smart Contract
Go
Smart ContractGo
Smart Contract
Client
Fabric SDK
Keys
Application Developers Smart Contract
Developer
IDCS
Event
Hub
Persistent
Storage
OABCS Console
Ops UI
OPC Services
OABCS
Console
HTTP/SHTTP/S
LBCS
Peer Container
Endorser
Simulates TX
Ledger
(LevelDB)
Committer
Applies
changes
Peer Container
Endorser
Simulates TXs
Ledger
Committer
Applies changes
Orderer
Membership
REST
Kafka APIs
Service Container
Customer
Application
Fabric-based
OPC Service
OABCS Code
Legend
Customer
Chaincode
NodeJS
Smart Contract