Sol.College

Structure lesson (licence does not allow quoting code)

devolt

Official repository for DeVolt's Solana programs, iOS and Android app, main API and microsservice, providing decentralized infrastructure for energy management and auctions on the blockchain.

Original
devolthq/devolt
SuperStack fork
Blockchains/devolt @ 9c2b4a6
Stars
1
Last push (original)
2024-10-09
Languages
TypeScript, Rust, JavaScript, Shell
Detected stack
Anchorweb3.js
Categories
Infrastructure & Tooling
Licence
NOASSERTION: code not quoted on Sol.College
Homepage
https://www.devolt.xyz/

Architecture

84 source files. By extension: .tsx ×32, .ts ×26, .rs ×23, .js ×3.

Top-level directorySource files
app74
programs8
migrations1
tests1

On-chain programs: programs/payment-engine

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
sell_energySellEnergyprograms/payment-engine/src/lib.rs:14
confirm_sellingConfirmSellingprograms/payment-engine/src/lib.rs:18
buy_energyBuyEnergyprograms/payment-engine/src/lib.rs:22
confirm_buyingConfirmBuyingprograms/payment-engine/src/lib.rs:26

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
tests/payment-engine.tsgetBalance, PublicKey, Keypair, SystemProgram, findProgramAddressSync, mintTo
app/payment-engine-service/src/utils/accounts.tsPublicKey, Keypair, Connection, Transaction, sendAndConfirmTransaction, mintTo
app/payment-engine-service/src/utils/balance.tsPublicKey, Connection, Keypair, mintTo, getBalance, requestAirdrop
app/payment-engine-service/src/utils/tokenAccount.tsPublicKey, Connection, Keypair
app/payment-engine-service/src/utils/accountInitialization.tsPublicKey, Keypair, Connection
app/payment-engine-service/src/utils/compression.tsTransaction, Connection, Keypair, sendAndConfirmTransaction, Program
programs/payment-engine/src/contexts/confirm_buying.rsseeds, CpiContext, Program
app/payment-engine-service/src/config/index.tsKeypair, PublicKey, Connection, AnchorProvider, Program
app/mobile/app/home/profile/index.tsxPublicKey, Connection, Keypair, getAssociatedTokenAddress
app/payment-engine-service/src/services/sellEnergyService.tsKeypair, PublicKey, SystemProgram, findProgramAddressSync, Transaction
app/payment-engine-service/src/services/buyEnergyService.tsKeypair, PublicKey, SystemProgram, findProgramAddressSync, Transaction
programs/payment-engine/src/state/devolt_escrow.rsPubkey

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/devolt/. 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 lint
app/mobilenpm run start
app/mobilenpm run test
app/mobilenpm run lint
app/payment-engine-servicenpm run dev
app/payment-engine-servicenpm run start
app/payment-engine-servicenpm run build
.anchor build
.anchor test
.anchor run test
.cargo build
.cargo test

What you could build from it