Beginning Ethereum Smart Contracts Programming. With Examples in Python, Solidity and JavaScript
Book information
Description
Contents......Page 3 Intro......Page 9 1 Understanding Blockchain......Page 10 Placement of Trusts......Page 11 Trust Issues......Page 12 Example of Decentralization......Page 13 Blockchain As a Distributed Ledger......Page 17 How Blockchain Works......Page 18 Chaining the Blocks......Page 19 Broadcasting Transactions......Page 21 The Mining Process......Page 22 Immutability of Blockchains......Page 25 Blockchain in More Detail......Page 26 Types of Nodes......Page 28 Merkle Tree and Merkle Root......Page 30 Uses of Merkle Tree and the Merkle Root......Page 31 Summary......Page 32 Our Conceptual Blockchain Implementation......Page 33 Obtaining the Nonce......Page 35 Installing Flask......Page 36 Declaring the Class in Python......Page 37 Finding the Nonce......Page 39 Adding Transactions......Page 40 Obtaining the Full Blockchain......Page 41 Performing Mining......Page 42 Adding Transactions......Page 43 Testing Our Blockchain......Page 44 Synchronizing Blockchains......Page 49 Testing the Blockchain with Multiple Nodes......Page 53 Full Listing for the Python Blockchain Implementation......Page 59 Summary......Page 67 3 Connecting to Ethereum Blockchain......Page 68 Installing Geth for macOS......Page 69 Installing Geth for Windows......Page 70 Getting Started with Geth......Page 71 Examining the Data Downloaded......Page 72 Geth JavaScript Console......Page 73 Sync Modes......Page 75 Summary......Page 76 Creating the Private Ethereum Test Network......Page 77 Creating the Genesis Block......Page 78 Creating a Folder for Storing Node Data......Page 79 Initiating a Blockchain Node......Page 80 Creating Accounts......Page 82 Checking the Balance of an Account......Page 83 Starting Another Node......Page 84 Getting Information About the Node......Page 85 Pairing the Nodes......Page 87 Performing Mining......Page 90 Examining a Block......Page 91 Mining on Both Nodes......Page 92 Transferring Ethers Between Nodes......Page 93 Managing Accounts......Page 94 Setting the Coinbase......Page 96 Summary......Page 97 What Is MetaMask?......Page 98 How MetaMask Works Behind the Scene......Page 99 Installing MetaMask......Page 100 Signing in to MetaMask......Page 102 Selecting Ethereum Networks......Page 108 Getting Ethers......Page 109 Creating Additional Accounts......Page 116 Transferring Ethers......Page 118 Recovering Accounts......Page 122 Exporting Accounts......Page 125 Importing Accounts......Page 129 Summary......Page 131 Your First Smart Contract......Page 132 Using the Remix IDE......Page 133 Compiling the Contract......Page 136 Testing the Smart Contract Using the JavaScript VM......Page 138 Getting the ABI and Bytecode of the Contract......Page 141 Loading the Smart Contract onto Geth......Page 144 Testing the Contract......Page 147 Calling the Contract from Another Node......Page 149 Summary......Page 151 Downloading and Installing Ganache......Page 152 Command-Line Interface......Page 153 Graphical User Interface......Page 155 Creating a Smart Contract......Page 158 Deploying the Contract to Ganache......Page 159 Examining Ganache......Page 161 Testing the Contract......Page 164 Connecting MetaMask to Ganache......Page 166 Summary......Page 172 What Is web3.js?......Page 173 Installing web3.js......Page 174 Testing the web3.js Using MetaMask......Page 175 Testing the web3.js Without MetaMask......Page 179 Deploying Contracts Using web3.js......Page 182 Interacting with a Contract Using web3.js......Page 188 Sending Ethers to Smart Contracts......Page 195 Summary......Page 202 What Are Events in Solidity?......Page 203 Adding Events to the ProofOfExistence Contract......Page 204 Deploying the Contract......Page 207 Handling Events Using web3.js......Page 208 Testing the Front End......Page 212 Notarizing the Same Document Twice......Page 217 Sending Incorrect Amount of Ether......Page 219 Summary......Page 223 How the Lottery Game Works......Page 224 Defining the Smart Contract......Page 226 Constructor......Page 227 Betting a Number......Page 228 Drawing the Winning Number and Announcing the Winners......Page 230 Getting the Winning Number......Page 232 Testing the Contract......Page 233 Betting on a Number......Page 234 Viewing the Winning Number......Page 239 Examining the Contract on Etherscan......Page 240 Killing the Contract......Page 242 Adding Events to the Contract......Page 246 Creating the Web Front End......Page 250 Returning Ethers Back to the Owner at the End of the Game......Page 256 Making the Game Run Indefinitely......Page 258 Summary......Page 259 What Are Tokens?......Page 260 Burning Tokens......Page 262 Units Used Internally in Token Contracts......Page 263 ERC20 Token Standard......Page 264 Creating Token Contracts......Page 266 Deploying the Token Contract......Page 275 Adding Tokens to MetaMask......Page 278 Buying Tokens......Page 282 Creating an ICO Page......Page 287 Summary......Page 290 Index......Page 291
Similar books
Go Programming Language For Dummies
2021 · AZW
DuckDB
2024 · EPUB
DuckDB: Up and Running: Fast Data Analytics and Reporting
2025 · PDF
DuckDB: Up and Running
2024 · EPUB
Go programmieren für Dummies
2022 · PDF
Practical .NET 2.0 Networking Projects
2007 · PDF
Beginning Ethereum Smart Contracts Programming: With Examples in Python, Solidity, and JavaScript
EPUB
Beginning Ethereum Smart Contracts Programming: With Examples in Python, Solidity, and JavaScript
2023 · PDF