我正在尝试离线签署数据,然后通过web3.js发送已签名的事务
下面是我的代码片段:
const {sign} = require('@warren-bank/ethereumjs-tx-sign');
const {Loader} = require("loader-in-console");
var txData = {
nonce: nonce,
chainId: 80001,
from: address1,
to: address2,
data: data,
gas: 30000,
gasPrice: 35000,
value: '0x0'
}
const {rawTx} = sign(txData, privateKey);
var serializedTx = '0x' + rawTx.toString('hex');
let txResponse = await web3.eth.sendSignedTransaction(serializedTx);
console.log(txResponse);时间安排好了。我在这里做错了什么,还有其他的方法吗?
发布于 2022-01-03 19:00:20
你们的汽油价格很低。你可以用web3.eth.gasPrice()查询汽油价格,当我这么做的时候,我得到了2000000000。由于您的35000非常低,矿工需要很长时间(或可能永远不会)才能处理此事务。
https://ethereum.stackexchange.com/questions/117898
复制相似问题