Installation
Install Rust, the Solana CLI, and the sbpf toolchain on macOS or Linux.
This page covers the local toolchain needed to write, build, and deploy a Solana program in pure assembly. macOS and Linux are first-class. Windows is supported through WSL.
Quick install
The Solana CLI ships its own installer that pulls Rust, the Solana CLI, and a few common tools in one shot.
curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bashAfter that, install the sbpf CLI from crates.io.
cargo install sbpfVerify both:
solana --version
sbpf --versionWindows users: install WSL first, then run every command below inside the Ubuntu (WSL) terminal.
If the quick install fails or you want to install each piece individually, follow the steps below.
Install dependencies
Install Rust
The sbpf CLI is built from source via cargo. Install Rust through rustup.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -yReload your PATH:
. "$HOME/.cargo/env"Verify:
rustc --versionInstall the Solana CLI
The Solana CLI is required to deploy programs, query account state, and run a local validator.
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"If you use zsh (the macOS default):
echo 'export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcexport PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"Add the same line to your shell rc file (~/.bashrc, ~/.zshrc) so it persists.
Verify:
solana --versionTo upgrade later:
agave-install updateInstall the sbpf CLI
sbpf is the project scaffolder, assembler driver, and deploy wrapper for pure-asm Solana programs. It is published to crates.io and installs as a regular cargo binary.
cargo install sbpfVerify:
sbpf --versionSource and issues: blueshift-gg/sbpf. The companion crate sbpf-linker is only needed if you want to relink upstream BPF binaries from Rust into sBPF v0 format; pure assembly projects do not require it.
Solana CLI basics
Configure the cluster
Inspect the current configuration:
solana config getConfig File: /Users/you/.config/solana/cli/config.yml
RPC URL: https://api.mainnet-beta.solana.com
WebSocket URL: wss://api.mainnet-beta.solana.com/ (computed)
Keypair Path: /Users/you/.config/solana/id.json
Commitment: confirmedSwitch cluster:
solana config set -um # mainnet-beta
solana config set -ud # devnet
solana config set -ul # localhost
solana config set -ut # testnetCreate a wallet
solana-keygen newThe default keypair path is ~/.config/solana/id.json. Use --outfile <path> to keep separate keypairs per cluster, then point the config at the one you want with solana config set --keypair <path>.
Print your address:
solana addressFund devnet
solana config set -ud
solana airdrop 2
solana balanceAirdrops are rate-limited. If you hit a limit, use the Solana Web Faucet instead.
Run a local validator
In a separate terminal:
solana-test-validatorPoint your config at localhost:
solana config set -ulsbpf basics
Initialize a project
sbpf init my_program
cd my_programThis scaffolds a Bun + Mocha test project with a single empty program under src/my_program/my_program.s and a deploy keypair under deploy/my_program-keypair.json.
Build
sbpf buildThe assembler compiles every .s file under src/ into a deployable .so under deploy/.
Deploy
sbpf deploy my_program https://api.devnet.solana.comsbpf deploy is a thin wrapper around solana program deploy. The deployer keypair comes from solana config get. If no URL is passed, sbpf defaults to localhost.
Disassemble
sbpf disassemble deploy/my_program.soRound-trips the deployed bytes back to assembly. Read the output of this command often. It is the most direct way to verify the assembler emitted what you wrote.
Shell completions
The Solana CLI ships completion generators for bash, fish, and zsh. Add them once and solana <tab> works in every new shell.
If you do not already use oh-my-zsh, ensure your ~/.zshrc has:
autoload -U compinit
compinit -iThen:
solana completion --shell zsh | sudo tee /usr/local/share/zsh/site-functions/_solana
exec zshmkdir -p $HOME/.local/share/bash-completion/completions
solana completion --shell bash > $HOME/.local/share/bash-completion/completions/solana
exec bashmkdir -p $HOME/.config/fish/completions
solana completion --shell fish > $HOME/.config/fish/completions/solana.fish
source $HOME/.config/fish/config.fishFurther reading
For broader Solana development tutorials, mini-projects, and learning paths from the team behind sbpf, see the Blueshift Learn site and the blueshift-gg GitHub organization.