Closed AndreMiras closed 6 years ago
Since we don't run a node locally and since ropsten.infura.io and api.myetherapi.com obviously don't provide access to account management, we'll need to deal with a local file accounts and manage transaction signing manually, see https://github.com/ethereum/web3.py/blob/v4.0.0-beta.11/docs/contracts.rst and https://github.com/ethereum/web3.py/blob/v4.0.0-beta.11/docs/web3.eth.account.rst I believe the strategy would be:
Pseudo code could be:
transaction = etheroll.contract.functions.playerRollDice(roll_under).buildTransaction()
encrypted_key = open('~/.ethereum/keystore/wallet.json').read()
private_key = w3.eth.account.decrypt(encrypted_key, password)
signed = w3.eth.account.signTransaction(transaction, private_key)
w3.eth.sendRawTransaction(signed_transaction.rawTransaction)
Bet placed on Testnet from local wallet account. From the current code, simply update password
, wallet_path
and from_address_normalized
.
Deploy the contract on the testnet, try to place a bet and document the instructions
playerRollDice()
)