Skip to content

Instantly share code, notes, and snippets.

@kdembler
Last active June 9, 2020 21:40
Show Gist options
  • Save kdembler/281ea9b157ff03b2098b6274b916965f to your computer and use it in GitHub Desktop.
Save kdembler/281ea9b157ff03b2098b6274b916965f to your computer and use it in GitHub Desktop.
from web3 import Web3, HTTPProvider
web3_endpoint = 'https://kovan.infura.io/v3/xxxxxxxxxxxxxxxxxx'
private_key = '0xCC206D...'
web3 = Web3(HTTPProvider(web3_endpoint))
transaction = {
'to': '0x4d6Bb4ed029B33cF25D0810b029bd8B1A6bcAb7B',
'gas': 21000,
'gasPrice': 10000000000,
'value': 1,
'nonce': 1
}
signed = web3.eth.account.sign_transaction(transaction, private_key)
web3.eth.sendRawTransaction(signed.rawTransaction)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment