PTA-Generator test tool release

Hello PTA community,

I released a new tool, pta-generator which can generate test data for PTA tools.

Currently it has following features:

  • Support for following PTA tools
  • Three major modes:
    • comm: Journal with commodities
      • Tools: tackler, (h)ledger, beancount
    • plain: The simplest journal
      • Tools: tackler, (h)ledger
    • audit: Journal with transaction audit data
      • Tools: tackler
  • Three journal storage strategies:
    • single: Single journal
      • Tools: tackler, (h)ledger, beancount
    • month: Shard by transaction date
      • Tools: tackler
    • txn: Shard by transaction (each txn is in own file)
      • Tools: tackler
  • Journal sizes from 10 to 1_000_000 transactions

Quickstart Guide

Simple Journal

# Generate 10_000 (1e4) txns single file journals under `data` directory
pta-generator plain --path data --set-size 1e4 --shard-type single --flavor tackler
pta-generator plain --path data --set-size 1e4 --shard-type single --flavor ledger


# Run balance report with this test data
tackler    --config data/plain/set-1e4-single.toml
ledger -no-pager -f data/plain/set-1e4-single/txns/1e4.journal
hledger          -f data/plain/set-1e4-single/txns/1e4.journal

Journal with Commodities

# Generate 10_000 (1e4) txns single file journals under `data` directory
pta-generator comm --path data --set-size 1e4 --shard-type single --flavor tackler
pta-generator comm --path data --set-size 1e4 --shard-type single --flavor ledger
pta-generator comm --path data --set-size 1e4 --shard-type single --flavor beancount

# Run balance report with this test data
tackler    --config data/comm/set-1e4-single.toml
ledger -no-pager -f data/comm/set-1e4-single/txns/1e4.journal bal
hledger          -f data/comm/set-1e4-single/txns/1e4.journal bal
bean-query          data/comm/set-1e4-single/txns/1e4.beancount 'balances from year = 2024'

Journal with Tackler Audit Test Data

Tackler can produce cryptographic proofs of used accounting data with reports. Audit mode produce test data for this.

# Generate 10_000 (1e4) audit txns set ("journal") under `data` directory
pta-generator audit --path data --set-size 1e4 --shard-type month

# Run balance report with this test data
tackler --config data/audit/set-1e4-month.toml

To run full account auditing report, do following extra steps:

cd data/audit/set-1e4-month
git init .
git add .
git commit -m "Journal for year 2024"
cd ../../..

tackler --config data/audit/set-1e4-month.toml --input.storage git

This will produce following report:

Git Storage
         commit : bd3baa9204607d8ef556dcd480ff10703ccfc168
      reference : main
      directory : txns
         suffix : .txn
        message : Journal for year 2024

Txn Set Checksum
        SHA-256 : cd00114244ec332d3aac3c301c9c9d04bb2b4e64e7b0d9e336d59cde04e7693f
       Set size : 10000

**********************************************************************************
Account Selector Checksum
           None : select all


Tackler: 1e4 (10_000) Balance Report
------------------------------------
         -13568.0000848   a:ay2024:am01
...

The commit id will change but Txn Set Checksum will be the same. This identifies uniquely all transactions used to produce this report, and git commit id will verify the content of journal. The report is calculated directly from repository data, the working copy is not used for this and the repository could be even bare.

Installation

You can install pta-generator with Rust tool chain's cargo command:

# Latest released version
cargo install --locked pta-generator

# Latest development version
cargo install --locked --git https://github.com/tackler-ng/pta-generator

Documentation

See project repository for Design and Developer Documentation.

Happy accounting (testing)!

3 Likes