Sol.College

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 directorySource files
src64
(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.

sakkom/chapl1n · 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]);
  1. Line 92 const [userPda] = web3.PublicKey.findProgramAddressSync(: Derives a PDA from seeds and the program ID and returns the address with its canonical bump.
  2. 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.

DirectoryCommandRuns
.npm run devnext dev
.npm run startnext start
.npm run buildnext build
.npm run lintnext lint

What you could build from it

Used in lessons