更换费太低

Replacement fee too low

我正在尝试 运行 使用 nodejs 的脚本来获取一些数据。该脚本是我在下一行中附加的脚本:

const IdentityManager = artifacts.require("IdentityManager");
const fs = require("fs");
const path = require("path");
const ethers = require("ethers");
// Admin keystore
const adminPath = path.resolve('./dev-tools/createFakeIdentities/mocked-identity-keys/admin-f8bd94fcb46ee4232ade9f4880be9332909ea277');
// Identity Manager Address
const imAddress = "0xD23068144e89Cb08988C3487AAd46cf941E71D77";
    
module.exports = async function () {
  try {
    
    let provider = new ethers.providers.JsonRpcProvider("http://localhost:22000");
    let adminKeystore = fs.readFileSync(adminPath, 'utf-8');
    let adminAccount = await ethers.Wallet.fromEncryptedJson(adminKeystore, "12345",(progress)=>{
      
    });
    const wallet = adminAccount.connect(provider);
    let imInstance = new ethers.Contract(imAddress, IdentityManager.abi, wallet);
    const tx1 = await imInstance.prepareID(adminAccount.address,{gasPrice:"0",gasLimit:"0x6691b7"});
    console.log(tx1);
    console.log("tx1", tx1);
    const tx2 = await imInstance.createIdentity("0x50382c1a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000008230783966646137636461353931383739343863653861656433643864666538313366323263366632303237633261383837396365633936376663353538333836333939383262386138343839643061363266303237633238353763393835633438643362663139633438616235633137393365653133633563383066326238343333000000000000000000000000000000000000000000000000000000000000");
    console.log(tx2);
    console.log("tx2", tx2);
    
  } catch (error) {
    console.log(error);
  }
}

我 运行 truffle with truffle exec script.js --network testnet 的脚本我得到了这个错误,我不知道为什么我有这个:

Using network 'testnet'.

{ nonce: 13,
  gasPrice: BigNumber { _hex: '0x00', _isBigNumber: true },
  gasLimit: BigNumber { _hex: '0x6691b7', _isBigNumber: true },
  to: '0xD23068144e89Cb08988C3487AAd46cf941E71D77',
  value: BigNumber { _hex: '0x00', _isBigNumber: true },
  data:
   '0x45748b42000000000000000000000000f8bd94fcb46ee4232ade9f4880be9332909ea277',
  chainId: 9535753591,
  v: 19071507218,
  r:
   '0x1a5e04c1cb0bb99cca7b29d2476811a74651c53b727f85d3abb38714246f1e98',
  s:
   '0x40c11e2d9969fa7ed857f7f8d20b15247cb736ed39e51bb1f567e91ee8fcb109',
  from: '0xF8bD94FcB46EE4232ADe9f4880be9332909Ea277',
  hash:
   '0x87a80379bf88d42517bbe0aa2f938a9cca57bfcc989f27f631c81ea0bfb403eb',
  wait: [Function] }
tx1 { nonce: 13,
  gasPrice: BigNumber { _hex: '0x00', _isBigNumber: true },
  gasLimit: BigNumber { _hex: '0x6691b7', _isBigNumber: true },
  to: '0xD23068144e89Cb08988C3487AAd46cf941E71D77',
  value: BigNumber { _hex: '0x00', _isBigNumber: true },
  data:
   '0x45748b42000000000000000000000000f8bd94fcb46ee4232ade9f4880be9332909ea277',
  chainId: 9535753591,
  v: 19071507218,
  r:
   '0x1a5e04c1cb0bb99cca7b29d2476811a74651c53b727f85d3abb38714246f1e98',
  s:
   '0x40c11e2d9969fa7ed857f7f8d20b15247cb736ed39e51bb1f567e91ee8fcb109',
  from: '0xF8bD94FcB46EE4232ADe9f4880be9332909Ea277',
  hash:
   '0x87a80379bf88d42517bbe0aa2f938a9cca57bfcc989f27f631c81ea0bfb403eb',
  wait: [Function] }
{ Error: replacement fee too low (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":56,\"error\":{\"code\":-32000,\"message\":\"replacement transaction underpriced\"}}\n","error":{"code":-32000},"requestBody":"{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0xf901ab0d808307c2e694d23068144e89cb08988c3487aad46cf941e71d7780b901446d69d99a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e450382c1a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000823078396664613763646135393138373934386365386165643364386466653831336632326336663230323763326138383739636563393637666335353833383633393938326238613834383964306136326630323763323835376339383563343864336266313963343861623563313739336565313363356338306632623834333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000850470c01b11a037d4bd3372bd00ac66da692c5ff43c5c79f0c00957ba20bd9162de4c3736607ca02195e8c17239d03ba4099b6e67e2c328b5c5a6d05db3f412ce8bb6bff96b6a67\"],\"id\":56,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://172.26.91.72:22000"}, method="sendTransaction", transaction="0xf901ab0d808307c2e694d23068144e89cb08988c3487aad46cf941e71d7780b901446d69d99a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e450382c1a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000823078396664613763646135393138373934386365386165643364386466653831336632326336663230323763326138383739636563393637666335353833383633393938326238613834383964306136326630323763323835376339383563343864336266313963343861623563313739336565313363356338306632623834333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000850470c01b11a037d4bd3372bd00ac66da692c5ff43c5c79f0c00957ba20bd9162de4c3736607ca02195e8c17239d03ba4099b6e67e2c328b5c5a6d05db3f412ce8bb6bff96b6a67", code=REPLACEMENT_UNDERPRICED, version=providers/5.0.17)
    at Logger.makeError (/usr/lib/node_modules/ethers/node_modules/@ethersproject/logger/src.ts/index.ts:205:28)
    at Logger.throwError (/usr/lib/node_modules/ethers/node_modules/@ethersproject/logger/src.ts/index.ts:217:20)
    at checkError (/usr/lib/node_modules/ethers/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:62:16)
    at JsonRpcProvider.<anonymous> (/usr/lib/node_modules/ethers/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:463:20)
    at step (/usr/lib/node_modules/ethers/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:46:23)
    at Object.throw (/usr/lib/node_modules/ethers/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:27:53)
    at rejected (/usr/lib/node_modules/ethers/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:19:65)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  reason: 'replacement fee too low',
  code: 'REPLACEMENT_UNDERPRICED',
  error:
   { Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"id\":56,\"error\":{\"code\":-32000,\"message\":\"replacement transaction underpriced\"}}\n", error={"code":-32000}, requestBody="{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0xf901ab0d808307c2e694d23068144e89cb08988c3487aad46cf941e71d7780b901446d69d99a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e450382c1a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000823078396664613763646135393138373934386365386165643364386466653831336632326336663230323763326138383739636563393637666335353833383633393938326238613834383964306136326630323763323835376339383563343864336266313963343861623563313739336565313363356338306632623834333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000850470c01b11a037d4bd3372bd00ac66da692c5ff43c5c79f0c00957ba20bd9162de4c3736607ca02195e8c17239d03ba4099b6e67e2c328b5c5a6d05db3f412ce8bb6bff96b6a67\"],\"id\":56,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="http://172.26.91.72:22000", code=SERVER_ERROR, version=web/5.0.11)
       at Logger.makeError (/usr/lib/node_modules/ethers/node_modules/@ethersproject/logger/src.ts/index.ts:205:28)
       at Logger.throwError (/usr/lib/node_modules/ethers/node_modules/@ethersproject/logger/src.ts/index.ts:217:20)
       at /usr/lib/node_modules/ethers/node_modules/@ethersproject/web/src.ts/index.ts:284:28
       at step (/usr/lib/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:33:23)
       at Object.next (/usr/lib/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:14:53)
       at fulfilled (/usr/lib/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:5:58)
       at process._tickCallback (internal/process/next_tick.js:68:7)
     reason: 'processing response error',
     code: 'SERVER_ERROR',
     body:
      '{"jsonrpc":"2.0","id":56,"error":{"code":-32000,"message":"replacement transaction underpriced"}}\n',
     error:
      { Error: replacement transaction underpriced
          at getResult (/usr/lib/node_modules/ethers/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:85:28)
          at processJsonFunc (/usr/lib/node_modules/ethers/node_modules/@ethersproject/web/src.ts/index.ts:326:22)
          at /usr/lib/node_modules/ethers/node_modules/@ethersproject/web/src.ts/index.ts:263:42
          at step (/usr/lib/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:33:23)
          at Object.next (/usr/lib/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:14:53)
          at fulfilled (/usr/lib/node_modules/ethers/node_modules/@ethersproject/web/lib/index.js:5:58)
          at process._tickCallback (internal/process/next_tick.js:68:7) code: -32000, data: undefined },
     requestBody:
      '{"method":"eth_sendRawTransaction","params":["0xf901ab0d808307c2e694d23068144e89cb08988c3487aad46cf941e71d7780b901446d69d99a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e450382c1a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000823078396664613763646135393138373934386365386165643364386466653831336632326336663230323763326138383739636563393637666335353833383633393938326238613834383964306136326630323763323835376339383563343864336266313963343861623563313739336565313363356338306632623834333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000850470c01b11a037d4bd3372bd00ac66da692c5ff43c5c79f0c00957ba20bd9162de4c3736607ca02195e8c17239d03ba4099b6e67e2c328b5c5a6d05db3f412ce8bb6bff96b6a67"],"id":56,"jsonrpc":"2.0"}',
     requestMethod: 'POST',
     url: 'http://172.26.91.72:22000' },
  method: 'sendTransaction',
  transaction:
   { nonce: 13,
     gasPrice: BigNumber { _hex: '0x00', _isBigNumber: true },
     gasLimit: BigNumber { _hex: '0x07c2e6', _isBigNumber: true },
     to: '0xD23068144e89Cb08988C3487AAd46cf941E71D77',
     value: BigNumber { _hex: '0x00', _isBigNumber: true },
     data:
      '0x6d69d99a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e450382c1a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000823078396664613763646135393138373934386365386165643364386466653831336632326336663230323763326138383739636563393637666335353833383633393938326238613834383964306136326630323763323835376339383563343864336266313963343861623563313739336565313363356338306632623834333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
     chainId: 9535753591,
     v: 19071507217,
     r:
      '0x37d4bd3372bd00ac66da692c5ff43c5c79f0c00957ba20bd9162de4c3736607c',
     s:
      '0x2195e8c17239d03ba4099b6e67e2c328b5c5a6d05db3f412ce8bb6bff96b6a67',
     from: '0xF8bD94FcB46EE4232ADe9f4880be9332909Ea277',
     hash:
      '0x444886b55229f452b08043581a171291397fdc4c076590da23412b847eb84158' },
  transactionHash:
   '0x444886b55229f452b08043581a171291397fdc4c076590da23412b847eb84158' }

为什么我有这个错误?,我在 tx2 上找到了它,因为当我评论关于 tx2 的行时,一切正常但是当我想显示 tx2 时我遇到了问题。在此先感谢您的帮助

通过一个tx1.wait();和 tx2.wait();该笔交易将等到被挖出,然后执行下一笔交易。