Skip to content

Client Load Testing: Create tool 'generate' command #3

@sreuland

Description

@sreuland

Summary

Create the generate command to bootstrap seed data from a live RPC network.

Related to: Cliient load testing tool Feature - #4
Related to: Client load testing Epic - #2

Prerequisite

Depends on #6 to be done first. It will create the initial CLI tool scaffolding.

Scope

This task focuses on:

  1. Implementing the generate command functionality to collect seed data from target network
  2. Saving collected data to bootstrap.dat file

Details

stellar-rpc-loadtest generate \
  --rpc-url <RPC_URL> \
  --network-passphrase <NETWORK_PASSPHRASE> \
  --output <PATH_TO_BOOTSTRAP_DAT> \
  [--ledger-window <NUM_LEDGERS>]

Parameters:

  • --rpc-url: Target RPC server URL (required)
  • --network-passphrase: Network passphrase for the target network (required)
  • --output: Path to save bootstrap data file (default: ./bootstrap.dat)
  • --ledger-window: Number of ledgers prior to last checkpoint ledger to sample data from (default: 1000)

Data Collection Requirements

The generate command must collect and save the following data:

  1. Recent transaction hashes

    • Sample transactions from the requested ledger window
    • Detect status, whether successful and failed
    • Store transaction hash and success status
  2. Valid ledger keys

    • Query ledger entries for different key types:
      • Account entries
      • Contract data entries
      • Contract code entries
      • Trustline entries
    • Store the base64-encoded ledger keys
  3. Active contract IDs

    • Identify contracts that have activity in the sampled ledgers
    • Store contract IDs (C... addresses)
  4. Contract event topics

    • Extract event topics from contract events in sampled ledgers
    • Store unique topic values
  5. Recent ledger sequences

    • Store the range of ledger sequences sampled
    • Include first and last ledger in the window

Bootstrap Data File Format

Define a data format for bootstrap.dat:

  • Use serialized JSON for structured data formatting on each row in the file
  • Organize rows by type for efficient loading

Acceptance Criteria

  • CLI tool runs 'generate' command successfully
  • Bootstrap data is saved to bootstrap.dat file in structured format
  • generate command displays progress/status during data collection, time elapsed number of tx's, contract ids, ledgers
  • generate command handles errors gracefully (network failures, invalid parameters)
  • Basic README with usage instructions for generate command

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Needs Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions