Installation¶
This guide covers installing SolScript and its dependencies.
Prerequisites¶
Before installing SolScript, ensure you have:
- Rust (1.83 or later) - Install Rust
- Solana CLI - Install Solana
- Anchor (optional, for Anchor mode) - Install Anchor
- LLVM 18 (optional, for direct LLVM mode) - See below
Install SolScript¶
From Cargo (Recommended)¶
From Source¶
git clone https://github.com/cryptuon/solscript
cd solscript
cargo install --path crates/solscript-cli
With LLVM Support (Direct BPF Compilation)¶
# Install LLVM 18 first (see below), then:
cargo install --path crates/solscript-cli --features llvm
Verify Installation¶
You should see output like:
Check Your Environment¶
Run the doctor command to verify all tools are installed:
Expected output:
SolScript Build Environment
✓ cargo build-sbf: solana-cargo-build-sbf 1.18.0
✓ solana: solana-cli 1.18.0
✓ anchor: anchor-cli 0.29.0
✓ Ready to build SolScript programs
Installing Dependencies¶
Solana CLI¶
Add to your PATH:
Anchor Framework¶
# Install AVM (Anchor Version Manager)
cargo install --git https://github.com/coral-xyz/anchor avm --locked
# Install latest Anchor
avm install latest
avm use latest
LLVM 18 (For Direct BPF Compilation)¶
Direct LLVM compilation bypasses Anchor/Rust for faster builds. Requires LLVM 18.
Ubuntu/Debian:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt install llvm-18-dev libpolly-18-dev
export LLVM_SYS_180_PREFIX=/usr/lib/llvm-18
macOS:
Build with LLVM feature:
Verify LLVM:
IDE Setup¶
VS Code¶
Install the SolScript extension from the VS Code marketplace, or manually:
- Download the
.vsixfile from the releases page - In VS Code: Extensions → ... → Install from VSIX
The extension provides:
- Syntax highlighting
- Error diagnostics
- Go to definition
- Hover information
- Auto-completion
Other Editors¶
SolScript provides a Language Server Protocol (LSP) implementation that works with any LSP-compatible editor:
Configure your editor to use solscript-lsp as the language server for .sol files.
Troubleshooting¶
"cargo build-sbf not found"¶
Ensure Solana CLI is installed and in your PATH:
If not found, reinstall Solana CLI and add it to your PATH.
"anchor not found"¶
Install Anchor using AVM:
cargo install --git https://github.com/coral-xyz/anchor avm --locked
avm install latest
avm use latest
Build Errors¶
If you encounter build errors, try:
- Update Rust:
rustup update - Update Solana:
solana-install update - Clear cargo cache:
cargo clean
Next Steps¶
- Quick Start - Create your first project
- Your First Contract - Write your first smart contract