Hyperledger Fabric Blockchain Systems Programming using Docker Containers

epl421 systems programming n.w
1 / 24
Embed
Share

"Explore the world of Hyperledger Fabric blockchain systems programming with Docker containers. Understand blockchain fundamentals, Docker deployment, and smart contracts. Dive into public vs. permissioned blockchains and learn about certificate authorities and membership service providers. Enhance your knowledge of decentralized databases and secure interactions in blockchain technology."

  • Blockchain
  • Hyperledger Fabric
  • Docker Containers
  • Smart Contracts
  • Decentralized Databases

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. EPL421: Systems Programming Hyperledger Fabric blockchain Using Docker Containers By: (pmikel01@cs.ucy.ac.cy) (mpapad02@cs.ucy.ac.cy) - (mbofos01@cs.ucy.ac.cy) https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 1

  2. DOCKER Open source project. Simplifies the deployment of applications. Runs on local kernel. Uses containers. Designed to benefit both developers and system administrators. https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 2

  3. WHAT IS BLOCKCHAIN Growing chain of records(blocks). Each block contains transaction data. Each Block contains hash value of previous block. Used to create decentralized database. https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 3

  4. PUBLIC VS PERMISSIONED BLOCKCHAINS PUBLIC Anyone can participate Every participant anonymous No trust Proof of work(PoW) PERMISSIONED Operate amongst a set of known Certain degree of trust Provides a way to secure the interactions https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 4

  5. https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 5

  6. HYPERLEDGER FABRIC Open source framework. Established under the Linux Foundation(2015). Used to create permissioned blockchain network. Native support for smart contracts. Runs over docker containers. https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 6

  7. CERTIFICATE AUTHORITIES(CA) Creates Certificates. Certificates: public & private keys. Public: Held by CA. Private: Known only by user. https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 7

  8. MEMBERSHIP SERVICE PROVIDER Set of folders added to network configuration. Used to validate users and organizations. Validates identities(keys) created by CA. https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 8

  9. SMART CONTRACTS(CHAINCODE) Set of rules and actions allowed in a channel. More than one can be used. Logical base of the network. Implemented in Go, Node.js, or Java. https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 9

  10. TERMINOLOGY Peer Organization Channels Assets Consensus https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 10

  11. REQUIREMENTS Go - sudo apt install golang-go Curl - sudo apt install curl Docker - sudo apt install docker Docker Compose - sudo apt install docker-compose Node.js and NPM - sudo apt install nodejs npm Python - sudo apt install python3 https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 11

  12. USECASE Asset trading network. One Channel. Two organizations using the channel. One peer per organization. One chaincode controls the channel. https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 12

  13. CHAINCODE async InitLedger(ctx); async CreateAsset(ctx, id, color, size, owner, appraisedValue); async ReadAsset(ctx, id); async UpdateAsset(ctx, id, color, size, owner, appraisedValue); async DeleteAsset(ctx, id); async AssetExists(ctx, id); async TransferAsset(ctx, id, newOwner); https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 13

  14. CHAINCODE SAMPLE FUNCTIONS https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 14

  15. NETWORK SETUP ./network.sh up createChannel -c mychannel ca ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 15

  16. TEST APPLICATION - EXPORTS export PATH=${PWD}/../bin:$PATH export FABRIC_CFG_PATH=$PWD/../config/ export CORE_PEER_TLS_ENABLED=true export CORE_PEER_LOCALMSPID="Org1MSP" export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1. example.com/peers/peer0.org1.example.com/tls/ca.crt export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.exa mple.com/users/Admin@org1.example.com/msp export CORE_PEER_ADDRESS=localhost:7051 https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 16

  17. TEST APPLICATION COMMANDS peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -- tls --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/t lscacerts/tlsca.example.com-cert.pem -C mychannel -n basic --peerAddresses localhost:7051 -- tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls /ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls /ca.crt -c '{"function":"InitLedger","Args":[]}' https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 17

  18. TEST APPLICATION COMMANDS peer chaincode query -C mychannel -n basic -c '{"Args":["GetAllAssets"]} peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -- tls --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/t lscacerts/tlsca.example.com-cert.pem -C mychannel -n basic --peerAddresses localhost:7051 -- tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls /ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls /ca.crt -c '{"function":"TransferAsset","Args":["asset6","Christopher"]} peer chaincode query -C mychannel -n basic -c '{"Args":["ReadAsset","asset6"]} 5 https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 18

  19. APP.JS Run with: node app.js https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 19

  20. APP.JS https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 20

  21. DEMO https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 21

  22. CONCLUSION Highly scalable Secure (trustworthy) Decentralized Useful in a wide range of use cases Challenging implementation High rewards https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 22

  23. BIBLIOGRAPHY https://techterms.com/definition/blockchain#:~:text=A%20blockchain%20is%20 a%20digital,and%20have%20many%20other%20applications. https://hyperledger-fabric.readthedocs.io/en/release-2.2/ https://docs.microsoft.com/en-us/dotnet/architecture/microservices/container- docker-introduction/docker-defined https://opensource.com/resources/what-docker https://medium.com/free-code-camp/docker-simplified-96639a35ff36#06d9 https://www.quora.com/What-is-a-ledger-in-cryptocurrency?share=1 https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 23

  24. THANK YOU! ANY QUESTIONS? (pmikel01@cs.ucy.ac.cy) (mpapad02@cs.ucy.ac.cy) - (mbofos01@cs.ucy.ac.cy) https://www.cs.ucy.ac.cy/~dzeina/courses/epl421/ 24

Related


More Related Content