我一直无法找到从临时尾尾设备进行ETH事务的方法,因为通常的钱包(如MyCrypto )似乎不在那里运行。
发布于 2021-05-27 08:41:58
如果您有一个用于钱包的BIP39短语,并且想要进行一个简单的ETH事务,那么对尾4.18工作的步骤如下。
sudo apt update && sudo apt install python3-dev gcc
torsocks curl https://bootstrap.pypa.io/get-pip.py | torsocks python3
PATH=$PATH:/home/amnesia/.local/bin
torsocks pip install --upgrade pip setuptools web3prepare_tx.py:from web3 import Web3
from web3.auto import w3
gas_price = Web3.toWei("<GAS_PRICE>", "gwei")
amount_now = Web3.toWei("<ETHER_TO_TRANSFER>", "ether")
to_address = "<RECEIVER_ADDRESS>"
private_key = "<SENDER_PRIVATE_KEY>"
for nonce in [0, 1, 2, 3, 4]:
gas = 21000
gas_total = gas * gas_price
tx_amount = amount_now - gas_total
tx = {
"chainId": 1, # main ETH chain
"nonce": nonce,
"to": to_address,
"value": tx_amount,
"gas": gas,
"gasPrice": gas_price,
}
signed = w3.eth.account.sign_transaction(tx, private_key)
s = signed.rawTransaction
s_ = "0x" + "".join(format(x, "02x") for x in s)
print(f"nonce={nonce}")
print(s_)
print("-")prepare_tx.py以获得具有不同非get的签名事务字符串。https://ethereum.stackexchange.com/questions/99759
复制相似问题