Sol.College

Full lesson

Blockchain-SACCO

What it does

From the project README:

1. `chatbot-lambda`: Telegram chatbot backend on AWS Lambda (Python). 2. `website-nextjs`: Static-first transparency and signup site on Vercel (Next.js).
Original
avanloo01/Blockchain-SACCO
SuperStack fork
Blockchains/Blockchain-SACCO @ 4f20bfa
Stars
0
Last push (original)
2026-05-27
Languages
Python, TypeScript, CSS, JavaScript
Detected stack
Next.jssolana-py
Categories
Other
Licence
Apache-2.0

Architecture

61 source files. By extension: .py ×36, .ts ×13, .tsx ×12.

Top-level directorySource files
chatbot-lambda35
website-nextjs25
scripts1

Dapp: devnet deploy pending

⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/blockchain-sacco/. Until then, the lesson and step-by-step guide below are complete, and you can 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.

avanloo01/Blockchain-SACCO · chatbot-lambda/src/services/solana_disburse.py L25–48 @ 4f20bfa · Apache-2.0 · original
 # Well-known Solana program IDs._TOKEN_PROGRAM_ID = Pubkey.from_string("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")_ASSOCIATED_TOKEN_PROGRAM_ID = Pubkey.from_string("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL")_SYSTEM_PROGRAM_ID = Pubkey.from_string("11111111111111111111111111111111") # USDC has 6 decimal places._USDC_DECIMALS = 6  class DisburseResult(NamedTuple):    tx_signature: str    error: str | None = None  def _get_ata(wallet: Pubkey, mint: Pubkey) -> Pubkey:    """Derive the Associated Token Account (ATA) address for a given owner and mint."""    seeds = [bytes(wallet), bytes(_TOKEN_PROGRAM_ID), bytes(mint)]    ata, _ = Pubkey.find_program_address(seeds, _ASSOCIATED_TOKEN_PROGRAM_ID)    return ata  def _create_ata_idempotent_instruction(    payer: Pubkey, owner: Pubkey, mint: Pubkey, ata: Pubkey
  1. Line 42 seeds = [bytes(wallet), bytes(_TOKEN_PROGRAM_ID), bytes(mint)]: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  2. Line 43 ata, _ = Pubkey.find_program_address(seeds, _ASSOCIATED_TOKEN_PROGRAM_ID): Derives a PDA from seeds and the program ID and returns the address with its canonical bump.
avanloo01/Blockchain-SACCO · chatbot-lambda/src/services/solana_vote.py L49–72 @ 4f20bfa · Apache-2.0 · original
         memo_ix = Instruction(            program_id=_MEMO_PROGRAM_ID,            accounts=[AccountMeta(pubkey=payer, is_signer=True, is_writable=False)],            data=memo_bytes,        )         bh_resp = _rpc(rpc_url, "getLatestBlockhash", [{"commitment": "confirmed"}])        recent_blockhash = Hash.from_string(bh_resp["result"]["value"]["blockhash"])         tx = Transaction.new_signed_with_payer(            instructions=[memo_ix],            payer=payer,            signing_keypairs=[keypair],            recent_blockhash=recent_blockhash,        )         import base64  # noqa: PLC0415        tx_b64 = base64.b64encode(bytes(tx)).decode("utf-8")        send_resp = _rpc(            rpc_url,            "sendTransaction",            [tx_b64, {"encoding": "base64", "preflightCommitment": "confirmed"}],        )
  1. Line 56 bh_resp = _rpc(rpc_url, "getLatestBlockhash", [{"commitment": "confirmed"}]): Fetches a recent blockhash. Transactions expire if it gets too old.
  2. Line 70 "sendTransaction",: 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
website-nextjsnpm run devnext dev
website-nextjsnpm run startnext start
website-nextjsnpm run buildnext build
website-nextjsnpm run linteslint

What you could build from it