Sol.College

Full lesson

Hub-AgentBot

GetFi Ecosystem: Next.js Web3 Hub & RaiderBot (Autonomous Telegram Agent) powered by Solana and AI.

What it does

From the project README:

Monorepo for the GetFi hackathon submission. Contains two production services that share an on-chain `getfi_lootbox` Anchor program on Solana devnet:
Original
GetfiLabs/Hub-AgentBot
SuperStack fork
Blockchains/Hub-AgentBot @ a1ecdb6
Stars
0
Last push (original)
2026-05-13
Languages
JavaScript, TypeScript, CSS, Rust, Shell
Detected stack
AnchorNext.jsweb3.js
Categories
AI & AgentsGaming
Licence
MIT
Homepage
https://getfi.org/

Architecture

94 source files. By extension: .tsx ×38, .js ×32, .ts ×18, .rs ×6.

Top-level directorySource files
hub68
bot26

On-chain programs: hub/getfi_lootbox/programs/getfi_lootbox

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/hub-agentbot/. 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.

GetfiLabs/Hub-AgentBot · hub/getfi_lootbox/programs/getfi_lootbox/src/lib.rs L853–876 @ a1ecdb6 · MIT · original
        bump    )]    pub config: Account<'info, Config>,    #[account(        init,        payer = owner,        space = 8 + GlobalInventory::SIZE,        seeds = [INVENTORY_SEED],        bump    )]    pub inventory: Account<'info, GlobalInventory>,    pub reward_mint: Account<'info, Mint>,    pub system_program: Program<'info, System>,} #[derive(Accounts)]pub struct InitializeInventoryV2<'info> {    #[account(mut)]    pub owner: Signer<'info>,    #[account(seeds = [CONFIG_SEED], bump = config.bump, has_one = owner)]    pub config: Account<'info, Config>,    #[account(        init,        payer = owner,
  1. Line 853 bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
  2. Line 857 init,: Creates and pays for a new account. Space and payer must be specified.
  3. Line 860 seeds = [INVENTORY_SEED],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  4. Line 871 pub owner: Signer<'info>,: Requires this account to have signed the transaction.
  5. Line 872 #[account(seeds = [CONFIG_SEED], bump = config.bump, has_one = owner)]: Checks that a stored pubkey field matches the passed account.
GetfiLabs/Hub-AgentBot · hub/functions/index.js L481–504 @ a1ecdb6 · MIT · original
      playerEntropy,      backendCommitment,      expiresAt,      signature,    });     const tx = new Transaction().add(      ComputeBudgetProgram.setComputeUnitLimit({units: 400_000}),      ed25519Ix,      requestIx,    );    tx.feePayer = hotWallet.publicKey;    const {blockhash, lastValidBlockHeight} =      await connection.getLatestBlockhash("confirmed");    tx.recentBlockhash = blockhash;    tx.partialSign(hotWallet);     const serialized = tx.serialize({requireAllSignatures: false});     return {      success: true,      requestId,      cost,      boxCount,
  1. Line 488 ComputeBudgetProgram.setComputeUnitLimit({units: 400_000}),: Sets the compute-unit limit or price (priority fee).
  2. Line 494 await connection.getLatestBlockhash("confirmed");: Fetches a recent blockhash. Transactions expire if it gets too old.

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
botnpm run devnode --watch src/index.js
botnpm run startnode src/index.js
botnpm run testecho "Error: no test specified" && exit 1
hubnpm run devnext dev
hubnpm run startnext start
hubnpm run buildnext build
hubnpm run testvitest run
hubnpm run linteslint
hub/functionsnpm run startnpm run shell
hub/functionsnpm run linteslint .
hub/functionsnpm run deployfirebase deploy --only functions
hub/getfi_lootboxnpm run lintprettier */*.js "*/**/*{.js,.ts}" --check
hub/getfi_lootboxanchor buildcompile programs and generate IDLs
hub/getfi_lootboxanchor testlocal validator + test suite
hub/getfi_lootboxanchor run testyarn run ts-mocha -p ./tsconfig.json -t 1000000 'tests/**/*.ts'
hub/getfi_lootboxanchor run migrateyarn run ts-node scripts/migrate_v2.ts

What you could build from it

Used in lessons