A high-performance HTTP API server built with Axum for interacting with the Solana blockchain. This server provides RESTful endpoints to query blockchain data including account information, balances, transactions, and network status.
http-server.mp4
- GET
/
- API documentation and usage information
- GET
/health
- Health check endpoint for monitoring service status - GET
/slot
- Get the latest slot number from the Solana network
- GET
/balance/{address}
- Get SOL balance for a specific wallet address - GET
/account/{address}
- Get detailed account information including data and metadata
- GET
/transaction/{signature}
- Get transaction details by signature
- GET
/validators
- Get current validator information and network statistics
- Rust installed
- Access to a Solana RPC endpoint
- Clone the repository:
git clone https://github.com/AvhiMaz/http-server
- Change directory
cd http-server
- Install dependencies:
cargo build
- Run the server:
cargo run
The server will start on http://localhost:3000
curl http://localhost:3000/balance/11111111111111111111111111111112
curl http://localhost:3000/account/11111111111111111111111111111112
curl http://localhost:3000/transaction/5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW
curl http://localhost:3000/health
curl http://localhost:3000/slot
curl http://localhost:3000/validators
The server supports various Solana RPC providers:
- Mainnet:
https://api.mainnet-beta.solana.com
- Testnet:
https://api.testnet.solana.com
- Devnet:
https://api.devnet.solana.com
- Custom: Your own RPC endpoint
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request