Created
March 12, 2020 16:24
-
-
Save samsondav/3e5fe8c48e954c1de6cbe4faa385b642 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set these parameters | |
provider_url = 'YOUR_INFURA_URL' | |
wallet_password = 'YOUR_WALLET_PASSWORD' | |
nonce_start = 29936 | |
nonce_end = 29940 | |
gas_price = 112 * 10**9 | |
from web3 import Web3 | |
web3 = Web3(Web3.HTTPProvider(provider_url)) | |
with open('node_key') as keyfile: | |
encrypted_key = keyfile.read() | |
private_key = web3.eth.account.decrypt(encrypted_key, wallet_password) | |
for nonce in range(nonce_start, nonce_end): | |
transaction = { | |
'to': '0x43EB83A6B54A98b2d051c933B8e4A900D6bAcbee', # doesn't matter | |
'value': 0, | |
'gas': 21000, | |
'gasPrice': gas_price, | |
'nonce': nonce, | |
'chainId': 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