Your instructor may use one of the applications stored in this repository to conduct a Building on Solana workshop. There are a few key elements of this repository to understand:
- 📘 Resources to learn about Solana development - whether you're beginner or intermediate level, can be found in the Resources section below.
- 🔧 Setup steps are detailed in the How to Code Along section.
- You can use a web-based IDE, which allows you to build & deploy programs without installation of any toolkits (ie.
solana
,rust
,cargo
). - You can also code along with your local setup, if you've got everything installed.
- You can use a web-based IDE, which allows you to build & deploy programs without installation of any toolkits (ie.
- 🔑 You'll get the best experience from these workshops by cloning down the redacted code and filling in the blank sections as you follow your instructor through the session.
- You can choose to simply clone down the complete application & deploy that, but this may not be as insightful!
⚠️ If at any point you get stuck or have a question, you can share your workspace with your instructor - both for the web-based IDE & your local setup.
- Go to https://beta.solpg.io/ and when you open the page for the first time, you'll see a template Solana program repository.
- You can choose to delete this template Solana repository.
- Click the "Wallet Not Connected" button in the bottom left & follow the prompts to either upload your existing wallet or generate a new one.
- To create a new repository (called a workspace), click the "New" button in the upper left-hand side.
- Choose your toolkit: Solana Native, Anchor, or Seahorse.
- Name it, and click "Create".
- 🔑 If you want to instead import an existing project, SolPG supports importing GitHub repositories as well.
- Choose "Import from GitHub" & select the framework your repository is built using (Native, Anchor, Seahorse).
- Follow the instructions detailed in the pop-up window about the specific path to provide.
- Name it, and click "Import". You should see your program code in SolPG!
- Install the Solana CLI
- Note: Requires Rust & Cargo full installation.
- Configure the Solana CLI's Cluster
solana config set -ul
: Sets cluster tohttp://localhost:8899
solana config set -ud
: Sets cluster tohttps://api.devnet.solana.com
solana config set -ut
: Sets cluster tohttps://api.testnet.solana.com
solana config set -um
: Sets cluster tohttps://api.mainnet-beta.solana.com
- Configure the Solana CLI's Wallet
solana-keygen new
: This will generate a new keypair to~/.config/solana/id.json
- Use the
-o
flag to change that output location. - Use the
--help
flag to get more information about the CLI commands.
- Building programs with Cargo
cargo new --lib program-name
- Ensure you add the following config to Cargo.toml under
[lib]
:crate-type = ["cdylib", "lib"]
cargo build-sbf --manifest-path=path/to/Cargo.toml
- Simply clone this repo but use only the
redacted-code
branchgit clone git@github.com:solana-developers/workshop-dapps.git
git checkout redacted-code
- Click the little arrow symbol underneath your project's name/path. If you hover over it, it should say "Share" (Not "Export").
- This will generate a unique URL that will allow anyone to route to your specific SolPG workspace.
- Share this link with the instructor!
- Currently the best way to do this is by using GitHub.
- You can push your most recent changes up to GitHub
- Share the link with the instructor
- Instructor can import the project into his/her SolPG instance