| Crates.io | solify |
| lib.rs | solify |
| version | 0.1.1 |
| created_at | 2025-11-15 17:43:18.161383+00 |
| updated_at | 2025-11-15 20:30:44.051396+00 |
| description | A CLI tool to generate anchor program tests for Solana |
| homepage | |
| repository | https://github.com/adisehrawat/solify |
| max_upload_size | |
| id | 1934618 |
| size | 284,573 |
Solify is a powerful CLI tool that automatically generates comprehensive test suites for Solana Anchor programs. By analyzing your program's IDL (Interface Definition Language) file, Solify creates TypeScript test files with positive and negative test cases, handles account setup, PDA initialization, and provides an interactive interface for test generation.
cargo install solify
git clone https://github.com/adisehrawat/solify.git
cd solify
cargo build --release
cargo install --path cli
Navigate to your Anchor project:
cd your-anchor-project
Build your program to generate the IDL:
anchor build
Run Solify to generate tests:
solify gen-test
Or specify custom paths:
solify gen-test --idl target/idl/your_program.json --output tests
Or off-chain computation:
solify gen-test --off
Follow the interactive prompts:
~/.config/solana/id.json)Run the generated tests:
anchor test
solify inspect <transaction-signature>
Example:
solify inspect 5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmGpnD9i8X5zgD3A6i8j5Y3vJ8vK8vK8vK8
gen-testGenerates comprehensive test suites for your Solana Anchor program.
Syntax:
solify gen-test [OPTIONS]
Options:
-i, --idl <PATH>: Path to IDL file or directory containing IDL files (default: target/idl)-o, --output <PATH>: Output directory for generated test files (default: tests)--rpc-url <URL>: Solana RPC endpoint URL (default: https://api.devnet.solana.com)-v, --verbose: Enable verbose logging-off: For off chain computationExamples:
# Use default paths (target/idl -> tests)
solify gen-test
# Specify custom IDL file
solify gen-test --idl target/idl/my_program.json
# Specify custom output directory
solify gen-test --output my-tests
# Use mainnet RPC (for production programs)
solify gen-test --rpc-url https://api.mainnet-beta.solana.com
# Enable verbose output
solify gen-test --verbose
# Enable off-chain computation
solify gen-test --off
Interactive Flow:
Generated Test Structure:
The generated tests include:
inspectInspect and analyze Solana transactions with a beautiful TUI interface.
Syntax:
solify inspect <SIGNATURE> [OPTIONS]
Arguments:
SIGNATURE: Transaction signature to inspect
Examples:
# Inspect a transaction on devnet
solify inspect 5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmGpnD9i8X5zgD3A6i8j5Y3vJ8vK8vK8vK8
**Inspection Features:**
- Transaction status and confirmation details
- Instruction breakdown with parsed data
- Account information and balances
- Program logs and execution traces
- Compute units consumed
- Fee information
- Return data (if available)
solify/
├── cli/ # CLI application and user interface
├── parser/ # IDL parsing and analysis
├── analyzer/ # Program analysis (dependencies, PDAs, account ordering)
├── generator/ # Test file generation using templates
├── client/ # Solana RPC client for on-chain operations
├── common/ # Shared types, errors, and utilities
└── solana-program/ # On-chain Solana program (if applicable)
# Clone the repository
git clone https://github.com/adisehrawat/solify.git
cd solify
# Build the project
cargo build --release
# Run tests
cargo test
# Build the CLI
cargo build --release -p solify
# Parse an IDL file
cargo run --example parse_idl -p solify-parser
The project uses a Rust workspace with the following crates:
solify-common: Shared types and error definitionssolify-parser: IDL parsing functionalitysolify-analyzer: Program analysis logicsolify-generator: Test generation enginesolify-client: Solana RPC client wrapperBy default, Solify looks for your wallet at ~/.config/solana/id.json. You can specify a different path during the interactive flow or by modifying the default in the code.
Issue: "IDL file not found"
anchor build, or specify the correct path with --idlIssue: "Failed to connect to RPC"
--rpc-urlIssue: "Wallet not found"
~/.config/solana/id.json or provide the correct path during the interactive flowIssue: "Insufficient funds"
solana airdrop 2 (on devnet)Issue: "Generated tests fail"
solify gen-test --verboseContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under either of
at your option.
Aditya Sehrawat
Made with pure Rustling mind for the Solana community