Ethereum Blockchain Developer - The Bootcamp
By Thomas Wiesner and Colleen Wtorek
5/5
()
About this ebook
In this book, you will not only learn the basics, but also proper Solidity development and Ethereum Smart Contract best practices. Instead of in-depth technical theory, you will learn these skills as we walk you through completing a project. In easy-to-understand chapters, you will learn everything you need to know about the Ethereum blockchain and Smart Contract Development. We will walk you through how to create, test, and troubleshoot Smart Contracts; and then deploy these contracts to various networks. Additionally you will learn how to use the Smart Contracts in various scenarios and environments.
Related to Ethereum Blockchain Developer - The Bootcamp
Related ebooks
Solidity Smart Contracts: Build DApps In The Ethereum Blockchain Rating: 4 out of 5 stars4/5Building Blockchain Projects Rating: 2 out of 5 stars2/5Smart Contract Development with Solidity and Ethereum: Building Smart Contracts with the Azure Blockchain Rating: 0 out of 5 stars0 ratingsQuick Guide for Smart Contracts Creation and Deployment on Ethereum Blockchain Rating: 0 out of 5 stars0 ratingsHow to Not Get Rekt Trading Crypto Rating: 5 out of 5 stars5/5Creation and Deployment of Smart Contracts on Ethereum Blockchain Rating: 0 out of 5 stars0 ratingsBuilding Decentralized Blockchain Applications: Learn How to Use Blockchain as the Foundation for Next-Gen Apps (English Edition) Rating: 0 out of 5 stars0 ratingsEthereum Blockchain Revolution Explained: Understanding Ethereum Technology For Beginners Rating: 0 out of 5 stars0 ratingsHyperledger Fabric In-Depth: Learn, Build and Deploy Blockchain Applications Using Hyperledger Fabric Rating: 0 out of 5 stars0 ratingsMastering Blockchain Rating: 5 out of 5 stars5/5Blockchain: A Practical Guide to Developing Business, Law, and Technology Solutions Rating: 5 out of 5 stars5/5Building Ethereum Dapps: Decentralized applications on the Ethereum blockchain Rating: 5 out of 5 stars5/5The Solidity Programmer's Handbook Rating: 0 out of 5 stars0 ratingsSolidity A Complete Guide Rating: 0 out of 5 stars0 ratingsThe Business Blockchain: Promise, Practice, and Application of the Next Internet Technology Rating: 4 out of 5 stars4/5Blockchain: Real-World Applications And Understanding Rating: 4 out of 5 stars4/5Blockchain: Step By Step Guide To Understanding The Blockchain Revolution And The Technology Behind It Rating: 5 out of 5 stars5/5Token Economy: How the Web3 reinvents the Internet Rating: 4 out of 5 stars4/5Economy Monitor Guide to Smart Contracts: Blockchain Examples Rating: 0 out of 5 stars0 ratingsMastering Ethereum And Blockchain - A Beginner's Guide To Start Making Money With Ethereum And Blockchain Rating: 3 out of 5 stars3/5Ethereum: A New World of Possibilities Rating: 5 out of 5 stars5/5Blockchain: An Illustrated Guidebook to Understanding Blockchain Rating: 4 out of 5 stars4/5Blockchain: The complete guide to understanding Blockchain Technology for beginners in record time Rating: 4 out of 5 stars4/5Crypto Market Cap Rating: 4 out of 5 stars4/5Blockchain Unlocked: Business Transformation with Blockchain Technology Rating: 0 out of 5 stars0 ratingsBlockchain: A Guide to Understanding Blockchain Rating: 0 out of 5 stars0 ratingsBlockchain Revolution: Understanding The Internet Of Money Rating: 3 out of 5 stars3/5
Computers For You
Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 5 out of 5 stars5/5101 Awesome Builds: Minecraft® Secrets from the World's Greatest Crafters Rating: 4 out of 5 stars4/5The Mega Box: The Ultimate Guide to the Best Free Resources on the Internet Rating: 4 out of 5 stars4/5Procreate for Beginners: Introduction to Procreate for Drawing and Illustrating on the iPad Rating: 0 out of 5 stars0 ratingsLearning the Chess Openings Rating: 5 out of 5 stars5/5Deep Search: How to Explore the Internet More Effectively Rating: 5 out of 5 stars5/5Quantum Computing For Dummies Rating: 0 out of 5 stars0 ratingsSQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5CompTIA Security+ Get Certified Get Ahead: SY0-701 Study Guide Rating: 5 out of 5 stars5/5Storytelling with Data: Let's Practice! Rating: 4 out of 5 stars4/5The ChatGPT Millionaire Handbook: Make Money Online With the Power of AI Technology Rating: 0 out of 5 stars0 ratingsAWS Certified Cloud Practitioner All-in-One Exam Guide (Exam CLF-C01) Rating: 5 out of 5 stars5/5Artificial Intelligence: The Complete Beginner’s Guide to the Future of A.I. Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Ultimate Guide to Mastering Command Blocks!: Minecraft Keys to Unlocking Secret Commands Rating: 5 out of 5 stars5/5Elon Musk Rating: 4 out of 5 stars4/5CompTIA IT Fundamentals (ITF+) Study Guide: Exam FC0-U61 Rating: 0 out of 5 stars0 ratingsTor and the Dark Art of Anonymity Rating: 5 out of 5 stars5/5Practical Lock Picking: A Physical Penetration Tester's Training Guide Rating: 5 out of 5 stars5/5CompTIA Security+ Practice Questions Rating: 2 out of 5 stars2/5The Professional Voiceover Handbook: Voiceover training, #1 Rating: 5 out of 5 stars5/5AP® Computer Science Principles Crash Course Rating: 0 out of 5 stars0 ratingsEverybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are Rating: 4 out of 5 stars4/5
Reviews for Ethereum Blockchain Developer - The Bootcamp
2 ratings0 reviews
Book preview
Ethereum Blockchain Developer - The Bootcamp - Thomas Wiesner
Book Overview
In this book, you will not only learn the basics, but also proper Solidity development and Ethereum Smart Contract development workflows. Instead of in-depth technical theory, you will learn these skills as we walk you through completing a project. In easy-to-understand how-to
-style chapters, you will learn everything you need to know about the Ethereum blockchain and Smart Contract Development. We will walk you through how to create, test, and troubleshoot Smart Contracts; and then deploy these contracts to various networks. Additionally, you will learn how to use the Smart Contracts in various scenarios and environments.
Goal:
● Understand the tools needed to create smart contracts
● Write and understand secure Solidity code
● Avoid accidentally introducing Bugs and Blockchain Programming Errors
● Understand the development and deployment workflow
● Use and create private networks, test networks and the public main network
● Understand how transactions are structured
● Understand how Gas and gas costs can be calculated correctly
● Write, Deploy and Interact with your Smart Contract on the Ethereum Blockchain
● Understand the difference between Web3.js and truffle-contract
● Install, configure and use the Truffle Framework
● Write Smart Contract tests with the Truffle Framework
● Deploy to IPFS
Who is this book for?
● People who have heard of Ethereum, but do not know how to start
● People who have some experience with programming, but no Solidity experience
● People who want to know how this technology works
● People who have written simple Solidity contracts, but want to delve deeper into the subject matter.
Requirements for this book:
● Absolutely necessary: basic knowledge in JavaScript / HTML
● Absolutely necessary: A computer (Windows / Linux / Mac)
● Advantageous: basic knowledge in C ++ / Java, data types
● Advantageous: basic knowledge with git repositories
● Advantageous: basic knowledge of Solidity
Introduction
Who are we what we will create during this course
Hi, I'm Thomas.
I have over 15 years hands-on development experience in various environments, a masters’ degree in computer science and years of in-depth applied knowledge of blockchain technology, Solidity and the Ethereum platform.
I also co-created the industry standard Ethereum certification program CBDE with the Blockchain Training Alliance (BTA).
So far there are 6 in-depth best-selling blockchain developer video courses which I authored or co-authored online available. And I am currently consulting and training Fortune 500 companies in blockchain technologies and Ethereum development.
In this book I’m going with you through the different aspects of Ethereum development. I’ll demonstrate the tools available and workflows that worked best for me and my projects.
Hi, I’m Colleen.
https://media.licdn.com/dms/image/C5603AQGrdGSVNjMDpA/profile-displayphoto-shrink_800_800/0?e=1544054400&v=beta&t=5KE_FEA_8kBrm_kCBBnp0H78w5X9bvuIGmmSUzBMqtEI have over 20 years in the tech industry, in various roles: from tech support to web developer to business analyst to project manager to CTO. I got interested in Blockchain, Bitcoin and Ethereum several years ago, and I have been working as a teaching assistant for Thomas’ courses for the past year.
Code repository and sample code
For each example in this course there is sample code. This code is located in a repository located here: https://goo.gl/faLDdD
We try to keep the code updated to the best extend we can. That means it should run on the most up to date solidity versions until there are breaking changes that need a complete overhaul. To give you an example, that would’ve been the jump from Truffle 3 to Truffle Version 4. The command line interface changed, as well as the folder structure. We’ll keep note of such changes in the FAQ document located in the repository. Of course you can always post issues, which are more than welcome!
How to get in touch with us
You found a bug? Something is not working right? The code seems outdated? No problem! You can find us and talk to us - we’re just humans and mistakes happen.
If you found a bug in the code, best course of action would be to simply raise an issue on GitHub. This way we can look into it and fix it accordingly.
There is a private Facebook group for Ethereum enthusiasts which you can reach here: http://bit.ly/2NbAC6X
You can also find us on LinkedIn!
Thomas: www.linkedin.com/in/thomas-wiesner
Colleen: https://www.linkedin.com/in/colleenwtorek
Formatting in this book
Let’s keep this short, just remember:
Words in italics are keywords in Solidity
Words in bold are key concepts to remember throughout the book
Solidity Basics and the Remix Environment
In this chapter we are going to lay out the basics to write a smart contract. It is neither a complete reference of Solidity, nor a complete reference of Remix, but a starting point to the most important functions to get you started quickly.
What is Remix?
Remix is an integrated development environment (IDE) for Solidity development, which runs completely in any modern browser. Simply connect to: http://remix.ethereum.org and you're ready to start.
At first, Remix doesn’t connect to any private or public blockchains. It has an in-memory representation of a blockchain, purely for Solidity development testing purposes. This is quite handy as the overhead and resources needed to create a local blockchain, or the cost to interact with the live chain, can be prohibitive to someone new starting in this ecosystem. We will describe how to connect to a real chain works in subsequent sections, but for now, Remix help us to get up and running with Solidity development quickly!
Let's take a look around.
When you start Remix for the first time, you already have a demo Smart Contract. You see this in the center top area. This is the editor window where you write the actual code.
The Code Editor has some features that make working with Solidity easier.
On the left side you will find your files. This works in a similar way to normal code editors.
In the center bottom you will find a transaction log window. The next section will describe how to work with the log.
On the right, there are several ways to interact with your smart contracts. Remix has a built-in blockchain simulation and can also connect to other blockchains. We will cover this in another section.
Something to understand with this IDE; Remix saves all changes locally in your browser window, this is called the localStore. This means that you can shut down your machine, but the site will persist your code.
openhttp://remix.ethereum.org and edit some files and do some changes and then
openhttpS://remix.ethereum.org
(sometimes the browser automatically redirects if he detects the same website running SSL enabled)
all your edits will not be visible if just one single piece of the URL or the protocol changes. (http vs https).
––––––––
If you open http://remix.etherum.org, this is a different localStore than https://remix.ethereum.org. So, if suddenly your Smart Contracts are gone, then look at the address first!
Remix File Management
In this chapter, let's take a look at how we can interact with Remix. To do this we will remove the standard Smart Contract, delete the file and create a new one.
First, we close the already opened smart contract. Click on the little X next to the name. But the smart contract is not gone. We still need to delete the associated file. This can be found here in your file overview. Right-click on the file and it will be deleted.
––––––––
Let’s create our own contract. Click on the ‘Create New File’ button. We give the file a name - in our example ex1.sol
.
The following example will describe the absolute minimum for a Smart Contract.
Each file should start with the pragma line.
This is actually for the compiler, and should specify for which compiler version the smart contract was written.
The ecosystem evolves so fast and solidity changes constantly, there is often no backwards compatibility for solidity, so you need to take care and ensure that your contract’s pragma is aligned with the compiler version that the code was developed for.
The pragma line specifies which version this solidity file was written for. This follows the so-called Semantic Versioning. You can find out more at this link: https://docs.npmjs.com/misc/semver
If you took an older Contract and attempted to compile it with a newer solidity version, you would likely get compiler warnings or errors that would prohibit contract deployment.
This particular line says that the file was written for Solidity 0.4.24 or greater. But a maximum of 0.5, with compiler version 0.5 would not compile.
After the pragma-line, the actual contract code is included. This starts with the word contract and then in CapWords style the smart contract name. This means that all words are written together, but the words themselves begin with a capital letter. For example, MyContractExampleOne
. Or here: ExampleOne
. Then come curly brackets, and that's it.
This is the actual contract code, which could be compiled and deployed on the Ethereum blockchain.
Starting, Stopping and Interacting with Smart Contracts
Let’s take a look at how we can use Remix to interact with smart contracts. We want to be able to test and use them during the development phase.
For this I have extended the smart contract from the last section to write a simple variable.
Note that the contract should automatically compile, and any errors or warnings will appear on the right panel. If it doesn’t compile automatically then head over to the Compile
tab and turn Auto compile
on.
Notice the variable and the function here. The variable is a Storage variable of the type unsigned integer 256. It can only store positive values in the range up to 256 bits, so 0 to 1.1579209e+77. Any number larger than this, and the variable will wrap around and start at 0 again, similar to a car odometer that has reached 999,999 miles, and you keep driving it. The function is public. That means you can call it from outside the contract, it expects an argument, and then writes it into the storage variable.
Let’s test this out. The first thing we see is here on the right: our contract is green. That means there are no errors or warnings.
We also see on the right side the Remix has more tabs.
Now important for us is the second tab, called Run
. Select it and we see that we have more options.
The first setting is the selection in which environment we want to deploy our Smart Contract. We can leave that on Javascript VM, as this is the in-memory blockchain that Remix provides for rapid development. If you have something else selected, then please choose the JavaScript VM now.
The next select field is the account. When we choose a JavaScript VM environment, Remix will automatically give us some accounts with enough Ether to deploy contracts