This guide covers installing SolScript and its dependencies.
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
cargo install solscriptgit clone https://github.com/cryptuon/solscript
cd solscript
cargo install --path crates/solscript-cli# Install LLVM 18 first (see below), then:
cargo install --path crates/solscript-cli --features llvmsolscript --versionYou should see output like:
solscript 0.1.0
Run the doctor command to verify all tools are installed:
solscript doctorExpected 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
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"Add to your PATH:
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"# Install AVM (Anchor Version Manager)
cargo install --git https://github.com/coral-xyz/anchor avm --locked
# Install latest Anchor
avm install latest
avm use latestDirect 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-18macOS:
brew install llvm@18
export LLVM_SYS_180_PREFIX=$(brew --prefix llvm@18)Build with LLVM feature:
cargo build -p solscript-bpf --features llvmVerify LLVM:
llvm-config-18 --version # Should show 18.xInstall 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
SolScript provides a Language Server Protocol (LSP) implementation that works with any LSP-compatible editor:
# Start the language server
solscript-lspConfigure your editor to use solscript-lsp as the language server for .sol files.
Ensure Solana CLI is installed and in your PATH:
which solana
solana --versionIf not found, reinstall Solana CLI and add it to your PATH.
Install Anchor using AVM:
cargo install --git https://github.com/coral-xyz/anchor avm --locked
avm install latest
avm use latestIf you encounter build errors, try:
- Update Rust:
rustup update - Update Solana:
solana-install update - Clear cargo cache:
cargo clean
- Quick Start - Create your first project
- Your First Contract - Write your first smart contract