Sol.College

Structure lesson (licence does not allow quoting code)

HYDRX-protocol

High-Throughput, Sub-50ms Verifiable Water Conservation DePIN on Solana

Original
NVN404/HYDRX-protocol
SuperStack fork
Blockchains/HYDRX-protocol @ 5c17da5
Stars
0
Last push (original)
2026-10-11
Languages
TypeScript, JavaScript, HTML, Rust, CSS, Shell
Detected stack
AnchorNext.jsweb3.js
Categories
DePIN
Licence
none detected: code not quoted on Sol.College
Homepage
https://hydrx-frontend.onrender.com/

Architecture

47 source files. By extension: .tsx ×26, .js ×9, .ts ×9, .rs ×3.

Top-level directorySource files
frontend34
scripts5
programs3
dashboard2
relayer1
tests1
iot-simulator1

On-chain programs: programs/hydrx_magic

How it works: instructions and accounts

Each instruction handler and the accounts struct it validates, found by reading the Rust source. Links go to the exact line at the pinned commit.

InstructionAccountsSource
set_relayerSetRelayerprograms/hydrx_magic/src/lib.rs:52
initialize_residentInitializeResidentprograms/hydrx_magic/src/lib.rs:67
delegate_residentDelegateResidentprograms/hydrx_magic/src/lib.rs:93
commit_residentCommitResidentprograms/hydrx_magic/src/lib.rs:195
undelegate_residentUndelegateResidentprograms/hydrx_magic/src/lib.rs:220
claim_tokensClaimTokensprograms/hydrx_magic/src/lib.rs:279

Where the Solana code lives

Source files that import a Solana SDK, ranked by how many Solana APIs they use, with the APIs each one calls. Read them in this order to see how the app talks to the chain.

FileSolana APIs used
relayer/server.jsPublicKey, Keypair, Transaction, getLatestBlockhash, signTransaction, Connection
programs/hydrx_magic/src/lib.rsseeds, Pubkey, AccountInfo, Program, CpiContext, has_one
tests/hydrx_magic.tsPublicKey, SystemProgram, Keypair, getAssociatedTokenAddressSync, findProgramAddressSync, Transaction
frontend/src/app/api/meteora/swap/route.tsPublicKey, Keypair, createTransferInstruction, getAssociatedTokenAddress, Connection, Transaction
frontend/src/app/api/faucet/route.tsPublicKey, Keypair, getAssociatedTokenAddress, createTransferInstruction, Connection, Transaction
frontend/src/components/DonationTab.tsxTransaction, PublicKey, getAssociatedTokenAddress, useWallet, useConnection, sendTransaction
frontend/src/lib/solana.tsPublicKey, Connection, findProgramAddressSync, getAssociatedTokenAddressSync, Program
frontend/src/app/api/meteora/route.tsPublicKey, Connection, Transaction, findProgramAddressSync, transfer, Program
scripts/test-real-onchain.jsPublicKey, Keypair, Connection, SystemProgram, AnchorProvider, Program
frontend/src/components/MarketplaceTab.tsxTransaction, useWallet, useConnection, SystemProgram, PublicKey, sendTransaction
scripts/init-pool.jsPublicKey, Keypair, SystemProgram, Program, findProgramAddressSync, Connection
scripts/init-meteora-dbc.tsPublicKey, Program, Connection, Keypair

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/hydrx-protocol/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

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 dev
.npm run start
.npm run build
.npm run test
dashboardnpm run start
relayernpm run dev
relayernpm run start
frontendnpm run dev
frontendnpm run start
frontendnpm run build
frontendnpm run lint
iot-simulatornpm run start
.anchor build
.anchor test
.anchor run test
.cargo build

What you could build from it