Skip to content

Latest commit

 

History

History
59 lines (46 loc) · 2.81 KB

File metadata and controls

59 lines (46 loc) · 2.81 KB

Rota News Curator — GenLayer Intelligent Contract

news_curator.py is a GenLayer Intelligent Contract: a Python contract whose validators can browse the web and run LLM inference, reaching consensus on the result (the "equivalence principle"). Rota uses it as an on-chain, AI-curated news desk:

  • arc category — best news for the Arc ecosystem (Arc L1, Circle, USDC, stablecoin payments).
  • rota category — news for Rota's domain: ROSCAs / chit funds / group savings, financial inclusion, stablecoin remittances.

Each refresh_news() transaction makes validators fetch live sources — two Google News queries plus the news sections of CoinMarketCap, CoinGecko, and TradingView — ask an LLM to pick and summarize the most relevant stories, agree on the result (non-comparative equivalence principle, so slightly different fetches per validator are fine), and store it on-chain as JSON. The app's /news page reads it with genlayer-js — no backend, no API keys in the frontend.

Live deployment

Contract Network Address
RotaNewsCurator GenLayer studionet 0xDFEE06117b8d91b5b3e17Bfb09C6C0592ea71690

This is the address in .env.example; the app reads it via VITE_GENLAYER_NEWS_CONTRACT. Studionet resets occasionally — if reads start failing, redeploy per below and update the variable.

Deploy on GenLayer Studio testnet (studionet)

  1. Open GenLayer Studio and connect/create an account (studionet is free — no gas token needed).

  2. Create a new contract, paste the contents of news_curator.py, and Deploy (the constructor takes no arguments).

  3. Copy the deployed contract address (0x…).

  4. In the repo root .env.local, add:

    VITE_GENLAYER_NEWS_CONTRACT=0xYourDeployedAddress
  5. Restart pnpm dev. The News page now reads from your contract.

  6. Seed it: either call refresh_news from the Studio UI, or use the Refresh on-chain button on the /news page (it signs with a free local burner account — fine on studionet).

Alternative: the GenLayer CLI (npm i -g genlayer, genlayer init, genlayer deploy) deploys the same file.

Notes / limitations

  • Curation quality and feed availability depend on the validators' LLM and web access; refresh_news can take ~30–60 s to finalize while consensus runs.
  • Anyone may call refresh_news — acceptable for a testnet news feed; gate it behind an owner address before any production use.
  • Studionet resets occasionally; redeploy and update VITE_GENLAYER_NEWS_CONTRACT if reads start failing.