Full lesson
SolanaGhostMesh
What it does
From the project README:
GhostMesh bridges the physical and digital worlds by turning low-power edge devices into verifiable sources of real-world truth.
- Original
- dmarcr1997/SolanaGhostMesh
- SuperStack fork
- Blockchains/SolanaGhostMesh @
704955f - Stars
- 0
- Last push (original)
- 2025-10-30
- Languages
- TypeScript, JavaScript, Python, CSS, Rust, HTML
- Detected stack
- web3.js
- Categories
- Other
- Licence
- MIT
Architecture
39 source files. By extension: .ts ×19, .tsx ×9, .js ×6, .py ×3, .rs ×1, .sol ×1.
| Top-level directory | Source files |
|---|---|
pi | 21 |
fe | 17 |
contract | 1 |
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/solanaghostmesh/. 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.
contract/src/lib.rs L73–96 @ 704955f · MIT · original pub timestamp: i64, pub verified: bool, #[max_len(10)] pub whitelist: Vec<Pubkey>,} #[derive(Accounts)]pub struct SubmitAttestation<'info> { #[account(mut)] pub payer: Signer<'info>, #[account( init_if_needed, payer = payer, space = ANCHOR_DISCRIMINATOR_SIZE + DeviceAttestation::INIT_SPACE, seeds = [b"attestation", payer.key().as_ref()], bump )] pub device_attestation: Account<'info, DeviceAttestation>, pub system_program: Program<'info, System>,} #[derive(Accounts)]pub struct VerifyDevice<'info> { #[account(mut)]- Line 82
pub payer: Signer<'info>,: Requires this account to have signed the transaction. - Line 84
init_if_needed,: Creates the account only if it doesn't exist. Watch for re-initialisation bugs. - Line 87
seeds = [b"attestation", payer.key().as_ref()],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 88
bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
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 |
|---|---|---|
fe/flock-ipfs-image-mesh | npm run dev | vite |
fe/flock-ipfs-image-mesh | npm run build | tsc -b && vite build |
fe/flock-ipfs-image-mesh | npm run lint | eslint . |
pi/uploader | npm run start | node /app/index.mjs |
pi/submitter | npm run dev | ts-node-esm src/server.ts |
pi/submitter | npm run start | node dist/server.js |
pi/submitter | npm run build | tsc |
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)