Prerequisites
- System: macOS, Linux, or Windows with WSL
- Basic terminal knowledge: Running commands in terminal
Step 1: Install Rust (if not already installed)
If you don’t have Rust installed:Step 2: Install Latest Solana CLI
Install the latest Solana CLI 3.0.0 from Anza:solana-cli 3.0.0 (src:21f770aa; feat:2900245688, client:Agave)
Step 3: Create Hello Solayer Project
Create a new Rust library project:edition2024
feature.
Update your Cargo.toml
:
Step 4: Write the Hello Solayer Program
Replace the contents ofsrc/lib.rs
with:
Step 5: Generate Keypairs
Navigate back to your project root:Step 6: Configure Solayer Devnet
Set Solana CLI to use Solayer devnet:- RPC URL:
https://devnet-rpc.solayer.org
- Keypair Path:
./wallet-keypair.json
Step 7: Fund Your Wallet
Check your current balance:Step 8: Build Your Program
Navigate to your hello directory and build the program:hello.so
in the dist directory.