Blockchain class

Let's create a blockchain interface code in wallet and name the script blockchain.py. This file is responsible for connecting to the blockchain. Its responsibilities include checking the balance of the account, getting local accounts, sending transactions, and getting token information. By putting all blockchain functions inside one class or file, it is easier for us to debug the problem, to test the implementations, and to develop the functionalities. Go to https://gitlab.com/arjunaskykok/hands-on-blockchain-for-python-developers/tree/master/chapter_09/wallet and refer to the blockchain.py code file for this section.

This blockchain class has 10 methods to interact with the blockchain. In addition, it also has the generic ...

Get Hands-On Blockchain for Python Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.