Skip to content

Personal repository with my progress during the First Romanian Solana Developers Program C2, containing the implementation of the courses' labs and the project. The repository is forked to the First-Romanian-Developer-Program organisation.

Notifications You must be signed in to change notification settings

angelobarbu/First-Romanian-Solana-Developers-Program-C2

Repository files navigation

First Romanian Solana Developers Program C2

Barbu Angelo-Gabriel - angelo.barbu123@gmail.com - 2024


Table of Contents

  1. Introduction
  2. Prerequisites
  3. Course Labs


Introduction

Personal repository with my progress during the First Romanian Solana Developers Program C2, containing the implementation of the courses' labs and the project. The repository is forked to the program's organisation.


Prerequisites

The following prerequisites apply for a macOS 15 system.

For Windows systems, Windows Subsystem for Linux 2 is required.




Course Labs

Course 1 - Loading and Saving Keypairs

Dependencies:

  • @solana/web3.js
  • @solana-developers/helpers
  • esrun
  • dotenv

Commands:

  1. Install dependencies
npm install

  1. Run key generator script
npx esrun generate-keypair.ts

  1. Save generated secret key to .env file
SECRET_KEY="[
   36, 236,  50,  70,   4, 204, 164, 134,   3, 170, 249,
   58, 130,  54, 251, 194,  78, 134, 241,  33,  78,  79,
   61, 205, 150,  55, 234, 102, 251,  81, 149,   1,  75,
  127, 114, 102,  75, 237, 248,  23, 138, 134, 214,  86,
  223, 134,  81, 234, 229, 134,  90, 197,  35,  59, 228,
   65,  83,  11, 235,  43,  97, 207,  45, 167
]"

  1. Run key loader script
npx esrun load-keypair.ts



Course 2 - Using Solana Devnet

Dependencies

  • @solana-developers/helpers
  • @solana/web3.js
  • esrun
  • dotenv

Commands:

  1. Install dependencies
npm install

  1. Checking account balance using Solana CLI
solana account <PUBLIC_KEY>

  1. Run check-balance.ts script
npx esrun check-balance.ts

Utils

  • Config Solana Cluster to devnet
solana config set --url https://api.devnet.solana.com



Course 3 - Transactions

Dependencies:

  • @solana/web3.js
  • @solana-developers/helpers
  • @solana/spl-memo
  • esrun
  • dotenv

Commands:

  1. Install dependencies
npm install

  1. Send airdrop to sender public key using Solana Devnet Faucet or check-balance.ts from Course 2 - Using Solana Devnet

  1. Run transfer script
npx esrun transfer.ts

Utils

  • Accounts, Transactions, Programs, Tokens, Blocks can be checked out at Solana Explorer



Course 4 - Token Minting

Dependencies:

  • @solana/web3.js
  • @solana-developers/helpers
  • @solana/spl-token
  • esrun
  • dotenv

Commands:

  1. Install dependencies
npm install

  1. Create Token Mint
npx esrun create-token-mint.ts

  1. Create a destination token account owned by another account
npx esrun create-token-account.ts

  1. Mint tokens to the destination token account created previously
npx esrun mint-tokens.ts

  1. Transfer tokens from one account to another
npx esrun mint-tokens.ts

Note: Important Public Keys

TOKEN_MINT: "CzbDpanY5DBcMGwPETdm1N82cZ8cFMLj6NpwMFaXXLLW"
MINT_AUTHORITY: "65iHwGLu5SJjGfKRACwn28f4PJ15uWureEaFTUPKiBQ2"

SRC_ACCOUNT: "GENC37uWEWWKTitsUSDu4hth9xC7yUwxxN45oYbWYngn"
SRC_TOKEN_ACCOUNT: "2N5BAGtJqaEkPWLeNHKYDS5tha5Wouerzzm4DEARhPj7"
DST_ACCOUNT: "BMdqZbo8oJrHRps5SBvyJGSF7BCa6CNxgA7piumsxAim"
DST_TOKEN_ACCOUNT: "EvjmoASQ55j9jVAo1FBVz2wkKa3jwsveibhvd46tfUN5"

Important Secret Keys available in .env file



Course 5 - Creating Token Metadata

Dependencies:

  • @metaplex-foundation/mpl-token-metadata
  • @metaplex-foundation/umi-bundle-defaults
  • @metaplex-foundation/umi-uploader-irys
  • @solana/web3.js ^1.95.4
  • @solana-developers/helpers
  • esrun
  • dotenv

Contents:

  • upload-image.ts uploads the image off-chain and gets the URI
  • upload-metadata.ts uploads the NFT's metadata offchain and gets the metadata's URI
  • mint-nft mints the NFT containing the data, the metadata and the image for the NFT on-chain and gets the transaction ID
  • index.ts mainfile used to call all the implemented functions and successfully mint the NFT

Commands:

  1. Install dependencies
npm install

  1. Run the main script
npx esrun index.ts



Course 6 - Introduction to Rust

Dependencies:

  • Rust
  • Cargo
  • Rustlings

Contents:

  • rustlings exercises finished from 00_intro to 09_strings (including quiz1).

Commands:

  1. Install and initialise rustlings
   cargo install rustlings
   rustlings init

  1. Run rustlings to see exercises' progress
rustlings



Course 7 - Local Program Development

Dependencies:

  • Rust
  • Anchor
  • Solana CLI
  • Yarn

Notes:

  • Downgrade to Solana 1.18.25 to have no issues with commands such as anchor-build, solana-keygen etc.

Commands:

  1. Initialise Anchor project
   anchor init anchor_test --template single

  1. Build Anchor project
   cd anchor_test
   anchor build

  1. Deploy Program to Devnet
   anchor deploy --provider.cluster devnet

Note: Make sure your program account has sufficient SOL balance (use Solana Devnet Faucet) and a Solana Keygen configured. If not, run:

   solana-keygen new -o /Users/user/.config/solana/id.json

  1. Run test
   anchor test

Note: Make sure your Anchor.toml cluster provider is devnet or use the flag --provider.cluster devnet.



Course 8 - On-Chain Programming

Dependencies:

  • Rust
  • Anchor
  • Solana CLI
  • Yarn

Notes & Contents:

  • Downgrade to Solana 1.18.25 to have no issues with commands such as anchor-build, solana-keygen etc.
  • Simple Solana Program that sets account's favorites and tests the method

Commands:

  1. Run the test
   anchor test



Course 9 - 10 - Anchor and Tokens

Dependencies:

  • Rust
  • Anchor
  • Solana CLI
  • Yarn
  • @solana-developers/helpers
  • @solana/spl-token

Notes & Contents:

  • Downgrade to Solana 1.18.25 to have no issues with commands such as anchor-build, solana-keygen etc.
  • Solana Program working as an escrow that mediates the transfer between two entities that want to exchange tokens.

Commands:

  1. Initialise Anchor project
   anchor init escrow --template=multiple
  1. Install NPM dependencies
   npm install
  1. Run the tests
   anchor test



Course 11 - Wallets and Frontend Development

Dependencies:

  • Next.js
  • React.js
  • "@solana/web3.js"
  • "@solana/wallet-adapter" libraries

Notes & Contents:

  • NextJs project cloned from this repository.
  • Added Connect button for Solana wallet.
  • Added Bonus functionality to send amount of SOL to recipient address from the connected wallet.

Commands:

  1. Install dependencies
   npm install
  1. Build Next.js project
   npm run build
  1. Start the project
   npm run start

Note: Project is running on localhost:3000

About

Personal repository with my progress during the First Romanian Solana Developers Program C2, containing the implementation of the courses' labs and the project. The repository is forked to the First-Romanian-Developer-Program organisation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages