Back to Course
3/8
Complete50 XP
code challenge20 min

Setting Up Your Environment

Setting Up Your Development Environment

Before we start building, let's set up the tools you'll need for Solana development.

Prerequisites

You should have the following installed:

  • Rust (via rustup)
  • Solana CLI (v1.18+)
  • Node.js (v18+)
  • Anchor (v0.30+)
  • Make sure you're on Solana CLI v1.18 or later. Earlier versions have known compatibility issues with the latest Anchor releases.

    Challenge

    Write a TypeScript function that connects to Solana devnet and fetches the current slot number.

    1Import Connection from @solana/web3.js
    2Connect to the devnet cluster
    3Fetch and return the current slot number

    Hints

    0/3 revealed
    🔒 Hint 2 — reveal previous hints first
    🔒 Hint 3 — reveal previous hints first

    Solution

    ⚠️ Try solving it yourself first!