Quick Start

This guide will help you set up your development environment and create your first Dolphin program.

Prerequisites

Before you begin, make sure you have the following installed:

# Install Rust and Cargo
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install Solana CLI tools
sh -c "$(curl -sSfL https://release.solana.com/v1.17.0/install)"

# Install Anchor Framework
cargo install --git https://github.com/coral-xyz/anchor avm --locked
avm install latest
avm use latest

# Install Python 3.8 or higher
# macOS
brew install python@3.8

# Ubuntu
sudo apt-get install python3.8 python3.8-dev

Installation

Install Dolphin using pip:

pip install dolphin-framework

For game development, also install:

pip install casino-of-life

Create Your First Program

  1. Initialize a new project:

dolphin init hello_world HeLLo777777777777777777777777777777777777777
  1. Navigate to your new project and open program/lib.py:

from dolphin.prelude import *

@program("HeLLo777777777777777777777777777777777777777")
class HelloWorldProgram:
    @account
    class Counter:
        authority: Pubkey
        count: u64
        
    @instruction
    def initialize(
        self,
        counter: Counter,
        authority: Signer,
        system_program: Program = SYSTEM_PROGRAM_ID
    ):
        counter.authority = authority.key()
        counter.count = 0
        
    @instruction
    def increment(
        self,
        counter: Counter,
        authority: Signer
    ):
        assert counter.authority == authority.key(), "Invalid authority"
        counter.count += 1
  1. Build your program:

dolphin build
  1. Run tests:

dolphin test
  1. Deploy to Solana devnet:

dolphin deploy --network devnet

What's Next

Ready to dive deeper? Continue to Creating Your First Program for a more detailed walkthrough.

Last updated