# Import library that manage the connection to your local blockchain
from web3 import Web3

# Configure the connection to your local blockchain
web3 = Web3(Web3.HTTPProvider('http://127.0.0.1:7545'))
if web3.is_connected():
    print("Connected to Ganache")
else: 
    print("Connection error: Couldn't connect to Ganache")

print("\n\n ##### BLOCKS ##### \n")
print("Here some informations about the first block of the blockchain: ")
first_block = web3.eth.get_block(0)
print("Block " + str(first_block.number))


print("\n\n ##### ACCOUNTS ##### \n")

print("\n\n ##### TRANSACTIONS ##### \n")
# Change the addresses here by addresses from your own ganache instances (as addresses should be randoms)
from_address = '0x4AfbFbC5A8909682AA26f13180Aee3943fEDbDFf'
to_address = '0x3fE633B30646E5f7E731D2c6c016DF1E2043AA4c'
value = 1
print(f"We are now sending a transaction from {from_address} to {to_address} of value {value}")
