February 2019
Intermediate to advanced
450 pages
9h 59m
English
Before we develop a decentralized GUI application, let's write a script to put some fixtures in the smart contract. Fixtures are like sample data. This makes developing an application a more pleasurable experience. Call the script fixtures.py. Refer to the code file in the following GitLab for the full code: https://gitlab.com/arjunaskykok/hands-on-blockchain-for-python-developers/blob/master/chapter_07/dapp/fixtures.py:
from web3 import Web3, HTTPProviderfrom populus.utils.wait import wait_for_transaction_receiptw3 = Web3(HTTPProvider('http://localhost:7545'))private_keys = ['dummy', '59e31694256f71b8d181f47fc67914798c4b96990e835fc1407bf4673ead30e2', 'ac1e6abbe002699fbef756a2cbc2bf8c03cfac97adee84ce32f198219be94788']...... txhash ...