This guide will help you set up your development environment and create your first Dolphin program.
# 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
pip install dolphin-framework
pip install casino-of-life
dolphin init hello_world HeLLo777777777777777777777777777777777777777
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
dolphin deploy --network devnet