2

The error name is expired_tx_exception and the code for the same is 3040005 please tell me how can I perform these much transactions per seconds. I am able to perform 250 transactions per seconds but after that, it is throwing this error.

The code is as follows:

 for (let i = 0; i < 300; i++) {
    contract
            .transfer(
              {
                from: "myaccount",
                to: "myaccount2",
                quantity: "1.0000 SYS",
                memo: i
              },
              {
                authorization: ["myaccount@active"]
              }
            )
            .then(res => {
              console.log(res);
              fs.appendFileSync("test.json", JSON.stringify(res));
            })
            .catch(err => {
              console.log(err);
            });
    }
  • First of all, use Promise.all not loop. – Rajat Chaudhary Sep 11 '18 at 4:50
1

it looks like your problem can be in the node configuration, not in your code. try this: https://github.com/EOSIO/eos/issues/3370

also you code is kind of slow because you run all actions in a sequence, not in parallel. so if you will not reach desired speed after fixing your error - try to remove bottlenecks like - remove logs - they take time and try to run a few instances of you script in parallel (redirect logs in different files if you really need it). node js is single threaded, so running a few instances can make total throughput way bigger (of cause if you have multiple-core CPU).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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