وبلاگ بلیان

Beginning Ethereum Smart Contracts Programming : With Examples in Python, Solidity, and JavaScript

معرفی کتاب «Beginning Ethereum Smart Contracts Programming : With Examples in Python, Solidity, and JavaScript» نوشتهٔ Wei-Meng Lee، منتشرشده توسط نشر Apress : Imprint: Apress در سال 2019. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Beginning Ethereum Smart Contracts Programming : With Examples in Python, Solidity, and JavaScript» در دستهٔ بدون دسته‌بندی قرار دارد.

Use this book to write an Ethereum Blockchain Smart Contract, test it, deploy it, and create a web application to interact with your smart contract.**__Beginning Ethereum Smart Contracts Programming__** is your fastest and most efficient means of getting started if you are unsure where to begin and how to connect to the Ethereum Blockchain. The book begins with a foundational discussion of blockchain and the motivation behind it. From there, you will get up close and personal with the Ethereum Blockchain, learning how to use an Ethereum client (geth) to connect to the Ethereum Blockchain to perform transactions such as sending Ethers to another account. You will learn about smart contracts without having to wade through tons of documentation. Author Lee’s “learn-by-doing” approach will allow you to be productive and feel confident in your ability in no time. The last part of this book covers tokens, a topic that has taken the cryptocurrency market by storm.Sample code in Python, Solidity, and JavaScript is provided in the book and online.**What You'll Learn** * Understand the basic premise of blockchain and “record keeping” in a peer-to-peer network * Experience blockchain in action by creating your own blockchain using Python * Know the foundation of smart contracts programming and how to deploy and test smart contracts * Work on a case study to illustrate the use of blockchain * Be familiar with tokens, and how to create and launch your own ICO digital token * Write smart contracts that transact using tokens **Who This Book Is For**Those who want to get started quickly with Ethereum Smart Contracts programming. Basic programming knowledge and an understanding of Python or JavaScript is recommended. Table of Contents 5 About the Author 11 About the Technical Reviewer 12 Acknowledgments 13 Introduction 14 Chapter 1: Understanding Blockchain 15 Motivations Behind Blockchain 16 Placement of Trusts 16 Trust Issues 17 Solving Trust Issues Using Decentralization 18 Example of Decentralization 18 Blockchain As a Distributed Ledger 22 How Blockchain Works 23 Chaining the Blocks 24 Mining 26 Broadcasting Transactions 26 The Mining Process 27 Proof of Work 30 Immutability of Blockchains 30 Blockchain in More Detail 31 Types of Nodes 33 Merkle Tree and Merkle Root 35 Uses of Merkle Tree and the Merkle Root 36 Summary 37 Chapter 2: Implementing Your Own Blockchain Using Python 38 Our Conceptual Blockchain Implementation 38 Obtaining the Nonce 40 Installing Flask 41 Importing the Various Modules and Libraries 42 Declaring the Class in Python 42 Finding the Nonce 44 Appending the Block to the Blockchain 45 Adding Transactions 45 Exposing the Blockchain Class as a REST API 46 Obtaining the Full Blockchain 46 Performing Mining 47 Adding Transactions 48 Testing Our Blockchain 49 Synchronizing Blockchains 54 Testing the Blockchain with Multiple Nodes 58 Full Listing for the Python Blockchain Implementation 64 Summary 72 Chapter 3: Connecting to the Ethereum Blockchain 73 Downloading and Installing Geth 74 Installing Geth for macOS 74 Installing Geth for Windows 75 Installing Geth for Linux 76 Getting Started with Geth 76 Examining the Data Downloaded 77 Geth JavaScript Console 78 Sync Modes 80 Summary 81 Chapter 4: Creating Your Own Private Ethereum Test Network 82 Creating the Private Ethereum Test Network 82 Creating the Genesis Block 83 Creating a Folder for Storing Node Data 84 Initiating a Blockchain Node 85 Starting Up the Nodes 87 Creating Accounts 87 Checking the Balance of an Account 88 Stopping the Node 89 Starting Another Node 89 Getting Information About the Node 90 Pairing the Nodes 92 Performing Mining 95 Examining a Block 96 Mining on Both Nodes 97 Transferring Ethers Between Nodes 98 Managing Accounts 99 Removing Accounts 101 Setting the Coinbase 101 Summary 102 Chapter 5: Using the MetaMask Chrome Extension 103 What Is MetaMask? 103 How MetaMask Works Behind the Scene 104 Installing MetaMask 105 Signing in to MetaMask 107 Selecting Ethereum Networks 113 Getting Ethers 114 Creating Additional Accounts 121 Transferring Ethers 123 Recovering Accounts 127 Importing and Exporting Accounts 130 Exporting Accounts 130 Importing Accounts 134 Summary 136 Chapter 6: Getting Started with Smart Contract 137 Your First Smart Contract 137 Using the Remix IDE 138 Compiling the Contract 141 Testing the Smart Contract Using the JavaScript VM 143 Getting the ABI and Bytecode of the Contract 146 Loading the Smart Contract onto Geth 149 Testing the Contract 152 Calling the Contract from Another Node 154 Summary 156 Chapter 7: Testing Smart Contracts Using Ganache 157 Downloading and Installing Ganache 157 Command-Line Interface 158 Graphical User Interface 160 Creating a Smart Contract 163 Deploying the Contract to Ganache 164 Examining Ganache 166 Testing the Contract 169 Connecting MetaMask to Ganache 171 Summary 177 Chapter 8: Using the web3.js APIs 178 What Is web3.js? 178 Installing web3.js 179 Testing the web3.js Using MetaMask 180 Testing the web3.js Without MetaMask 184 Deploying Contracts Using web3.js 187 Interacting with a Contract Using web3.js 193 Sending Ethers to Smart Contracts 200 Summary 207 Chapter 9: Smart Contract Events 208 What Are Events in Solidity? 208 Adding Events to the ProofOfExistence Contract 209 Deploying the Contract 212 Handling Events Using web3.js 213 Testing the Front End 217 Notarizing the Same Document Twice 222 Sending Incorrect Amount of Ether 224 Summary 228 Chapter 10: Project – Online Lottery 229 How the Lottery Game Works 229 Defining the Smart Contract 231 Constructor 232 Betting a Number 233 Drawing the Winning Number and Announcing the Winners 235 Getting the Winning Number 237 Killing the Contract 238 Testing the Contract 238 Betting on a Number 239 Viewing the Winning Number 244 Examining the Contract on Etherscan 245 Killing the Contract 247 Adding Events to the Contract 251 Creating the Web Front End 255 Returning Ethers Back to the Owner at the End of the Game 261 Making the Game Run Indefinitely 263 Summary 264 Chapter 11: Creating Your Tokens 265 What Are Tokens? 265 How Tokens Are Implemented? 267 Minting New Tokens 267 Burning Tokens 267 Units Used Internally in Token Contracts 268 ERC20 Token Standard 269 Creating Token Contracts 271 Deploying the Token Contract 280 Adding Tokens to MetaMask 283 Buying Tokens 287 Creating an ICO Page 292 Summary 295 Index 296 Use this book to write an Ethereum Blockchain Smart Contract, test it, deploy it, and create a web application to interact with your smart contract. Beginning Ethereum Smart Contracts Programming is your fastest and most efficient means of getting started if you are unsure where to begin and how to connect to the Ethereum Blockchain. The book begins with a foundational discussion of blockchain and the motivation behind it. From there, you will get up close and personal with the Ethereum Blockchain, learning how to use an Ethereum client (geth) to connect to the Ethereum Blockchain to perform transactions such as sending Ethers to another account. You will learn about smart contracts without having to wade through tons of documentation. Author Lees "learn-by-doing" approach will allow you to be productive and feel confident in your ability in no time. The last part of this book covers tokens, a topic that has taken the cryptocurrency market by storm. Sample code in Python, Solidity, and JavaScript is provided in the book and online. What You'll Learn: Understand the basic premise of blockchain and "record keeping" in a peer-to-peer network Experience blockchain in action by creating your own blockchain using Python Know the foundation of smart contracts programming and how to deploy and test smart contracts Work on a case study to illustrate the use of blockchain Be familiar with tokens, and how to create and launch your own ICO digital token Write smart contracts that transact using tokens This book is for those who want to get started quickly with Ethereum Smart Contracts programming. Basic programming knowledge and an understanding of Python or JavaScript is recommended. Wei-Meng Lee is the founder of Developer Learning Solutions, a technology company specializing in hands-on training of blockchain and other emerging technologies. He has many years of training expertise and his courses emphasize a learn-by-doing approach. He is a master at making learni ng a new programming language or technology less intimidating and fun. He can be found speaking at conferences worldwide and he regularly contributes to online and print publications. He is active on social media on his blog learn2develop.net, on Facebook at DeveloperLearningSolutions, on Twitter @weimenglee, and on LinkedIn at leeweimeng Use this book to write an Ethereum Blockchain Smart Contract, test it, deploy it, and create a web application to interact with your smart contract. Beginning Ethereum Smart Contracts Programming is your fastest and most efficient means of getting started if you are unsure where to begin and how to connect to the Ethereum Blockchain. The book begins with a foundational discussion of blockchain and the motivation behind it. From there, you will get up close and personal with the Ethereum Blockchain, learning how to use an Ethereum client (geth) to connect to the Ethereum Blockchain to perform transactions such as sending Ethers to another account. You will learn about smart contracts without having to wade through tons of documentation. Author Lee’s “learn-by-doing” approach will allow you to be productive and feel confident in your ability in no time. The last part of this book covers tokens, a topic that has taken the cryptocurrency market by storm. Sample code in Python, Solidity, and JavaScript is provided in the book and online. What You'll Learn Understand the basic premise of blockchain and “record keeping” in a peer-to-peer network Experience blockchain in action by creating your own blockchain using Python Know the foundation of smart contracts programming and how to deploy and test smart contracts Work on a case study to illustrate the use of blockchain Be familiar with tokens, and how to create and launch your own ICO digital token Write smart contracts that transact using tokens Who This Book Is For Those who want to get started quickly with Ethereum Smart Contracts programming. Basic programming knowledge and an understanding of Python or JavaScript is recommended. Front Matter ....Pages i-xvii Understanding Blockchain (Wei-Meng Lee)....Pages 1-23 Implementing Your Own Blockchain Using Python (Wei-Meng Lee)....Pages 25-59 Connecting to the Ethereum Blockchain (Wei-Meng Lee)....Pages 61-69 Creating Your Own Private Ethereum Test Network (Wei-Meng Lee)....Pages 71-91 Using the MetaMask Chrome Extension (Wei-Meng Lee)....Pages 93-126 Getting Started with Smart Contract (Wei-Meng Lee)....Pages 127-146 Testing Smart Contracts Using Ganache (Wei-Meng Lee)....Pages 147-167 Using the web3.js APIs (Wei-Meng Lee)....Pages 169-198 Smart Contract Events (Wei-Meng Lee)....Pages 199-219 Project – Online Lottery (Wei-Meng Lee)....Pages 221-256 Creating Your Tokens (Wei-Meng Lee)....Pages 257-287 Back Matter ....Pages 289-293
دانلود کتاب Beginning Ethereum Smart Contracts Programming : With Examples in Python, Solidity, and JavaScript