diff --git a/.gitignore b/.gitignore index a4b4e2fbb..fb20a9056 100644 --- a/.gitignore +++ b/.gitignore @@ -2,11 +2,17 @@ .next node_modules pnpm-lock.yaml +# Generated LLM exports (see scripts/generate-full-docs.js) public/full-documentation.txt +public/llms.txt +public/llms-full.txt +public/**/llms-full.txt +public/**/*.md .specstory/ # SpecStory explanation file .specstory/.what-is-this.md .claude/settings.local.json playwright-report/ test-results/ -blob-report/ \ No newline at end of file +blob-report/ +scripts/retrofit/retrofit-log.json diff --git a/components/copy-page.tsx b/components/copy-page.tsx index 56fc192f7..f0c454ae8 100644 --- a/components/copy-page.tsx +++ b/components/copy-page.tsx @@ -8,10 +8,18 @@ import DocumentIcon from './icons/document'; import ChatGPTIcon from './icons/chatgpt'; import AnthropicIcon from './icons/anthropic'; +// Path of the raw-markdown mirror generated by scripts/generate-full-docs.js +function markdownPathFor(asPath: string): string { + const cleanPath = asPath.split(/[?#]/)[0].replace(/\/$/, ""); + return cleanPath === "" ? "/index.md" : `${cleanPath}.md`; +} + const CopyPage: React.FC = () => { const [isOpen, setIsOpen] = useState(false); const [isCopied, setIsCopied] = useState(false); const dropdownRef = useRef(null); + const { asPath } = useRouter(); + const mdPath = markdownPathFor(asPath); // Close dropdown when clicking outside useEffect(() => { @@ -27,15 +35,19 @@ const CopyPage: React.FC = () => { const copyPageAsMarkdown = async () => { try { - // Get the current page content - const pageContent = document.querySelector('main')?.innerText || ''; - const pageTitle = document.title; - - // Create markdown content - const markdownContent = `# ${pageTitle}\n\n${pageContent}`; - + // Use the generated raw-markdown mirror of this page; fall back to the + // rendered text if it is unavailable (e.g. in dev before generation) + let markdownContent: string; + const response = await fetch(mdPath); + if (response.ok) { + markdownContent = await response.text(); + } else { + const pageContent = document.querySelector('main')?.innerText || ''; + markdownContent = `# ${document.title}\n\n${pageContent}`; + } + await navigator.clipboard.writeText(markdownContent); - + // Show success feedback setIsCopied(true); setTimeout(() => { @@ -48,21 +60,13 @@ const CopyPage: React.FC = () => { }; const viewAsMarkdown = () => { - const pageContent = document.querySelector('main')?.innerText || ''; - const pageTitle = document.title; - const markdownContent = `# ${pageTitle}\n\n${pageContent}`; - - // Open in new window/tab - const blob = new Blob([markdownContent], { type: 'text/markdown' }); - const url = URL.createObjectURL(blob); - window.open(url, '_blank'); - URL.revokeObjectURL(url); + window.open(mdPath, '_blank'); setIsOpen(false); }; const openInAI = (platform: 'chatgpt' | 'claude') => { - const currentUrl = window.location.href; - const prompt = `I'm building with GenLayer - can you read this docs page ${currentUrl} so I can ask you questions about it?`; + const mdUrl = `${window.location.origin}${mdPath}`; + const prompt = `I'm building with GenLayer - can you read this docs page ${mdUrl} so I can ask you questions about it?`; const encodedPrompt = encodeURIComponent(prompt); const urls = { diff --git a/middleware.ts b/middleware.ts new file mode 100644 index 000000000..0ffd07a3d --- /dev/null +++ b/middleware.ts @@ -0,0 +1,30 @@ +import { NextRequest, NextResponse } from "next/server"; + +// Content negotiation for AI agents: clients that explicitly ask for +// `Accept: text/markdown` on a docs page get the raw-markdown mirror +// generated by scripts/generate-full-docs.js (same content the `.md` URL +// suffix serves). Browsers never send text/markdown, so human traffic is +// unaffected. `Vary: Accept` keeps CDN caches from mixing the two. +export function middleware(req: NextRequest) { + const { pathname } = req.nextUrl; + const accept = req.headers.get("accept") || ""; + + const isPageRoute = + !pathname.startsWith("/_next") && + !pathname.startsWith("/api") && + !/\.[a-zA-Z0-9]+$/.test(pathname); + + if (isPageRoute && accept.includes("text/markdown")) { + const url = req.nextUrl.clone(); + url.pathname = pathname === "/" ? "/index.md" : `${pathname.replace(/\/$/, "")}.md`; + const res = NextResponse.rewrite(url); + res.headers.set("Vary", "Accept"); + return res; + } + + const res = NextResponse.next(); + if (isPageRoute) { + res.headers.set("Vary", "Accept"); + } + return res; +} diff --git a/next.config.js b/next.config.js index b7ff90fc3..807c405ba 100644 --- a/next.config.js +++ b/next.config.js @@ -54,7 +54,7 @@ const previousRedirects = [ { old: "/build-with-genlayer/use-cases/llm-erc20", new: "/developers/intelligent-contracts/ideas" }, { old: "/advanced-features/:page*", - new: "/developers/intelligent-contracts/advanced-features/:page*", + new: "/developers/intelligent-contracts/features/:page*", }, { old: "/core-concepts/intelligent-contracts", new: "/developers/intelligent-contracts/introduction" }, { @@ -85,7 +85,7 @@ const actualRedirects = [ }, { old: "/build-with-genlayer/intelligent-contracts/advanced-features/:page*", - new: "/developers/intelligent-contracts/advanced-features/:page*", + new: "/developers/intelligent-contracts/features/:page*", }, { old: "/build-with-genlayer/use-cases/:page*", @@ -148,8 +148,16 @@ const actualRedirects = [ new: "/developers/intelligent-contracts/examples/storage", }, { - old: "/developers/intelligent-contracts/advanced-features", - new: "/developers/intelligent-contracts/advanced-features/contract-to-contract-interaction", + old: "/developers/intelligent-contracts/advanced-features/:page*", + new: "/developers/intelligent-contracts/features/:page*", + }, + { + old: "/developers/intelligent-contracts/features/contract-to-contract-interaction", + new: "/developers/intelligent-contracts/features/interacting-with-intelligent-contracts", + }, + { + old: "/developers/intelligent-contracts/features/features", + new: "/developers/intelligent-contracts/features", }, { old: "/developers/intelligent-contracts/testing-and-debugging", @@ -161,11 +169,24 @@ const actualRedirects = [ }, { old: "/developers/intelligent-contracts/error-handling", - new: "/developers/intelligent-contracts/advanced-features/error-handling", + new: "/developers/intelligent-contracts/features/error-handling", }, ]; const nextConfig = withNextra({ + async rewrites() { + return { + // Runs only when no real file matched, so valid .md mirrors in + // public/ are served directly and misses get a markdown 404 with + // closest-match suggestions instead of an HTML error page. + afterFiles: [ + { + source: "/:requested(.*\\.md)", + destination: "/api/markdown-404?requested=:requested", + }, + ], + }; + }, async redirects() { return [ // Previous redirects diff --git a/package-lock.json b/package-lock.json index 082d76c99..9f7f0c452 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "react-dom": "^18.3.1" }, "devDependencies": { + "@napi-rs/simple-git": "^0.1.22", "@playwright/test": "^1.55.0", "@types/node": "22.10.1", "typescript": "^5.0.0" @@ -525,34 +526,35 @@ } }, "node_modules/@napi-rs/simple-git": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git/-/simple-git-0.1.19.tgz", - "integrity": "sha512-jMxvwzkKzd3cXo2EB9GM2ic0eYo2rP/BS6gJt6HnWbsDO1O8GSD4k7o2Cpr2YERtMpGF/MGcDfsfj2EbQPtrXw==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git/-/simple-git-0.1.22.tgz", + "integrity": "sha512-bMVoAKhpjTOPHkW/lprDPwv5aD4R4C3Irt8vn+SKA9wudLe9COLxOhurrKRsxmZccUbWXRF7vukNeGUAj5P8kA==", "license": "MIT", "engines": { "node": ">= 10" }, "optionalDependencies": { - "@napi-rs/simple-git-android-arm-eabi": "0.1.19", - "@napi-rs/simple-git-android-arm64": "0.1.19", - "@napi-rs/simple-git-darwin-arm64": "0.1.19", - "@napi-rs/simple-git-darwin-x64": "0.1.19", - "@napi-rs/simple-git-freebsd-x64": "0.1.19", - "@napi-rs/simple-git-linux-arm-gnueabihf": "0.1.19", - "@napi-rs/simple-git-linux-arm64-gnu": "0.1.19", - "@napi-rs/simple-git-linux-arm64-musl": "0.1.19", - "@napi-rs/simple-git-linux-powerpc64le-gnu": "0.1.19", - "@napi-rs/simple-git-linux-s390x-gnu": "0.1.19", - "@napi-rs/simple-git-linux-x64-gnu": "0.1.19", - "@napi-rs/simple-git-linux-x64-musl": "0.1.19", - "@napi-rs/simple-git-win32-arm64-msvc": "0.1.19", - "@napi-rs/simple-git-win32-x64-msvc": "0.1.19" + "@napi-rs/simple-git-android-arm-eabi": "0.1.22", + "@napi-rs/simple-git-android-arm64": "0.1.22", + "@napi-rs/simple-git-darwin-arm64": "0.1.22", + "@napi-rs/simple-git-darwin-x64": "0.1.22", + "@napi-rs/simple-git-freebsd-x64": "0.1.22", + "@napi-rs/simple-git-linux-arm-gnueabihf": "0.1.22", + "@napi-rs/simple-git-linux-arm64-gnu": "0.1.22", + "@napi-rs/simple-git-linux-arm64-musl": "0.1.22", + "@napi-rs/simple-git-linux-ppc64-gnu": "0.1.22", + "@napi-rs/simple-git-linux-s390x-gnu": "0.1.22", + "@napi-rs/simple-git-linux-x64-gnu": "0.1.22", + "@napi-rs/simple-git-linux-x64-musl": "0.1.22", + "@napi-rs/simple-git-win32-arm64-msvc": "0.1.22", + "@napi-rs/simple-git-win32-ia32-msvc": "0.1.22", + "@napi-rs/simple-git-win32-x64-msvc": "0.1.22" } }, "node_modules/@napi-rs/simple-git-android-arm-eabi": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm-eabi/-/simple-git-android-arm-eabi-0.1.19.tgz", - "integrity": "sha512-XryEH/hadZ4Duk/HS/HC/cA1j0RHmqUGey3MsCf65ZS0VrWMqChXM/xlTPWuY5jfCc/rPubHaqI7DZlbexnX/g==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm-eabi/-/simple-git-android-arm-eabi-0.1.22.tgz", + "integrity": "sha512-JQZdnDNm8o43A5GOzwN/0Tz3CDBQtBUNqzVwEopm32uayjdjxev1Csp1JeaqF3v9djLDIvsSE39ecsN2LhCKKQ==", "cpu": [ "arm" ], @@ -566,9 +568,9 @@ } }, "node_modules/@napi-rs/simple-git-android-arm64": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm64/-/simple-git-android-arm64-0.1.19.tgz", - "integrity": "sha512-ZQ0cPvY6nV9p7zrR9ZPo7hQBkDAcY/CHj3BjYNhykeUCiSNCrhvwX+WEeg5on8M1j4d5jcI/cwVG2FslfiByUg==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm64/-/simple-git-android-arm64-0.1.22.tgz", + "integrity": "sha512-46OZ0SkhnvM+fapWjzg/eqbJvClxynUpWYyYBn4jAj7GQs1/Yyc8431spzDmkA8mL0M7Xo8SmbkzTDE7WwYAfg==", "cpu": [ "arm64" ], @@ -582,9 +584,9 @@ } }, "node_modules/@napi-rs/simple-git-darwin-arm64": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-arm64/-/simple-git-darwin-arm64-0.1.19.tgz", - "integrity": "sha512-viZB5TYgjA1vH+QluhxZo0WKro3xBA+1xSzYx8mcxUMO5gnAoUMwXn0ZO/6Zy6pai+aGae+cj6XihGnrBRu3Pg==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-arm64/-/simple-git-darwin-arm64-0.1.22.tgz", + "integrity": "sha512-zH3h0C8Mkn9//MajPI6kHnttywjsBmZ37fhLX/Fiw5XKu84eHA6dRyVtMzoZxj6s+bjNTgaMgMUucxPn9ktxTQ==", "cpu": [ "arm64" ], @@ -598,9 +600,9 @@ } }, "node_modules/@napi-rs/simple-git-darwin-x64": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-x64/-/simple-git-darwin-x64-0.1.19.tgz", - "integrity": "sha512-6dNkzSNUV5X9rsVYQbpZLyJu4Gtkl2vNJ3abBXHX/Etk0ILG5ZasO3ncznIANZQpqcbn/QPHr49J2QYAXGoKJA==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-x64/-/simple-git-darwin-x64-0.1.22.tgz", + "integrity": "sha512-GZN7lRAkGKB6PJxWsoyeYJhh85oOOjVNyl+/uipNX8bR+mFDCqRsCE3rRCFGV9WrZUHXkcuRL2laIRn7lLi3ag==", "cpu": [ "x64" ], @@ -614,9 +616,9 @@ } }, "node_modules/@napi-rs/simple-git-freebsd-x64": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-freebsd-x64/-/simple-git-freebsd-x64-0.1.19.tgz", - "integrity": "sha512-sB9krVIchzd20FjI2ZZ8FDsTSsXLBdnwJ6CpeVyrhXHnoszfcqxt49ocZHujAS9lMpXq7i2Nv1EXJmCy4KdhwA==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-freebsd-x64/-/simple-git-freebsd-x64-0.1.22.tgz", + "integrity": "sha512-xyqX1C5I0WBrUgZONxHjZH5a4LqQ9oki3SKFAVpercVYAcx3pq6BkZy1YUOP4qx78WxU1CCNfHBN7V+XO7D99A==", "cpu": [ "x64" ], @@ -630,9 +632,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-arm-gnueabihf": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm-gnueabihf/-/simple-git-linux-arm-gnueabihf-0.1.19.tgz", - "integrity": "sha512-6HPn09lr9N1n5/XKfP8Np53g4fEXVxOFqNkS6rTH3Rm1lZHdazTRH62RggXLTguZwjcE+MvOLvoTIoR5kAS8+g==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm-gnueabihf/-/simple-git-linux-arm-gnueabihf-0.1.22.tgz", + "integrity": "sha512-4LOtbp9ll93B9fxRvXiUJd1/RM3uafMJE7dGBZGKWBMGM76+BAcCEUv2BY85EfsU/IgopXI6n09TycRfPWOjxA==", "cpu": [ "arm" ], @@ -646,9 +648,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-arm64-gnu": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-gnu/-/simple-git-linux-arm64-gnu-0.1.19.tgz", - "integrity": "sha512-G0gISckt4cVDp3oh5Z6PV3GHJrJO6Z8bIS+9xA7vTtKdqB1i5y0n3cSFLlzQciLzhr+CajFD27doW4lEyErQ/Q==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-gnu/-/simple-git-linux-arm64-gnu-0.1.22.tgz", + "integrity": "sha512-GVOjP/JjCzbQ0kSqao7ctC/1sodVtv5VF57rW9BFpo2y6tEYPCqHnkQkTpieuwMNe+TVOhBUC1+wH0d9/knIHg==", "cpu": [ "arm64" ], @@ -662,9 +664,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-arm64-musl": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-musl/-/simple-git-linux-arm64-musl-0.1.19.tgz", - "integrity": "sha512-OwTRF+H4IZYxmDFRi1IrLMfqbdIpvHeYbJl2X94NVsLVOY+3NUHvEzL3fYaVx5urBaMnIK0DD3wZLbcueWvxbA==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-musl/-/simple-git-linux-arm64-musl-0.1.22.tgz", + "integrity": "sha512-MOs7fPyJiU/wqOpKzAOmOpxJ/TZfP4JwmvPad/cXTOWYwwyppMlXFRms3i98EU3HOazI/wMU2Ksfda3+TBluWA==", "cpu": [ "arm64" ], @@ -677,12 +679,12 @@ "node": ">= 10" } }, - "node_modules/@napi-rs/simple-git-linux-powerpc64le-gnu": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-powerpc64le-gnu/-/simple-git-linux-powerpc64le-gnu-0.1.19.tgz", - "integrity": "sha512-p7zuNNVyzpRvkCt2RIGv9FX/WPcPbZ6/FRUgUTZkA2WU33mrbvNqSi4AOqCCl6mBvEd+EOw5NU4lS9ORRJvAEg==", + "node_modules/@napi-rs/simple-git-linux-ppc64-gnu": { + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-ppc64-gnu/-/simple-git-linux-ppc64-gnu-0.1.22.tgz", + "integrity": "sha512-L59dR30VBShRUIZ5/cQHU25upNgKS0AMQ7537J6LCIUEFwwXrKORZKJ8ceR+s3Sr/4jempWVvMdjEpFDE4HYww==", "cpu": [ - "powerpc64le" + "ppc64" ], "license": "MIT", "optional": true, @@ -694,9 +696,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-s390x-gnu": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-s390x-gnu/-/simple-git-linux-s390x-gnu-0.1.19.tgz", - "integrity": "sha512-6N2vwJUPLiak8GLrS0a3is0gSb0UwI2CHOOqtvQxPmv+JVI8kn3vKiUscsktdDb0wGEPeZ8PvZs0y8UWix7K4g==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-s390x-gnu/-/simple-git-linux-s390x-gnu-0.1.22.tgz", + "integrity": "sha512-4FHkPlCSIZUGC6HiADffbe6NVoTBMd65pIwcd40IDbtFKOgFMBA+pWRqKiQ21FERGH16Zed7XHJJoY3jpOqtmQ==", "cpu": [ "s390x" ], @@ -710,9 +712,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-x64-gnu": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-gnu/-/simple-git-linux-x64-gnu-0.1.19.tgz", - "integrity": "sha512-61YfeO1J13WK7MalLgP3QlV6of2rWnVw1aqxWkAgy/lGxoOFSJ4Wid6ANVCEZk4tJpPX/XNeneqkUz5xpeb2Cw==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-gnu/-/simple-git-linux-x64-gnu-0.1.22.tgz", + "integrity": "sha512-Ei1tM5Ho/dwknF3pOzqkNW9Iv8oFzRxE8uOhrITcdlpxRxVrBVptUF6/0WPdvd7R9747D/q61QG/AVyWsWLFKw==", "cpu": [ "x64" ], @@ -726,9 +728,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-x64-musl": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-musl/-/simple-git-linux-x64-musl-0.1.19.tgz", - "integrity": "sha512-cCTWNpMJnN3PrUBItWcs3dQKCydsIasbrS3laMzq8k7OzF93Zrp2LWDTPlLCO9brbBVpBzy2Qk5Xg9uAfe/Ukw==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-musl/-/simple-git-linux-x64-musl-0.1.22.tgz", + "integrity": "sha512-zRYxg7it0p3rLyEJYoCoL2PQJNgArVLyNavHW03TFUAYkYi5bxQ/UFNVpgxMaXohr5yu7qCBqeo9j4DWeysalg==", "cpu": [ "x64" ], @@ -742,9 +744,9 @@ } }, "node_modules/@napi-rs/simple-git-win32-arm64-msvc": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-arm64-msvc/-/simple-git-win32-arm64-msvc-0.1.19.tgz", - "integrity": "sha512-sWavb1BjeLKKBA+PbTsRSSzVNfb7V/dOpaJvkgR5d2kWFn/AHmCZHSSj/3nyZdYf0BdDC+DIvqk3daAEZ6QMVw==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-arm64-msvc/-/simple-git-win32-arm64-msvc-0.1.22.tgz", + "integrity": "sha512-XGFR1fj+Y9cWACcovV2Ey/R2xQOZKs8t+7KHPerYdJ4PtjVzGznI4c2EBHXtdOIYvkw7tL5rZ7FN1HJKdD5Quw==", "cpu": [ "arm64" ], @@ -757,10 +759,26 @@ "node": ">= 10" } }, + "node_modules/@napi-rs/simple-git-win32-ia32-msvc": { + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-ia32-msvc/-/simple-git-win32-ia32-msvc-0.1.22.tgz", + "integrity": "sha512-Gqr9Y0gs6hcNBA1IXBpoqTFnnIoHuZGhrYqaZzEvGMLrTrpbXrXVEtX3DAAD2RLc1b87CPcJ49a7sre3PU3Rfw==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@napi-rs/simple-git-win32-x64-msvc": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-x64-msvc/-/simple-git-win32-x64-msvc-0.1.19.tgz", - "integrity": "sha512-FmNuPoK4+qwaSCkp8lm3sJlrxk374enW+zCE5ZksXlZzj/9BDJAULJb5QUJ7o9Y8A/G+d8LkdQLPBE2Jaxe5XA==", + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-x64-msvc/-/simple-git-win32-x64-msvc-0.1.22.tgz", + "integrity": "sha512-hQjcreHmUcpw4UrtkOron1/TQObfe484lxiXFLLUj7aWnnnOVs1mnXq5/Bo9+3NYZldFpFRJPdPBeHCisXkKJg==", "cpu": [ "x64" ], @@ -913,6 +931,7 @@ "integrity": "sha512-04IXzPwHrW69XusN/SIdDdKZBzMfOT9UNT/YiJit/xpy2VuAoB8NHc8Aplb96zsWDddLnbkPL3TsmrS04ZU2xQ==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "playwright": "1.55.0" }, @@ -1103,6 +1122,7 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.8.tgz", "integrity": "sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g==", "license": "MIT", + "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -1124,6 +1144,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1470,6 +1491,7 @@ "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.32.0.tgz", "integrity": "sha512-5JHBC9n75kz5851jeklCPmZWcg3hUe6sjqJvyk3+hVqFaKcHwHgxsjeN1yLmggoUc6STbtm9/NQyabQehfjvWQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10" } @@ -1852,6 +1874,7 @@ "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", "license": "ISC", + "peer": true, "engines": { "node": ">=12" } @@ -5247,6 +5270,7 @@ "resolved": "https://registry.npmjs.org/next/-/next-15.0.7.tgz", "integrity": "sha512-Vl6fLEuOP1MgtEmDrY51BQr6Bl8oC8vDSHdA10xZWPPZa6e+dOwYNDLWHjvTktNLZkKYySpsW3Yzy4Lo+JORkw==", "license": "MIT", + "peer": true, "dependencies": { "@next/env": "15.0.7", "@swc/counter": "0.1.3", @@ -6336,6 +6360,7 @@ "resolved": "https://registry.npmjs.org/nextra/-/nextra-2.13.4.tgz", "integrity": "sha512-7of2rSBxuUa3+lbMmZwG9cqgftcoNOVQLTT6Rxf3EhBR9t1EI7b43dted8YoqSNaigdE3j1CoyNkX8N/ZzlEpw==", "license": "MIT", + "peer": true, "dependencies": { "@headlessui/react": "^1.7.17", "@mdx-js/mdx": "^2.3.0", @@ -6637,6 +6662,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -6649,6 +6675,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -8074,6 +8101,7 @@ "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", "license": "MIT", + "peer": true, "dependencies": { "ansi-sequence-parser": "^1.1.0", "jsonc-parser": "^3.2.0", diff --git a/package.json b/package.json index ea75072a7..d3a7b1d63 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "0.0.1", "description": "GenLayer documentation", "scripts": { - "dev": "npm run node-generate-changelog && npm run node-update-setup-guide && npm run node-update-config && npm run node-update-docker-compose && npm run node-update-monitoring-docker-compose && npm run node-update-monitoring-alloy-config && npm run node-update-greybox && npm run node-generate-api-docs && node scripts/generate-full-docs.js && next dev", - "build": "npm run node-generate-changelog && npm run node-update-setup-guide && npm run node-update-config && npm run node-update-docker-compose && npm run node-update-monitoring-docker-compose && npm run node-update-monitoring-alloy-config && npm run node-update-greybox && npm run node-generate-api-docs && node scripts/generate-full-docs.js && next build", + "dev": "npm run node-generate-changelog && npm run node-update-setup-guide && npm run node-update-config && npm run node-update-docker-compose && npm run node-update-monitoring-docker-compose && npm run node-update-monitoring-alloy-config && npm run node-update-greybox && npm run node-generate-api-docs && node scripts/generate-full-docs.js && node scripts/check-llm-exports.js && next dev", + "build": "npm run node-generate-changelog && npm run node-update-setup-guide && npm run node-update-config && npm run node-update-docker-compose && npm run node-update-monitoring-docker-compose && npm run node-update-monitoring-alloy-config && npm run node-update-greybox && npm run node-generate-api-docs && node scripts/generate-full-docs.js && node scripts/check-llm-exports.js && next build", "start": "next start", "test:e2e": "playwright test", "generate-sitemap": "node scripts/generate-sitemap-xml.js", @@ -37,6 +37,7 @@ "react-dom": "^18.3.1" }, "devDependencies": { + "@napi-rs/simple-git": "^0.1.22", "@playwright/test": "^1.55.0", "@types/node": "22.10.1", "typescript": "^5.0.0" diff --git a/pages/FAQ.mdx b/pages/FAQ.mdx index c8759662f..8e9e3b339 100644 --- a/pages/FAQ.mdx +++ b/pages/FAQ.mdx @@ -1,5 +1,6 @@ --- title: "FAQ" +description: "Frequently asked questions about GenLayer: Intelligent Contracts, Optimistic Democracy consensus, validators, the GenVM, and how to start building." --- # FAQ diff --git a/pages/api-references.mdx b/pages/api-references.mdx index 956aeb580..6cde09bb4 100644 --- a/pages/api-references.mdx +++ b/pages/api-references.mdx @@ -1,5 +1,11 @@ +--- +description: "Reference documentation for GenLayer tools: the GenLayer CLI, GenLayerJS and GenLayerPY SDKs, the testing framework, the node JSON-RPC API, and the GenVM linter." +--- + import { Card, Cards } from "nextra-theme-docs"; +# API References + diff --git a/pages/api-references/genlayer-cli/_meta.json b/pages/api-references/genlayer-cli/_meta.json index 81e1620fa..0edde3491 100644 --- a/pages/api-references/genlayer-cli/_meta.json +++ b/pages/api-references/genlayer-cli/_meta.json @@ -1,21 +1,12 @@ { - "init": "init", - "up": "up", - "stop": "stop", - "new": "new", - "config": "config", - "network": "network", - "deploy": "deploy", - "call": "call", - "write": "write", - "schema": "schema", - "code": "code", - "receipt": "receipt", - "trace": "trace", - "appeal": "appeal", - "appeal-bond": "appeal-bond", - "account": "account", - "staking": "staking", - "localnet": "localnet", - "update": "update" + "index": "Overview", + "environment": "Environment", + "contracts": "Contracts", + "transactions": "Transactions", + "configuration": "Configuration", + "accounts": "Accounts", + "staking": "Staking", + "localnet": "Localnet", + "finalize": "finalize", + "finalize-batch": "finalize-batch" } diff --git a/pages/api/markdown-404.ts b/pages/api/markdown-404.ts new file mode 100644 index 000000000..08d444af1 --- /dev/null +++ b/pages/api/markdown-404.ts @@ -0,0 +1,65 @@ +import type { NextApiRequest, NextApiResponse } from "next"; +import fs from "fs"; +import path from "path"; + +// Markdown-native 404 for missed `.md` URLs (wired via the afterFiles +// rewrite in next.config.js, so it only runs when no real .md mirror +// matched). Returns closest-match links from llms.txt instead of an HTML +// error page, so agents can self-correct. + +function suggestions(requested: string): { title: string; url: string }[] { + try { + const llms = fs.readFileSync(path.join(process.cwd(), "public", "llms.txt"), "utf8"); + const links: { title: string; url: string }[] = []; + const linkRegex = /^- \[([^\]]+)\]\((\S+?\.md)\)/gm; + let match: RegExpExecArray | null; + while ((match = linkRegex.exec(llms)) !== null) { + links.push({ title: match[1], url: match[2] }); + } + const tokens = requested + .replace(/\.md$/, "") + .toLowerCase() + .split(/[/-]/) + .filter((t) => t.length > 2); + return links + .map((link) => { + const haystack = link.url.toLowerCase(); + const score = tokens.filter((t) => haystack.includes(t)).length; + return { ...link, score }; + }) + .filter((link) => link.score > 0) + .sort((a, b) => b.score - a.score) + .slice(0, 5); + } catch { + return []; + } +} + +export default function handler(req: NextApiRequest, res: NextApiResponse) { + const requested = typeof req.query.requested === "string" ? req.query.requested : ""; + const matches = suggestions(requested); + + const lines = [ + "# 404 — Page not found", + "", + `No markdown page exists at \`/${requested}\`.`, + "", + ]; + if (matches.length) { + lines.push("Closest matches:", ""); + for (const match of matches) { + lines.push(`- [${match.title}](${match.url})`); + } + lines.push(""); + } + lines.push( + "Full page index: https://docs.genlayer.com/llms.txt", + "Complete documentation: https://docs.genlayer.com/llms-full.txt", + "" + ); + + res + .status(404) + .setHeader("Content-Type", "text/markdown; charset=utf-8") + .send(lines.join("\n")); +} diff --git a/pages/developers.mdx b/pages/developers.mdx index f92019e95..7b806e544 100644 --- a/pages/developers.mdx +++ b/pages/developers.mdx @@ -1,3 +1,7 @@ +--- +description: "Start building on GenLayer: write Intelligent Contracts in Python, develop dApps with the JS and Python SDKs, and deploy to Studio, testnet, or localnet." +--- + import { Card, Cards } from 'nextra-theme-docs' import { Callout } from 'nextra-theme-docs' diff --git a/pages/developers/decentralized-applications/_meta.json b/pages/developers/decentralized-applications/_meta.json index 4daf44892..8bc043015 100644 --- a/pages/developers/decentralized-applications/_meta.json +++ b/pages/developers/decentralized-applications/_meta.json @@ -5,6 +5,6 @@ "querying-a-transaction": "Querying a Transaction", "reading-data": "Reading Data from Intelligent Contracts", "writing-data": "Writing Data to Intelligent Contracts", - "testing": "Testing", + "testing": "Testing in Studio", "project-boilerplate": "Project Boilerplate" } diff --git a/pages/developers/decentralized-applications/architecture-overview.mdx b/pages/developers/decentralized-applications/architecture-overview.mdx index 0e519b391..e10b23c83 100644 --- a/pages/developers/decentralized-applications/architecture-overview.mdx +++ b/pages/developers/decentralized-applications/architecture-overview.mdx @@ -1,6 +1,10 @@ +--- +description: "GenLayer DApp architecture covers frontend, GenLayerJS, Optimistic Democracy, GenVM, and Ghost Contracts." +--- + # Architecture Overview of Decentralized Applications Using GenLayer -A decentralized application (DApp) on GenLayer leverages its unique blockchain architecture to integrate AI-powered smart contracts, called "Intelligent Contracts." These DApps consist of various components that work together to ensure seamless interaction with the GenLayer protocol. +A decentralized application (DApp) on GenLayer is an application architecture that connects a frontend to the GenLayer protocol through coordinated components, including AI-powered Intelligent Contracts. These DApps leverage GenLayer's unique blockchain architecture so the components can work together for seamless protocol interaction. ## Key Components diff --git a/pages/developers/decentralized-applications/dapp-development-workflow.mdx b/pages/developers/decentralized-applications/dapp-development-workflow.mdx index ce4ecf978..4d7590aba 100644 --- a/pages/developers/decentralized-applications/dapp-development-workflow.mdx +++ b/pages/developers/decentralized-applications/dapp-development-workflow.mdx @@ -1,6 +1,10 @@ +--- +description: "DApp Development Workflow with GenLayer covers Studio, local testing, deployment workflow, and GenLayerJS frontend integration." +--- + # DApp Development Workflow with GenLayer -The GenLayer platform allows developers to create decentralized applications (DApps) throughout the lifecycle of creating, testing, and deploying. This guide details how developers can transition from using the **GenLayer Studio** for their first Intelligent Contract to an advanced local development workflow, finishing with building a frontend application with **GenLayerJS**. +DApp development with GenLayer is the lifecycle for creating, testing, deploying, and connecting decentralized applications built with Intelligent Contracts. This guide explains how developers can move from using **GenLayer Studio** for their first Intelligent Contract to an advanced local development workflow, then finish by building a frontend application with **GenLayerJS**. --- diff --git a/pages/developers/decentralized-applications/genlayer-js.mdx b/pages/developers/decentralized-applications/genlayer-js.mdx index ec480ecda..44ef2415c 100644 --- a/pages/developers/decentralized-applications/genlayer-js.mdx +++ b/pages/developers/decentralized-applications/genlayer-js.mdx @@ -1,6 +1,10 @@ +--- +description: "GenLayerJS SDK covers TypeScript tools for building DApps on GenLayer with clients, transactions, events, and Viem." +--- + # GenLayerJS SDK -GenLayerJS SDK is a TypeScript library designed for developers building decentralized applications (DApps) on the GenLayer protocol. This SDK provides a comprehensive set of tools to interact with the GenLayer network, including client creation, transaction handling, event subscriptions, and more, all while leveraging the power of Viem as the underlying blockchain client. +GenLayerJS SDK is a TypeScript library for building decentralized applications (DApps) on the GenLayer protocol. It provides tools for interacting with the GenLayer network, including client creation, transaction handling, event subscriptions, and more, while using Viem as the underlying blockchain client. ## Features diff --git a/pages/developers/decentralized-applications/project-boilerplate.mdx b/pages/developers/decentralized-applications/project-boilerplate.mdx index d0bb78b19..ae0319e53 100644 --- a/pages/developers/decentralized-applications/project-boilerplate.mdx +++ b/pages/developers/decentralized-applications/project-boilerplate.mdx @@ -1,14 +1,16 @@ +--- +description: "GenLayer Project Boilerplate shows how to build a DApp with Intelligent Contracts, Vue.js, GenLayerJS, and tests." +--- import { Callout } from 'nextra-theme-docs' # GenLayer Project Boilerplate -The GenLayer Project Boilerplate is a template for building decentralized applications (DApps) on GenLayer. This boilerplate includes a complete example implementation of a football prediction market, demonstrating best practices and common patterns for GenLayer development. +The GenLayer Project Boilerplate is a template for building decentralized applications (DApps) on GenLayer with Intelligent Contracts, frontend integration, testing, and environment configuration. It includes a complete example implementation of a football prediction market that demonstrates best practices and common patterns for GenLayer development. This boilerplate is a work in progress and is not yet ready for production use. You can find the latest version at: [GenLayer Project Boilerplate](https://github.com/genlayerlabs/genlayer-project-boilerplate) - ## Features - **Contract Templates**: Ready-to-use intelligent contract templates and examples diff --git a/pages/developers/decentralized-applications/querying-a-transaction.mdx b/pages/developers/decentralized-applications/querying-a-transaction.mdx index 631205049..2dcd6bef4 100644 --- a/pages/developers/decentralized-applications/querying-a-transaction.mdx +++ b/pages/developers/decentralized-applications/querying-a-transaction.mdx @@ -1,6 +1,10 @@ +--- +description: "Querying a Transaction shows how to fetch GenLayer transaction details by hash with GenLayerJS and monitor status." +--- + # Querying a Transaction -Reading transactions in GenLayer allows you to inspect the details of any transaction that has been submitted to the network. This is useful for monitoring transaction status, debugging, and verifying transaction details. +Querying a transaction in GenLayer means reading a submitted network transaction by its hash to inspect its details. Use transaction queries to monitor transaction status, debug behavior, and verify transaction details. ## Basic Transaction Reading diff --git a/pages/developers/decentralized-applications/reading-data.mdx b/pages/developers/decentralized-applications/reading-data.mdx index 9b37f22e0..99cf9b08e 100644 --- a/pages/developers/decentralized-applications/reading-data.mdx +++ b/pages/developers/decentralized-applications/reading-data.mdx @@ -1,6 +1,10 @@ +--- +description: "Reading from Intelligent Contracts uses view functions to query state with GenLayerJS without transactions, gas, or state changes." +--- + # Reading from Intelligent Contracts -Reading from an Intelligent Contract allows you to query the contract's state and execute view functions without modifying the blockchain state. These operations are free (no fees) and provide immediate access to contract data. +Reading from Intelligent Contracts means querying contract state or executing view functions without modifying blockchain state. These read-only operations are free, require no fees, and provide immediate access to contract data. ## Understanding View Operations diff --git a/pages/developers/decentralized-applications/testing.mdx b/pages/developers/decentralized-applications/testing.mdx index c213ed7df..afebf933e 100644 --- a/pages/developers/decentralized-applications/testing.mdx +++ b/pages/developers/decentralized-applications/testing.mdx @@ -1,6 +1,10 @@ +--- +description: "Test contracts and dApps interactively using GenLayer Studio and the local development environment." +--- + import { Callout } from 'nextra-theme-docs' -# Testing Intelligent Contracts on GenLayer +# Testing Contracts in GenLayer Studio Testing Intelligent Contracts on GenLayer involves deploying contracts, sending transactions, validating their behavior, and identifying issues. Here is some guidance on how to test using the tools provided in the local development environment and GenLayer Studio. diff --git a/pages/developers/decentralized-applications/writing-data.mdx b/pages/developers/decentralized-applications/writing-data.mdx index eea79427c..8036b6da4 100644 --- a/pages/developers/decentralized-applications/writing-data.mdx +++ b/pages/developers/decentralized-applications/writing-data.mdx @@ -1,6 +1,10 @@ +--- +description: "Writing to Intelligent Contracts covers GenLayer write transactions, fees, gas, signing, receipts, and finalization." +--- + # Writing to Intelligent Contracts -Writing to an Intelligent Contract involves sending transactions that modify the contract's state. Unlike read operations, write operations require fees and need to be processed by the network before taking effect. +Writing to an Intelligent Contract means sending a transaction that modifies the contract's state. Unlike read operations, write operations require fees and must be processed by the network before taking effect. ## Understanding Write Operations diff --git a/pages/developers/intelligent-contracts/_meta.json b/pages/developers/intelligent-contracts/_meta.json index 475d7e28c..dbd6bf8cb 100644 --- a/pages/developers/intelligent-contracts/_meta.json +++ b/pages/developers/intelligent-contracts/_meta.json @@ -5,10 +5,10 @@ "tooling-setup": "Development Setup", "first-contract": "Your First Contract", "types": "Types", - "storage": "Storage", + "storage": "Contract Storage", "first-intelligent-contract": "Your First Intelligent Contract", "equivalence-principle": "Equivalence Principle", - "debugging": "Debugging", + "debugging": "Debugging in Studio", "testing": "Testing", "deploying": "Deploying", "crafting-prompts": "Prompt & Data Techniques", diff --git a/pages/developers/intelligent-contracts/crafting-prompts.mdx b/pages/developers/intelligent-contracts/crafting-prompts.mdx index 71fb1783a..7817459d6 100644 --- a/pages/developers/intelligent-contracts/crafting-prompts.mdx +++ b/pages/developers/intelligent-contracts/crafting-prompts.mdx @@ -1,8 +1,12 @@ +--- +description: "Prompt and data techniques for Intelligent Contracts: JSON outputs, stable web data, and grounded LLM judgments" +--- + # Prompt & Data Techniques import { Callout } from 'nextra-theme-docs' -Intelligent contracts combine LLM reasoning with web data and programmatic logic. Getting reliable results requires specific techniques — structured outputs, stable data extraction, and grounding LLM judgments with verified facts. +Prompt and data techniques for Intelligent Contracts are practices for getting reliable LLM reasoning, web data, and programmatic logic to work together. Use structured outputs, stable data extraction, and verified facts to make LLM judgments easier to validate. ## Always Return JSON diff --git a/pages/developers/intelligent-contracts/debugging.mdx b/pages/developers/intelligent-contracts/debugging.mdx index c334c6d5b..aa6b4ef37 100644 --- a/pages/developers/intelligent-contracts/debugging.mdx +++ b/pages/developers/intelligent-contracts/debugging.mdx @@ -1,6 +1,10 @@ +--- +description: "Debug Intelligent Contracts interactively in GenLayer Studio: deploy, send transactions, validate behavior, and inspect node logs." +--- + import { Callout } from 'nextra-theme-docs' -# Debugging Intelligent Contracts on GenLayer +# Debugging Intelligent Contracts in GenLayer Studio Debugging Intelligent Contracts on GenLayer involves deploying contracts, sending transactions, validating their behavior, and identifying issues using logs. Here is some guidance on how to debug using the GenLayer Studio. diff --git a/pages/developers/intelligent-contracts/deploying.mdx b/pages/developers/intelligent-contracts/deploying.mdx index b902414b0..7bf8f9311 100644 --- a/pages/developers/intelligent-contracts/deploying.mdx +++ b/pages/developers/intelligent-contracts/deploying.mdx @@ -1,9 +1,12 @@ +--- +description: "Deploying Intelligent Contracts on GenLayer: CLI deployment, deploy scripts, network configuration, and workflow guidance." +--- import { Callout } from 'nextra-theme-docs' import { Card, Cards } from 'nextra-theme-docs' # Deploying Intelligent Contracts -This comprehensive guide covers everything you need to know about deploying your Intelligent Contracts on GenLayer. From local development to testnet deployment, learn how to use different methods and networks effectively. +Deploying Intelligent Contracts on GenLayer means choosing a deployment method and network for moving Python-based contracts from local development toward testnet use. This guide covers local development through testnet deployment, including CLI direct deployment, deploy scripts, network configuration, and how to use each approach effectively. ## Quick Start diff --git a/pages/developers/intelligent-contracts/deploying/cli-deployment.mdx b/pages/developers/intelligent-contracts/deploying/cli-deployment.mdx index 1121d4244..6cfbef22c 100644 --- a/pages/developers/intelligent-contracts/deploying/cli-deployment.mdx +++ b/pages/developers/intelligent-contracts/deploying/cli-deployment.mdx @@ -1,8 +1,11 @@ +--- +description: "CLI Deployment explains how to deploy GenLayer Intelligent Contracts with genlayer deploy, RPC targets, and constructor args." +--- import { Callout } from 'nextra-theme-docs' # CLI Deployment -The GenLayer CLI provides a straightforward way to deploy contracts directly from the command line. +CLI Deployment is the process of using the GenLayer CLI to deploy Intelligent Contracts directly from the command line. The GenLayer CLI provides a straightforward `deploy` command for deploying a contract file, optionally selecting an RPC endpoint and passing constructor arguments. ## Direct Contract Deployment diff --git a/pages/developers/intelligent-contracts/deploying/deploy-scripts.mdx b/pages/developers/intelligent-contracts/deploying/deploy-scripts.mdx index 6d2e71a85..c415bd4b7 100644 --- a/pages/developers/intelligent-contracts/deploying/deploy-scripts.mdx +++ b/pages/developers/intelligent-contracts/deploying/deploy-scripts.mdx @@ -1,8 +1,11 @@ +--- +description: "Deploy Scripts guide complex Intelligent Contract deployments with ordered TypeScript or JavaScript scripts." +--- import { Callout } from 'nextra-theme-docs' # Deploy Scripts -For more complex deployment workflows, use deploy scripts. +Deploy scripts are TypeScript or JavaScript files used to automate more complex Intelligent Contract deployment workflows. Use deploy scripts when a deployment needs ordered steps, configuration, initialization, or multiple operations beyond a simple deploy command. ## Script Structure diff --git a/pages/developers/intelligent-contracts/deploying/deployment-methods.mdx b/pages/developers/intelligent-contracts/deploying/deployment-methods.mdx index abca59785..3aa595e19 100644 --- a/pages/developers/intelligent-contracts/deploying/deployment-methods.mdx +++ b/pages/developers/intelligent-contracts/deploying/deployment-methods.mdx @@ -1,6 +1,10 @@ +--- +description: "Deployment Methods explains CLI direct deployment and deploy scripts for GenLayer Intelligent Contracts." +--- + # Deployment Methods -GenLayer offers two primary methods for deploying Intelligent Contracts: +Deployment Methods for GenLayer Intelligent Contracts are the two supported approaches for deploying contracts: CLI direct deployment and deploy scripts. Choose **CLI Direct Deployment** to deploy contracts directly using command-line arguments, or use **Deploy Scripts** with TypeScript/JavaScript scripts for complex deployment workflows. 1. **CLI Direct Deployment**: Deploy contracts directly using command-line arguments 2. **Deploy Scripts**: Use TypeScript/JavaScript scripts for complex deployment workflows diff --git a/pages/developers/intelligent-contracts/deploying/network-configuration.mdx b/pages/developers/intelligent-contracts/deploying/network-configuration.mdx index e59b993b4..4a62e9450 100644 --- a/pages/developers/intelligent-contracts/deploying/network-configuration.mdx +++ b/pages/developers/intelligent-contracts/deploying/network-configuration.mdx @@ -1,8 +1,11 @@ +--- +description: "GenLayer network configuration covers Localnet, Studionet, Testnet Asimov, and Testnet Bradbury for deployments." +--- import { Callout } from 'nextra-theme-docs' # Network Configuration -GenLayer supports multiple networks, each serving specific purposes in the development lifecycle: +GenLayer network configuration defines which network your GenLayer CLI deployments and development workflows use. GenLayer supports multiple networks, each serving specific purposes in the development lifecycle: ## Localnet diff --git a/pages/developers/intelligent-contracts/equivalence-principle.mdx b/pages/developers/intelligent-contracts/equivalence-principle.mdx index d5a9aacf5..a6c9322ab 100644 --- a/pages/developers/intelligent-contracts/equivalence-principle.mdx +++ b/pages/developers/intelligent-contracts/equivalence-principle.mdx @@ -1,11 +1,14 @@ +--- +description: "Equivalence Principle explains how GenLayer validators reach consensus on non-deterministic Intelligent Contract outputs." +--- import { Callout } from 'nextra-theme-docs' import { Fragment } from 'react'; # The Equivalence Principle -The Equivalence Principle is how GenLayer achieves consensus on non-deterministic operations — things like web requests, LLM calls, or any computation that might produce different results on different nodes. +The Equivalence Principle is GenLayer's method for reaching consensus on non-deterministic operations, including web requests, LLM calls, or any computation that might produce different results on different nodes. -The core idea: a **leader** executes the operation and proposes a result, then **validators** independently verify whether that result is acceptable. +Under the Equivalence Principle, a **leader** executes the operation and proposes a result, then **validators** independently verify whether that result is acceptable. ## Quick Reference: Which Pattern to Use diff --git a/pages/developers/intelligent-contracts/examples/fetch-github-profile.mdx b/pages/developers/intelligent-contracts/examples/fetch-github-profile.mdx index 44fe990fb..998563def 100644 --- a/pages/developers/intelligent-contracts/examples/fetch-github-profile.mdx +++ b/pages/developers/intelligent-contracts/examples/fetch-github-profile.mdx @@ -1,6 +1,10 @@ +--- +description: "FetchGitHubProfile Contract shows how a GenLayer Intelligent Contract fetches GitHub profiles and stores agreed content." +--- + # FetchGitHubProfile Contract -The FetchGitHubProfile contract demonstrates how to fetch and store GitHub profile content within an intelligent contract. This contract shows how to use the [comparative equivalence principle](/developers/intelligent-contracts/equivalence-principle#comparative-equivalence-principle) to ensure all nodes agree on the same profile content. +The FetchGitHubProfile contract is a GenLayer Intelligent Contract example that fetches a GitHub profile page and stores its content in contract state. The example shows how to use the [comparative Equivalence Principle](/developers/intelligent-contracts/equivalence-principle#comparative-equivalence-principle) so all nodes agree on the same profile content. ```python # { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } diff --git a/pages/developers/intelligent-contracts/examples/fetch-web-content.mdx b/pages/developers/intelligent-contracts/examples/fetch-web-content.mdx index 8b2bf9859..f7713ee6f 100644 --- a/pages/developers/intelligent-contracts/examples/fetch-web-content.mdx +++ b/pages/developers/intelligent-contracts/examples/fetch-web-content.mdx @@ -1,6 +1,10 @@ +--- +description: "FetchWebContent Contract shows how an Intelligent Contract fetches web content, stores it, and reaches node agreement." +--- + # FetchWebContent Contract -The FetchWebContent contract demonstrates how to fetch and store web content within an intelligent contract. This contract shows how to use the [comparative equivalence principle](/developers/intelligent-contracts/equivalence-principle#comparative-equivalence-principle) to ensure all nodes agree on the same web content. +The FetchWebContent contract is an Intelligent Contract example that fetches web content, stores it in contract state, and uses the [comparative equivalence principle](/developers/intelligent-contracts/equivalence-principle#comparative-equivalence-principle) so all nodes agree on the same web content. The contract retrieves `https://example.com/`, decodes the response body as UTF-8 text, stores the result in `content`, and exposes it through `show_content()`. ```python # { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } diff --git a/pages/developers/intelligent-contracts/examples/github-profile-projects.mdx b/pages/developers/intelligent-contracts/examples/github-profile-projects.mdx index cf6fd4bed..a36212cdd 100644 --- a/pages/developers/intelligent-contracts/examples/github-profile-projects.mdx +++ b/pages/developers/intelligent-contracts/examples/github-profile-projects.mdx @@ -1,6 +1,10 @@ +--- +description: "GitHubProfilesRepositories contract fetches GitHub profiles, counts repositories, and stores high-contributor handles." +--- + # GitHubProfilesRepositories Contract -The GitHubProfilesRepositories contract demonstrates how to fetch GitHub profile data, analyze repository counts, and store profiles of high-contributing developers. This contract shows how to use the [comparative equivalence principle](/developers/intelligent-contracts/equivalence-principle#comparative-equivalence-principle) along with pattern matching to process web content. +The GitHubProfilesRepositories contract is an Intelligent Contract example that fetches public GitHub profile data, extracts repository counts, and stores handles for developers with more than 25 repositories. The example demonstrates how to use the [comparative Equivalence Principle](/developers/intelligent-contracts/equivalence-principle#comparative-equivalence-principle) with pattern matching to process web content and reach consensus on the fetched repository count. ```python # { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } diff --git a/pages/developers/intelligent-contracts/examples/github-profile-summary.mdx b/pages/developers/intelligent-contracts/examples/github-profile-summary.mdx index c44cbfb53..67679e603 100644 --- a/pages/developers/intelligent-contracts/examples/github-profile-summary.mdx +++ b/pages/developers/intelligent-contracts/examples/github-profile-summary.mdx @@ -1,6 +1,10 @@ +--- +description: "GitHubProfilesSummaries Intelligent Contract fetches GitHub profiles and stores AI-generated summaries using equivalence principles." +--- + # GitHubProfilesSummaries Contract -The GitHubProfilesSummaries contract demonstrates how to fetch GitHub profile data and generate AI-powered summaries of user profiles. This contract shows how to combine web scraping with AI analysis using both [comparative](/developers/intelligent-contracts/equivalence-principle#comparative-equivalence-principle) and [non-comparative](/developers/intelligent-contracts/equivalence-principle#non-comparative-equivalence-principle) equivalence principles. +The GitHubProfilesSummaries contract is an Intelligent Contract example that fetches GitHub profile data, generates AI-powered summaries, and stores one summary per GitHub handle. The example demonstrates how to combine web scraping with AI analysis using both [comparative](/developers/intelligent-contracts/equivalence-principle#comparative-equivalence-principle) and [non-comparative](/developers/intelligent-contracts/equivalence-principle#non-comparative-equivalence-principle) equivalence principles. ```python # { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } diff --git a/pages/developers/intelligent-contracts/examples/llm-hello-world-non-comparative.mdx b/pages/developers/intelligent-contracts/examples/llm-hello-world-non-comparative.mdx index 8f805eea3..83885a723 100644 --- a/pages/developers/intelligent-contracts/examples/llm-hello-world-non-comparative.mdx +++ b/pages/developers/intelligent-contracts/examples/llm-hello-world-non-comparative.mdx @@ -1,6 +1,10 @@ +--- +description: "LlmHelloWorldNonComparative shows non-comparative Equivalence Principle prompting in a Python Intelligent Contract." +--- + # LlmHelloWorldNonComparative Contract -The LlmHelloWorldNonComparative contract demonstrates a simple example of integrating AI capabilities within an intelligent contract without requiring that all the validators execute the full task. They just need to evaluate the leader's response against the specified criteria. This is done by using the [non-comparative equivalence principle](/developers/intelligent-contracts/equivalence-principle#non-comparative-equivalence-principle). +The `LlmHelloWorldNonComparative` contract is a Python Intelligent Contract example that stores an LLM response validated with the non-comparative Equivalence Principle. It demonstrates integrating AI capabilities without requiring all validators to execute the full task; validators only evaluate the leader's response against specified criteria. This is done by using the [non-comparative equivalence principle](/developers/intelligent-contracts/equivalence-principle#non-comparative-equivalence-principle). ```python # { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } @@ -17,8 +21,11 @@ class LlmHelloWorldNonComparative(gl.Contract): @gl.public.write def set_message(self) -> typing.Any: + def get_input() -> str: + return "There is no context, I just want you to answer with truthy value in python (for example: 'yes', 'True', 1)" + self.message = gl.eq_principle.prompt_non_comparative( - lambda: "There is no context, I just want you to answer with truthy value in python (for example: 'yes', 'True', 1)", + get_input, task="Answer with truthy value in python (for example: 'yes', 'True', 1)", criteria="Answer should be a truthy value in python" ) @@ -34,7 +41,7 @@ class LlmHelloWorldNonComparative(gl.Contract): - **Write Method**: - `set_message()` uses AI functionality to generate and store a message. - Uses `gl.eq_principle.prompt_non_comparative()` with three parameters: - - A lambda function providing the prompt + - An input function (`get_input`) providing the prompt - A task description - Validation criteria for the response - **Read Method**: diff --git a/pages/developers/intelligent-contracts/examples/llm-hello-world.mdx b/pages/developers/intelligent-contracts/examples/llm-hello-world.mdx index 0c31fbe73..9c4a5b6a4 100644 --- a/pages/developers/intelligent-contracts/examples/llm-hello-world.mdx +++ b/pages/developers/intelligent-contracts/examples/llm-hello-world.mdx @@ -1,6 +1,10 @@ +--- +description: "LlmHelloWorld is the simplest Intelligent Contract LLM example: the leader generates a salute and validators judge it against criteria." +--- + # LlmHelloWorld Contract -The LlmHelloWorld contract demonstrates a simple example of integrating AI capabilities within an intelligent contract. This contract shows how to use the [comparative equivalence principle](/developers/intelligent-contracts/equivalence-principle#comparative-equivalence-principle) to call an LLM and store the response in the contract state. +The `LlmHelloWorld` contract is the simplest example of calling an LLM from a Python Intelligent Contract. The leader validator asks an LLM to generate a short salute, and the other validators use the [non-comparative Equivalence Principle](/developers/intelligent-contracts/equivalence-principle#pattern-4-source-grounded-non-comparative-validation) to judge whether the leader's response actually is a salute — without each validator generating its own. This is how GenLayer reaches consensus on open-ended LLM output that would never match word-for-word across validators. ```python # { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } @@ -17,35 +21,42 @@ class LlmHelloWorld(gl.Contract): @gl.public.write def set_message(self) -> typing.Any: - - def get_message() -> str: - task = "There is no context, I just want you to answer with a string equal to 'yes'" - result = gl.nondet.exec_prompt(task) - print(result) - return result - - self.message = gl.eq_principle.strict_eq(get_message) + def get_input() -> str: + return "A new developer just deployed their first Intelligent Contract on GenLayer" + + self.message = gl.eq_principle.prompt_non_comparative( + get_input, + task="Write a short, friendly salute of at most one sentence celebrating this moment", + criteria=""" + The response is a salute or greeting + It is friendly and positive + It is at most one sentence + """, + ) @gl.public.view - def get_message(self) -> str: + def get_message(self) -> str: return self.message ``` ## Code Explanation - **Initialization**: The `LlmHelloWorld` class initializes with an empty string in the `message` variable. -- **Write Method**: - - `set_message()` uses AI functionality to generate and store a message. - - It contains an inner function `get_message()` that prompts an AI model with a simple task. - - Uses `gl.eq_principle.strict_eq()` to ensure deterministic AI responses across the network. -- **Read Method**: - - `get_message()` returns the stored message. +- **Write Method**: + - `set_message()` calls `gl.eq_principle.prompt_non_comparative()` with three parameters: + - An input function (`get_input`) providing the context the LLM works from + - A `task` describing what the leader's LLM should generate + - The `criteria` validators use to judge the leader's output + - The **leader** runs the LLM with the input and task and proposes the salute it generated. + - Each **validator** does not generate its own salute; it evaluates the leader's response against the criteria and votes to accept or reject. +- **Read Method**: + - `get_message()` returns the stored salute. ## Key Components -1. **AI Integration**: The contract uses `gl.nondet.exec_prompt()` to interact with an AI model. -2. **Deterministic Execution**: `gl.eq_principle.strict_eq()` ensures that all nodes in the network arrive at the same exact result. -3. **State Management**: The contract maintains a single string state variable that stores the AI response. +1. **Open-ended LLM output**: Every LLM run produces a differently worded salute, so validators could never agree on an exact string. +2. **Criteria-based consensus**: `gl.eq_principle.prompt_non_comparative()` lets validators agree on whether the output *satisfies the criteria* ("is this a friendly one-sentence salute?") instead of requiring identical text. +3. **State Management**: The contract stores the accepted salute in a single string state variable. ## Deploying the Contract @@ -58,38 +69,38 @@ To deploy the LlmHelloWorld contract: After deployment, you can: -- Use `get_message()` to view the currently stored message. +- Use `get_message()` to view the currently stored salute. - Initially, this will return an empty string. ## Executing Transactions To interact with the deployed contract: -1. Call `set_message()` to trigger the AI interaction. +1. Call `set_message()` to trigger the LLM interaction. 2. The function will: - - Execute the AI prompt requesting a "yes" response - - Store the result using the equivalence principle - - Print the result to the logs + - Have the leader's LLM generate a one-sentence salute + - Have validators judge the salute against the criteria + - Store the salute once validators accept it -## Understanding AI Integration +## Understanding the Consensus Flow This contract demonstrates several important concepts: -- **AI Prompting**: Shows how to formulate simple prompts for AI models within smart contracts. -- **Deterministic AI**: Uses the equivalence principle to ensure all nodes reach consensus on AI outputs. -- **State Updates**: Demonstrates how AI-generated content can be stored in blockchain state. +- **Leader proposes, validators judge**: Only the leader generates the salute; validators evaluate it, which is cheaper and tolerant of wording differences. +- **Subjective agreement**: Validators reach consensus on a subjective question ("is this a salute?") rather than on exact bytes. +- **State Updates**: LLM-generated content becomes blockchain state only after validators accept it. ## Handling Different Scenarios - **Initial State**: The message starts empty. -- **After set_message()**: The message will contain "yes" (the AI's response). -- **Multiple Calls**: Each call to `set_message()` will update the stored message. -- **Network Consensus**: All nodes will agree on the same message due to the equivalence principle. +- **After set_message()**: The message contains a salute, worded differently on every run. +- **Multiple Calls**: Each call to `set_message()` stores a new, differently worded salute. +- **Validator rejection**: If the leader's LLM returns something that is not a salute (or violates the criteria), validators reject it and consensus handles the disagreement. ## Important Notes -1. This is a minimal example to demonstrate AI-blockchain integration. -2. The AI prompt is intentionally simple for demonstration purposes. -3. The equivalence principle ensures that the AI response is consistent across all network nodes. +1. This is a minimal example of LLM integration in an Intelligent Contract; the prompt and criteria are intentionally simple. +2. Never use `gl.eq_principle.strict_eq()` for LLM calls — LLM output is non-deterministic, so exact-match consensus fails. Use criteria-based validation like this example, or a [custom validator function](/developers/intelligent-contracts/equivalence-principle#validation-patterns) for full control. +3. For a variant where validators check the response against task criteria with explicit parameters, see [LlmHelloWorldNonComparative](/developers/intelligent-contracts/examples/llm-hello-world-non-comparative). -You can monitor the contract's behavior through transaction logs, which will show the AI responses and state updates as they occur. +You can monitor the contract's behavior through transaction logs, which will show the LLM responses and state updates as they occur. diff --git a/pages/developers/intelligent-contracts/examples/prediction.mdx b/pages/developers/intelligent-contracts/examples/prediction.mdx index 78bd5c285..02bf5d43b 100644 --- a/pages/developers/intelligent-contracts/examples/prediction.mdx +++ b/pages/developers/intelligent-contracts/examples/prediction.mdx @@ -1,6 +1,10 @@ +--- +description: "Prediction Market Contract example shows how an Intelligent Contract resolves football outcomes with web data and the Equivalence Principle." +--- + # Prediction Market Contract -The Prediction Market contract sets up a scenario to determine the outcome of a football game between two teams. The contract uses the Equivalence Principle to ensure accurate and consistent decision-making based on the game's resolution data. +The Prediction Market contract is an Intelligent Contract example that determines the outcome of a football game between two teams. The contract uses the Equivalence Principle to support accurate and consistent decision-making based on the game's resolution data. ```python filename="PredictionMarket" copy # { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } diff --git a/pages/developers/intelligent-contracts/examples/storage.mdx b/pages/developers/intelligent-contracts/examples/storage.mdx index d838c3d23..4d0949deb 100644 --- a/pages/developers/intelligent-contracts/examples/storage.mdx +++ b/pages/developers/intelligent-contracts/examples/storage.mdx @@ -1,6 +1,10 @@ +--- +description: "Storage Contract example shows a Python Intelligent Contract that stores, reads, and updates a string value." +--- + # Storage Contract -The Storage contract sets up a simple scenario to store and retrieve a string value. This contract demonstrates basic data storage and retrieval functionality within a blockchain environment. +The Storage contract is a simple Python Intelligent Contract that stores a string value, returns the current value, and updates it with a new string. This example demonstrates basic data storage and retrieval functionality within a blockchain environment. ```python # { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } diff --git a/pages/developers/intelligent-contracts/examples/user-storage.mdx b/pages/developers/intelligent-contracts/examples/user-storage.mdx index 49e426494..15b582387 100644 --- a/pages/developers/intelligent-contracts/examples/user-storage.mdx +++ b/pages/developers/intelligent-contracts/examples/user-storage.mdx @@ -1,7 +1,10 @@ +--- +description: "UserStorage Contract stores and retrieves per-user string values by account address in a GenLayer Intelligent Contract." +--- # UserStorage Contract -The UserStorage contract sets up a scenario to store and retrieve string values associated with different user accounts. This contract demonstrates basic per-user data storage and retrieval functionality within a blockchain environment. +The UserStorage contract is a GenLayer Intelligent Contract example that stores and retrieves string values for individual user accounts. It demonstrates basic per-user data storage and retrieval in a blockchain environment, using the caller's address to update that user's stored value and read methods to return either all storage or one account's value. ```python # { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } @@ -29,6 +32,7 @@ class UserStorage(gl.Contract): def update_storage(self, new_storage: str) -> None: self.storage[gl.message.sender_address] = new_storage ``` + ## Code Explanation - **Initialization**: The `UserStorage` class initializes the contract with an empty dictionary `self.storage` to store user-specific data. diff --git a/pages/developers/intelligent-contracts/examples/vector-store-log-indexer.mdx b/pages/developers/intelligent-contracts/examples/vector-store-log-indexer.mdx index 54fd5105e..2310e0216 100644 --- a/pages/developers/intelligent-contracts/examples/vector-store-log-indexer.mdx +++ b/pages/developers/intelligent-contracts/examples/vector-store-log-indexer.mdx @@ -1,6 +1,10 @@ +--- +description: "LogIndexer Contract demonstrates VecDB log storage, CRUD operations, and vector similarity search in GenVM." +--- + # LogIndexer Contract -The LogIndexer contract demonstrates how to use the Vector Store database (VecDB) provided by the GenVM SDK. This contract shows how to store, retrieve, update, and remove text logs using vector embeddings for similarity-based searches. +The LogIndexer contract is an Intelligent Contract example that uses the Vector Store database (VecDB) provided by the GenVM SDK to index text logs with vector embeddings. The contract demonstrates how to store, retrieve, update, and remove logs, then search them by similarity. ```python # { diff --git a/pages/developers/intelligent-contracts/examples/wizard-of-coin.mdx b/pages/developers/intelligent-contracts/examples/wizard-of-coin.mdx index 581b58221..7a47e95fe 100644 --- a/pages/developers/intelligent-contracts/examples/wizard-of-coin.mdx +++ b/pages/developers/intelligent-contracts/examples/wizard-of-coin.mdx @@ -1,6 +1,10 @@ +--- +description: "Wizard of Coin Contract shows a GenLayer Intelligent Contract that uses an LLM and Equivalence Principle to decide coin ownership." +--- + # Wizard of Coin Contract -The Wizard of Coin contract sets up a scenario where a wizard possesses a valuable coin, which adventurers try to obtain. The wizard must decide whether to give the coin away based on specific conditions. +The Wizard of Coin contract is a GenLayer Intelligent Contract example where a wizard holds a valuable coin and adventurers try to obtain it. The contract decides whether the wizard gives the coin away based on specific conditions, using an LLM response validated through the Equivalence Principle. ```python # { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" } diff --git a/pages/developers/intelligent-contracts/features.mdx b/pages/developers/intelligent-contracts/features.mdx index 1a96f83bf..f09259ccf 100644 --- a/pages/developers/intelligent-contracts/features.mdx +++ b/pages/developers/intelligent-contracts/features.mdx @@ -1,7 +1,12 @@ +--- +description: "Intelligent Contract Features lists deterministic and non-deterministic capabilities for GenLayer Intelligent Contracts." +--- import { Card, Cards } from 'nextra-theme-docs' # Intelligent Contract Features +Intelligent Contract Features catalogs the deterministic and non-deterministic capabilities available when building GenLayer Intelligent Contracts, from storage, messages, value transfers, and contract interactions to LLM calls, image processing, and web access. + ## Deterministic Features diff --git a/pages/developers/intelligent-contracts/features/_meta.json b/pages/developers/intelligent-contracts/features/_meta.json index f632399ac..d05f4a045 100644 --- a/pages/developers/intelligent-contracts/features/_meta.json +++ b/pages/developers/intelligent-contracts/features/_meta.json @@ -1,5 +1,5 @@ { - "storage": "Storage", + "storage": "Storage Reference", "error-handling": "Error Handling", "upgradability": "Upgradability", "value-transfers": "Value Transfers", @@ -9,7 +9,7 @@ "interacting-with-evm-contracts": "Interacting with EVM Contracts", "special-methods": "Special Methods", "vector-storage": "Vector Storage", - "debugging": "Debugging", + "debugging": "Debugging Code", "random": "Random", "non-determinism": "Non-determinism", "calling-llms": "Calling LLMs", diff --git a/pages/developers/intelligent-contracts/features/calling-llms.mdx b/pages/developers/intelligent-contracts/features/calling-llms.mdx index f59b0095e..75e18d8f4 100644 --- a/pages/developers/intelligent-contracts/features/calling-llms.mdx +++ b/pages/developers/intelligent-contracts/features/calling-llms.mdx @@ -1,7 +1,12 @@ +--- +description: "Calling LLMs in Intelligent Contracts with exec_prompt, JSON responses, image inputs, validation, parsing, and error handling" +--- import { Callout } from 'nextra-theme-docs' # Calling LLMs +Calling LLMs in Intelligent Contracts uses `gl.nondet.exec_prompt` to execute prompts, request JSON responses, process image inputs, and return model output through `run_nondet_unsafe` with custom validation. Because LLM outputs are non-deterministic, validators should check response structure, validity, and error behavior instead of requiring exact equality. + ## Basic LLM Calls Execute prompts using large language models: diff --git a/pages/developers/intelligent-contracts/features/debugging.mdx b/pages/developers/intelligent-contracts/features/debugging.mdx index 608a6e22d..f9d361478 100644 --- a/pages/developers/intelligent-contracts/features/debugging.mdx +++ b/pages/developers/intelligent-contracts/features/debugging.mdx @@ -1,6 +1,10 @@ +--- +description: "Debug Intelligent Contract code with print statements and runtime traces in the GenVM." +--- + import { Callout } from "nextra-theme-docs"; -# Debugging +# Debugging Contract Code ## Print Statements diff --git a/pages/developers/intelligent-contracts/features/error-handling.mdx b/pages/developers/intelligent-contracts/features/error-handling.mdx index 066011ad6..8f316c7cd 100644 --- a/pages/developers/intelligent-contracts/features/error-handling.mdx +++ b/pages/developers/intelligent-contracts/features/error-handling.mdx @@ -1,5 +1,11 @@ +--- +description: "Error Handling in GenVM explains unrecoverable exits, UserError, VMError, propagation, result types, and consensus patterns." +--- + # Error Handling +Error Handling in GenVM defines how Intelligent Contracts terminate, report user-generated failures, surface VM-generated failures, propagate errors from non-deterministic code, and classify failures for consensus. GenVM execution can end with unrecoverable exit codes or unhandled exceptions, produce `UserError` and `VMError` results, and let contracts catch user errors from sub-VMs when using the Equivalence Principle. + ## Unrecoverable Errors Exit codes terminate execution immediately: diff --git a/pages/developers/intelligent-contracts/features/features.mdx b/pages/developers/intelligent-contracts/features/features.mdx deleted file mode 100644 index 31c26894a..000000000 --- a/pages/developers/intelligent-contracts/features/features.mdx +++ /dev/null @@ -1,27 +0,0 @@ -import { Card, Cards } from 'nextra-theme-docs' - -# Intelligent Contract Features - -## Deterministic Features - - - - - - - - - - - - - - - -## Non-Deterministic Features - - - - - - diff --git a/pages/developers/intelligent-contracts/features/image-processing.mdx b/pages/developers/intelligent-contracts/features/image-processing.mdx index 11d16fb6a..8503e2575 100644 --- a/pages/developers/intelligent-contracts/features/image-processing.mdx +++ b/pages/developers/intelligent-contracts/features/image-processing.mdx @@ -1,8 +1,11 @@ +--- +description: "Image Processing in Intelligent Contracts sends images to vision-capable LLMs for visual analysis." +--- import { Callout } from "nextra-theme-docs"; # Image Processing -Intelligent Contracts can process images through LLMs — pass screenshots, photos, or any visual data alongside a prompt for analysis. +Image Processing in Intelligent Contracts lets contracts send screenshots, photos, or other visual data to LLMs alongside a prompt for analysis. ## Sending Images to LLMs diff --git a/pages/developers/intelligent-contracts/features/interacting-with-evm-contracts.mdx b/pages/developers/intelligent-contracts/features/interacting-with-evm-contracts.mdx index 12ecb37d4..d834f8cef 100644 --- a/pages/developers/intelligent-contracts/features/interacting-with-evm-contracts.mdx +++ b/pages/developers/intelligent-contracts/features/interacting-with-evm-contracts.mdx @@ -1,7 +1,12 @@ +--- +description: "EVM contract interaction in GenLayer: define interfaces, read balances, call views, and emit finality messages." +--- import { Callout } from "nextra-theme-docs"; # Interacting with EVM Contracts +Interacting with EVM Contracts lets Intelligent Contracts define EVM contract interfaces, read EVM contract data and balances, and emit messages to EVM contracts. + > These are external messages — they cross from the GenVM layer back to the GenLayer Chain via [ghost contracts](/developers/intelligent-contracts/features/messages#ghost-contracts). See [Messages](/developers/intelligent-contracts/features/messages) for the conceptual model. ## Contract Interface Definition diff --git a/pages/developers/intelligent-contracts/features/interacting-with-intelligent-contracts.mdx b/pages/developers/intelligent-contracts/features/interacting-with-intelligent-contracts.mdx index 8ccd06299..4c1108fc7 100644 --- a/pages/developers/intelligent-contracts/features/interacting-with-intelligent-contracts.mdx +++ b/pages/developers/intelligent-contracts/features/interacting-with-intelligent-contracts.mdx @@ -1,5 +1,11 @@ +--- +description: "Interacting with Intelligent Contracts: get references, call view methods, emit messages, and deploy child contracts." +--- + # Interacting with Intelligent Contracts +Interacting with Intelligent Contracts means referencing another contract by address, calling its read-only `view()` methods, emitting asynchronous write messages with `emit()`, and deploying child contracts. + > This page covers syntax for internal messages (IC → IC). See [Messages](/developers/intelligent-contracts/features/messages) for the conceptual model and [Value Transfers](/developers/intelligent-contracts/features/value-transfers) for sending GEN. ## Getting Contract References diff --git a/pages/developers/intelligent-contracts/features/messages.mdx b/pages/developers/intelligent-contracts/features/messages.mdx index 988b07ef7..792b929aa 100644 --- a/pages/developers/intelligent-contracts/features/messages.mdx +++ b/pages/developers/intelligent-contracts/features/messages.mdx @@ -1,8 +1,11 @@ +--- +description: "Messages in GenLayer define transactions, internal IC calls, external chain-layer calls, ghost contracts, and message context." +--- import { Callout } from "nextra-theme-docs"; # Messages -GenLayer has three types of interaction, each operating at a different layer of the architecture. +Messages in GenLayer are interactions that move execution between callers, Intelligent Contracts, the GenVM layer, and the GenLayer Chain. GenLayer has three types of interaction, each operating at a different layer of the architecture: transactions that start Intelligent Contract execution, internal messages between Intelligent Contracts, and external messages from an Intelligent Contract to the chain layer. ## Transactions (→ Intelligent Contract) diff --git a/pages/developers/intelligent-contracts/features/non-determinism.mdx b/pages/developers/intelligent-contracts/features/non-determinism.mdx index c9de39d75..4698e3ae6 100644 --- a/pages/developers/intelligent-contracts/features/non-determinism.mdx +++ b/pages/developers/intelligent-contracts/features/non-determinism.mdx @@ -1,7 +1,13 @@ +--- +description: "Non-determinism in Intelligent Contracts: when to use nondet blocks and how GenVM consensus validates variable outputs" +--- + # Non-determinism import { Callout } from 'nextra-theme-docs' +Non-determinism in Intelligent Contracts is any operation whose result can vary between nodes, such as external API calls, LLM and AI model calls, random number generation, or other variable execution. GenVM requires these operations to run inside nondeterministic blocks so validators can reach consensus on the agreed result before deterministic side effects occur. + ## When to Use Non-deterministic operations are needed for: diff --git a/pages/developers/intelligent-contracts/features/random.mdx b/pages/developers/intelligent-contracts/features/random.mdx index cc6c966af..b9126c4e1 100644 --- a/pages/developers/intelligent-contracts/features/random.mdx +++ b/pages/developers/intelligent-contracts/features/random.mdx @@ -1,7 +1,10 @@ +--- +description: "Random in Intelligent Contracts uses seeded randomness to avoid nondeterministic disagreement or leader trust." +--- + # Random -Getting random in deterministic part may be difficult. Trying to delegate it to non-deterministic block will cause -your contract to either never agree on that block or to trust the leader. For that reason it is advised to use seeded random. +Randomness in an Intelligent Contract should use seeded random values because getting random data in the deterministic part may be difficult. Delegating randomness to a non-deterministic block can cause the contract to either never agree on that block or to trust the leader. ## Seed acquisition methods diff --git a/pages/developers/intelligent-contracts/features/special-methods.mdx b/pages/developers/intelligent-contracts/features/special-methods.mdx index 585c6fe71..c99c91c31 100644 --- a/pages/developers/intelligent-contracts/features/special-methods.mdx +++ b/pages/developers/intelligent-contracts/features/special-methods.mdx @@ -1,8 +1,13 @@ +--- +description: "Special Methods in Intelligent Contracts define GenVM fallback and receive handlers for unmatched calls and value transfers." +--- + # Special Methods +Special methods are the two methods allowed in each contract **definition** for handling undefined method calls and no-method value transfers: `__handle_undefined_method__` and `__receive__`. GenVM uses these methods when an unhandled message does not match any regular method. + > For how these methods fit into value transfer flows, see [Value Transfers](/developers/intelligent-contracts/features/value-transfers#receiving-value-without-a-method-call). -There are two special methods allowed in each contract **definition**: ```python class Contract(gl.Contract): @gl.public.write # .payable? diff --git a/pages/developers/intelligent-contracts/features/storage.mdx b/pages/developers/intelligent-contracts/features/storage.mdx index 51c5007c5..ac7054578 100644 --- a/pages/developers/intelligent-contracts/features/storage.mdx +++ b/pages/developers/intelligent-contracts/features/storage.mdx @@ -1,6 +1,10 @@ +--- +description: "Quick reference for GenVM storage types: primitives, collections, and custom classes." +--- + import { Callout } from "nextra-theme-docs"; -# Storage +# Storage Quick Reference ## Basic Types diff --git a/pages/developers/intelligent-contracts/features/transaction-context.mdx b/pages/developers/intelligent-contracts/features/transaction-context.mdx index 5e67e2f11..3a72d4c5b 100644 --- a/pages/developers/intelligent-contracts/features/transaction-context.mdx +++ b/pages/developers/intelligent-contracts/features/transaction-context.mdx @@ -1,8 +1,11 @@ +--- +description: "Transaction Context exposes GenVM transaction metadata, caller addresses, GEN value, chain ID, and deterministic timestamps." +--- import { Callout } from "nextra-theme-docs"; # Transaction Context -Every contract execution has access to information about the transaction that triggered it — caller addresses, value, chain ID, and the transaction **timestamp** (datetime). This page covers how to read the current time, get a Unix timestamp, access caller and tx metadata, and what is *not* exposed (block number, gas, wall-clock). +Transaction Context is the GenVM execution metadata available to every Intelligent Contract execution, including caller addresses, value, chain ID, and the transaction **timestamp** (datetime). This page explains how to read the current transaction time, derive a Unix timestamp, access caller and transaction metadata, and understand what is *not* exposed, including block number, gas, and host wall-clock time. ## `gl.message` — typed accessors diff --git a/pages/developers/intelligent-contracts/features/upgradability.mdx b/pages/developers/intelligent-contracts/features/upgradability.mdx index d926033fd..1cc9c9bd8 100644 --- a/pages/developers/intelligent-contracts/features/upgradability.mdx +++ b/pages/developers/intelligent-contracts/features/upgradability.mdx @@ -1,8 +1,11 @@ +--- +description: "Upgradability in GenVM controls Intelligent Contract code changes with Root Slot upgraders and locked storage slots" +--- import { Callout } from "nextra-theme-docs"; # Upgradability -GenVM provides a native contract upgradability system that allows contracts to be modified after deployment while maintaining security guarantees and clear access controls. +Upgradability in GenVM is a native system for modifying an Intelligent Contract after deployment while preserving security guarantees and clear access controls. The system is built around the **Root Slot** (`gl.storage.Root`), which stores: diff --git a/pages/developers/intelligent-contracts/features/value-transfers.mdx b/pages/developers/intelligent-contracts/features/value-transfers.mdx index fdd6725fb..7229b04ee 100644 --- a/pages/developers/intelligent-contracts/features/value-transfers.mdx +++ b/pages/developers/intelligent-contracts/features/value-transfers.mdx @@ -1,7 +1,12 @@ +--- +description: "Value transfers in Intelligent Contracts: receive, send, and read GEN balances with payable methods and messages" +--- import { Callout } from "nextra-theme-docs"; # Value Transfers +Value transfers in Intelligent Contracts use GEN, GenLayer's native token, to receive funds with payable methods, send value through messages, and read contract balances. + ## Native Token (GEN) GenLayer uses GEN as its native token. Values are denominated in wei (1 GEN = 10¹⁸ wei). Use the `u256` type for value amounts in contract code. diff --git a/pages/developers/intelligent-contracts/features/vector-storage.mdx b/pages/developers/intelligent-contracts/features/vector-storage.mdx index 710d9c252..14ac1e1ff 100644 --- a/pages/developers/intelligent-contracts/features/vector-storage.mdx +++ b/pages/developers/intelligent-contracts/features/vector-storage.mdx @@ -1,5 +1,9 @@ +--- +description: "Vector Store in GenLayer stores embeddings, computes similarity, manages metadata, and supports CRUD in Intelligent Contracts." +--- + # Vector Store -The Vector Store feature in GenLayer allows developers to enhance their Intelligent Contracts by efficiently storing, retrieving, and calculating similarities between texts using vector embeddings. This feature is particularly useful for tasks that require natural language processing (NLP), such as creating context-aware applications or indexing text data for semantic search. +Vector Store is a GenLayer feature for Intelligent Contracts that stores text as vector embeddings, retrieves entries, and calculates text similarity efficiently. Developers can use Vector Store for natural language processing (NLP) tasks such as context-aware applications and indexing text data for semantic search. ## Key Features of Vector Store The Vector Store provides several powerful features for managing text data: diff --git a/pages/developers/intelligent-contracts/features/web-access.mdx b/pages/developers/intelligent-contracts/features/web-access.mdx index a30b433d0..e41bc2f54 100644 --- a/pages/developers/intelligent-contracts/features/web-access.mdx +++ b/pages/developers/intelligent-contracts/features/web-access.mdx @@ -1,5 +1,11 @@ +--- +description: "Web Access in Intelligent Contracts covers HTTP requests, page rendering, screenshots, errors, and consensus-safe web data." +--- + # Web Access +Web Access lets Intelligent Contracts fetch external data, send HTTP requests, render web pages, capture screenshots, and handle API errors from non-deterministic blocks. Because leaders and validators make independent web requests, use stable fields or derived summaries when applying the Equivalence Principle to web data. + ## HTTP Requests Send data to external services: diff --git a/pages/developers/intelligent-contracts/first-contract.mdx b/pages/developers/intelligent-contracts/first-contract.mdx index f10c345ce..786a4860d 100644 --- a/pages/developers/intelligent-contracts/first-contract.mdx +++ b/pages/developers/intelligent-contracts/first-contract.mdx @@ -1,3 +1,7 @@ +--- +description: "Step-by-step tutorial to write, deploy, and test your first GenLayer Intelligent Contract in Python." +--- + import { Callout } from 'nextra-theme-docs' # Your First Contract diff --git a/pages/developers/intelligent-contracts/first-intelligent-contract.mdx b/pages/developers/intelligent-contracts/first-intelligent-contract.mdx index 4b6de044c..0847da4a2 100644 --- a/pages/developers/intelligent-contracts/first-intelligent-contract.mdx +++ b/pages/developers/intelligent-contracts/first-intelligent-contract.mdx @@ -1,13 +1,15 @@ -# Your First **Intelligent** Contract +--- +description: "Your First Intelligent Contract shows how to use non-deterministic blocks, web rendering, and strict_eq in GenLayer." +--- -Now is the time to utilize all the power of GenLayer! +# Your First **Intelligent** Contract -For blockchain integrity reasons, non-determinism must be contained within special non-deterministic blocks. Such blocks are regular Python functions with no arguments, which can return arbitrary values. However, there are some limitations: +An Intelligent Contract in GenLayer can contain non-deterministic blocks: regular Python functions with no arguments that may return arbitrary values and must be invoked through `gl.eq_principle.*`. For blockchain integrity reasons, non-determinism must be contained within these special non-deterministic blocks, and the blocks have two important limitations: - Storage is inaccessible from non-deterministic blocks - State of the Python interpreter is not passed back to the deterministic code (for instance, you won't see changes in global variables) ### Simple Case -To illustrate how it works, let's get a webpage as plain HTML, and verify that it has a link to the owner: +To illustrate how non-deterministic blocks work, this example gets a webpage as plain HTML and verifies that it has a link to the owner: ```py example_web_address = 'https://example.org' diff --git a/pages/developers/intelligent-contracts/ideas.mdx b/pages/developers/intelligent-contracts/ideas.mdx index 96ea6b135..04aafd1d8 100644 --- a/pages/developers/intelligent-contracts/ideas.mdx +++ b/pages/developers/intelligent-contracts/ideas.mdx @@ -1,6 +1,10 @@ +--- +description: "GenLayer Intelligent Contract ideas for web-aware, API-driven, LLM-powered blockchain applications." +--- + # 💡 Build With GenLayer -Here are some ideas to get you started with building Intelligent Contracts that can interact with web sources, APIs, and understand natural language using LLM calls. +GenLayer Intelligent Contract ideas are example applications that use web sources, APIs, and LLM calls to understand natural language and act on real-world information. Use these ideas as starting points for building Intelligent Contracts on GenLayer. | Idea | Implementation Details | |-------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| diff --git a/pages/developers/intelligent-contracts/introduction.mdx b/pages/developers/intelligent-contracts/introduction.mdx index 84bb1e329..eb1ca88c8 100644 --- a/pages/developers/intelligent-contracts/introduction.mdx +++ b/pages/developers/intelligent-contracts/introduction.mdx @@ -1,3 +1,7 @@ +--- +description: "Intelligent Contracts are Python smart contracts on GenLayer that access the web and call LLMs natively, enabling judgment-based decisions on-chain." +--- + # Introduction to Intelligent Contracts ## What are Intelligent Contracts? diff --git a/pages/developers/intelligent-contracts/security-and-best-practices/prompt-injection.mdx b/pages/developers/intelligent-contracts/security-and-best-practices/prompt-injection.mdx index 012fa3d9c..4f626b424 100644 --- a/pages/developers/intelligent-contracts/security-and-best-practices/prompt-injection.mdx +++ b/pages/developers/intelligent-contracts/security-and-best-practices/prompt-injection.mdx @@ -1,6 +1,10 @@ +--- +description: "Prompt injection in Intelligent Contracts: risks from manipulated AI prompts and input/output controls to mitigate them" +--- + # Prompt Injection -Intelligent Contracts exclusively interact with public data, reducing certain types of risks such as data leakage. However, ensuring the integrity of these contracts still requires careful management of inputs and outputs. +Prompt injection is the manipulation of prompts fed to AI models to produce unintended outcomes in Intelligent Contracts. Intelligent Contracts exclusively interact with public data, reducing certain types of risks such as data leakage, but preserving contract integrity still requires careful management of inputs and outputs. ## Understanding Prompt Injection diff --git a/pages/developers/intelligent-contracts/storage.mdx b/pages/developers/intelligent-contracts/storage.mdx index 25f7fd903..c6d5d8293 100644 --- a/pages/developers/intelligent-contracts/storage.mdx +++ b/pages/developers/intelligent-contracts/storage.mdx @@ -1,3 +1,7 @@ +--- +description: "How Intelligent Contracts persist data on the blockchain: storage rules, allowed types, and patterns for GenVM storage." +--- + import { Callout } from 'nextra-theme-docs' # Persisting data on the blockchain diff --git a/pages/developers/intelligent-contracts/testing.mdx b/pages/developers/intelligent-contracts/testing.mdx index ac594ef01..44b963504 100644 --- a/pages/developers/intelligent-contracts/testing.mdx +++ b/pages/developers/intelligent-contracts/testing.mdx @@ -1,3 +1,7 @@ +--- +description: "Test Intelligent Contracts with the pytest-based GenLayer Testing Suite (genlayer-test): direct mode and integration mode." +--- + import { Callout } from 'nextra-theme-docs' # Testing Intelligent Contracts diff --git a/pages/developers/intelligent-contracts/tooling-setup.mdx b/pages/developers/intelligent-contracts/tooling-setup.mdx index 3211c9fa2..39022d5e6 100644 --- a/pages/developers/intelligent-contracts/tooling-setup.mdx +++ b/pages/developers/intelligent-contracts/tooling-setup.mdx @@ -1,3 +1,7 @@ +--- +description: "Install and configure the GenLayer development tools: the GenLayer CLI, GenLayer Studio, and the testing suite." +--- + import { Callout } from 'nextra-theme-docs' import CustomCard from '../../../components/card' diff --git a/pages/developers/intelligent-contracts/tools/genlayer-cli.mdx b/pages/developers/intelligent-contracts/tools/genlayer-cli.mdx index 499e1fac1..44f0e4a9b 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-cli.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-cli.mdx @@ -1,6 +1,10 @@ +--- +description: "GenLayer CLI installs, initializes, and runs GenLayer Studio locally for development, simulation, and testing." +--- + # GenLayer CLI -The GenLayer CLI is a command-line interface designed to streamline the setup and local execution of the GenLayer Studio. It automates the process of downloading and launching the Studio, allowing developers to start simulating and testing locally with minimal effort. +The GenLayer CLI is a command-line interface for setting up and running GenLayer Studio locally. It automates downloading and launching the Studio so developers can start local simulation and testing workflows with minimal effort. ## Features diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio.mdx index 2d34eca01..ab0d39934 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio.mdx @@ -1,14 +1,18 @@ +--- +description: "GenLayer Studio is a browser-based sandbox for developing and testing Intelligent Contracts in a local replica of the GenLayer network." +--- + import { Card, Cards, Callout, Bleed } from 'nextra-theme-docs' # GenLayer Studio -This Studio is an interactive sandbox designed for developers to explore the potential of GenLayer's Intelligent Contracts. It replicates the GenLayer network's execution environment and consensus algorithm, but offers a controlled and local environment to test different ideas and behaviors. +GenLayer Studio is an interactive sandbox where developers explore the potential of GenLayer's Intelligent Contracts. It replicates the GenLayer network's execution environment and consensus algorithm, but offers a controlled and local environment to test different ideas and behaviors. ### What you can do with the GenLayer Studio: -- **Experiment with AI smart contracts:** Intelligent Contracts leverage LLMs, such as GPT-4 or Llama3, to understand natural language and be capable of complex decision making. +- **Experiment with Intelligent Contracts:** Intelligent Contracts leverage LLMs, such as GPT-4 or Llama3, to understand natural language and be capable of complex decision making. -- **Access the Web Natively:** GenLayer is the first platform where smart contracts don’t need oracles to access the Internet. +- **Access the Web Natively:** GenLayer is the first platform where Intelligent Contracts don’t need oracles to access the Internet. - **Code in Python:** Develop in a familiar, developer-friendly language, where memory and string management are not a big headache. diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/advanced-features/custom-plugins.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/advanced-features/custom-plugins.mdx index cf2e3f3c6..947005cb2 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/advanced-features/custom-plugins.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/advanced-features/custom-plugins.mdx @@ -1,7 +1,12 @@ +--- +description: "Adding LLM Provider Plugins explains how to integrate custom LLM providers into GenLayer Studio." +--- import { Callout } from "nextra-theme-docs"; # Adding LLM Provider Plugins +LLM provider plugins in GenLayer Studio let advanced users integrate custom LLM providers beyond the providers supported out of the box. + This section is intended for advanced users who wish to integrate new LLM provider plugins. This process requires code modifications, and we encourage @@ -9,8 +14,7 @@ import { Callout } from "nextra-theme-docs"; official GenLayer Studio. -The GenLayer Studio seamlessly interacts with multiple LLM providers. -Currently, we support the following providers out of the box: +The GenLayer Studio seamlessly interacts with multiple LLM providers. Currently, we support the following providers out of the box: - [OpenAI](https://platform.openai.com/) - [Anthropic](https://www.anthropic.com/) diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/contract-state.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/contract-state.mdx index e71987eaa..215d14280 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/contract-state.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/contract-state.mdx @@ -1,6 +1,10 @@ +--- +description: "Current Intelligent Contract State explains how to view read methods in GenLayer Studio and verify deployed contract variables." +--- + # Current Intelligent Contract State -Once your Intelligent Contract is deployed, you can check its current state to verify that it has been initialized correctly. This step ensures that the contract's data and variables are set as expected. +Current Intelligent Contract State is the deployed contract data shown through read methods in GenLayer Studio, used to verify that initialization succeeded. Once your Intelligent Contract is deployed, you can check its current state to confirm that the contract's data and variables are set as expected. ## Viewing the Current Intelligent Contract State diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/deploying-contract.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/deploying-contract.mdx index 9bb719fcf..546e8086d 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/deploying-contract.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/deploying-contract.mdx @@ -1,6 +1,10 @@ +--- +description: "GenLayer Studio contract deployment: set constructor parameters, detect inputs, and deploy an Intelligent Contract." +--- + # Deploy Contracts -Once you have loaded your Intelligent Contract into the GenLayer Studio, the next step is to set the constructor parameters and deploy it. The constructor parameters are essential inputs that initialize the state of your contract. +Deploying an Intelligent Contract in GenLayer Studio means setting the constructor parameters that initialize the contract state, then deploying the loaded contract. Once you have loaded your Intelligent Contract into the GenLayer Studio, the next step is to set the constructor parameters and deploy it. ## Setting Constructor Parameters diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/development-tips.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/development-tips.mdx index 74940248a..90ed9cdc8 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/development-tips.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/development-tips.mdx @@ -1,7 +1,10 @@ +--- +description: "GenLayer Studio development tips explain validator setup, typed inputs, deployment, debugging, and transaction inspection." +--- import Image from 'next/image' # Development Tips -Here are some valuable tips on how to develop your intelligent contract, debug it, and test it using the GenLayer Studio. +GenLayer Studio development tips explain how to develop your Intelligent Contract, debug it, and test it in GenLayer Studio. ## 1. Validators setup You need to be sure that you have at least one validator. If you don't have any, you can create one in the validators screen by providing: diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/execute-transaction.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/execute-transaction.mdx index fa404e24d..61dd11931 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/execute-transaction.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/execute-transaction.mdx @@ -1,6 +1,10 @@ +--- +description: "GenLayer Studio transaction execution covers running Intelligent Contract write methods and viewing results." +--- + # Execute Transactions -After deploying your Intelligent Contract and verifying its state, the next step is to execute transactions. This allows you to interact with your contract's methods and functions to perform specific actions or queries. +Executing transactions in GenLayer Studio means calling the write methods of a deployed Intelligent Contract to perform specific actions or queries. After deploying your Intelligent Contract and verifying its state, use transaction execution to interact with the contract's methods and functions and review the returned results. ## Write Methods diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/limitations.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/limitations.mdx index 154f64aee..07d1e45b3 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/limitations.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/limitations.mdx @@ -1,6 +1,10 @@ +--- +description: "GenLayer Studio limitations covering gasless testing, EVM parity gaps, web access constraints, and live-network validation." +--- + # Limitations of the GenLayer Studio -GenLayer Studio is a development environment for building and testing Intelligent Contracts. It supports core contract execution, consensus testing, appeals, web access, and native value transfers, but it is not a full live-network replica. These are the current Studio-specific caveats: +GenLayer Studio limitations are Studio-specific caveats for building and testing Intelligent Contracts outside a full live-network replica. GenLayer Studio supports core contract execution, consensus testing, appeals, web access, and native value transfers, but live-network behavior should be validated where exact gas, chain-layer, EVM, or web-access behavior matters. ## Gas Usage diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/loading-contract.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/loading-contract.mdx index f5d84862d..00c091d6a 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/loading-contract.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/loading-contract.mdx @@ -1,6 +1,10 @@ +--- +description: "GenLayer Studio contract loading: add an Intelligent Contract file, open it, and prepare it to run and deploy." +--- + # Load Your Contract -To start using the GenLayer Studio, you need to load your Intelligent Contract into the Studio. This involves navigating the Studio interface, selecting your contract file, and preparing it for deployment and execution. +Loading an Intelligent Contract in GenLayer Studio means adding your contract file to the Studio, opening it in the editor, and preparing it for deployment and execution. To start using the GenLayer Studio, navigate the Studio interface and select your contract file so you can run and debug it before deploying. ## Access your Intelligent Contracts diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/monitoring-node-logs.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/monitoring-node-logs.mdx index d33448353..b3c4d272f 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/monitoring-node-logs.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/monitoring-node-logs.mdx @@ -1,6 +1,10 @@ +--- +description: "Node Logs in GenLayer Studio show real-time transaction, deployment, execution, validator, and consensus events." +--- + # Monitoring Node Logs -Node Logs in the GenLayer Studio provide real-time feedback and are a critical component for debugging and tracking the behavior of Intelligent Contracts as they interact within the studio. +Node Logs in GenLayer Studio are real-time logs for debugging and tracking how Intelligent Contracts behave as they interact within the studio. They help developers monitor contract activity, execution feedback, and related node behavior while working in GenLayer Studio. ## Key Features of Node Logs diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/providers.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/providers.mdx index 908c6520e..e7be9c3bf 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/providers.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/providers.mdx @@ -1,8 +1,11 @@ +--- +description: "Inference Providers in GenLayer Studio configure validator models, provider settings, custom plugins, and defaults." +--- import Image from 'next/image' # Inference Providers -Validators can use various inference providers to validate transactions. You can configure those providers and add custom ones to suit your needs. When you then create a new validator in the validators page, you will be able to select those providers and the relevant models from the list. +Inference providers are the model backends that validators use to validate transactions in GenLayer Studio. You can configure those providers and add custom ones to suit your needs. When you create a new validator in the validators page, you will be able to select those providers and the relevant models from the list. ## Accessing Providers diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/reset-the-studio.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/reset-the-studio.mdx index 86ce1d284..cafebc030 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/reset-the-studio.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/reset-the-studio.mdx @@ -1,7 +1,10 @@ +--- +description: "GenLayer Studio reset clears storage, state, memory, and contract examples so developers can start from a clean workspace." +--- import Image from 'next/image' # Resetting the GenLayer Studio -The GenLayer Studio provides a straightforward way to reset its storage, current status, memory, and contract examples. This feature is particularly useful if you want to start fresh with a clean state, whether you’re testing new contracts or simply clearing out previous configurations. +Resetting the GenLayer Studio clears its storage, current status, memory, and contract examples so the workspace returns to a clean state. Use this feature when you want to start fresh, test new contracts, or remove previous configurations. ## How to Reset the Studio To reset the GenLayer Studio, follow these simple steps: diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/troubleshooting.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/troubleshooting.mdx index cc239429c..6b3dbd591 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/troubleshooting.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/troubleshooting.mdx @@ -1,6 +1,10 @@ +--- +description: "GenLayer Studio troubleshooting steps for loading issues, port conflicts, Docker problems, display issues, and startup errors" +--- + # Troubleshooting -If you encounter any issues with the Studio, here are some detailed steps to help you resolve common problems: +GenLayer Studio troubleshooting covers common issues that can prevent the Studio from loading, starting, displaying correctly, or responding as expected. If you encounter any issues with the Studio, use these steps to resolve common problems: ## Frontend Not Loading Correctly The frontend may not load correctly due to caching issues or an outdated version of the contract stored in your browser. diff --git a/pages/developers/intelligent-contracts/tools/genlayer-studio/validators.mdx b/pages/developers/intelligent-contracts/tools/genlayer-studio/validators.mdx index 5f8032cbd..3130e651d 100644 --- a/pages/developers/intelligent-contracts/tools/genlayer-studio/validators.mdx +++ b/pages/developers/intelligent-contracts/tools/genlayer-studio/validators.mdx @@ -1,14 +1,15 @@ +--- +description: "GenLayer Studio validators manage consensus roles, default validator setup, and configuration for Intelligent Contracts." +--- import Image from 'next/image' # Accessing and Configuring Validators -In the GenLayer Studio, validators are essential for achieving consensus and validating transactions through a process known as [Optimistic Democracy](/core-concepts/optimistic-democracy). When you initialize the Studio based on your selected LLM provider(s), you are provided with 5 default validators. +GenLayer Studio validators are configurable participants that help achieve consensus and validate transactions through [Optimistic Democracy](/understand-genlayer-protocol/core-concepts/optimistic-democracy). When you initialize the Studio based on your selected LLM provider(s), you are provided with 5 default validators that can be modified to suit your Intelligent Contract's requirements. 1. **Leaders:** Within this consensus model, one validator is selected as the leader for each transaction. The leader's role is to propose how a transaction should be executed based on the transaction data and the Intelligent Contract's logic. -2. **Validators:** After the leader proposes a transaction execution, other validators are responsible for reviewing and validating the proposal. They use the [Equivalence Principle](/core-concepts/optimistic-democracy/equivalence-principle) to determine if the leader’s proposal meets the required standards. - -These validators can be modified to suit your Intelligent Contract's requirements. +2. **Validators:** After the leader proposes a transaction execution, other validators are responsible for reviewing and validating the proposal. They use the [Equivalence Principle](/understand-genlayer-protocol/core-concepts/optimistic-democracy/equivalence-principle) to determine if the leader's proposal meets the required standards. ## Accessing Validators diff --git a/pages/developers/intelligent-contracts/types/address.mdx b/pages/developers/intelligent-contracts/types/address.mdx index c3b9ac611..1e8ae84d9 100644 --- a/pages/developers/intelligent-contracts/types/address.mdx +++ b/pages/developers/intelligent-contracts/types/address.mdx @@ -1,6 +1,10 @@ +--- +description: "Address Type covers 20-byte blockchain addresses in Intelligent Contracts, including users, contracts, and interactions" +--- + # Address Type -The `Address` type represents a 20-byte blockchain address, similar to Ethereum addresses. It's one of the most important types in Intelligent Contracts for handling user accounts, contract addresses, and cross-contract interactions. +The `Address` type is a 20-byte blockchain address type for Intelligent Contracts, similar to Ethereum addresses. It is one of the most important types for handling user accounts, contract addresses, and cross-contract interactions. ## Creating Address Instances diff --git a/pages/developers/intelligent-contracts/types/collections.mdx b/pages/developers/intelligent-contracts/types/collections.mdx index 200c7a72b..813fd1373 100644 --- a/pages/developers/intelligent-contracts/types/collections.mdx +++ b/pages/developers/intelligent-contracts/types/collections.mdx @@ -1,6 +1,10 @@ +--- +description: "Collection Types in GenVM define storage-compatible DynArray and TreeMap structures for Intelligent Contracts." +--- + # Collection Types -GenVM provides storage-compatible collection types that replace Python's built-in collections. These are essential for managing dynamic data structures in Intelligent Contracts. +Collection Types in GenVM are storage-compatible replacements for Python's built-in collections, used to manage dynamic data structures in Intelligent Contracts. GenVM provides these collection types so contract state can use array-like and map-like structures while remaining compatible with storage. ## DynArray (Dynamic Arrays) diff --git a/pages/developers/intelligent-contracts/types/dataclasses.mdx b/pages/developers/intelligent-contracts/types/dataclasses.mdx index 2be20e375..47632a09c 100644 --- a/pages/developers/intelligent-contracts/types/dataclasses.mdx +++ b/pages/developers/intelligent-contracts/types/dataclasses.mdx @@ -1,6 +1,10 @@ +--- +description: "Dataclasses define structured storage-compatible data types for GenLayer Intelligent Contracts using @allow_storage." +--- + # Dataclasses -Dataclasses provide structured data types for Intelligent Contracts. Use `@allow_storage` decorator for storage compatibility. +Dataclasses are structured Python data types for GenLayer Intelligent Contracts, used to model method parameters, return values, and stored contract data. Use the `@allow_storage` decorator to make a dataclass compatible with contract storage. ## Method Parameters and Returns diff --git a/pages/developers/intelligent-contracts/types/primitive.mdx b/pages/developers/intelligent-contracts/types/primitive.mdx index 06426cda0..9d13bf1b4 100644 --- a/pages/developers/intelligent-contracts/types/primitive.mdx +++ b/pages/developers/intelligent-contracts/types/primitive.mdx @@ -1,8 +1,11 @@ +--- +description: "Primitive Types in GenVM cover sized integers, strings, bytes, booleans, conversions, and storage range checks." +--- import { Callout } from 'nextra-theme-docs' # Primitive Types -GenVM provides comprehensive sized integer types for efficient storage. These types are primarily used for type annotations in storage fields and enforce range constraints only when assigned to storage. +Primitive Types in GenVM are Python-compatible value types used in Intelligent Contracts, including sized integers for efficient storage and type annotations on storage fields. Sized integer types enforce range constraints only when values are assigned to storage. **Important**: Sized integer types (`u8`, `u256`, etc.) are `typing.NewType` aliases that behave like regular Python `int` outside of storage context. Range checking and overflow protection only occur when assigning values to storage fields. diff --git a/pages/developers/intelligent-contracts/when-to-use-genlayer.mdx b/pages/developers/intelligent-contracts/when-to-use-genlayer.mdx index 4113b87eb..7beafbaf1 100644 --- a/pages/developers/intelligent-contracts/when-to-use-genlayer.mdx +++ b/pages/developers/intelligent-contracts/when-to-use-genlayer.mdx @@ -1,8 +1,12 @@ +--- +description: "GenLayer use cases: decide when to use Intelligent Contracts for on-chain judgment, evidence, and neutral consensus." +--- + # When to Use GenLayer -GenLayer is most useful when your application needs a **shared, on-chain decision** about something a normal deterministic smart contract cannot evaluate by itself. +GenLayer is for applications that need a **shared, on-chain decision** about something a normal deterministic smart contract cannot evaluate by itself. -Use GenLayer when the decision depends on evidence, language, or judgment — and when different parties need to trust the result without relying on a single backend, oracle, or operator. +Use GenLayer when the decision depends on evidence, language, or judgment, and when different parties need to trust the result without relying on a single backend, oracle, or operator. ## Quick Fit Checklist diff --git a/pages/developers/networks.mdx b/pages/developers/networks.mdx index a482c2f83..56723d4c4 100644 --- a/pages/developers/networks.mdx +++ b/pages/developers/networks.mdx @@ -1,3 +1,7 @@ +--- +description: "GenLayer network environments and connection details: testnet, Studio, and localnet RPC endpoints, chain IDs, and wallet configuration." +--- + import { Callout } from 'nextra-theme-docs' import AddToWallet from '../../components/AddToWallet' diff --git a/pages/developers/staking-guide.mdx b/pages/developers/staking-guide.mdx index 7383345ad..df228bdc8 100644 --- a/pages/developers/staking-guide.mdx +++ b/pages/developers/staking-guide.mdx @@ -1,10 +1,13 @@ +--- +description: "Staking Contract Guide covers direct Solidity interactions for GenLayer validator and delegator staking operations." +--- import { Callout } from "nextra-theme-docs"; # Staking Contract Guide -This guide covers consensus-level staking operations for developers who want to interact directly with the GenLayer staking smart contracts. It includes Solidity code examples for both validator and delegator operations. +The Staking Contract Guide explains how developers can interact directly with GenLayer staking smart contracts for consensus-level staking operations. It includes Solidity code examples for both validator and delegator operations. -To understand the concepts behind staking—including the epoch system, shares vs stake, validator selection weights, and reward distribution—see [Staking in GenLayer](/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking). +To understand the concepts behind staking, including the epoch system, shares vs stake, validator selection weights, and reward distribution, see [Staking in GenLayer](/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking). For CLI-based staking operations (recommended for most users), see the [GenLayer CLI Staking Commands](/api-references/genlayer-cli#staking-operations-testnet). diff --git a/pages/index.mdx b/pages/index.mdx index dcda30271..dc06d4cb6 100644 --- a/pages/index.mdx +++ b/pages/index.mdx @@ -1,5 +1,6 @@ --- breadcrumb: false +description: "GenLayer is the adjudication layer for the agentic economy: decentralized AI-validator consensus for contracts that require judgment, not just code." --- import Image from 'next/image' diff --git a/pages/partners/_meta.json b/pages/partners/_meta.json index 584d5bf23..5a0c2d701 100644 --- a/pages/partners/_meta.json +++ b/pages/partners/_meta.json @@ -4,5 +4,6 @@ "ionet": "io.net", "comput3": "Comput3", "chutes": "Chutes", + "libertai": "LibertAI", "morpheus": "Morpheus" } \ No newline at end of file diff --git a/pages/partners/chutes.mdx b/pages/partners/chutes.mdx index ad97926a4..f1afeece1 100644 --- a/pages/partners/chutes.mdx +++ b/pages/partners/chutes.mdx @@ -1,12 +1,12 @@ -# Using Chutes with GenLayer Validators - -This guide explains how GenLayer validators can use Chutes to access AI models through the Chutes API. +--- +description: "Chutes for GenLayer validators: API setup, model inference, authentication, discounts, and GPU-free AI workloads." +--- -Chutes provides serverless inference for open-source AI models running on decentralized GPU infrastructure powered by Bittensor. +# Using Chutes with GenLayer Validators -Validators can call these models through a simple HTTP API without running their own GPU infrastructure. +Chutes is a serverless inference platform for open-source AI models that GenLayer validators can access through the Chutes API. Chutes runs on decentralized GPU infrastructure powered by Bittensor, so validators can call AI models through a simple HTTP API without running their own GPU infrastructure. -GenLayer Validators can request a discount on Chutes models by [filling out this form](https://docs.google.com/forms/d/e/1FAIpQLSd6I_Q0aiCalDQLX9FvzQ3hfFaKR4j1jaDEoa-jfpXhLclmog/viewform). +This guide explains how GenLayer validators can use Chutes to access AI models, authenticate requests, and run model inference from a validator environment. GenLayer Validators can request a discount on Chutes models by [filling out this form](https://docs.google.com/forms/d/e/1FAIpQLSd6I_Q0aiCalDQLX9FvzQ3hfFaKR4j1jaDEoa-jfpXhLclmog/viewform). --- diff --git a/pages/partners/comput3.mdx b/pages/partners/comput3.mdx index 35c5be03f..c27a724f4 100644 --- a/pages/partners/comput3.mdx +++ b/pages/partners/comput3.mdx @@ -1,7 +1,11 @@ +--- +description: "Comput3 provides GenLayer Validators with decentralized AI inference APIs for Intelligent Contracts." +--- + # Comput3 -[Comput3](https://genlayer.comput3.ai/) is a decentralized compute network providing access to various AI models. The platform offers serverless access to open-source AI models through a distributed infrastructure, enabling developers to leverage powerful AI capabilities without the need for local hardware. +[Comput3](https://genlayer.comput3.ai/) is a decentralized compute network that provides serverless access to open-source AI models through distributed infrastructure. The platform gives developers access to powerful AI capabilities without requiring local hardware. -In partnership with GenLayer, Comput3 provides access to inferencing APIs with support for llama3, hermes3, and qwen3 models. GenLayer Validators can use the Comput3.ai inferencing API to power their Intelligent Contracts with high-quality AI responses. Validators can obtain free [Comput3 API credits](https://genlayer.comput3.ai/) to get started with their validator setup. +In partnership with GenLayer, Comput3 provides access to inferencing APIs with support for llama3, hermes3, and qwen3 models. GenLayer Validators can use the Comput3.ai inferencing API to power their Intelligent Contracts with high-quality AI responses, and can obtain free [Comput3 API credits](https://genlayer.comput3.ai/) to get started with their validator setup. -This partnership enhances the GenLayer ecosystem by providing reliable and scalable AI inference capabilities for decentralized applications. \ No newline at end of file +This partnership enhances the GenLayer ecosystem by providing reliable and scalable AI inference capabilities for decentralized applications. diff --git a/pages/partners/genlayerlabs.mdx b/pages/partners/genlayerlabs.mdx index ac9a7a710..9654c8975 100644 --- a/pages/partners/genlayerlabs.mdx +++ b/pages/partners/genlayerlabs.mdx @@ -1,6 +1,10 @@ -## GenLayer Labs +--- +description: "GenLayer Labs is an AI research lab and core GenLayer developer focused on AI-enhanced blockchain networks." +--- -[GenLayer Labs](https://www.genlayerlabs.com/) is a pioneering AI research lab dedicated to revolutionizing human-AI interaction. They are one of the core developers of GenLayer, focusing on using AI to enhance the performance, security, and scalability of blockchain networks. By embedding AI into the blockchain's core, GenLayer Labs enables decentralized applications to make smart decisions autonomously, opening new possibilities for automation and efficiency in various industries. +# GenLayer Labs -We encourage other developers and organizations to collaborate with GenLayer Labs on this groundbreaking project. Together, we can push the boundaries of what AI and blockchain technology can achieve. +[GenLayer Labs](https://www.genlayerlabs.com/) is a pioneering AI research lab and one of the core developers of GenLayer. GenLayer Labs focuses on using AI to enhance the performance, security, and scalability of blockchain networks, with work dedicated to revolutionizing human-AI interaction. By embedding AI into the blockchain's core, GenLayer Labs enables decentralized applications to make smart decisions autonomously, opening new possibilities for automation and efficiency in various industries. + +We encourage other developers and organizations to collaborate with GenLayer Labs on this groundbreaking project. Together, we can push the boundaries of what AI and blockchain technology can achieve. diff --git a/pages/partners/heurist.mdx b/pages/partners/heurist.mdx index ea6f45de6..2cd4b4618 100644 --- a/pages/partners/heurist.mdx +++ b/pages/partners/heurist.mdx @@ -1,7 +1,11 @@ +--- +description: "Heurist provides decentralized AI model APIs and free credits for GenLayer Intelligent Contract developers." +--- + # Heurist -[Heurist](https://www.heurist.ai/) is a Layer 2 network for AI model hosting and inference, built on the ZK Stack. It offers serverless access to open-source AI models through a decentralized network, making AI deployment easy and efficient for developers. This approach promotes transparency and reduces bias, which is especially useful for projects like GenLayer that require detailed AI analysis. +[Heurist](https://www.heurist.ai/) is a Layer 2 network for AI model hosting and inference, built on the ZK Stack. Heurist offers serverless access to open-source AI models through a decentralized network, making AI deployment easy and efficient for developers. This approach promotes transparency and reduces bias, which is especially useful for projects like GenLayer that require detailed AI analysis. -In collaboration with GenLayer, Heurist provides APIs for open-source large language models (LLMs) to enable developers building Intelligent Contracts use AI at low or no cost. Developers building on GenLayer can obtain free [Heurist API credits](https://dev-api-form.heurist.ai) by using the referral code: _"genlayer"_. +In collaboration with GenLayer, Heurist provides APIs for open-source large language models (LLMs) to enable developers building Intelligent Contracts to use AI at low or no cost. Developers building on GenLayer can obtain free [Heurist API credits](https://dev-api-form.heurist.ai) by using the referral code: _"genlayer"_. This partnership underscores our commitment to providing robust tools and scalable solutions for decentralized applications. diff --git a/pages/partners/ionet.mdx b/pages/partners/ionet.mdx index 85390b1cd..fa71dd098 100644 --- a/pages/partners/ionet.mdx +++ b/pages/partners/ionet.mdx @@ -1,7 +1,11 @@ +--- +description: "io.net partnership gives GenLayer developers access to io.intelligence open-source AI models via one API." +--- + # io.net -io.intelligence is an AI infrastructure and API platform that democratizes access to advanced AI models and AI agents for the IO community and AI developers. It allows users to access and integrate pre-trained open-source models and custom AI agents into their applications via API calls. io.intelligence is powered by [io.net](https://io.net)'s decentralized distributed compute network. +io.intelligence is an AI infrastructure and API platform from [io.net](https://io.net) that gives the IO community and AI developers API access to advanced AI models and AI agents. The platform lets users access and integrate pre-trained open-source models and custom AI agents into applications through API calls, powered by [io.net](https://io.net)'s decentralized distributed compute network. -In partnership with GenLayer, [io.net](https://io.net) provides access to over 25 of the top open source models including latest versions of Deepseek, Qwen, Llama and Mistral through one unified API endpoint. Developers on Genlayer can receive free daily compute tokens to access io.intelligence for Enterprise. Complete a short [form](https://form.typeform.com/to/pDmCCViV) to get started. +Through its partnership with GenLayer, [io.net](https://io.net) provides access to over 25 top open-source models, including the latest versions of Deepseek, Qwen, Llama, and Mistral, through one unified API endpoint. Developers on GenLayer can receive free daily compute tokens to access io.intelligence for Enterprise by completing a short [form](https://form.typeform.com/to/pDmCCViV). -API Reference: https://docs.io.net/reference/get-started-with-io-intelligence-api \ No newline at end of file +API Reference: https://docs.io.net/reference/get-started-with-io-intelligence-api diff --git a/pages/partners/libertai.mdx b/pages/partners/libertai.mdx index e089e1243..4d4ec3b65 100644 --- a/pages/partners/libertai.mdx +++ b/pages/partners/libertai.mdx @@ -1,6 +1,10 @@ +--- +description: "LibertAI provides GenLayer developers confidential open-source model access through one unified API endpoint." +--- + # LibertAI -[LibertAI](https://libertai.io) is a decentralized AI platform designed to be more secure and resilient than traditional centralized alternatives, while protecting user privacy. LibertAI leverages [Aleph Cloud](https://aleph.cloud) GPUs and TEEs to offer confidential AI services, tools for AI Agents to become self-sustainable & more! +[LibertAI](https://libertai.io) is a decentralized AI platform that provides confidential AI services through [Aleph Cloud](https://aleph.cloud) GPUs and TEEs, designed to be more secure and resilient than traditional centralized alternatives while protecting user privacy. LibertAI also offers tools for AI Agents to become self-sustainable & more! In partnership with GenLayer, [LibertAI](https://libertai.io) provides access to top open-source models with complete data confidentiality through one unified API endpoint. Developers on GenLayer can receive free API credits visible in the [LibertAI console](https://console.libertai.io). Complete a short [form](https://tally.so/r/n9AvdK) to get started. diff --git a/pages/partners/morpheus.mdx b/pages/partners/morpheus.mdx index 1bdfe403a..fe5beefdd 100644 --- a/pages/partners/morpheus.mdx +++ b/pages/partners/morpheus.mdx @@ -1,8 +1,12 @@ +--- +description: "Morpheus provides decentralized LLM inference for GenLayer Intelligent Contract validators via an OpenAI-compatible API." +--- + # Morpheus Morpheus -[Morpheus](https://mor.org/) is a decentralized AI inference network where open-source model providers compete on a peer-to-peer marketplace. Instead of relying on a single centralized API, Morpheus routes requests across independent compute providers offering models like DeepSeek, Llama, Qwen, and others — with the available model list updating dynamically as providers join and leave the network. +[Morpheus](https://mor.org/) is a decentralized AI inference network where open-source model providers compete on a peer-to-peer marketplace. The network routes requests across independent compute providers instead of relying on a single centralized API, offering models like DeepSeek, Llama, Qwen, and others, with the available model list updating dynamically as providers join and leave the network. In partnership with GenLayer, Morpheus provides decentralized LLM inference for Intelligent Contract validators through an OpenAI-compatible API. GenLayer Studio fetches available models from the Morpheus marketplace in real time, so validators always see the latest options. Developers can obtain a [Morpheus API key](https://mor.org/) to get started. diff --git a/pages/understand-genlayer-protocol.mdx b/pages/understand-genlayer-protocol.mdx index e24359a2f..5fceb524b 100644 --- a/pages/understand-genlayer-protocol.mdx +++ b/pages/understand-genlayer-protocol.mdx @@ -1,3 +1,6 @@ +--- +description: "Optimistic Democracy consensus in GenLayer: validator selection, recomputation, and AI-driven transaction validation." +--- ## What is GenLayer? GenLayer is the first AI-native blockchain built for AI-powered smart contracts—called Intelligent Contracts—capable of reasoning and adapting to real-world data. Its foundation is the Optimistic Democracy consensus mechanism, an enhanced Delegated Proof of Stake (dPoS) model where validators connect directly to Large Language Models (LLMs). This setup allows for non-deterministic operations—such as processing text prompts, fetching live web data, and executing AI-based decision-making—while preserving the reliability and security of a traditional blockchain. @@ -30,9 +33,9 @@ This architecture supports autonomous DAOs, self-executing prediction markets, a # Optimistic Democracy: How Consensus Works -GenLayer Optimistic Democracy Consensus Diagram +Optimistic Democracy is GenLayer's consensus mechanism for merging probabilistic AI systems with deterministic blockchain rules so the network can reach secure and accurate consensus at scale. Inspired by **[Condorcet's Jury Theorem](https://jury-theorem.genlayer.com/)** (click the link to check out our interactive model), the process uses validator recomputation and majority agreement as a safety net for AI-driven computations. -Inspired by **[Condorcet's Jury Theorem](https://jury-theorem.genlayer.com/)** (click the link to check out our interactive model), Optimistic Democracy merges probabilistic AI systems with deterministic blockchain rules, ensuring secure and accurate consensus at scale. +GenLayer Optimistic Democracy Consensus Diagram 1. **User Submits a Transaction** A user sends a transaction request to the network (see the diagram's Step 1). @@ -43,12 +46,10 @@ The network selects a Leader, who processes the request and proposes an outcome 3. **Validators Recompute** A group of Validators independently re-compute the transaction (Step 3). If the output aligns with the Leader's proposal, they approve; otherwise, they deny. -This multi-layer validation ensures majority agreement, adding a safety net for AI-driven computations. - -# Validator Selection Mechanism -Token holders bolster network security by delegating tokens to validator candidates. A deterministic function f(x) then randomly designates Leader-Validator and Validators for each transaction. This process not only promotes fairness but also helps decentralize validation power, strengthening GenLayer's security and trustlessness. +## Validator Selection Mechanism +Token holders bolster network security by delegating tokens to validator candidates. A deterministic function f(x) then randomly designates Leader-Validator and Validators for each transaction. This process promotes fairness, helps decentralize validation power, and strengthens GenLayer's security and trustlessness. -# Validator Operational Framework +## Validator Operational Framework Each GenLayer validator node integrates: - **Validator Software** @@ -62,7 +63,7 @@ Validators seamlessly manage both: 1. **Deterministic Transactions** typical of traditional blockchains. 2. **Non-Deterministic Transactions** that leverage AI-driven logic (e.g., searching the internet, analyzing data, making probabilistic inferences). -By splitting tasks between standard deterministic and advanced AI-powered transactions, GenLayer ensures high performance without compromising on security. +By splitting tasks between standard deterministic transactions and advanced AI-powered transactions, GenLayer ensures high performance without compromising on security. -# Putting It All Together +## Putting It All Together With Optimistic Democracy guiding consensus and validators empowered by AI, GenLayer enables a new class of blockchain applications. From DAOs that self-govern based on real-time data to DeFi protocols that dynamically adjust parameters in response to market changes, developers can now build truly intelligent decentralized solutions. diff --git a/pages/understand-genlayer-protocol/core-concepts.mdx b/pages/understand-genlayer-protocol/core-concepts.mdx index effb688c9..872f0bf2b 100644 --- a/pages/understand-genlayer-protocol/core-concepts.mdx +++ b/pages/understand-genlayer-protocol/core-concepts.mdx @@ -1,9 +1,12 @@ +--- +description: "GenLayer Core Concepts explains GenVM, transactions, Optimistic Democracy, finality, staking, slashing, and unstaking." +--- import { Card, Cards } from 'nextra-theme-docs' # Core Concepts -Dive into GenLayer’s fundamental building blocks. These core concepts elucidate how Intelligent Contracts remain secure, efficient, and reliable in a non-deterministic environment: +GenLayer core concepts are the fundamental building blocks that explain how Intelligent Contracts remain secure, efficient, and reliable in a non-deterministic environment. Use these topics to understand GenVM, transactions, Optimistic Democracy, the Equivalence Principle, the appeal process, finality, staking, slashing, and unstaking. @@ -15,4 +18,4 @@ Dive into GenLayer’s fundamental building blocks. These core concepts elucidat - \ No newline at end of file + diff --git a/pages/understand-genlayer-protocol/core-concepts/accounts-and-addresses.mdx b/pages/understand-genlayer-protocol/core-concepts/accounts-and-addresses.mdx index a9d046677..c22053c3c 100644 --- a/pages/understand-genlayer-protocol/core-concepts/accounts-and-addresses.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/accounts-and-addresses.mdx @@ -1,5 +1,11 @@ +--- +description: "Accounts and addresses in GenLayer: EOAs, contract accounts, 0x addresses, keys, transactions, gas, and security" +--- + # Accounts and Addressing +Accounts in GenLayer are entities that can hold tokens, deploy Intelligent Contracts, and initiate transactions on the network. GenLayer supports Externally Owned Accounts controlled by private keys and Contract Accounts associated with deployed Intelligent Contracts, each using addresses typically represented as `0x`-prefixed hexadecimal strings. + ## Overview Accounts are fundamental to interacting with the GenLayer network. They represent users or entities that can hold tokens, deploy Intelligent Contracts, and initiate transactions. diff --git a/pages/understand-genlayer-protocol/core-concepts/economic-model.mdx b/pages/understand-genlayer-protocol/core-concepts/economic-model.mdx index 28229dbbf..bc2a01be4 100644 --- a/pages/understand-genlayer-protocol/core-concepts/economic-model.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/economic-model.mdx @@ -1,5 +1,11 @@ +--- +description: "Economic Model explains GenLayer validator staking, rewards, transaction fees, slashing, and economic security." +--- + # Economic Model +GenLayer's Economic Model defines how staking, rewards, transaction fees, and slashing incentivize participants to maintain the network's security and functionality. Validators stake tokens to participate in validation, earn rewards for correctly validating transactions, receive fees from transaction processing, and risk penalties if they act maliciously or incompetently. + ## Overview GenLayer's economic model is designed to incentivize participants to maintain the network's security and functionality. It involves staking, rewards, transaction fees, and penalties. diff --git a/pages/understand-genlayer-protocol/core-concepts/genvm.mdx b/pages/understand-genlayer-protocol/core-concepts/genvm.mdx index 2b93f2918..29a3e7af8 100644 --- a/pages/understand-genlayer-protocol/core-concepts/genvm.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/genvm.mdx @@ -1,6 +1,10 @@ +--- +description: "GenVM is GenLayer's virtual machine for executing Python Intelligent Contracts with web and LLM access." +--- + # GenVM (GenLayer Virtual Machine) -The GenVM is the execution environment for Intelligent Contracts in the GenLayer protocol. It serves as the backbone for processing and managing contract operations within the GenLayer ecosystem. +GenVM is the execution environment for Intelligent Contracts in the GenLayer protocol, processing and managing contract operations across the GenLayer ecosystem. GenVM executes Intelligent Contracts that may use non-deterministic code while preserving blockchain security and consistency. [Source code at GitHub](https://github.com/genlayerlabs/genvm) diff --git a/pages/understand-genlayer-protocol/core-concepts/large-language-model-llm-integration.mdx b/pages/understand-genlayer-protocol/core-concepts/large-language-model-llm-integration.mdx index 629189be8..4fa6f9a27 100644 --- a/pages/understand-genlayer-protocol/core-concepts/large-language-model-llm-integration.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/large-language-model-llm-integration.mdx @@ -1,5 +1,11 @@ +--- +description: "Large Language Model integration in GenLayer lets Intelligent Contracts use LLMs for natural language decisions." +--- + # Large Language Model (LLM) Integration +Large Language Model (LLM) integration in GenLayer lets Intelligent Contracts interact directly with LLMs for natural language processing and context-aware decision-making within blockchain applications. + ## Overview Intelligent Contracts in GenLayer can interact directly with Large Language Models (LLMs), enabling natural language processing and more complex decision-making capabilities within blockchain applications. diff --git a/pages/understand-genlayer-protocol/core-concepts/non-deterministic-operations-handling.mdx b/pages/understand-genlayer-protocol/core-concepts/non-deterministic-operations-handling.mdx index 409f4c79b..04905bda0 100644 --- a/pages/understand-genlayer-protocol/core-concepts/non-deterministic-operations-handling.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/non-deterministic-operations-handling.mdx @@ -1,5 +1,11 @@ +--- +description: "Non-deterministic operations handling in GenLayer explains how Intelligent Contracts use equivalence and consensus for variable outputs." +--- + # Non-Deterministic Operations Handling +Non-deterministic operations handling in GenLayer is the process of maintaining network consensus when Intelligent Contracts produce variable results from actions such as interacting with Large Language Models (LLMs) or accessing web data. GenLayer addresses this variability through the Equivalence Principle, where validators assess whether different outputs are equivalent based on predefined criteria, and Optimistic Democracy, which supports provisional transaction acceptance with an appeals process. + ## Overview GenLayer extends traditional smart contracts by allowing Intelligent Contracts to perform non-deterministic operations, such as interacting with Large Language Models (LLMs) and accessing web data. Handling the variability inherent in these operations is crucial for maintaining consensus across the network. diff --git a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy.mdx b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy.mdx index 5557fd801..d81a1c0cf 100644 --- a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy.mdx @@ -1,8 +1,11 @@ +--- +description: "Optimistic Democracy explains GenLayer consensus for validating Intelligent Contract transactions and appeals." +--- import { Callout } from 'nextra-theme-docs' # Optimistic Democracy -Optimistic Democracy is the consensus method used by GenLayer to validate transactions and operations of Intelligent Contracts. This approach is especially good at handling unpredictable outcomes from transactions involving web data or AI models, which is important for keeping the network reliable and secure. +Optimistic Democracy is GenLayer's consensus method for validating transactions and operations of Intelligent Contracts. It is designed to handle unpredictable outcomes from transactions involving web data or AI models, helping keep the network reliable and secure. ## Key Components diff --git a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/appeal-process.mdx b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/appeal-process.mdx index 13913352c..457912185 100644 --- a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/appeal-process.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/appeal-process.mdx @@ -1,6 +1,10 @@ +--- +description: "Appeals Process explains how GenLayer challenges validation decisions, escalates validator review, and handles appeal bonds and gas costs." +--- + # Appeals Process -The appeals process in GenLayer is a critical component of the Optimistic Democracy consensus mechanism. It provides a means for correcting errors or disagreements in the validation of Intelligent Contracts. This process ensures that non-deterministic transactions are accurately evaluated, contributing to the robustness and fairness of the platform. +The appeals process in GenLayer is the Optimistic Democracy mechanism for correcting errors or disagreements in the validation of Intelligent Contracts. Participants can challenge an initial validation decision so non-deterministic transactions are reassessed, helping preserve the platform's robustness and fairness. ## How It Works diff --git a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/equivalence-principle.mdx b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/equivalence-principle.mdx index d0e8a25eb..f305b3ecd 100644 --- a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/equivalence-principle.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/equivalence-principle.mdx @@ -1,3 +1,7 @@ +--- +description: "The Equivalence Principle is how GenLayer validators reach consensus on non-deterministic outputs such as LLM responses and live web data." +--- + # Equivalence Principle Mechanism The Equivalence Principle mechanism is a cornerstone in ensuring that Intelligent Contracts function consistently across various validators when handling non-deterministic outputs like responses from Large Language Models (LLMs) or data retrieved through web browsing. It plays a crucial role in how validators assess and agree on the outcomes proposed by the Leader. diff --git a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/finality.mdx b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/finality.mdx index 7a9da0f2a..b53dcbd24 100644 --- a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/finality.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/finality.mdx @@ -1,6 +1,10 @@ +--- +description: "Finality in GenLayer explains when transactions become unchangeable, how Finality Windows enable appeals, and when fast finality applies." +--- + # Finality -Finality refers to the state in which a transaction is considered settled and unchangeable. In GenLayer, once a transaction achieves finality, it cannot be appealed or altered, providing certainty to all participants in the system. This is particularly important for applications that rely on accurate and definitive outcomes, such as financial contracts or decentralized autonomous organizations (DAOs). +Finality in GenLayer is the state in which a transaction is settled, unchangeable, and no longer appealable. Once a transaction achieves finality, it cannot be appealed or altered, giving participants certainty that the outcome is definitive. Finality is especially important for applications that depend on accurate settled outcomes, such as financial contracts or decentralized autonomous organizations (DAOs). ## Finality Window diff --git a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/slashing.mdx b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/slashing.mdx index a6f5f951a..007379114 100644 --- a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/slashing.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/slashing.mdx @@ -1,8 +1,10 @@ -# Slashing in GenLayer +--- +description: "Slashing in GenLayer penalizes validators for missed execution or appeal windows by reducing stake after finality." +--- -Slashing is a mechanism used in GenLayer to penalize validators who engage in behavior detrimental to the network. This ensures that validators act honestly and effectively, maintaining the integrity of the platform and the Intelligent Contracts executed within it. +# Slashing in GenLayer -By penalizing undesirable behavior, slashing helps align validators' incentives with those of the network and its users. +Slashing in GenLayer is the validator penalty mechanism that reduces stake for behavior detrimental to the network, such as missing required execution or appeal windows. Slashing helps validators act honestly and effectively, maintains the integrity of the platform and the Intelligent Contracts executed within it, and aligns validator incentives with the network and its users. ## Slashing Process diff --git a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking.mdx b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking.mdx index 877f67049..09b363e72 100644 --- a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking.mdx @@ -1,6 +1,10 @@ +--- +description: "Staking in GenLayer explains validator and delegator token locking, network consensus participation, and transaction processing." +--- + # Staking in GenLayer -Participants, known as validators, commit a specified amount of tokens to the network by locking them up on the rollup layer. This commitment supports the network's consensus mechanism and enables validators to actively participate in processing transactions and managing the network. +Staking in GenLayer is the process where validators lock a specified amount of tokens on the rollup layer to participate in the network. This commitment supports GenLayer's consensus mechanism and enables validators to process transactions and help manage the network. ## Validators vs Delegators diff --git a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/unstaking.mdx b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/unstaking.mdx index af2970106..455d5dc8e 100644 --- a/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/unstaking.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/unstaking.mdx @@ -1,5 +1,9 @@ +--- +description: "Unstaking in GenLayer explains how validators exit active duties, wait for finality, and withdraw stake and rewards." +--- + # Unstaking in GenLayer -Unstaking in GenLayer is the process by which validators disengage their staked tokens from the network, ending their active participation as validators. They must initiate an unstaking process, which includes a cooldown period to finalize all pending transactions. This procedure ensures that all obligations are fulfilled and pending issues resolved, maintaining the network's integrity and securing the platform’s operations. +Unstaking in GenLayer is the process by which validators disengage their staked tokens from the network and end active participation as validators. Validators initiate unstaking with a transaction, are removed from the active validator pool, and wait through a cooldown period so all transactions they participated in can reach full finality. After pending obligations and issues are resolved, validators and their delegators can withdraw staked tokens and any accrued rewards while preserving network integrity and platform security. ## How Unstaking Works diff --git a/pages/understand-genlayer-protocol/core-concepts/rollup-integration.mdx b/pages/understand-genlayer-protocol/core-concepts/rollup-integration.mdx index 2352a63ad..a6ab9c779 100644 --- a/pages/understand-genlayer-protocol/core-concepts/rollup-integration.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/rollup-integration.mdx @@ -1,6 +1,10 @@ +--- +description: "Rollup Integration explains how GenLayer uses Ethereum rollups to scale GenVM execution, lower fees, and inherit Ethereum security." +--- + # Rollup Integration -GenLayer leverages Ethereum rollups, such as ZKSync or Polygon CDK, to ensure scalability and compatibility with existing Ethereum infrastructure. This integration is crucial for optimizing transaction throughput and reducing fees while maintaining the security guarantees of the Ethereum mainnet. +Rollup Integration is how GenLayer uses Ethereum rollups, such as ZKSync or Polygon CDK, to improve scalability and compatibility with existing Ethereum infrastructure. By moving execution off-chain while anchoring results to Ethereum, this integration helps optimize transaction throughput and reduce fees while maintaining the security guarantees of the Ethereum mainnet. ## Key Aspects of Rollup Integration diff --git a/pages/understand-genlayer-protocol/core-concepts/transactions.mdx b/pages/understand-genlayer-protocol/core-concepts/transactions.mdx index 2e2eaf089..8c93a929e 100644 --- a/pages/understand-genlayer-protocol/core-concepts/transactions.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/transactions.mdx @@ -1,6 +1,9 @@ -# Transactions -Transactions are the fundamental operations that drive the GenLayer protocol. Whether it's deploying a new contract, sending value between accounts, or invoking a function within an existing contract, transactions are the means by which state changes occur on the network. +--- +description: "Transactions in GenLayer define how deployments, transfers, and contract calls change network state." +--- +# Transactions +Transactions in GenLayer are the fundamental operations that change network state, including deploying a new contract, sending value between accounts, or invoking a function within an existing contract. A transaction records the call data, sender and recipient addresses, gas limit, nonce, status, consensus data, and execution receipts used by the protocol to process and finalize the operation. Here is the general structure of a transaction: @@ -102,6 +105,7 @@ Here is the general structure of a transaction: "value": 0 } ``` + ## Explanation of fields: - consensus_data: Object containing information about the consensus process diff --git a/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-encoding-serialization-and-signing.mdx b/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-encoding-serialization-and-signing.mdx index d3179390c..fce437948 100644 --- a/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-encoding-serialization-and-signing.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-encoding-serialization-and-signing.mdx @@ -1,5 +1,8 @@ +--- +description: "Transaction encoding, serialization, and signing in GenLayer for preparing raw transactions and RPC submission" +--- -## Transaction encoding, serialization, and signing -In GenLayer, all three types of transactions needs to be properly encoded, serialized, and signed on the client-side. This process ensures that the transaction data is packaged into a relieable cross-platform efficient format, and securely signed using the sender's private key to verify the sender's identity. +# Transaction encoding, serialization, and signing +Transaction encoding, serialization, and signing in GenLayer is the client-side process of packaging all three transaction types into a reliable, cross-platform, efficient format and signing them with the sender's private key to verify the sender's identity. Once prepared, the transaction is sent to the network via the `eth_sendRawTransaction` method on the RPC Server. This method performs the inverse process: it decodes and deserializes the transaction data, and then verifies the signature to ensure its authenticity. By handling all transaction types through `eth_sendRawTransaction`, GenLayer ensures that transactions are processed securely and efficiently while maintaining compatibility with Ethereum’s specification. diff --git a/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-execution.mdx b/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-execution.mdx index 818de4ceb..cfd7c28b1 100644 --- a/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-execution.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-execution.mdx @@ -1,9 +1,13 @@ -## Transaction execution -Once a transaction is received and properly verified by the `eth_sendRawTransaction` method on the RPC server, it is stored with a PENDING status and its hash is returned as the RPC method response. This means that the transaction has been validated for authenticity and format, but it has not yet been executed. From this point, the transaction enters the GenLayer consensus mechanism, where it is picked up for execution by the network's validators according to the consensus rules. +--- +description: "Transaction execution in GenLayer: how submitted transactions move from pending through validator consensus to finalization" +--- -As the transaction progresses through various stages—such as proposing, committing, and revealing—its status is updated accordingly. Throughout this process, the current status and output of the transaction can be queried by the user. This is done by calling the `eth_getTransactionByHash` method on the RPC server, which retrieves the transaction's details based on its unique hash. This method allows users to track the transaction's journey from submission to finalization, providing transparency and ensuring that they can monitor the outcome of their transactions in real-time. +# Transaction execution +Transaction execution in GenLayer is the process that starts after `eth_sendRawTransaction` receives and verifies a transaction, stores it with a PENDING status, and returns its hash as the RPC response. At that point, the transaction has been validated for authenticity and format, but it has not yet been executed; it enters the GenLayer consensus mechanism, where the network's validators pick it up for execution according to the consensus rules. -### Transaction Status Transitions +As the transaction progresses through stages such as proposing, committing, and revealing, its status is updated accordingly. Users can query the current status and output of the transaction by calling the `eth_getTransactionByHash` method on the RPC server, which retrieves the transaction's details based on its unique hash. This method lets users track the transaction's journey from submission to finalization, providing transparency and helping them monitor transaction outcomes in real time. + +## Transaction Status Transitions In the journey of a transaction within the GenLayer protocol, it begins its life when an Externally Owned Account (EOA) submits it, entering the `Pending` state. Here, it awaits further processing unless it encounters an `OutOfFee` state due to insufficient fees. If the fees are topped up, it returns to `Pending`. Alternatively, the user can cancel the transaction, moving it to the `Canceled` state. diff --git a/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-statuses.mdx b/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-statuses.mdx index e124de5d5..ca5a1d08e 100644 --- a/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-statuses.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/transactions/transaction-statuses.mdx @@ -1,5 +1,9 @@ +--- +description: "Transaction Processing explains GenLayer transaction statuses from pending queue to finalized, undetermined, or canceled outcomes." +--- + # Transaction Processing -In GenLayer, transactions are processed through an account-based queue system that ensures orderliness. Here’s how transactions transition through different statuses: +GenLayer transaction processing is the account-based queue flow that moves each transaction through network statuses from submission to execution outcome. Transactions are queued per account to preserve the order in which they were submitted, then transition through pending, proposing, committing, revealing, accepted, finalized, undetermined, or canceled states. ## 1. Pending When a transaction is first submitted, it enters the pending state. This means it has been received by the network but is waiting to be processed. Transactions are queued per account, ensuring that each account's transactions are processed in the order they were submitted. diff --git a/pages/understand-genlayer-protocol/core-concepts/transactions/types-of-transactions.mdx b/pages/understand-genlayer-protocol/core-concepts/transactions/types-of-transactions.mdx index a5952fcdc..897cdce98 100644 --- a/pages/understand-genlayer-protocol/core-concepts/transactions/types-of-transactions.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/transactions/types-of-transactions.mdx @@ -1,6 +1,9 @@ -# Types of Transactions -There are three different types of transactions that users can send in GenLayer. All three types are sent through the same RPC method, but they differ in the data they contain and the actions they perform. +--- +description: "Types of Transactions covers GenLayer contract deployment, GEN transfers, and Intelligent Contract function calls." +--- +# Types of Transactions +GenLayer transactions are user-submitted operations that deploy an Intelligent Contract, send native GEN value, or call a function on an existing Intelligent Contract. All three types are sent through the same RPC method, but they differ in the data they contain and the actions they perform. ## 1. Deploy a Contract Deploying a contract involves creating a new Intelligent Contract on the GenLayer network. This transaction initializes the contract's state and assigns it a unique address on the blockchain. The deployment process ensures that the contract code is properly validated and stored, making it ready to be called. diff --git a/pages/understand-genlayer-protocol/core-concepts/validators-and-validator-roles.mdx b/pages/understand-genlayer-protocol/core-concepts/validators-and-validator-roles.mdx index 70fae242a..413ba9d7a 100644 --- a/pages/understand-genlayer-protocol/core-concepts/validators-and-validator-roles.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/validators-and-validator-roles.mdx @@ -1,5 +1,11 @@ +--- +description: "Validators in GenLayer validate transactions, vote in Optimistic Democracy, stake tokens, and serve leader or consensus roles." +--- + # Validators and Validator Roles +Validators are GenLayer network participants that validate transactions, help maintain blockchain integrity and security, and participate in Optimistic Democracy consensus. They verify deterministic and non-deterministic transactions, use the Equivalence Principle for non-deterministic operations, take part in leader selection, vote on proposed outcomes, and stake tokens to earn validation rights and rewards. + ## Overview Validators are essential participants in the GenLayer network. They are responsible for validating transactions and maintaining the integrity and security of the blockchain. Validators play a crucial role in the Optimistic Democracy consensus mechanism, ensuring that both deterministic and non-deterministic transactions are processed correctly. diff --git a/pages/understand-genlayer-protocol/core-concepts/web-data-access.mdx b/pages/understand-genlayer-protocol/core-concepts/web-data-access.mdx index b06b44428..76fe3b339 100644 --- a/pages/understand-genlayer-protocol/core-concepts/web-data-access.mdx +++ b/pages/understand-genlayer-protocol/core-concepts/web-data-access.mdx @@ -1,5 +1,11 @@ +--- +description: "Web Data Access in Intelligent Contracts lets GenLayer contracts fetch, validate, and use live web data without oracles." +--- + # Web Data Access in Intelligent Contracts +Web Data Access in Intelligent Contracts is GenLayer's capability for contracts to directly retrieve and use web data without relying on oracles. This enables blockchain applications to respond to real-world events while validators use equivalence validation to check retrieved data for consistency. + ## Overview GenLayer enables Intelligent Contracts to directly access and interact with web data, removing the need for oracles and allowing for real-time data integration into blockchain applications. diff --git a/pages/understand-genlayer-protocol/optimistic-democracy-how-genlayer-works.mdx b/pages/understand-genlayer-protocol/optimistic-democracy-how-genlayer-works.mdx index da3feca38..397cb99d5 100644 --- a/pages/understand-genlayer-protocol/optimistic-democracy-how-genlayer-works.mdx +++ b/pages/understand-genlayer-protocol/optimistic-democracy-how-genlayer-works.mdx @@ -1,7 +1,12 @@ +--- +description: "Optimistic Democracy: how GenLayer validators reach consensus, handle non-determinism, appeals, and finality." +--- import { Callout } from "nextra-theme-docs"; # How GenLayer Works +GenLayer works through **Optimistic Democracy**, a consensus mechanism where validators running diverse AI models independently evaluate transactions and vote on outcomes. This page explains the transaction lifecycle, how GenLayer reaches consensus on non-deterministic results from Intelligent Contracts, and how appeals lead to finality. + ## Optimistic Democracy GenLayer uses **Optimistic Democracy** for consensus — a mechanism where validators running diverse AI models independently evaluate transactions and vote on outcomes. It applies [Condorcet's Jury Theorem](https://en.wikipedia.org/wiki/Condorcet%27s_jury_theorem): a group of independent reasoners is more likely to reach the correct answer than any individual. This is what lets GenLayer act as an **adjudication layer** for the agentic economy — judgments emerge from a diverse validator set rather than from any one model, operator, or jurisdiction. diff --git a/pages/understand-genlayer-protocol/typical-use-cases.mdx b/pages/understand-genlayer-protocol/typical-use-cases.mdx index 2a97aa821..2d56f2953 100644 --- a/pages/understand-genlayer-protocol/typical-use-cases.mdx +++ b/pages/understand-genlayer-protocol/typical-use-cases.mdx @@ -1,6 +1,10 @@ +--- +description: "GenLayer use cases for Intelligent Contracts that resolve subjective, evidence-based outcomes on-chain" +--- + # Use Cases -GenLayer is built for commitments where outcomes depend on judgment — evaluating evidence, interpreting language, or assessing quality — and where a deterministic smart contract alone cannot resolve them. +GenLayer use cases are commitments where outcomes depend on judgment, such as evaluating evidence, interpreting language, or assessing quality, and where a deterministic smart contract alone cannot resolve them. If you are deciding whether a feature belongs on GenLayer or in a normal backend, start with the [builder fit checklist](/developers/intelligent-contracts/when-to-use-genlayer). diff --git a/pages/understand-genlayer-protocol/what-is-genlayer.mdx b/pages/understand-genlayer-protocol/what-is-genlayer.mdx index 98e0f77fe..f66c9cfda 100644 --- a/pages/understand-genlayer-protocol/what-is-genlayer.mdx +++ b/pages/understand-genlayer-protocol/what-is-genlayer.mdx @@ -1,3 +1,7 @@ +--- +description: "GenLayer is the first Intelligent Blockchain: smart contracts that natively access the web, call LLMs, and reach consensus on subjective, judgment-based decisions." +--- + import { Callout } from "nextra-theme-docs"; # What is GenLayer diff --git a/pages/validators/genvm-configuration.mdx b/pages/validators/genvm-configuration.mdx index 847183a1c..c3042eb0a 100644 --- a/pages/validators/genvm-configuration.mdx +++ b/pages/validators/genvm-configuration.mdx @@ -1,8 +1,11 @@ +--- +description: "GenVM Configuration explains how validators configure LLM providers, model routing, web access, hot reloads, and costs." +--- import { Callout } from "nextra-theme-docs"; # GenVM Configuration -Your validator's GenVM needs two things to function: **LLM providers** to process AI-powered contract logic, and a **web module** to fetch live internet data. This page covers how to configure both. +GenVM Configuration defines the LLM providers and web module settings a validator's GenVM needs to process AI-powered contract logic and fetch live internet data. This page covers how to configure both. **Why this matters:** The LLM providers you choose directly affect your validator's operating costs and performance. Faster, cheaper models reduce your costs per transaction. Higher-quality models improve your consensus accuracy, which affects your rewards and avoids slashing. By tuning your provider setup — choosing the right models, configuring fallback chains, running local inference, or applying input filters — you can optimize the economics of running your validator. diff --git a/pages/validators/monitoring.mdx b/pages/validators/monitoring.mdx index b98a8ccea..1b5df4dbc 100644 --- a/pages/validators/monitoring.mdx +++ b/pages/validators/monitoring.mdx @@ -1,8 +1,11 @@ +--- +description: "Validator monitoring and telemetry covers Prometheus metrics, health checks, and resource tracking for GenLayer validators." +--- import { Callout } from "nextra-theme-docs"; # Monitoring & Telemetry -GenLayer validators expose comprehensive metrics that are ready for consumption by Prometheus and other monitoring tools. This allows you to monitor your validator's performance, health, and resource usage. +Monitoring and telemetry for GenLayer validators means collecting validator performance, health, and resource usage metrics through endpoints ready for Prometheus and other monitoring tools. GenLayer validators expose comprehensive metrics so you can monitor your validator's performance, health, and resource usage. ## Accessing Metrics diff --git a/pages/validators/setup-guide.mdx b/pages/validators/setup-guide.mdx index ae41150f8..08d86e393 100644 --- a/pages/validators/setup-guide.mdx +++ b/pages/validators/setup-guide.mdx @@ -1,3 +1,7 @@ +--- +description: "Complete guide to running a GenLayer validator node: system requirements, installation, configuration, staking, and node operation." +--- + import { Callout } from "nextra-theme-docs"; # Setting Up Your GenLayer Validator diff --git a/pages/validators/system-requirements.mdx b/pages/validators/system-requirements.mdx index 02b8491d1..c8f56def7 100644 --- a/pages/validators/system-requirements.mdx +++ b/pages/validators/system-requirements.mdx @@ -1,8 +1,11 @@ +--- +description: "System Requirements list initial hardware and software recommendations for running a GenLayer validator node." +--- import { Callout } from "nextra-theme-docs"; # System Requirements -Below are the **initial** recommended system requirements for running a GenLayer validator node. These guidelines may change as the network grows and evolves. +System Requirements for a GenLayer validator node are the **initial** recommended hardware and software guidelines for running one. These guidelines may change as the network grows and evolves. ## RAM diff --git a/pages/validators/upgrade.mdx b/pages/validators/upgrade.mdx index 3336fd2ae..0802f772e 100644 --- a/pages/validators/upgrade.mdx +++ b/pages/validators/upgrade.mdx @@ -1,8 +1,11 @@ +--- +description: "Validator Upgrade Guide explains GenLayer validator breaking and non-breaking upgrades, database handling, and downtime expectations." +--- import { Callout } from "nextra-theme-docs"; # Validator Upgrade Guide -Before upgrading, check the [changelog](/validators/changelog) for the target version to determine whether the upgrade is **breaking** or **non-breaking**. +A GenLayer validator upgrade is either **non-breaking** or **breaking**, and the upgrade type determines whether the database carries over and how much downtime to expect. Before upgrading, check the [changelog](/validators/changelog) for the target version to confirm the correct procedure. | Upgrade Type | How to Identify | Database | Downtime | |---|---|---|---| diff --git a/public/llms-full.txt b/public/llms-full.txt deleted file mode 120000 index ce994ea94..000000000 --- a/public/llms-full.txt +++ /dev/null @@ -1 +0,0 @@ -full-documentation.txt \ No newline at end of file diff --git a/public/llms.txt b/public/llms.txt deleted file mode 100644 index 21a304408..000000000 --- a/public/llms.txt +++ /dev/null @@ -1,24 +0,0 @@ -# GenLayer - -> GenLayer is the first Intelligent Blockchain — a DLT capable of nondeterministic operations through dynamic consensus, enabling smart contracts to natively access the Internet and make subjective decisions. - -## Documentation - -- [Full Documentation](https://docs.genlayer.com/full-documentation.txt): Complete documentation in a single file -- [Developers Guide](https://docs.genlayer.com/developers): Build on GenLayer -- [Validators Guide](https://docs.genlayer.com/validators/setup-guide): Run a validator node - -## API References - -- [GenLayerJS SDK](https://docs.genlayer.com/api-references/genlayer-js): TypeScript SDK for dApps -- [GenLayerPY SDK](https://docs.genlayer.com/api-references/genlayer-py): Python SDK for dApps -- [GenLayer CLI](https://docs.genlayer.com/api-references/genlayer-cli): Command-line interface -- [GenLayer Node RPC](https://docs.genlayer.com/api-references/genlayer-node): JSON-RPC API -- [GenLayer Test](https://docs.genlayer.com/api-references/genlayer-test): Testing framework -- [GenVM SDK](https://sdk.genlayer.com/): SDK for writing intelligent contracts - -## Key Concepts - -- [Intelligent Contracts](https://docs.genlayer.com/developers/intelligent-contracts/introduction): Contracts that can access the web and use LLMs -- [Equivalence Principle](https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/equivalence-principle): How validators reach consensus on nondeterministic outputs -- [Staking](https://docs.genlayer.com/developers/staking-guide): Validator and delegator staking guide diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 000000000..43f7c7799 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,49 @@ +# GenLayer Documentation — https://docs.genlayer.com +# LLM-friendly resources: +# Docs index for LLMs: https://docs.genlayer.com/llms.txt +# Complete docs in one file: https://docs.genlayer.com/llms-full.txt + +User-agent: * +Allow: / + +# AI crawlers and assistants — explicitly welcome +User-agent: GPTBot +Allow: / + +User-agent: OAI-SearchBot +Allow: / + +User-agent: ChatGPT-User +Allow: / + +User-agent: ClaudeBot +Allow: / + +User-agent: Claude-SearchBot +Allow: / + +User-agent: Claude-User +Allow: / + +User-agent: PerplexityBot +Allow: / + +User-agent: Perplexity-User +Allow: / + +User-agent: Google-Extended +Allow: / + +User-agent: Bingbot +Allow: / + +User-agent: CCBot +Allow: / + +User-agent: meta-externalagent +Allow: / + +User-agent: Applebot-Extended +Allow: / + +Sitemap: https://docs.genlayer.com/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml index 3aee10dad..ef3430f08 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -2,817 +2,1273 @@ https://docs.genlayer.com/FAQ - 2026-03-09T15:19:14.172Z + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/_providers/ollama - 2026-03-09T15:19:14.173Z + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/create + 2026-03-27 weekly 0.8 - https://docs.genlayer.com/_providers/openai - 2026-03-09T15:19:14.173Z + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/export + 2026-03-27 weekly 0.8 - https://docs.genlayer.com/_temp/security-and-best-practices/grey-boxing - 2026-03-09T15:19:14.173Z + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/import + 2026-03-27 weekly 0.8 - https://docs.genlayer.com/_temp/security-and-best-practices/universal-attacks - 2026-03-09T15:19:14.173Z + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/list + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/lock + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/remove + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/send + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/show + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/unlock + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account/use + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/accounts/account + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/config/get + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/config/reset + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/config/set + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/config + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/network/info + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/network/list + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/network/set + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/configuration/network + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/contracts/call + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/contracts/code + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/contracts/deploy + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/contracts/schema + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/contracts/write + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/init + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/new + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/stop + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/up + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/update/ollama + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/environment/update + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/finalize-batch + 2026-05-06 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/finalize + 2026-05-06 weekly 0.8 https://docs.genlayer.com/api-references/genlayer-cli - 2026-03-09T15:19:14.173Z + 2026-05-06 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/count + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/create-random + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/create + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/delete + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/get + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators/update + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet/validators + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/localnet/localnet + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/active-validators + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/banned-validators + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/delegation-info + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/delegator-claim + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/delegator-exit + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/delegator-join + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/epoch-info + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/prime-all + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/quarantined-validators + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/set-identity + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/set-operator + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-claim + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-deposit + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-exit + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-history + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-info + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-join + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validator-prime + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/validators + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking/wizard + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/staking/staking + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/transactions/appeal-bond + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/transactions/appeal + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/transactions/receipt + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-cli/transactions/trace + 2026-03-27 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-js/contracts + 2026-04-22 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-js/staking + 2026-04-22 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-js/transactions + 2026-03-31 weekly 0.8 https://docs.genlayer.com/api-references/genlayer-js - 2026-03-09T15:19:14.173Z + 2026-04-01 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-linter + 2026-06-04 weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/debug/gen_dbg_ping - 2026-03-09T15:19:14.174Z + 2025-07-26 + weekly + 0.8 + + + https://docs.genlayer.com/api-references/genlayer-node/debug/gen_dbg_traceTransaction + 2026-04-03 weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/debug/gen_dbg_trie - 2026-03-09T15:19:14.174Z + 2025-07-26 weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/gen/gen_call - 2026-03-09T15:19:14.174Z + 2026-04-29 weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/gen/gen_getContractCode - 2026-03-09T15:19:14.174Z + 2026-02-12 weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/gen/gen_getContractSchema - 2026-03-09T15:19:14.174Z + 2025-07-26 weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/gen/gen_getContractState - 2026-03-09T15:19:14.174Z + 2025-07-26 weekly 0.8 https://docs.genlayer.com/api-references/genlayer-node/gen/gen_getTransactionReceipt - 2026-03-09T15:19:14.174Z + 2026-04-29 weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-node/ops/balance - 2026-03-09T15:19:14.174Z + https://docs.genlayer.com/api-references/genlayer-node/gen/gen_getTransactionStatus + 2026-04-01 weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-node/ops/health - 2026-03-09T15:19:14.174Z + https://docs.genlayer.com/api-references/genlayer-node/gen/gen_syncing + 2026-04-03 weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-node/ops/metrics - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-node/ops/balance + 2025-12-19 weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-node - 2026-03-09T16:05:27.624Z + https://docs.genlayer.com/api-references/genlayer-node/ops/health + 2025-08-26 weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-py - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-node/ops/metrics + 2025-08-26 weekly 0.8 - https://docs.genlayer.com/api-references/genlayer-test - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-node/ops/snapshot + 2026-05-18 weekly 0.8 - https://docs.genlayer.com/api-references - 2026-03-09T15:19:14.173Z + https://docs.genlayer.com/api-references/genlayer-node + 2026-05-18 weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/architecture-overview - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-py/api + 2026-03-31 weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/dapp-development-workflow - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-py + 2026-03-27 weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/genlayer-js - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-test/direct + 2026-04-20 weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/project-boilerplate - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-test/glsim + 2026-03-27 weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/querying-a-transaction - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-test/integration + 2026-03-27 weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/reading-data - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references/genlayer-test + 2026-03-27 weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/testing - 2026-03-09T15:19:14.175Z + https://docs.genlayer.com/api-references + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/decentralized-applications/writing-data - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/architecture-overview + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/crafting-prompts - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/dapp-development-workflow + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/debugging - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/genlayer-js + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/deploying/cli-deployment - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/project-boilerplate + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/deploying/deploy-scripts - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/querying-a-transaction + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/deploying/deployment-methods - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/reading-data + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/deploying/network-configuration - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/testing + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/deploying - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/decentralized-applications/writing-data + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/equivalence-principle - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/intelligent-contracts/crafting-prompts + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_adr-validator - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/intelligent-contracts/debugging + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_flight-insurance - 2026-03-09T15:19:14.176Z + https://docs.genlayer.com/developers/intelligent-contracts/deploying/cli-deployment + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_genlayer-dao - 2026-03-09T15:19:14.177Z + https://docs.genlayer.com/developers/intelligent-contracts/deploying/deploy-scripts + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_git-bounties - 2026-03-09T15:19:14.177Z + https://docs.genlayer.com/developers/intelligent-contracts/deploying/deployment-methods + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_influencer-tweet-analyzer - 2026-03-09T15:19:14.177Z + https://docs.genlayer.com/developers/intelligent-contracts/deploying/network-configuration + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_purellm-dao - 2026-03-09T15:19:14.177Z + https://docs.genlayer.com/developers/intelligent-contracts/deploying + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/examples/_advanced/_rokos-mansion - 2026-03-09T15:19:14.177Z + https://docs.genlayer.com/developers/intelligent-contracts/equivalence-principle + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/fetch-github-profile - 2026-03-09T15:19:14.177Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/fetch-web-content - 2026-03-09T15:19:14.177Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/github-profile-projects - 2026-03-09T15:19:14.177Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/github-profile-summary - 2026-03-09T15:19:14.177Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/llm-hello-world-non-comparative - 2026-03-09T15:19:14.177Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/llm-hello-world - 2026-03-09T15:19:14.177Z + 2026-03-12 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/prediction - 2026-03-09T15:19:14.177Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/storage - 2026-03-09T15:19:14.177Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/user-storage - 2026-03-09T15:19:14.177Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/vector-store-log-indexer - 2026-03-09T15:19:14.178Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/examples/wizard-of-coin - 2026-03-09T15:19:14.178Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/balances - 2026-03-09T15:19:14.178Z + 2026-04-07 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/calling-llms - 2026-03-09T15:19:14.178Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/debugging - 2026-03-09T15:19:14.178Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/error-handling - 2026-03-09T15:19:14.178Z + 2026-06-11 weekly 0.8 - https://docs.genlayer.com/developers/intelligent-contracts/features/features - 2026-03-09T15:19:14.178Z + https://docs.genlayer.com/developers/intelligent-contracts/features/image-processing + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/interacting-with-evm-contracts - 2026-03-09T15:19:14.178Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/interacting-with-intelligent-contracts - 2026-03-09T15:19:14.178Z + 2026-06-11 + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/features/messages + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/non-determinism - 2026-03-09T15:19:14.178Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/random - 2026-03-09T15:19:14.178Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/special-methods - 2026-03-09T15:19:14.178Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/storage - 2026-03-09T15:19:14.178Z + 2026-06-11 + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/features/transaction-context + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/upgradability - 2026-03-09T15:19:14.178Z + 2026-06-11 + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/features/value-transfers + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/vector-storage - 2026-03-09T15:19:14.178Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/features/web-access - 2026-03-09T15:19:14.178Z + 2026-06-11 + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/features + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/first-contract - 2026-03-09T15:19:14.179Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/first-intelligent-contract - 2026-03-09T15:19:14.179Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/ideas - 2026-03-09T15:19:14.179Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/introduction - 2026-03-09T15:19:14.179Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/security-and-best-practices/prompt-injection - 2026-03-09T15:19:14.179Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/storage - 2026-03-09T15:19:14.179Z + 2026-06-11 + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/testing + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tooling-setup - 2026-03-09T15:19:14.179Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-cli - 2026-03-09T15:19:14.179Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/advanced-features/custom-plugins - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/contract-state - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/deploying-contract - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/development-tips - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/execute-transaction - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/limitations - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/loading-contract - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/monitoring-node-logs - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/providers - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/reset-the-studio - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/troubleshooting - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio/validators - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/tools/genlayer-studio - 2026-03-09T15:19:14.179Z + 2025-06-26 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/types/address - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/types/collections - 2026-03-09T15:19:14.180Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/types/dataclasses - 2026-03-09T15:19:14.181Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/intelligent-contracts/types/primitive - 2026-03-09T15:19:14.181Z + 2026-06-11 + weekly + 0.8 + + + https://docs.genlayer.com/developers/intelligent-contracts/when-to-use-genlayer + 2026-06-11 + weekly + 0.8 + + + https://docs.genlayer.com/developers/networks + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers/staking-guide - 2026-03-09T15:19:14.181Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/developers - 2026-03-09T15:19:14.175Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/ - 2026-03-09T15:19:14.181Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/partners/chutes - 2026-03-09T16:04:56.383Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/partners/comput3 - 2026-03-09T15:19:14.181Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/partners/genlayerlabs - 2026-03-09T15:19:14.181Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/partners/heurist - 2026-03-09T15:19:14.181Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/partners/ionet - 2026-03-09T15:19:14.181Z + 2026-06-11 + weekly + 0.8 + + + https://docs.genlayer.com/partners/libertai + 2026-06-11 + weekly + 0.8 + + + https://docs.genlayer.com/partners/morpheus + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/accounts-and-addresses - 2026-03-09T15:19:14.182Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/economic-model - 2026-03-09T15:19:14.182Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/genvm - 2026-03-09T15:19:14.182Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/large-language-model-llm-integration - 2026-03-09T15:19:14.182Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/non-deterministic-operations-handling - 2026-03-09T15:19:14.182Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/appeal-process - 2026-03-09T15:19:14.182Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/equivalence-principle - 2026-03-09T15:19:14.182Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/finality - 2026-03-09T15:19:14.182Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/slashing - 2026-03-09T15:19:14.182Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy/unstaking - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/optimistic-democracy - 2026-03-09T15:19:14.182Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/rollup-integration - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/transactions/transaction-encoding-serialization-and-signing - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/transactions/transaction-execution - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/transactions/transaction-statuses - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/transactions/types-of-transactions - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/transactions - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/validators-and-validator-roles - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts/web-data-access - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/core-concepts - 2026-03-09T15:19:14.182Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/optimistic-democracy-how-genlayer-works - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/typical-use-cases - 2026-03-09T15:19:14.183Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/what-are-intelligent-contracts - 2026-03-09T15:19:14.183Z + 2026-04-07 + weekly + 0.8 + + + https://docs.genlayer.com/understand-genlayer-protocol/what-is-genlayer + 2026-06-11 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/what-makes-genlayer-different - 2026-03-09T15:19:14.184Z + 2026-04-07 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/who-is-genlayer-for - 2026-03-09T15:19:14.184Z + 2026-04-07 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol/why-we-are-building-genlayer - 2026-03-09T15:19:14.184Z + 2026-04-07 weekly 0.8 https://docs.genlayer.com/understand-genlayer-protocol - 2026-03-09T15:19:14.181Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/validators/changelog - 2026-03-09T16:05:26.719Z + 2026-05-25 weekly 0.8 https://docs.genlayer.com/validators/genvm-configuration - 2026-03-09T16:05:04.111Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/validators/monitoring - 2026-03-09T15:19:14.184Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/validators/setup-guide - 2026-03-09T16:05:27.399Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/validators/system-requirements - 2026-03-09T15:19:14.184Z + 2026-06-11 weekly 0.8 https://docs.genlayer.com/validators/upgrade - 2026-03-09T15:19:14.184Z + 2026-06-11 weekly 0.8 diff --git a/scripts/check-llm-exports.js b/scripts/check-llm-exports.js new file mode 100644 index 000000000..9bf9b2b53 --- /dev/null +++ b/scripts/check-llm-exports.js @@ -0,0 +1,82 @@ +const fs = require('fs'); +const path = require('path'); + +// Guards against silent regressions in the LLM exports — entire sections were +// once missing from llms-full.txt for months without anyone noticing. +// Runs right after generate-full-docs.js in dev/build. + +const PUBLIC = path.join(process.cwd(), 'public'); +const failures = []; + +function read(relPath) { + const fullPath = path.join(PUBLIC, relPath); + if (!fs.existsSync(fullPath)) { + failures.push(`missing file: public/${relPath}`); + return ''; + } + return fs.readFileSync(fullPath, 'utf8'); +} + +const llmsTxt = read('llms.txt'); +const fullDocs = read('full-documentation.txt'); +const llmsFull = read('llms-full.txt'); +const apiBundle = read('api-references/llms-full.txt'); + +// 1. Coverage floors (update deliberately if pages are intentionally removed) +const llmsTxtLinks = (llmsTxt.match(/^- \[/gm) || []).length; +if (llmsTxtLinks < 200) { + failures.push(`llms.txt lists only ${llmsTxtLinks} pages (floor: 200) — pages are being dropped`); +} +const rootPageCount = (fullDocs.match(/^Source: /gm) || []).length; +if (rootPageCount < 130) { + failures.push(`full-documentation.txt has only ${rootPageCount} pages (floor: 130)`); +} +const apiPageCount = (apiBundle.match(/^Source: /gm) || []).length; +if (apiPageCount < 70) { + failures.push(`api-references/llms-full.txt has only ${apiPageCount} pages (floor: 70) — CLI subtree may be missing`); +} + +// 2. No JSX leaks — components must be converted to markdown +for (const [name, content] of [ + ['full-documentation.txt', fullDocs], + ['api-references/llms-full.txt', apiBundle], +]) { + const leak = content.match(/<(Callout|Cards|CustomCard|Tabs)[\s>]/); + if (leak) { + failures.push(`JSX leaked into ${name}: found "${leak[0].trim()}" — check cleanMdxContent()`); + } +} + +// 3. Known content anchors — each guards a subtree that once went missing +const anchors = [ + [fullDocs, 'full-documentation.txt', 'Source: https://docs.genlayer.com/api-references/genlayer-js'], + [fullDocs, 'full-documentation.txt', 'Source: https://docs.genlayer.com/validators/setup-guide'], + [fullDocs, 'full-documentation.txt', 'Equivalence Principle'], + [apiBundle, 'api-references/llms-full.txt', 'validator-deposit'], + [apiBundle, 'api-references/llms-full.txt', 'gen_call'], +]; +for (const [content, name, anchor] of anchors) { + if (content && !content.includes(anchor)) { + failures.push(`anchor "${anchor}" not found in ${name}`); + } +} + +// 4. llms-full.txt must mirror full-documentation.txt +if (llmsFull && fullDocs && llmsFull !== fullDocs) { + failures.push('llms-full.txt differs from full-documentation.txt'); +} + +// 5. Per-page mirrors exist and carry frontmatter +const sampleMirror = read('developers/intelligent-contracts/introduction.md'); +if (sampleMirror && !/^---\ntitle:/.test(sampleMirror)) { + failures.push('per-page .md mirror is missing its frontmatter header'); +} + +if (failures.length) { + console.error('check-llm-exports: FAILED'); + for (const failure of failures) console.error(` - ${failure}`); + process.exit(1); +} +console.log( + `check-llm-exports: OK (llms.txt: ${llmsTxtLinks} pages, root bundle: ${rootPageCount}, api bundle: ${apiPageCount})` +); diff --git a/scripts/generate-full-docs.js b/scripts/generate-full-docs.js index 2fc30eed7..86398e834 100644 --- a/scripts/generate-full-docs.js +++ b/scripts/generate-full-docs.js @@ -1,5 +1,8 @@ const fs = require('fs'); const path = require('path'); +const { buildGitDates } = require('./lib/git-dates'); + +const DOMAIN = 'https://docs.genlayer.com'; // Function to read and parse _meta.json files function parseMetaJson(dir) { @@ -11,50 +14,411 @@ function parseMetaJson(dir) { return null; } -// Function to recursively get all MDX files -function getMdxFiles(baseDir, fileList = []) { +function titleFromFilename(filename) { + return filename + .replace(/\.mdx?$/, '') + .split('-') + .map(word => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' '); +} + +// Collect all documentation pages (.mdx and .md), following _meta.json order +// first, then sweeping up any files/directories not listed in _meta.json so +// pages are never silently dropped (e.g. the CLI command subtrees and the +// generated .md API references). +function collectPages(baseDir) { + const pages = []; + const visitedFiles = new Set(); + const visitedDirs = new Set(); + + function visitFile(filePath, title) { + if (visitedFiles.has(filePath)) return; + visitedFiles.add(filePath); + pages.push({ filePath, title }); + } + function traverseDirectory(dir) { - const meta = parseMetaJson(dir); - if (meta) { - Object.keys(meta).forEach(key => { - const mdxPath = path.join(dir, `${key}.mdx`); - if (fs.existsSync(mdxPath)) { - fileList.push(mdxPath); - } + if (visitedDirs.has(dir)) return; + visitedDirs.add(dir); + + const meta = parseMetaJson(dir) || {}; + + for (const key of Object.keys(meta)) { + if (key.startsWith('_')) continue; + const value = meta[key]; + if (value && typeof value === 'object' && value.href) continue; // external link + if (value && typeof value === 'object' && value.type === 'separator' && !value.title) continue; + const title = + typeof value === 'string' ? value : (value && value.title) || titleFromFilename(key); - const subDir = path.join(dir, key); - if (fs.existsSync(subDir) && fs.statSync(subDir).isDirectory()) { - traverseDirectory(subDir); + for (const ext of ['.mdx', '.md']) { + const filePath = path.join(dir, key + ext); + if (fs.existsSync(filePath)) { + visitFile(filePath, title); + break; } - }); + } + + const subDir = path.join(dir, key); + if (fs.existsSync(subDir) && fs.statSync(subDir).isDirectory()) { + traverseDirectory(subDir); + } + } + + // Sweep: pick up anything not referenced by _meta.json + for (const entry of fs.readdirSync(dir).sort()) { + if (entry.startsWith('_') || entry.startsWith('.')) continue; + const fullPath = path.join(dir, entry); + const stat = fs.statSync(fullPath); + if (stat.isDirectory()) { + traverseDirectory(fullPath); + } else if (/\.mdx?$/.test(entry)) { + visitFile(fullPath, titleFromFilename(entry)); + } } } traverseDirectory(baseDir); - return fileList; + return pages; +} + +function routeForPage(filePath, pagesDir) { + let route = path + .relative(pagesDir, filePath) + .replace(/\.mdx?$/, '') + .split(path.sep) + .join('/'); + return route.replace(/(^|\/)index$/, '$1').replace(/\/$/, ''); +} + +function dedupePagesByRoute(pages) { + const byRoute = new Map(); + for (const page of pages) { + const existing = byRoute.get(page.route); + if (!existing || /(^|\/)index\.mdx?$/.test(page.filePath)) { + byRoute.set(page.route, page); + } + } + return [...byRoute.values()]; +} + +// Minimal flat-YAML frontmatter parser (string values only) +function parseFrontmatter(raw) { + const match = raw.match(/^---\n([\s\S]*?)\n---\n/); + if (!match) return { data: {}, content: raw }; + const data = {}; + for (const line of match[1].split('\n')) { + const kv = line.match(/^(\w[\w-]*):\s*(.*)$/); + if (kv) data[kv[1]] = kv[2].replace(/^["']|["']$/g, '').trim(); + } + return { data, content: raw.slice(match[0].length) }; +} + +function parseAttributes(attrString) { + const attrs = {}; + const attrRegex = /(\w+)=(?:"([^"]*)"|'([^']*)'|\{`([^`]*)`\}|\{"([^"]*)"\}|\{'([^']*)'\})/g; + let match; + while ((match = attrRegex.exec(attrString)) !== null) { + attrs[match[1]] = match[2] ?? match[3] ?? match[4] ?? match[5] ?? match[6] ?? ''; + } + return attrs; +} + +const CALLOUT_LABELS = { + info: 'Note', + warning: 'Warning', + error: 'Caution', + tip: 'Tip', +}; + +// Block-level components that can legitimately wrap fenced code blocks — +// transform these across the whole document before fence-splitting. +function transformBlockJsx(text) { + // ... -> blockquote + text = text.replace(/]*)>([\s\S]*?)<\/Callout>/g, (_, attrString, inner) => { + const attrs = parseAttributes(attrString); + const label = CALLOUT_LABELS[attrs.type] || 'Note'; + const lines = inner.trim().split('\n'); + const quoted = lines.map(line => `> ${line.replace(/^ /, '')}`.trimEnd()).join('\n'); + return `> **${label}:**\n${quoted}`; + }); + + // ... -> labeled sections + text = text.replace( + /([\s\S]*?)<\/Tabs>/g, + (_, itemsString, body) => { + const items = [...itemsString.matchAll(/['"]([^'"]+)['"]/g)].map(m => m[1]); + let index = 0; + const sections = []; + body.replace(/([\s\S]*?)<\/Tabs\.Tab>/g, (__, tabContent) => { + const label = items[index] || `Option ${index + 1}`; + index += 1; + const lines = tabContent.replace(/^\n+|\s+$/g, '').split('\n'); + const indents = lines + .filter(line => line.trim()) + .map(line => line.match(/^ */)[0].length); + const commonIndent = indents.length ? Math.min(...indents) : 0; + const dedented = lines.map(line => line.slice(commonIndent)).join('\n'); + sections.push(`**${label}:**\n\n${dedented}`); + return ''; + }); + return sections.join('\n\n'); + } + ); + + return text; +} + +// Convert MDX/JSX constructs in a non-code text segment to plain markdown +function transformJsxSegment(text) { + // MDX comments + text = text.replace(/\{\/\*[\s\S]*?\*\/\}/g, ''); + + // import/export statements (code samples live inside fences, so this is safe here) + text = text.replace(/^import\s.+$/gm, ''); + text = text.replace(/^export\s+(const|default|let|var)\s.+$/gm, ''); + + // -> markdown link bullet + text = text.replace(/<(?:Custom)?Card\s+([^>]*?)\/?>(?:<\/(?:Custom)?Card>)?/g, (_, attrString) => { + const attrs = parseAttributes(attrString); + if (!attrs.title) return ''; + const link = attrs.href ? `[${attrs.title}](${attrs.href})` : attrs.title; + return attrs.description ? `- ${link}: ${attrs.description}` : `- ${link}`; + }); + text = text.replace(/<\/?Cards[^>]*>/g, ''); + + // ... -> markdown image + text = text.replace(/]*?)\/?>/g, (_, attrString) => { + const attrs = parseAttributes(attrString); + return attrs.src ? `![${attrs.alt || ''}](${attrs.src})` : ''; + }); + + //