Skip to content

Latest commit

 

History

History
127 lines (103 loc) · 3.74 KB

README.md

File metadata and controls

127 lines (103 loc) · 3.74 KB

1. Lecture - Introduction to Solana and Blockchain

In order not to waste time on our first lecture, please prepare/install some stuff in advance. 👇

Table of Contents

Dev Setup

Tip

For step by step guide check Manual Setup

Setup Description Version How to Install
Windows subsystem for Linux(WSL) optional but highly recommended 2.0 Instructions
Rust - 1.79.0 Instructions
Solana tool suite 1.18.18 Instructions
Anchor framework - 0.30.1 Instructions
VSCode chose your own preferred IDE - Instructions
RustAnalyzer optional extension for VSCode - Instructions
Docker Install Docker - Instructions

Solana Handbook

Command cheatsheet

Solana CLI commands

  • 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

    As you may guess, Airdrop will only work on Devnet, Testnet or Localhost. No you cannot airdrop SOL on Mainnet!!

    solana airdrop 5

    You can also optionally specify the destination address of the airdrop

    solana airdrop 5 <YOUR_PUBKEY>

    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

    In most cases (99%) 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 commands

  • 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 separate window, call:
    solana-test-validator
    Within the anchor project directory
    • Build the project
      anchor build
    • Run Tests without starting the local validator (as you 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.