Scilab Tutorial 4
Scilab Tutorial 4
Architecture
By Shruti K
Agenda
Day 1
➢ What is Blockchain
➢ What is Hyperledger
➢ 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
➢ 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
➢ 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
➢ 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
➢ 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
➢ 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
➢ 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
➢ 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
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
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
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
26