Repository navigation
Notes from running afara end-to-end locally (fresh clone) + a pass over toju.network #20
Replies: 2 comments
|
Looping in @anurag-p6. During C4GT DMP'26 he worked on this same codebase in seetadev's copy, and two of his merged PRs there bear directly on the findings above:
Anurag, are there plans to bring either of these upstream here? It would help to know before anyone opens overlapping PRs for those two points. |
|
Also looping in Anirudh Sharma (@anisharma07 / @its-me-ani), another C4GT DMP'26 contributor on seetadev's projects. His SocialCalc healthcare apps (seetadev/ZKMedical-Billing#107) pin sheets, PDFs and CSVs to IPFS through Pinata or MeshKit. That makes him a downstream user of the same storage path as findings 4 and 5 above, the env/docs drift and the dev-port setup. Anirudh, if you hit any of these while integrating, or have other setup issues, please add them here. |
Uh oh!
There was an error while loading. Please reload this page.
Hi toju team 👋
I cloned afara at
b801877(main, identical todev), ran the full stack locally and tried the live app at toju.network. The product works: on mainnet, a 2 MB file for 30 days quotes at 1713 lamports. I didn't do a paid upload.Getting a fresh clone running took a few detours, and I found some things that don't match between the site, the docs and the code. Here they are, in the order I think matters most. I'm happy to open PRs for any of them; tell me which ones you'd take and whether to target
dev.1. The landing page says files are encrypted. The Terms say they aren't.
ui/src/containers/home/index.tsx:213).ui/src/content/terms.md:49-51).The code matches the Terms: nothing in
server/,packages/solorui/encrypts files. Data on IPFS is public, so the landing-page wording could lead people to upload sensitive files without encrypting them first. I'd suggest dropping "encrypted" from that copy, or saying something like "content-addressed".2. Migrations
0006and0008fail on a fresh PostgresI applied
server/drizzle/*.sqlin order to a clean Postgres 17:There are two separate problems:
DEFAULT "sol"andDEFAULT "SOL"use double quotes, so Postgres reads them as column names instead of strings. They should be'sol'and'SOL'.0006(lines 4-5) and0008(line 2) alter"transactions", butschema.ts:48and the earlier migrations createtransaction.Your existing databases were presumably fixed by hand. A new contributor's database can't get past
0006.3.
seed.tsseeds a storage rate that's far too largeserver/scripts/seed.ts:55insertsratePerBytePerDay: 3000000000.0. Its own comment says0.000000000003, and production returns3e-12.With the seeded value, a local quote for 2 MB × 30 days is
1.7121658898506614e+24lamports. After changing it to3e-12, the local quote is1713, the same asapi.toju.network.4. The setup docs still describe Storacha
After the move to Pinata (#8,
ca04dba), the README, CONTRIBUTING and Terms §4.1 still describe Storacha. The env docs also need updating:server/.env.example:server/src/index.ts:28-36won't start withoutPINATA_JWTandPINATA_GATEWAY..env.examplealso leaves outDATABASE_URLandSOLANA_PROGRAM_IDL.STORACHA_KEYandSTORACHA_PROOF.It may also help to say in CONTRIBUTING that
SOLANA_PROGRAM_IDLcan be the contents ofserver/src/utils/solana/idl.json. That program (CSXnf…FquxH) is already deployed on testnet, so contributors don't need Anchor or a local validator to run the server against testnet.5. The dev ports don't line up
http://localhost:5040(ui/src/lib/utils.ts:12,packages/sol/src/client.ts:36). For pricing calls this ignoresVITE_API_URL.PORT=3000(server/src/index.ts:21). That's also the port Vite uses (uidevscript:vite --port 3000).So with default settings, the UI's API calls fail with
ERR_CONNECTION_REFUSEDuntil you setPORT=5040. One possible fix is to default the server to 5040 and mention it in CONTRIBUTING.6. The server crashes on Node 26
@sentry/profiling-node(server/src/instrument.ts:2) has no prebuilt binary for Node 26, so startup fails with:The server runs on Node 22 LTS. CONTRIBUTING only says "Node >= 20", and the repo has no
enginesfield or.nvmrc. Pinning Node 22, or loading the profiler only whenSENTRY_DSNis set, would avoid the crash.7. Smaller things
/pricing/quotefails, the upload page shows the cost as "0 SOL" instead of an error. I hit this before the database was set up.pnpm testin bothserver/andui/exits 1 with "No tests found". CI (biome.yml,knip.yml) doesn't run tests either. A single smoke test, such as a/healthcheck or a migrations-apply check, would have caught finding 2.ui/index.html).ui/src/containers/home/index.tsx:100), so testnet builds show it too.j6YEHyCV, but the site footer links5YPxMnAf.ui/package.jsondisagree. CONTRIBUTING says the UI uses the workspace SDK (workspace:*), butui/package.json:32pins@toju.network/solto^1.0.0from npm. As a result, local SDK changes don't reach the UI.How I ran it locally without any hosted accounts
db.tsso it usesdrizzle-orm/node-postgreswhenDATABASE_URLpoints at localhost, because the Neon HTTP driver can't talk to a plain Postgres. If you're interested, this could be an opt-in dev path.SOLANA_RPC_URL=https://api.testnet.solana.complus the in-repo IDL. The server found the existing on-chain config ("Config already exists").After that,
/healthreturned 200 with the DB up,/pricing/solworked, and local quotes matched production exactly.Thanks for building this. Paying for IPFS storage straight from a wallet is a nice flow. Let me know which of these you'd like PRs for.
All reactions