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 directory | Source files |
|---|---|
hub | 68 |
bot | 26 |
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.
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,- Line 853
bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 857
init,: Creates and pays for a new account. Space and payer must be specified. - Line 860
seeds = [INVENTORY_SEED],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 871
pub owner: Signer<'info>,: Requires this account to have signed the transaction. - Line 872
#[account(seeds = [CONFIG_SEED], bump = config.bump, has_one = owner)]: Checks that a stored pubkey field matches the passed account.
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,- Line 488
ComputeBudgetProgram.setComputeUnitLimit({units: 400_000}),: Sets the compute-unit limit or price (priority fee). - 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.
| Directory | Command | Runs |
|---|---|---|
bot | npm run dev | node --watch src/index.js |
bot | npm run start | node src/index.js |
bot | npm run test | echo "Error: no test specified" && exit 1 |
hub | npm run dev | next dev |
hub | npm run start | next start |
hub | npm run build | next build |
hub | npm run test | vitest run |
hub | npm run lint | eslint |
hub/functions | npm run start | npm run shell |
hub/functions | npm run lint | eslint . |
hub/functions | npm run deploy | firebase deploy --only functions |
hub/getfi_lootbox | npm run lint | prettier */*.js "*/**/*{.js,.ts}" --check |
hub/getfi_lootbox | anchor build | compile programs and generate IDLs |
hub/getfi_lootbox | anchor test | local validator + test suite |
hub/getfi_lootbox | anchor run test | yarn run ts-mocha -p ./tsconfig.json -t 1000000 'tests/**/*.ts' |
hub/getfi_lootbox | anchor run migrate | yarn run ts-node scripts/migrate_v2.ts |
What you could build from it
- Fork the SuperStack copy and extend it within the AI & Agents gaps listed on the idea page.
- Learn the pattern first: Building and sending transactions from a client