Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Blockchain for Python Developers

You're reading from   Hands-On Blockchain for Python Developers Gain blockchain programming skills to build decentralized applications using Python

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781788627856
Length 450 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Arjuna Sky Kok Arjuna Sky Kok
Author Profile Icon Arjuna Sky Kok
Arjuna Sky Kok
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: Blockchain and Smart Contracts
2. Introduction to Blockchain Programming FREE CHAPTER 3. Smart Contract Fundamentals 4. Implementing Smart Contracts Using Vyper 5. Section 2: Web3 and Populus
6. Interacting with Smart Contracts Using Web3 7. Populus Development Framework 8. Building a Practical Decentralized Application 9. Section 3: Frontend Decentralized Applications
10. Frontend Decentralized Application 11. Section 4: Cryptocurrency and Wallets
12. Creating Token in Ethereum 13. Cryptocurrency Wallet 14. Section 5: Decentralized Filesystem
15. InterPlanetary - A Brave New File System 16. Using ipfsapi to Interact with IPFS 17. Implementing a Decentralized Application Using IPFS 18. Other Books You May Enjoy

Developing a simple voting application

First, we are going to build the simplest voting application, simpler than the voting application example that comes with the Vyper software source code. Let's set up our Populus project directory:

$ virtualenv -p python3.6 voting-venv
$ source voting-venv/bin/activate
(voting-venv) $ pip install eth-abi==1.2.2
(voting-venv) $ pip install eth-typing==1.1.0
(voting-venv) $ pip install web3==4.7.2
(voting-venv) $ pip install -e git+https://github.com/ethereum/populus#egg=populus
(voting-venv) $ pip install vyper
(voting-venv) $ mkdir voting_project
(voting-venv) $ cd voting_project
(voting-venv) $ mkdir tests contracts
(voting-venv) $ cp ../voting-venv/src/populus/populus/assets/defaults.v9.config.json project.json

Then, add Vyper support to project.json by changing the value of the key compilation to the following:

"compilation": {
...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime