Skip to content

sasphy/chain-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SolBeat: Solana Web3 Music Streaming Platform

DEPLOYED TO SOLANA DEVNET

SolBeat is a decentralized music streaming platform built on Solana that enables artists to tokenize their music using NFTs. The platform leverages the Metaplex Print Edition standard to create multi-edition music tokens with a bonding curve pricing mechanism.

Deployment Status

Features

  • Music NFT creation with Metaplex token standards
  • Multi-edition support with master/print editions
  • Bonding curve pricing (price increases as supply increases)
  • Creator royalties (configurable percentage)
  • Platform fees (configurable percentage)
  • Badge NFTs for achievements

Technical Architecture

  • Smart Contract: Anchor program for music NFT lifecycle and bonding curve logic
  • Client Library: TypeScript client for frontend integration
  • Backend Integration: Elysia-based API server with Bun runtime

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/your-org/solbeat.git
    cd solbeat
  2. Install dependencies:

    bun install
  3. Set up the development environment:

    bun run setup

Development Mode Options

This repository supports two modes of operation:

1. Simulation Mode

Simulates Solana transactions without actually deploying or interacting with the blockchain. This mode is useful for:

  • Development and testing without spending SOL
  • Rapid prototyping
  • Understanding the data flow

To use simulation mode:

# Initialize platform (simulation)
bun run platform:init

# Create track (simulation)
bun run track:create --name "My Track" --symbol TRK --uri "https://example.com/metadata.json" --initial-price 1000000 --increment 100000 --max-supply 100

# Purchase track (simulation)
bun run track:buy --mint <MINT_ADDRESS> --amount 1

2. Live Deployment Mode

Performs actual blockchain transactions on Solana devnet (or mainnet). This mode:

  • Requires SOL in your wallet
  • Creates real transactions on the selected Solana network
  • Deploys the actual smart contract
  • Creates real NFTs and performs real purchases

To use live deployment mode:

# Initialize platform with real NFTs but simulated logic (easiest)
bun run platform:init:partial

# Create track with real NFT but simulated logic (easiest)
bun run track:create:partial --name "My Track" --symbol TRK --uri "https://example.com/metadata.json" --initial-price 1000000 --increment 100000 --max-supply 100

# Purchase track with real NFT interaction but simulated logic (easiest)
bun run track:buy:partial --mint <MINT_ADDRESS> --amount 1

Project Structure

/
├── programs/                    # Solana smart contracts
│   ├── music-streaming/         # Original Anchor program
│   └── music-token-factory/     # Token factory program (DEPLOYED)
├── src/                         # TypeScript client library
│   ├── client.ts                # Main client class
│   ├── index.ts                 # Entry point
│   ├── metaplex.ts              # Metaplex utilities
│   └── solbeat-token-client.ts  # Token factory client
├── scripts/                     # Deployment and testing scripts
├── deployment/                  # Deployment information and track data
├── test-data/                   # Local state for simulation
├── Anchor.toml                  # Anchor configuration
├── FACTORY_DEPLOYMENT.md        # Deployment details
└── TOKEN_FACTORY_SUMMARY.md     # Summary of deployed assets

Smart Contract (Anchor) Development

The main token factory program is located in programs/music-token-factory/src/lib.rs. It contains:

  • initialize_protocol: Sets up the platform parameters and fees
  • create_music_token: Creates a new track with bonding curve parameters
  • buy_tokens: Purchases tokens using the bonding curve pricing
  • sell_tokens: Sells tokens back to the protocol
  • update_token_metadata: Updates track metadata information
  • update_protocol: Updates platform fee and treasury

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors