0% found this document useful (0 votes)
29 views

Scilab Tutorial 4

Uploaded by

Raghu BR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Scilab Tutorial 4

Uploaded by

Raghu BR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Hyperledger Fabric

Architecture

By Shruti K
Agenda
Day 1

➢ What is Blockchain

➢ What is Hyperledger

➢ Introduction to Hyperledger Fabric

➢ Key concepts

Day 2

➢ Transaction Lifecycle

➢ Application Design

➢ Steps/Demo
a. Creating a Fabric Network
b. Deployment of Smart Contract
c. Running the application
2
Agenda
Day 1

➢ What is Blockchain

➢ What is Hyperledger

➢ Introduction to Hyperledger Fabric

➢ Key concepts

Day 2

➢ Transaction Lifecycle

➢ Application Design

➢ Steps/Demo
a. Creating a Fabric Network
b. Deployment of Smart Contract
c. Running the application
3
What is Blockchain
▸ A digital ledger of transactions
▸ Distributed, Immutable

Ref: https://www.euromoney.com/learning/blockchain-explained/what-is-blockchain 4
Agenda
Day 1

➢ What is Blockchain

➢ What is Hyperledger

➢ Introduction to Hyperledger Fabric

➢ Key concepts

Day 2

➢ Transaction Lifecycle

➢ Application Design

➢ Steps/Demo
a. Creating a Fabric Network
b. Deployment of Smart Contract
c. Running the application
5
What is Hyperledger
▸ Open-source community
▸ Develops suite of frameworks, platforms and tools for
enterprise grade blockchain deployments

Ref: https://www.hyperledger.org/about 6
Agenda
Day 1

➢ What is Blockchain

➢ What is Hyperledger

➢ Introduction to Hyperledger Fabric

➢ Key concepts

Day 2

➢ Transaction Lifecycle

➢ Application Design

➢ Steps/Demo
a. Creating a Fabric Network
b. Deployment of Smart Contract
c. Running the application
7
Introduction to Hyperledger Fabric
▸ Open-source, enterprise-grade DLT platform
▸ Permissioned
▸ Privacy and Confidentiality
▸ Modular and configurable
▸ Smart contracts can be written in general purpose
programming languages - Java, Go, Nodejs
▸ Does not require any cryptocurrency
▸ Pluggable consensus protocol
▸ Performance and Scalability

8
Agenda
Day 1

➢ What is Blockchain

➢ What is Hyperledger

➢ Introduction to Hyperledger Fabric

➢ Key concepts

Day 2

➢ Transaction Lifecycle

➢ Application Design

➢ Steps/Demo
a. Creating a Fabric Network
b. Deployment of Smart Contract
c. Running the application
9
Key Concepts
▸ Identity
▹ PKI
▹ MSP

Ref: https://hyperledger-fabric.readthedocs.io/en/release-2.2/identity/identity.html 10
Key Concepts
▸ Peers
▹ Endorsing peers
▹ Committing peers
▸ Ledger
▹ World State
▹ Blockchain
▸ Ordering Service
▸ Channel
▸ Chaincode

Ref: https://hyperledger-fabric.readthedocs.io/en/release-1.4/peers/peers.html 11
Key Concepts
▸ Private Data
▸ Gossip Protocol
▹ Leader peers
▹ Anchor peers

Ref: https://hyperledger-fabric.readthedocs.io/en/release-1.4/peers/peers.html 12
Key Concepts

Ref: https://hyperledger-fabric.readthedocs.io/en/release-2.2/peers/peers.html#peers-and-organizations 13
Agenda
Day 1

➢ What is Blockchain

➢ What is Hyperledger

➢ Introduction to Hyperledger Fabric

➢ Key concepts

Day 2

➢ Transaction Lifecycle

➢ Application Design

➢ Steps/Demo
a. Creating a Fabric Network
b. Deployment of Smart Contract
c. Running the application
14
Transaction Lifecycle

15
Agenda
Day 1

➢ What is Blockchain

➢ What is Hyperledger

➢ Introduction to Hyperledger Fabric

➢ Key concepts

Day 2

➢ Transaction Lifecycle

➢ Application Design

➢ Steps/Demo
a. Creating a Fabric Network
b. Deployment of Smart Contract
c. Running the application
16
Application Design
▸ An application interacts with a blockchain network using
Fabric SDK.
▸ An application follows 6 basic steps to submit a transaction -
▹ Select an identity from a wallet
▹ Connect to a gateway
▹ Access the desired network
▹ Construct a transaction request for a smart contract
▹ Submit the transaction to the network
▹ Process the response

17
Application Design

18
Agenda
Day 1

➢ What is Blockchain

➢ What is Hyperledger

➢ Introduction to Hyperledger Fabric

➢ Key concepts

Day 2

➢ Transaction Lifecycle

➢ Application Design

➢ Steps/Demo
a. Creating a Fabric Network
b. Deployment of Smart Contract
c. Running the application
19
Demo - Asset Transfer

20
Create the blockchain network
▸ Understand the configurations -
▹ configtx.yaml
▹ connection-profile
▸ Generate the crypto material for organizations
▸ Generate the configuration artifacts
▸ Use the above generated artifacts to run the consortium
network
▸ Create the channel
▸ Join the peers to the channel
▸ Set the anchor peers for the Orgs

21
Write the Smart Contract
▸ Define the Asset Transfer chaincode

▸ Define transactions for -


▹ Creating asset
▹ Reading asset
▹ Updating asset
▹ Deleting asset
▹ Transferring asset

▸ Write init logic to add few assets to the


ledger

22
Deploy the Smart Contract
▸ Package the smart contract
▹ peer lifecycle chaincode package basic.tar.gz --path
../asset-transfer-basic/chaincode-javascript/ --lang node --label basic_1.0

▸ Each org should install the contract


▹ peer lifecycle chaincode install basic.tar.gz

▸ Each org should approve the contract


▹ peer lifecycle chaincode approveformyorg -o localhost:7050
--ordererTLSHostnameOverride orderer.example.com --channelID mychannel --name basic
--version 1.0 --package-id $CC_PACKAGE_ID --sequence 1 --tls --cafile
${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp
/tlscacerts/tlsca.example.com-cert.pem

23
Deploy the Smart Contract
▸ Check the commit readiness of the contract
▹ peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic
--version 1.0 --sequence 1 --tls --cafile
${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp
/tlscacerts/tlsca.example.com-cert.pem --output json

▸ Commit the smart contract to the ledger


▹ peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride
orderer.example.com --channelID mychannel --name basic --version 1.0 --sequence 1
--tls --cafile
${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp
/tlscacerts/tlsca.example.com-cert.pem --peerAddresses localhost:7051
--tlsRootCertFiles
${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/t
ls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles
${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/t
ls/ca.crt

24
Running the application
▸ Enroll the admin user
▸ Register and enroll the org user
▸ Import the credentials in a wallet
▸ Prepare a connection to the channel and smart contract
▸ Initialize ledger with some assets
▸ Invoke the chaincode functions

25
Thanks!
You can connect with me on

[email protected]

26

You might also like