Skip to content

bcnmy/tnop-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TNOP Stress Test Script

This script is designed to run stress tests for the TNOP program on the Biconomy Network. It broadcasts multiple supertransactions and tracks their execution status.

Prerequisites

  • Node.js v23
  • Bun v1.2.5

Installing Bun

If you don't have Bun installed, you can install it using one of the following methods:

Using curl:

curl -fsSL https://bun.sh/install | bash

Using npm:

npm install -g bun

Using Homebrew (macOS):

brew tap oven-sh/bun
brew install bun

After installation, verify the version:

bun --version
# Should output: 1.2.5

Project Setup

  1. Clone the repository:
git clone https://github.com/bcnmy/tnop-script.git
cd tnop-script
  1. Install dependencies:
bun i
  1. Create environment file:
cp .env.example .env
  1. Configure your .env file with the following variables:
# Your private key
PRIVATE_KEY=your_private_key_here

# Number of supertransactions to broadcast
STX_COUNT=20

# Chain ID for the network to use (e.g., 11155420 for Op Sepolia)
CHAIN_ID=11155420

Chain Selection

The script supports multiple networks through the CHAIN_ID environment variable. Some common chain IDs:

  • Base Sepolia: 84532
  • Base Mainnet: 8453
  • Ethereum Sepolia: 11155111
  • Ethereum Mainnet: 1

Make sure to set the appropriate CHAIN_ID for your target network.

Running the Script

To run the stress test:

bun run index.ts

What the Script Does

  1. Initializes a smart account using your private key
  2. Checks the account balance on Base Sepolia
  3. Broadcasts the specified number of supertransactions
  4. Monitors the execution status of each transaction
  5. Reports success/failure for each transaction

Output Format

The script provides detailed output including:

  • EOA (Externally Owned Account) address
  • Nexus Account address
  • Base Sepolia balance
  • Transaction status for each supertransaction
  • Batch processing results

Error Handling

  • The script handles timeouts gracefully
  • Failed transactions are marked as "FAILED"
  • Successful transactions are marked as "SUCCESS"
  • The script continues processing even if some transactions fail

Notes

  • Make sure your account has sufficient ETH on Base Sepolia
  • The script uses a 3-second timeout for transaction confirmation
  • Transactions are processed in batches of 10 for better performance

Troubleshooting

If you encounter any issues:

  1. Verify your Node.js version:
node --version
# Should be v23.x.x
  1. Check your Bun version:
bun --version
# Should be 1.2.5
  1. Ensure your .env file is properly configured
  2. Verify you have sufficient ETH in your account
  3. Check your internet connection

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published