- Set up full-stack (current README.md)
- airdrop-project
- new-token
- sol-program (calc)
- crowdfunding
- staking
This guide will walk you through the process of setting up the Solana environment on your local Windows machine. Please note that while Anchor does not currently support Windows, we'll leverage the Windows Subsystem for Linux (WSL) to create a Linux environment for Solana development.
To utilize WSL, open cmd.exe
in Admin mode and execute the following command:
wsl --install
This command installs the required components, downloads the latest Linux kernel, sets WSL 2 as default, and installs a Linux distribution (Ubuntu by default).
Restart your computer after the installation.
You'll have to make a UN & PW for the new Ubuntu terminal.
Access the Ubuntu Terminal by searching for "Ubuntu" in your Start menu.
Follow this guide or use these commands to install Node.js using nvm:
// Install Curl
sudo apt-get install curl
// Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
// Restart Ubuntu Terminal
// Test if nvm exists - this will return "nvm" and not a version number if working correctly!
command -v nvm
// Install the latest version of Node.js
nvm install --lts
** Remember to run all terminal commands in the Ubuntu Terminal from now on. **
Solana programs are written in Rust. Install Rust using the following command:
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
Verify the installation:
rustup --version
Then, make sure the rust compiler is installed:
rustc --version
Last, let's make sure Cargo is working as well. Cargo is the rust package manager.
cargo --version
If these commands output versions without errors, Rust is installed successfully.
Follow the steps here to install the Solana CLI for Linux.
After installation, run:
solana --version
solana config set --url localhost
solana config get
Ensure the configuration is set correctly.
Mocha is a testing framework for Solana programs. Install it using:
npm install -g mocha
To install Anchor, run:
npm install --global yarn
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev libssl-dev
cargo install --git https://github.com/project-serum/anchor anchor-cli --locked
Verify the installation:
anchor --version
Initialize a Solana project named myepicproject
.
anchor init myepicproject --javascript
cd myepicproject
Generate a local Solana wallet keypair:
solana-keygen new
This keypair functions as a local wallet for command-line interactions with Solana programs.
If you run:
solana address
You'll see the public address of your local wallet we just created.