Skip to content

blockchain-hq/testship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

218 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

testship logo

Testship

Test Anchor Programs without Writing Tests

Test Anchor programs in 40 seconds, not 40 minutes. No test files. Just results.

npm version npm downloads GitHub stars License: MIT

WebsiteDocumentationDemo VideoTwitter


See It In Action


Quick Start

# Run in your Anchor project directory
npx @blockchain-hq/testship start

# Or install globally
npm install -g @blockchain-hq/testship
testship start

That's it. Opens at http://localhost:3000 with your program ready to test.


What is Testship?

Think Postman for Solana programs.

Testship generates an interactive testing UI from your Anchor IDL. Test instructions visually, derive PDAs automatically, and see results instantly—all in your browser.

The Problem

Traditional Anchor testing means:

  • Writing test files for every instruction
  • Manually deriving PDAs in code
  • Parsing transaction logs to verify results
  • Re-running anchor test for every change
  • 40 minutes to test what should take 40 seconds

The Solution

testship start
  • Auto-generated forms from IDL
  • Automatic PDA derivation
  • Visual transaction execution
  • Instant feedback on results
  • Test in 40 seconds

Why Developers Love Testship

Before Testship

# 1. Write test file
# test/counter.ts
it("increments counter", async () => {
  // 30 lines of boilerplate...
});

# 2. Run tests
$ anchor test
# Wait 2-3 minutes...

# 3. Parse logs manually
# Error: constraint violation
# Which constraint?

# 4. Fix, repeat
# Another 2-3 minutes...

Time: 40 minutes per change

With Testship

# 1. Start Testship
$ testship start

# 2. Visual interface opens
# See all instructions

# 3. Click "Increment"
# Fill parameters (auto-complete)
# PDAs derived automatically

# 4. Execute
# Instant result

# 5. See exactly what changed

Time: 40 seconds per test

Key Features

Feature Description
Zero Configuration Run testship start in any Anchor project—that's it
Auto-Generated UI Forms created from your IDL automatically
Smart PDA Derivation Handles complex account-based PDAs without code
Wallet Integration Works with Phantom, Solflare, Backpack, and all Solana wallets
Instant Execution See transaction results in real-time
Account History Reuse accounts across instructions automatically
Multi-Program Support Detects and loads all programs in your workspace
Transaction History Full execution log for debugging
Type Validation Input validation based on IDL types
Cluster Support Test on localnet, devnet, or mainnet

Perfect For

Use Case Why Testship
Rapid Development Iterate 10x faster during development
Debugging Test specific scenarios without writing tests
Learning Anchor Understand how programs work interactively
Teaching Demonstrate programs to students visually
Pre-Deploy Testing Verify program behavior before mainnet
Demos Show your program to team, users, or investors
CI/CD Integration Quick manual verification alongside automated tests

How It Works

┌─────────────────────────────────────────────────────────────┐
│  1. You run: testship start                                 │
└─────────────────────────────────────────────────────────────┘
                              ↓
┌─────────────────────────────────────────────────────────────┐
│  2. Testship automatically:                                 │
│     • Finds your Anchor workspace                           │
│     • Loads program IDLs                                    │
│     • Generates testing UI                                  │
│     • Opens browser                                         │
└─────────────────────────────────────────────────────────────┘
                              ↓
┌─────────────────────────────────────────────────────────────┐
│  3. You interact:                                           │
│     • Select instruction                                    │
│     • Fill form (with auto-complete & validation)           │
│     • Connect wallet                                        │
│     • Execute transaction                                   │
│     • See results instantly                                 │
└─────────────────────────────────────────────────────────────┘

No test files. No boilerplate. No context switching. Just testing.


Example: Testing a Counter Program

Click to see step-by-step example

Your Program (counter.rs)

#[program]
pub mod counter {
    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
        ctx.accounts.counter.count = 0;
        Ok(())
    }

    pub fn increment(ctx: Context<Increment>) -> Result<()> {
        ctx.accounts.counter.count += 1;
        Ok(())
    }
}

Traditional Testing (test/counter.ts)

// 30+ lines of setup code...
describe("counter", () => {
  it("initializes", async () => {
    const tx = await program.methods
      .initialize()
      .accounts({
        counter: counterPda,
        user: provider.wallet.publicKey,
        systemProgram: SystemProgram.programId,
      })
      .rpc();

    const counter = await program.account.counter.fetch(counterPda);
    assert.equal(counter.count, 0);
  });

  it("increments", async () => {
    // Another 15 lines...
  });
});

// Run: anchor test (2-3 minutes)

With Testship

$ testship start

# Browser opens with:
# ┌─────────────────────────────┐
# │ Counter Program             │
# ├─────────────────────────────┤
# │ Instructions:               │
# │ • Initialize  ← [Click]     │
# │ • Increment                 │
# └─────────────────────────────┘
#
# Form auto-filled with PDAs
# Click "Execute"
# Counter initialized (0)
#
# Click "Increment"
# Counter incremented (1)
#
# Total time: 30 seconds

Documentation

Full documentation: docs.testship.xyz


Development Status

Current Version: v0.1.8 — Early Release, Actively Developed

Working Features

  • Auto-detect Anchor projects
  • Load IDL from multiple programs
  • Generate interactive forms from IDL
  • Auto-derive PDAs with seeds
  • Execute transactions with wallet
  • Real-time transaction feedback
  • Account history and reuse
  • Transaction history tracking
  • Multi-cluster support (localnet/devnet/mainnet)
  • Form validation and error handling

Coming Soon

  • Account state inspector (view account data)
  • Batch transaction execution
  • Export test as TypeScript code
  • Custom RPC endpoint support
  • Shareable test sessions
  • Program state snapshots

Found a Bug?

Report it on GitHub Issues

We're shipping updates daily based on your feedback!


Contributing

Testship is open source and MIT licensed. We welcome contributions from the community!

Ways to contribute:

  • Submit pull requests
  • Report bugs
  • Suggest features
  • Fork and modify
  • Create derivatives
  • Share feedback
  • Star the repo

See LICENSE for details.


Links & Resources


Support the Project

If Testship helps you build faster, please:

Built by developers, for developers.


Made with care for the Solana ecosystem

WebsiteDocsTwitternpm

About

Test Anchor programs without writing tests

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages