This project is a Python application that interacts with the Solana blockchain. It includes APIs for connecting to the Solana network, reading balances, and sending transactions.
- Python 3.11.8
- Solana SDK
- FastAPI
- Uvicorn
- SQLAlchemy
- Asyncpg
apis: Contains API routers for blockchain interactionsblockchain_test.py: API for testing blockchain connections and transactionscheck_balance.py: API for checking Solana account balances
database.py: Defines the database connection and schemamain.py: The main application file, which sets up the FastAPI app and includes API routersrequirements.txt: Lists project dependenciesdependencies.txt: Lists project dependencies with descriptions
- Install dependencies:
pip install -r requirements.txt - Run the application:
uvicorn main:app --reload --host 127.0.0.1 --port 5000 - Use the APIs:
GET /create-table: Creates a table in the databaseGET /: Returns a hello messageGET /check-balance: Checks the balance of a Solana account (seeapis/check_balance.pyfor usage)
GET /test: Tests the blockchain connection and sends a transaction
GET /check-balance: Checks the balance of a Solana account- Query parameter:
public_key(required)
- Query parameter:
The database schema is defined in database.py. The schema includes a single table, users, with the following columns:
id: Serial primary keyname: VARCHAR(255)email: VARCHAR(255) UNIQUEpassword: VARCHAR(255)
Contributions are welcome! Please submit pull requests with clear descriptions of changes.
This project is licensed under the MIT License. See LICENSE for details.