Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

1. Lecture - Introduction to Solana and Blockchain

To make the most of our first lecture, please set up your development environment in advance.

Table of Contents

Dev Setup

Tip

Checkout Manual Setup section for step by step guide.

Setup Version Installation Note
WSL 2.0 Guide Highly recomended
Rust 1.86.0 Guide
Solana 2.2.12 Guide
Anchor 0.31.1 Guide
VS Code Guide Or any other favorite IDE
Rust Analyzer Guide Highly recommended
Docker Guide To use pre-configured docker image

Solana Handbook

This is the main learning material for the first lecture. It is our introductory material to blockchain and Solana. Getting comfortable with it will help you pass the first task!

Solana Handbook

Command cheatsheet

Solana CLI

  • Get current config

    solana config get
  • Set CLI config url to localhost cluster

    solana config set --url localhost # useful for local development
    solana config set -u l # shorter option, l stands for localhost
    solana config set --url devnet # useful for devnet testing
    solana config set -u d # shorter option, d stands for devnet

    More at Clusters and Public RPC Endpoints

  • Create CLI Keypair

    solana-keygen new -o test.json
  • Airdrop

    [!NOTE] Airdrop only works on devnet, testnet and localhost.

    solana airdrop 5

    [!TIP] You can also optionally specify the destination address of the airdrop.

    solana airdrop 5 <YOUR_PUBKEY>

    [!TIP] You can also use the Solana Faucet to get some SOL.

  • Get PubKey from Keypair

    solana-keygen pubkey ~/my-solana-wallet/my-keypair.json
  • Run Solana test validator

    [!NOTE] In most cases you DO NOT need to start the local validator by yourself. Down below you can find the Anchor commands which will handle everything for you.

    solana-test-validator
  • Get logs from the Solana validator

    solana logs

Anchor

  • Initialize new project

    anchor init <your_project_name>
  • Build the project

    anchor build
  • Test the project (preferred)

    anchor test
  • Test the project (less preferred)

    In a separate terminal tab, call:

    solana-test-validator

    Within the anchor project directory:

    • Build the project
      anchor build
    • Run tests without starting the local validator (started it manually in the step above)
      anchor test --skip-local-validator

Need help?

If you have any questions feel free to reach out to us on Discord.