Replies: 13 comments 11 replies
-
Can you post a reproducible example? Currently the network is configured with a setting of 1200 mints per second. The throttles are applied per-node as 1200/N where N is the number of nodes in the network. So if you are testing with a 7 node network and only sending traffic to a single node, then we would expect to see a throttle of 1200/7 or about 171 mints per second, which should still take less than an hour to complete. If you are testing on a 26 node network, then that would be about 46 mints per second or several hours to complete. |
Beta Was this translation helpful? Give feedback.
-
@rbair23 thank you for the reply. Just to clarify, when you refer to a networks with a 'number of nodes in the network" do you mean a private test network? We are using public testnet, which I think is a 7-node network. Do you have scalability/performance tests or sample code that we can take a look and ideally run which demonstrates the performance you are describing? Could you direct us to it please? |
Beta Was this translation helpful? Give feedback.
-
To efficiently parallelise the operation, you should ideally use a different account Id per "thread" in order to avoid the duplicate transaction ids. You may also separate submitting transactions from getting receipts into separate threads, this will ensure that each mint doesn't wait on the receipt to issue the next one. |
Beta Was this translation helpful? Give feedback.
-
@rbair23 and @gregscullard Thank you for your comments. We can't use separate account ID per thread as it is not compatible with our use-case. And when we tried to parallelise with the single account we did indeed get the duplicate transaction IDs. Here is the extracted code sample which demonstrates the problems. Can you please point to changes that would need to be made here to achieve the rates your are listing above.
Case 1 runs at about 1s per transaction. In case 2 we get two types of errors if there are more than 200-300 transactions.
Or
|
Beta Was this translation helpful? Give feedback.
-
@anvabr something along those lines should fix the DUPLICATE_TRANSACTION
each thread ( Must be careful not to exceed the max value of a javascript number |
Beta Was this translation helpful? Give feedback.
-
We will test it and come back to you @gregscullard , thank you for the suggestion! |
Beta Was this translation helpful? Give feedback.
-
@gregscullard Thank you for the suggestion on fixing the
|
Beta Was this translation helpful? Give feedback.
-
Converting this issue into a discussion since it's not an issue with the JS SDK. |
Beta Was this translation helpful? Give feedback.
-
Perhaps I am asking a somewhat controversial question here, in the public docs Hedera claims >10k/sec Tx speed so looking at it naively it should take 40 seconds, not 30+ hours. However the published numbers I am sure are for a specific test set-up, I am just trying to figure out if there is a way we can get closer to that architecture, hoping to reduce time significantly. |
Beta Was this translation helpful? Give feedback.
-
In order to get to maximum capacity it would be good to attempt to mint and listen in separate threads in the JS SDK and to submit to separate nodes this way. This should lead to some improvement, it also may be something we can set up out of the box if it works so other folks don't run into this issue. |
Beta Was this translation helpful? Give feedback.
-
Following the discussion, I just wanted to test the samples provided here against the current stage of the network (since there might be some changes made concerning the exact use case). So, as mentioned, from the provided example, the first approach is not even a consideration from a performance point of view because you would have to wait to get the receipt of each Onto the second approach, running it as it is provided, for a total of 1000 NFT mints ends for roughly 5-6 minutes without any errors. You might see in the console Also, I see that you are trying to get the receipt of every Nonetheless, whenever I set it up to mint 100 000 NFTs, a JS error out of memory All observations were made on Please update us on your current intentions if this is still your case |
Beta Was this translation helpful? Give feedback.
-
Some additional approaches in order to optimize the whole process:
Those node IPs and accounts are publicly available here
cc: @anvabr |
Beta Was this translation helpful? Give feedback.
-
As up until now, the best approach from a performance point of view was achieved by using a third party library called bottleneck.js which gives us the opportunity to execute successfully up to ~8000 Notes: After several days of investigating, the issue with those 21 NFTs missing (each time the number differs) most probably has nothing to do with the network itself or the throttling limitations. Those transactions seem to not reach the application layer in order to be processed correctly. The issue most probably appears during the communication between the SDK and the application layer. This is prioritized and further research is required. I provide you with a template code piece to try:
Note that this code piece is for one batch of transactions only and after the execution of each batch you have to
cc: @anvabr |
Beta Was this translation helpful? Give feedback.
-
Description
Our use-case (environmental - carbon units/offsets etc) requires the creation of large number of NFTs which represent these carbon units. Realistically we are unable to achieve objective as it takes more than 30 hours to create 400,000 nfts using the SDK facilities. We attempted to parallelise the execution however it resulted in duplicate transactions.
Steps to reproduce
Use TokenMintTransaction and TransferTransaction SDK facilities to mint a large number of NFTs and transfer them to the owner[s]. Since these API methods can work with up to 10 records, in our use-case it makes 40,000 transactions.
Additional context
No response
Hedera network
testnet
Version
N/A
Operating system
No response
Beta Was this translation helpful? Give feedback.
All reactions