Barbu Angelo-Gabriel - angelo.barbu123@gmail.com - 2024
- Introduction
- Prerequisites
- Course Labs
- Course 1 - Loading and Saving Keypairs
- Course 2 - Using Solana Devnet
- Course 3 - Transactions
- Course 4 - Token Minting
- Course 5 - Creating Token Metadata
- Course 6 - Introduction to Rust
- Course 7 - Local Program Development
- Course 8 - On-Chain Programming
- Course 9 - 10 - Anchor and Tokens
- Course 11 - Wallets and Frontend Development
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.
The following prerequisites apply for a macOS 15 system.
For Windows systems, Windows Subsystem for Linux 2 is required.
Dependencies:
- @solana/web3.js
- @solana-developers/helpers
- esrun
- dotenv
Commands:
- Install dependencies
npm install
- Run key generator script
npx esrun generate-keypair.ts
- 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
]"
- Run key loader script
npx esrun load-keypair.ts
Dependencies
- @solana-developers/helpers
- @solana/web3.js
- esrun
- dotenv
Commands:
- Install dependencies
npm install
- Checking account balance using Solana CLI
solana account <PUBLIC_KEY>
- 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
Dependencies:
- @solana/web3.js
- @solana-developers/helpers
- @solana/spl-memo
- esrun
- dotenv
Commands:
- Install dependencies
npm install
- Send airdrop to sender public key using Solana Devnet Faucet or check-balance.ts from Course 2 - Using Solana Devnet
- Run transfer script
npx esrun transfer.ts
Utils
- Accounts, Transactions, Programs, Tokens, Blocks can be checked out at Solana Explorer
Dependencies:
- @solana/web3.js
- @solana-developers/helpers
- @solana/spl-token
- esrun
- dotenv
Commands:
- Install dependencies
npm install
- Create Token Mint
npx esrun create-token-mint.ts
- Create a destination token account owned by another account
npx esrun create-token-account.ts
- Mint tokens to the destination token account created previously
npx esrun mint-tokens.ts
- 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
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:
- Install dependencies
npm install
- Run the main script
npx esrun index.ts
Dependencies:
- Rust
- Cargo
- Rustlings
Contents:
- rustlings exercises finished from 00_intro to 09_strings (including quiz1).
Commands:
- Install and initialise rustlings
cargo install rustlings
rustlings init
- Run rustlings to see exercises' progress
rustlings
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:
- Initialise Anchor project
anchor init anchor_test --template single
- Build Anchor project
cd anchor_test
anchor build
- 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
- Run test
anchor test
Note: Make sure your Anchor.toml cluster provider is devnet or use the flag --provider.cluster devnet.
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:
- Run the test
anchor test
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:
- Initialise Anchor project
anchor init escrow --template=multiple
- Install NPM dependencies
npm install
- Run the tests
anchor test
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:
- Install dependencies
npm install
- Build Next.js project
npm run build
- Start the project
npm run start
Note: Project is running on localhost:3000