- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Node.JS dApp 服务器端的 Rinkeby 网络上遇到间歇性的“替换交易定价过低”错误。我在通过 estimateGas()
调用返回给我的交易 send() 调用中使用了估计气体的确切数量。在我的看涨期权中,我同时添加了 gas
和 gasLimit
字段,只是为了确保 estimateGas()
返回的估计 gas 值安全options
对象。有谁知道如何解决这个问题?
关于一个不相关的问题。令我沮丧的是,仅通过 Metamask 向 Rinkeby 网络提交交易大约需要 16 到 30 秒。请注意,我的意思是从 Metamask 扩展弹出到我的客户端代码重新获得控制权。我不是在谈论通过网络确认/挖掘交易所需的时间。话虽如此,我开始怀疑 Metamask 是否在交易被挖掘之前不会将控制权交还给你。是这样吗?
这是我用来将交易发送到 Rinkeby(或我正在测试的任何网络)的代码片段:
contractMethodToCall.estimateGas(
{ from: publicAddr, gasPrice: 20000000000, gas: 1500000})
.then(function(estimatedGas) {
if (estimatedGas <= 0)
throw new Error("The estimated gas for the transaction is zero.");
const rawTx = {
nonce: fromNonce,
gasPrice: gasPriceGwei,
// Use the estimated gas.
gasLimit: estimatedGas,
// Adding both gas and gasLimit just in case.
gas: estimatedGas,
to: contractAddr,
value: '0x00',
data: encodedAbiForCall
}
let tx = new Tx(rawTx);
// Sign the transaction using our server private key in Buffer format.
tx.sign(privateKeyBuffer);
let serializedTx = '0x' + tx.serialize().toString('hex');
return web3.eth.sendSignedTransaction(serializedTx);
});
最佳答案
听起来您从评论中找到了问题的原因。但是,为了让看到相同问题的其他人更加清楚,错误不仅仅是因为重复的 nonce。当提交的交易带有已在另一笔待处理交易中使用的随机数,并且汽油价格与(或低于)待处理交易相同时,将发生此错误。
如果您使用更高的汽油价格,您可以使用相同的随机数提交交易。矿工总是会为待处理的工作选择价格较高的交易,因此这是一种取消待处理交易或重新提交因低 gas 价格而被忽略的交易的方法。
关于javascript - 将以太坊交易发送到 Rinkeby 网络时出现 "replacement transaction underpriced"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51605416/
我需要为我的宠物项目测试以太坊。 我去https://faucet.rinkeby.io/ ,在 MetaMask 中添加我的推文和我的以太坊地址的链接,选择 3 Ethers / 8 hours .
我开始了我的第一个区 block 链教程,它是: https://www.youtube.com/watch?v=9oERTH9Bkw0&t=696s repo :https://github.com
根据 official docs的 ethers.js ,这应该是如何使用自定义数据连接到特定网络(如 Rinkeby-testnet)的方式: const provider = ethers.ge
我一直遇到标题中指定的。 我开发了一个智能合约并成功编译并部署到网络中,如下所示: 1.运行testrpc 2. 松露编译 3.松露迁移 但是,仍然显示上述错误。 然后我尝试删除构建文件并按照以下步骤
我在 Node.JS dApp 服务器端的 Rinkeby 网络上遇到间歇性的“替换交易定价过低”错误。我在通过 estimateGas() 调用返回给我的交易 send() 调用中使用了估计气体的确
我在Windows上尝试通过rinkeby连接到以太坊Testnet。 我下载了geth 1.8.2和以太坊钱包0.9.3 我给第一个命令是: geth --rinkeby --fast --cach
我不能在我的契约(Contract)上调用创建过滤器,这是我下面的代码。我能够获得契约(Contract)并在其上运行功能,但我无法收听事件: myContract = w3.eth.contract
我一直在使用 this course 学习 Solidity由 Stephen Grider 撰写,到目前为止一切顺利,我正在尝试部署 my code到 Rinkeby 测试网络。 作为引用,我使用
我是一名优秀的程序员,十分优秀!