Blockchain Quick Start Guide
eBook - ePub

Blockchain Quick Start Guide

A beginner's guide to developing enterprise-grade decentralized applications

  1. 222 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Blockchain Quick Start Guide

A beginner's guide to developing enterprise-grade decentralized applications

Book details
Book preview
Table of contents
Citations

About This Book

Learn quick and effective techniques to get up and running with building blockchain including Ethereum and Hyperledger Fabric.

Key Features

  • Understand the key concepts of decentralized applications and consensus algorithms
  • Learn key concepts of Ethereum and Solidity programming
  • Practical guide to get started with build efficient Blockchain applications with Ethereum and Hyperledger

Book Description

Blockchain is a technology that powers the development of decentralized applications.This technology allows the construction of a network with no single control that enables participants to make contributions to and receive benefits from the network directly.

This book will give you a thorough overview of blockchain and explain how a blockchain works.You will begin by going through various blockchain consensus mechanisms and cryptographic hash functions. You will then learn the fundamentals of programming in Solidity ā€“ the defacto language for developing decentralize, applications in Ethereum. After that, you will set up an Ethereum development environment and develop, package, build, and test campaign-decentralized applications.The book also shows you how to set up Hyperledger composer tools, analyze business scenarios, design business models, and write a chain code. Finally, you will get a glimpse of how blockchain is actually used in different real-world domains.

By the end of this guide, you will be comfortable working with basic blockchain frameworks, and develop secure, decentralized applications in a hassle-free manner.

What you will learn

  • Understand how blockchain hashing works
  • Write and test a smart contract using Solidity
  • Develop and test a decentralized application
  • Build and test your application using Hyperledger Fabric
  • Implement business network using Hyperledger Composer
  • Test and interact with business network applications

Who this book is for

The book is for developers, analysts, or anyone looking to learn about Blockchain in a quick and easy manner.

Frequently asked questions

Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Blockchain Quick Start Guide by Xun (Brian) Wu, Weimin Sun in PDF and/or ePUB format, as well as other popular books in Computer Science & Data Processing. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781789802801
Edition
1

Exploring an Enterprise Blockchain Application Using Hyperledger Fabric

the previous chapter, we discussed the Ethereum blockchain. Ethereum is a public blockchain; anyone can read the blockchain data and make legitimate changes. Anyone can write a new block into the chain. Ethereum is fully autonomous and is not controlled by anyone. The smart contract is written in Solidity, as a nearly Turing complete language, that can run on the Ethereum virtual machine (EVM) to execute various transactions. Developers can build and deploy decentralized applications (DApps) using these smart contracts. Ether is a cryptocurrency in Ethereum, and acts as fuel for every operation in Ethereum, including executing smart contracts, DApps, transactions, and so on. However, this is not the only way to build a blockchain.
Blockchains that require an access control layer built into the blockchain nodes to read restricted information on the blockchain can be created. This will limit the number of participants in the network who can transact in the consensus mechanism of the blockchain's network. This kind of blockchain is called a permissioned blockchain.
The differences between public and permissioned blockchains are shown in the following table:
Permissionless
Permissioned
Public
Everyone can read the transaction data.
Everyone can validate a transaction in the block.
  • Speed: Poor
  • Consensus: Proof-of-Work
  • Blockchain: Bitcoin, Ethereum
  • Token: Needed
Everyone can read the transaction data.
Only predefined users can validate a transaction.
  • Speed: Good
  • Consensus: Proof-of-Work
  • Blockchain: Ethereum after Casper
  • Token: Needed
Private
Only predefined users can read transaction data.
Only predefined users can validate a transaction.
  • Speed: Good
  • Consensus: Federated byzantine agreement (FBA)
  • Token: Not needed
Only predefined users can read transaction data.
Only entitled users can validate a transaction.
  • Speed: Good
  • Consensus: Practical Byzantine Fault Tolerance Algorithm (PBFT)
  • Blockchain: Hyperledger Fabric
  • Token: Not needed
Hyperledger Fabric is one such private permissioned blockchains. In this chapter, we will discuss the Hyperledger Fabric blockchain.
Hyperledger Fabric is an open source enterprise blockchain technology. The project was initially contributed by IBM and digital asset. Hyperledger Fabric is one of the blockchain projects hosted by the Linux foundation. The smart contract in Hyperledger Fabric is called chaincode, which defines the business logic for Fabric applications. The modular architecture design enables Fabric to support high degrees of confidentiality, resiliency, flexibility, and scalability. The components in Fabric, such as consensus and membership services, can be plug and play.
In this chapter, we will cover the following topics:
  • Key concepts in Hyperledger Fabric
  • Core component model
  • Setting up a Hyperledger Fabric environment
  • Write a chaincode
  • Configuring Hyperledger Fabric

Key concepts in Hyperledger Fabric

If you want to use Hyperledger Fabric effectively, you have to understand its key concepts. This includes ledger, chaincode, and channel.

Ledger

The ledger is the sequenced, immutable, entire historical record of all state transactions. All the transactions that are performed will be added to the ledger. We can find the entire transaction history for each channel. A fabric blockchain ledger has two types of dataā€”a world state and a blockchain transaction ledger. The world state, which is stored stored in a database, LevelDB, is the default database. The state data is mutable. It has a version number that keeps incrementally updated when the state changes. On the other hand, the ledger data is immutable, and is stored as a file. It records transaction data block information, which contains a sequence of transactions. Each block's header includes a hash of the block's transactions, as shown in the following diagram:

Chaincode

Chaincode is a program (or programs) that runs on top of the Hyperledger Fabric blockchain to implement the business logic of how applications interact with the ledger. It is currently written in Go, Node.js, and eventually will be written in other programming languages, such as Java, that implement a prescribed interface. When a transaction is invoked, it triggers the chaincode that decides what state change should be applied to the ledger. Chaincode is typically considered a smart contract. A state created by chaincode is restricted in scope to that chaincode and can't be accessed directl...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. About Packt
  4. Contributors
  5. Preface
  6. Introduction to Blockchain Technology
  7. Ethereum Fundamentals
  8. Overview of Solidity Programming
  9. Building an Ethereum Blockchain Application
  10. Exploring an Enterprise Blockchain Application Using Hyperledger Fabric
  11. Implementing Business Networks Using Hyperledger Composer
  12. Blockchain Use Cases
  13. Other Books You May Enjoy