4

experimental environment: m1 pro macbook

when I want send more transactions. the code will report this to me:

 RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1014: Priority is too low: (12562 vs 12562): The transaction has too low priority to replace another transaction already in the pool.
2022-04-09 23:44:45             DRR: 1014: Priority is too low: (12562 vs 12562): The transaction has too low priority to replace another transaction already in the pool.
2022-04-09 23:44:45        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1014: Priority is too low: (12562 vs 12562): The transaction has too low priority to replace another transaction already in the pool.

image

My solution to this is to start multiple dockers and repeat the script. but I found that I could not connect over the IP(like 192.168.xxx.xxx) of the LAN. Parallel chains can only be connected through 127.0.0.1.(Even localhost is not supported). this is my parachain start command.

./target/release/dorafactory-node \
--alice \
--collator \
--force-authoring \
--chain dora-roc-testnet.json \
--base-path /tmp/parachain/alice --log=info,xcm=trace,xcm-executor=trace \
--port 40334 \
--ws-port 8845 --ws-external --rpc-external --rpc-methods=unsafe --prometheus-port 9777 --prometheus-external \
-- \
--execution wasm \
--chain rococo-local-cfde.json \
--port 30344 \
--ws-port 9978

and this my hosts:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost

this is my LAN ip: image

this is my js-script error report:

image image

this is my WEB_SOCKET on my js-script:

const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api');

const WEB_SOCKET = 'ws://192.168.1.4:8845';
const wsProvider = new WsProvider(WEB_SOCKET);
1
  • Idk if you knew, but it's possible to batch transactions up as a utility.batch or utility.batchAll transaction which can have a number of transactions in it. But the limitation is that if you want them signed they would all have to be signed by the same account.
    – Squirrel
    Commented Apr 10, 2022 at 6:45

1 Answer 1

7

The polkadot-js api cookbook has an example of this, which uses the system.accountNextIndex rpc.

Overall you have a couple of options -

  1. Pass the nonce in as -1, which will use the above RPC to check against the pool (the docs example above)
  2. Query the nonce before sending, and then manually increment on each transaction (passing it through via nonce: ...)

Example of the first (as detailed in the above link) -

for (let i = 0; i < 10; i++) {
  const txhash = await api.tx.balances
    .transfer(recipient, 123)
    .signAndSend(sender, { nonce: -1 })
}

Example of the second approach, manually incrementing -

// or get it via system.account, not taking the txpool into account
let nonce = await api.rpc.system.accountNextIndex(sender)

for (let i = 0; i < 10; i++) {
  const txhash = await api.tx.balances
    .transfer(recipient, 123)
    .signAndSend(sender, { nonce })
  nonce = nonce.addn(1)

}
2
  • 1
    It's work! I tried to ask him to send 10000 transactions, but he said it exceeded the limit of the pool, but it was successfully sent. Do you know where to configure the limit of the pool?
    – 99kies
    Commented Apr 10, 2022 at 8:46
  • And why does using localhost or LAN IP cause disconnect?
    – 99kies
    Commented Apr 10, 2022 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.