【问题标题】:Transaction stuck in "local transactions" with status "In queue: Future" - Parity Ethereum Node交易卡在“本地交易”中,状态为“队列中:未来” - Parity 以太坊节点
【发布时间】:2017-11-26 23:45:22
【问题描述】:

我正在寻求帮助,因为我已经陷入困境,因为我的交易在 Parity TxQueueViewer 中显示为本地交易作为状态:

In queue: Future

如下图所示为 tx: 0x0e97a4c

我将 tx: 0x0e97a4c 设置为 https://github.com/ethereumjs/ethereumjs-tx 并使用 https://github.com/ethereum/web3.js/ 发送如下:

var Web3 = require('web3');
var Transaction = require('ethereumjs-tx');
var data = contract.method.getData(some, data);
console.log("Data: " + data);
var gasEstimate = web3.eth.estimateGas({
    to: web3.env.SENDER_ADDRRESS,
    data: data
});
console.log("GasEstimate: " + gasEstimate);
var nonce = web3.eth.getTransactionCount(process.env.SENDER_ADDRRESS);
console.log("Transation Count: " + nonce);
var rawTx = {
    nonce: web3.toHex(nonce),
    gasPrice: web3.toHex(process.env.GAS_PRICE),
    gasLimit: web3.toHex(gasEstimate),
    to: web3.toHex(process.env.CONTRACT_ADDRESS),
    value: web3.toHex(provider.toWei('1', 'ether')),
    data: data,
    chainId: 3
};
console.log("RawTx: " + JSON.stringify(rawTx));
var tx = new Transaction(rawTx);
console.log(tx.getChainId());
tx.sign(new Buffer(process.env.KEY, 'hex'));
web3.eth.sendRawTransaction("0x".concat(tx.serialize().toString('hex')), function(error, txHash) {
    if (error) {
        console.log(error); // an error occurred
        callback(error);
    }
    else {
        callback(null,{"error":0,"tx":txHash});
    }
});

我知道节点正在同步和传播交易,这些交易随后被挖掘,因为交易设置和从 Parity UI 发送成功,如下图所示(如上图所示):

作为一些背景知识,我一直在使用 Solidity 和 Javascript 并利用 Truffle 和 Web3js 为以太坊开发一个项目。针对 TestRPC 进行测试。经过一番研究,我选择了 Parity 而不是 Geth,并使用 Ropsten 网络运行测试。

我有 Parity 版本:

Parity/v1.6.8-beta-c396229-20170608/x86_64-macos/rustc1.17.0 

正在运行:

MacOS Sierra 10.12.5.

我开始使用以下内容:

parity --pruning fast --chain ropsten --warp --mode active --jsonrpc-interface all --jsonrpc-hosts all --allow-ips public
  • “队列中:未来”状态是什么意思?
  • Parity 是否有某种交易释放机制?
  • 还是我没有为这种类型的节点正确设置事务?

【问题讨论】:

    标签: ethereum web3js


    【解决方案1】:

    我刚刚通过停止 Parity 进程并删除 Parity 的缓存 (~/.local/share/io.parity.ethereum/cache) 解决了这个问题。当有一个事务在本地“卡住”时,就会出现此问题。一旦这个“卡住”交易进入本地队列,来自同一地址的其他交易将不会传播,直到“卡住”交易传播。

    【讨论】:

      【解决方案2】:

      这是困扰我很久的问题。在我的情况下,我发现错误是由于元掩码发送的较新的随机数引起的。

      场景

      我正在运行具有特定链 ID 的链。我正在使用元掩码发送交易。一周后,我创建了一个具有相同链 id 的新链,然后当我使用元掩码发送交易时,交易继续进行。

      治愈

      • 更改新链的链 ID。它可能需要更改 genesis 文件。
      • 将元掩码重新连接到 RPC。这是为了更新存储在 metamask 中的链 ID。
      • 发送交易。现在他们不应该进入“未来”

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-03-15
        • 1970-01-01
        • 1970-01-01
        • 2017-01-27
        • 2021-10-02
        • 2019-12-09
        • 1970-01-01
        相关资源
        最近更新 更多