Option A: Using Official Installer (Recommended)
- Download from: https://github.com/solana-labs/solana/releases
- Get the latest
solana-install-init-x86_64-pc-windows-msvc.exe - Run the installer
- Restart your terminal/PowerShell
Option B: Using Chocolatey
choco install solanaOption C: Manual Install via PowerShell
# Download and run the installer
cmd /c "curl https://release.solana.com/v1.18.4/solana-install-init-x86_64-pc-windows-msvc.exe --output C:\solana-installer.exe"
C:\solana-installer.exe v1.18.4After installation, verify:
solana --versionFirst, ensure you have Rust installed:
rustc --versionIf not, install Rust from: https://rustup.rs/
Then install Anchor:
cargo install --git https://github.com/coral-xyz/anchor anchor-cli --locked# Set cluster to devnet
solana config set --url devnet
# Verify configuration
solana config get# Create a new keypair
solana-keygen new --outfile ~/.config/solana/id.json
# Or if you want to recover from seed phrase
solana-keygen recover --outfile ~/.config/solana/id.jsonSave your seed phrase securely!
solana address# Request 2 SOL (for transaction fees)
solana airdrop 2
# Check balance
solana balanceIf airdrop doesn't work, try:
Devnet USDC Mint: 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU
You can get devnet USDC from:
- Circle's Faucet: https://faucet.circle.com/ (select Solana Devnet)
- SPL Token Faucet: https://spl-token-faucet.com/?token-name=USDC
- Manually create and mint (if you have SOL):
# Create USDC token account for yourself
spl-token create-account 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU
# Check your USDC balance
spl-token balance 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDUcd C:\Users\1arya\OneDrive\Desktop\polyield\polyield
anchor buildanchor keys listOutput will show:
polyield_vault: <YOUR_PROGRAM_ID>
Update these files with your actual program ID:
File: programs/polyield_vault/src/lib.rs
declare_id!("YOUR_PROGRAM_ID_HERE");File: Anchor.toml
[programs.devnet]
polyield_vault = "YOUR_PROGRAM_ID_HERE"File: lib/solana/constants.ts
export const PROGRAM_ID = new PublicKey("YOUR_PROGRAM_ID_HERE")anchor buildanchor deployThis will output your program address. Save it!
Create a script scripts/initialize-vault.ts:
import * as anchor from "@coral-xyz/anchor";
import { Program } from "@coral-xyz/anchor";
import { PublicKey, SystemProgram } from "@solana/web3.js";
import { TOKEN_PROGRAM_ID } from "@solana/spl-token";
const USDC_MINT = new PublicKey("4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU");
async function main() {
const provider = anchor.AnchorProvider.env();
anchor.setProvider(provider);
const program = anchor.workspace.PolyieldVault as Program;
const [vaultPDA] = PublicKey.findProgramAddressSync(
[Buffer.from("vault"), USDC_MINT.toBuffer()],
program.programId
);
const [vaultStatePDA] = PublicKey.findProgramAddressSync(
[Buffer.from("vault_state"), USDC_MINT.toBuffer()],
program.programId
);
console.log("Initializing vault...");
console.log("Vault PDA:", vaultPDA.toBase58());
console.log("Vault State PDA:", vaultStatePDA.toBase58());
const tx = await program.methods
.initialize()
.accounts({
admin: provider.wallet.publicKey,
mint: USDC_MINT,
vaultState: vaultStatePDA,
vault: vaultPDA,
tokenProgram: TOKEN_PROGRAM_ID,
systemProgram: SystemProgram.programId,
})
.rpc();
console.log("✅ Vault initialized!");
console.log("Transaction:", tx);
console.log("View on Solscan:", `https://solscan.io/tx/${tx}?cluster=devnet`);
}
main();Run it:
npx ts-node scripts/initialize-vault.ts- Download from: https://phantom.app/
- Install the browser extension
- Open Phantom
- Click Settings (gear icon)
- Scroll to "Developer Settings"
- Enable "Testnet Mode"
- Select "Devnet" from the network dropdown
To use your CLI wallet in Phantom:
- Get your private key:
solana-keygen pubkey ~/.config/solana/id.json --outfile /dev/stdout
cat ~/.config/solana/id.json- In Phantom: Settings → Add/Import Wallet → Import Private Key
- Paste the base58 encoded private key
- Your devnet SOL and USDC should show up
- If not, airdrop more SOL or get USDC from faucets
cd C:\Users\1arya\OneDrive\Desktop\polyield\polyield
pnpm run devGo to: http://localhost:3001/markets
- Click "Select Wallet"
- Choose Phantom
- Approve connection
- Make sure you're on Devnet in Phantom
- Click "Predict Yes" or "Predict No" on any market
- Click "[Deposit to Yes/No]"
- Enter amount (e.g., 1 USDC)
- Click "Deposit X USDC"
- Approve transaction in Phantom
- Wait for confirmation
After transaction confirms, click the "View on Solscan" link or go to:
https://solscan.io/account/YOUR_WALLET_ADDRESS?cluster=devnet
# Your address
solana address
# SOL balance
solana balance
# USDC balance
spl-token balance 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU
# All token accounts
spl-token accountssolana account <PROGRAM_ID>solana transaction-history $(solana address) --limit 10# Get vault PDA address from deployment logs
spl-token balance 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU --owner <VAULT_PDA>- Make sure vault is initialized
- Check you have devnet USDC in your wallet
- Verify you're on devnet network
- Get more devnet SOL via airdrop
- Get devnet USDC from faucets
- Check Solscan for detailed error logs
- Ensure program ID is correct in all files
- Verify vault was initialized
- Make sure Phantom is on Devnet mode
- Create USDC token account if needed
- Refresh the wallet
- Devnet Solscan: https://solscan.io/?cluster=devnet
- Devnet Explorer: https://explorer.solana.com/?cluster=devnet
- SOL Faucet: https://faucet.solana.com/
- Circle USDC Faucet: https://faucet.circle.com/
- SPL Token Faucet: https://spl-token-faucet.com/
Once testing is complete on devnet:
- Test all deposit/withdraw scenarios
- Verify transactions on Solscan
- Check vault balances
- Test with multiple users
- Document any issues
- Prepare for mainnet deployment (if applicable)