Skip to Content
Hands-On Blockchain for Python Developers
book

Hands-On Blockchain for Python Developers

by Arjuna Sky Kok
February 2019
Intermediate to advanced
450 pages
9h 59m
English
Packt Publishing
Content preview from Hands-On Blockchain for Python Developers

Creating a bootstrap script

This script is used to load data to make the development of our application easier. We can download free videos from https://videos.pexels.com/. Create a stock_videos directory adjacent to the videos_sharing_smart_contract directory and download some MP4 files to that stock_videos directory. In my case, I downloaded more than 20 videos.

After downloading some data, we will create a script called bootstrap_videos.py. Refer to the code file at the following GitLab link for the full code: https://gitlab.com/arjunaskykok/hands-on-blockchain-for-python-developers/blob/master/chapter_12/bootstrap_videos.py:

import os, jsonimport ipfsapifrom web3 import Web3, IPCProviderfrom populus.utils.wait import wait_for_transaction_receipt ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Blockchain in Action

Blockchain in Action

Bina Ramamurthy
Learn Python by Building a Blockchain and Cryptocurrency

Learn Python by Building a Blockchain and Cryptocurrency

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781788627856Supplemental Content