This repository contains the backend implementation for a decentralized betting application built on the Solana blockchain. The backend is responsible for managing user interactions, processing bets, and ensuring seamless communication with the Solana blockchain.
- Decentralized Architecture: Leverages Solana's blockchain to ensure transparency and immutability of betting transactions.
- User Management: Handles user authentication and wallet integration.
- Bet Processing: Manages the lifecycle of bets, including creation, validation, and settlement.
- Blockchain Interaction: Facilitates communication with the Solana blockchain for transaction execution and data retrieval.
- Cron Job Functionality: Automates periodic tasks to ensure smooth operation of the betting platform.
The backend includes a cron job system that performs the following tasks:
- Bet Settlement: Automatically checks for bets that have reached their conclusion and processes the results.
- Payout Distribution: Ensures timely distribution of winnings to the respective users' wallets.
- Data Cleanup: Removes expired or invalid bets from the system to maintain database efficiency.
- Blockchain Sync: Periodically syncs with the Solana blockchain to fetch the latest state and ensure data consistency.
- Notification Dispatch: Sends reminders or updates to users about their bets or platform activities.
To set up and run the backend locally, follow these steps:
- Clone the repository:
git clone https://github.com/your-repo/decentralized-solana-betting-backend.git - Install dependencies:
npm install - Build the project:
npm run build - Configure environment variables in a
.envfile.DATABASE_URL="" PRIVATE_KEY="" - Start the server:
npm start
Alternatively, you can use Docker to build and run the project:
- Build the Docker image:
docker build -t decentralized-betting-backend . - Run the Docker container:
docker run -p 3000:3000 --env-file .env decentralized-betting-backend
Steps Decentralized React Expo
This project is licensed under the MIT License. See the LICENSE file for details.