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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.