sunscreen.yml schema

Single source of truth for a workspace. Generated by chain new, read by every other command.

Warning

This page summarizes the schema. The authoritative shape lives in src/config/schema.rs and is emitted as JSON Schema via schemars. When in doubt, the Rust types win.

## Top-level shape
version: 1

project:
  name: my-app
  framework: anchor         # anchor | pinocchio
  frontend: vite            # none | vite | next

toolchain:
  # tool version pins; see ToolchainCfg in schema.rs
  anchor: "^0.30"

scaffolding:
  # marker + scaffolder preferences; see ScaffoldingCfg

programs:
  - name: my_app
    path: programs/my_app
    program_id: ~           # filled by deploy

workspace:
  # workspace-level layout knobs

clusters:
  localnet:
    url: http://127.0.0.1:8899
    wallet: ~/.config/solana/id.json
  devnet:
    url: https://api.devnet.solana.com
    wallet: ~/.config/solana/id.json
  mainnet:
    url: https://api.mainnet-beta.solana.com
    wallet: ~/.config/solana/id.json

runtime:
  engine: surfpool          # surfpool | test-validator
  port: 8899
  faucet_sol: 100

plugins:
  - source: ./plugins/my-plugin
    version: "0.2.0"

Top-level keys

KeyTypeRequiredDescription
versionintyesschema version; sunscreen migrates older values automatically
projectobjectnoname, framework (anchor/pinocchio), frontend (none/vite/next)
toolchainobjectnoexternal tool version pins
scaffoldingobjectnoscaffolder/marker behaviour knobs
programsarraynoone entry per program in the workspace
workspaceobjectnoworkspace-level layout
clustersobjectnoper-cluster RPC + wallet (localnet/devnet/mainnet)
runtimeobjectnolocal dev runtime preferences
pluginsarraynodeclared plugins

programs[]

FieldTypeRequiredDescription
namestringyessnake_case program name
pathpathyesrelative to workspace root
program_idstringnofilled by deploy; null until first deploy

clusters.<name>

FieldTypeRequiredDescription
urlstringyesRPC endpoint
walletstringyespath to the default keypair for this cluster

Sunscreen ships defaults for localnet, devnet, and mainnet. The CLI accepts mainnet (not mainnet-beta) as the cluster target name; the underlying URL remains https://api.mainnet-beta.solana.com.

runtime

FieldTypeDefaultDescription
engineenumsurfpoolsurfpool or test-validator (sunscreen falls back from Surfpool to test-validator when Surfpool isn't on PATH)
portint8899validator RPC port
faucet_solint100seed balance for the local runtime faucet

plugins[]

FieldTypeRequiredDescription
sourcestringyeslocal path or git URL
versionsemveryeswith or without v prefix

Migrations

When sunscreen reads a sunscreen.yml with a lower version than the current binary supports, it migrates in-place. Migrations are deterministic.

Validation

sunscreen.yml is validated on every command. Failures exit with code 3 (invalid_config) and a message naming the offending field path.