I have been looking through various tutorials (many of them outdated or with broken links) to figure out how to store and retrieve a simple string or hex value in the ETH blockchain. For my purposes (and intended application I am developing) it would be best to be able to interface with the blockchain via Python.
I have tried using web3 and pyethereum with not much success. The furthest I have gotten is using the following code with the web3 interface.
What pieces am I missing and how can I properly store and retrieve a value on the ETH blockchain?
How do I create a contract and store / retrieve a value from it?
def eth_black_magic(hex_value):
web3 = Web3(HTTPProvider('http://localhost:8545')) # what URL should I point at?
user1 = 'xxx' # what goes here?
user2 = 'xxx' # what goes here?
transaction = {'from': user2, 'to':user1, 'data': hex_value}
transaction_hash = web3.eth.sendTransaction(transaction)