This project is a Rust-based HTTP server optimized for performance and scalability. It serves as a reliable platform for developing web applications and APIs, leveraging Rust's efficiency and safety features. The server is designed to interact seamlessly with the Solana blockchain, enabling functionalities such as token creation, balance retrieval, and secure transactions.
- Fast and Efficient: Built with Rust, ensuring high performance and low memory usage.
- Modular Design: Organized into multiple modules for better maintainability.
- OpenAPI Integration: Includes OpenAPI support for API documentation.
- JSON Extraction: Provides utilities for extracting and processing JSON data.
├── Cargo.lock
├── Cargo.toml
├── Dockerfile
├── jest.config.js
├── package.json
├── src/
│ ├── json_extractor.rs
│ ├── main.rs
│ ├── openapi.rs
│ ├── routes.rs
├── tests/
│ ├── api_tests.js
- Rust (latest stable version)
- Node.js (for running tests)
- Docker (optional, for containerization)
- Clone the repository:
git clone <repository-url> cd sol_rs_server
- Build the project:
cargo build
- Run the server:
cargo run
To run the API tests:
npm install
npm test
The server includes OpenAPI support for API documentation. You can access the documentation at /
endpoint when the server is running.
- Method: POST
- Description: Accepts a message payload and echoes it back with a status of "Received".
- Method: GET
- Description: Fetches the balance of a given Solana address in lamports and SOL.
- Method: POST
- Description: Generates a new Solana keypair and returns the public key and secret key.
- Method: POST
- Description: Creates a new token mint on the Solana blockchain. Requires mint address, mint authority, and decimals.
- Method: POST
- Description: Mints tokens to a specified destination address. Requires mint address, destination address, authority, and amount.
- Method: POST
- Description: Signs a message using a provided secret key.
- Method: POST
- Description: Verifies the validity of a signed message using the provided signature and public key.
- Method: POST
- Description: Transfers SOL from one address to another. Requires sender address, recipient address, and amount in lamports.
- Method: POST
- Description: Transfers tokens from one address to another. Requires destination address, mint address, owner address, and amount.