首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SendSignedTransaction超时

SendSignedTransaction超时
EN

Ethereum用户
提问于 2022-01-03 18:15:06
回答 1查看 424关注 0票数 1

我正在尝试离线签署数据,然后通过web3.js发送已签名的事务

下面是我的代码片段:

代码语言:javascript
复制
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);

时间安排好了。我在这里做错了什么,还有其他的方法吗?

EN

回答 1

Ethereum用户

发布于 2022-01-03 19:00:20

你们的汽油价格很低。你可以用web3.eth.gasPrice()查询汽油价格,当我这么做的时候,我得到了2000000000。由于您的35000非常低,矿工需要很长时间(或可能永远不会)才能处理此事务。

票数 0
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/117898

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档