Solana Development Utilities
A collection of utilities and macros to enhance Solana program development, focusing on compute unit logging and instruction discriminant generation.
Features
- Generate unique instruction discriminants for Anchor programs
- Log compute units for functions and code blocks
- Utility functions for Solana-specific operations
Installation
Add the following to your Cargo.toml
:
[]
= "0.1.2"
= "0.1.2"
= "0.1.2"
For parsing the logs, the cli can be installed using:
Usage
Instruction Discriminants
Handles the global namespace automatically if no namespace is provided.
use anchor_discriminant;
match discriminant
Compute Unit Logging
- Function-level logging
use compute_fn;
- Code block logging
use compute_fn;
compute_fn!;
Log Parsing
The CLI can be used to parse the logs generated by the compute unit logging macros. The logs can be parsed from a file or a directory containing multiple log files.
Output will be in the form of a JSON object containing the logs.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.