Full lesson
chapl1n
Solana Radar Hackathon
What it does
From the project README:
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
- Original
- sakkom/chapl1n
- SuperStack fork
- Blockchains/chapl1n @
8e42953 - Stars
- 0
- Last push (original)
- 2024-10-08
- Languages
- TypeScript, CSS, JavaScript
- Detected stack
- MetaplexNext.jsweb3.js
- Categories
- Other
- Licence
- MIT
- Homepage
- https://chapl1n.vercel.app
Architecture
67 source files. By extension: .tsx ×48, .ts ×19.
| Top-level directory | Source files |
|---|---|
src | 64 |
(root) | 3 |
Dapp: deploying
This fork is queued for its own live dapp on Sol.College, with a Devnet/Mainnet switch. It appears here, at /dapps/chapl1n/, once it is deployed and checked on devnet. Until then, run it locally with the commands below.
Key code, explained
Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.
anchorClient.ts L85–108 @ 8e42953 · MIT · original) { try { const provider = createProvider(wallet); const program = new Program<ChaplinProtocol>(IDL, provider); if (!USERSEED) throw new Error("not USERSEED in env"); const [userPda] = web3.PublicKey.findProgramAddressSync( [Buffer.from(USERSEED), authority.toBuffer()], program.programId, ); console.log("user pda", userPda.toString()); const transaction = await program.methods .createUser(name) .accounts({ user: wallet.publicKey, authority: authority, userProfile: userPda, systemProgram: anchor.web3.SystemProgram.programId, }) .transaction(); const signature = await connection.sendTransaction(transaction, [wallet.payer]);- Line 92
const [userPda] = web3.PublicKey.findProgramAddressSync(: Derives a PDA from seeds and the program ID and returns the address with its canonical bump. - Line 108
const signature = await connection.sendTransaction(transaction, [wallet.payer]);: Submits the signed transaction to the cluster.
How to run, build and test
These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.
| Directory | Command | Runs |
|---|---|---|
. | npm run dev | next dev |
. | npm run start | next start |
. | npm run build | next build |
. | npm run lint | next lint |
What you could build from it
- Fork the SuperStack copy and extend it within the Other gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Cross-Program Invocations (CPIs)