DEV Community

Mike Ng for AWS Community Builders

Posted on

1

How to send large batch transaction to EVM-based blockchain network using AWS serverless service

This article is just a start, there will be more updates coming up like extracting the gas fee wallet to a separate wallet either using the private key in Secrets Manager or the KMS key and also setting up multiple workers for the minting process in the ERC721 smart contract. Which enables a higher volume of transactions executions performance.

This article illustrates sending a large batch of transactions from a single EOA on any EVM-based Blockchain network.

The entire solution used Lambda, Step Function, and SQS. At first, this solution will keep it simple as possible and continue to update.

To get started on this solution, please make sure you have development experience with any EVM-based blockchain network and ether.js.

As we all know, when sending transactions on any EVM-based blockchain will have a nonce. The nonce is the number of transactions sent from a given address which acts as a one-time code that prevents replay attacks or double-spending.

This means when sending batch transactions in an EVM-based blockchain, you have to wait until the recently sent transaction has been mined in the latest block, then you can get the latest nonce and send the next transaction.

If the application is sending the transaction in a synchronous manner, the overall performance and execution experience will be very poor. This means the entire transaction-sending process must be refactored and extracted to become an asynchronous process.

Image description

This solution has used a FIFO queue to ensure the transaction has been sent in an absolute order for processing. The example ERC-721 has been written to demonstrate large batch or minting process execution in Lambda function.

For the detail configuration and setting you can see directly in the CDK Github repository.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay