1"use strict";(self.webpackChunksuccinct_docs=self.webpackChunksuccinct_docs||[]).push([[2775],{28453:(e,n,o)=>{o.d(n,{R:()=>t,x:()=>i});var s=o(96540);const l={},r=s.createContext(l);function t(e){const n=s.useContext(r);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:t(e.components),s.createElement(r.Provider,{value:n},e.children)}},93775:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>t,metadata:()=>s,toc:()=>d});const s=JSON.parse('{"id":"provers/cluster-development/local-development","title":"Local Development","description":"Develop and test the SP1 Cluster locally for faster iteration and debugging.","source":"@site/docs/provers/cluster-development/local-development.md","sourceDirName":"provers/cluster-development","slug":"/provers/cluster-development/local-development","permalink":"/docs/provers/cluster-development/local-development","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":0,"frontMatter":{"title":"Local Development","sidebar_position":0,"toc_min_heading_level":2,"toc_max_heading_level":3},"sidebar":"proversSidebar","previous":{"title":"Architecture","permalink":"/docs/provers/cluster-development/architecture"},"next":{"title":"Bidder","permalink":"/docs/provers/cluster-development/bidder"}}');var l=o(74848),r=o(28453);const t={title:"Local Development",sidebar_position:0,toc_min_heading_level:2,toc_max_heading_level:3},i="Local Development",c={},d=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Setup",id:"setup",level:2},{value:"1. Clone the repository",id:"1-clone-the-repository",level:3},{value:"2. Build the workspace",id:"2-build-the-workspace",level:3},{value:"Running Locally",id:"running-locally",level:2},{value:"Testing Proofs",id:"testing-proofs",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}];function a(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.header,{children:(0,l.jsx)(n.h1,{id:"local-development",children:"Local Development"})}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.em,{children:"Develop and test the SP1 Cluster locally for faster iteration and debugging."})}),"\n",(0,l.jsx)(n.p,{children:"This page walks through how to set up and run the SP1 Cluster locally. While Docker Compose is recommended for deployment, running locally (outside Docker) offers faster compile times and easier iteration, especially when working on GPU code."}),"\n",(0,l.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,l.jsx)(n.p,{children:"To get started with local development, ensure you have the following installed:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"https://www.rust-lang.org/tools/install",children:"Rust"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"https://protobuf.dev/installation/",children:"protobuf compiler"})}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.a,{href:"https://developer.nvidia.com/cuda-downloads",children:"CUDA"})," \u2265 12.5.1"]}),"\n"]}),"\n",(0,l.jsx)(n.p,{children:"If using Docker Compose:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"https://docs.docker.com/get-docker/",children:"Docker"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"https://docs.docker.com/compose/install/",children:"Docker Compose"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.a,{href:"https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html",children:"NVIDIA Container Toolkit"})}),"\n"]}),"\n",(0,l.jsx)(n.p,{children:"If not using Docker Compose:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.a,{href:"https://golang.org/dl/",children:"Go"})," \u2265 1.22"]}),"\n"]}),"\n",(0,l.jsx)(n.admonition,{type:"info",children:(0,l.jsx)(n.p,{children:"Local development is fastest when done on a GPU machine. GPU proving is significantly faster and allows for efficient debugging of GPU-specific code paths."})}),"\n",(0,l.jsx)(n.h2,{id:"setup",children:"Setup"}),"\n",(0,l.jsx)(n.h3,{id:"1-clone-the-repository",children:"1. Clone the repository"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/succinctlabs/sp1-cluster.git\ncd cluster\n"})}),"\n",(0,l.jsx)(n.h3,{id:"2-build-the-workspace",children:"2. Build the workspace"}),"\n",(0,l.jsx)(n.p,{children:"Use Cargo to build the project in debug mode for faster rebuilds during development:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"cargo build\n"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsxs)(n.p,{children:["Note: Even in debug mode, dependencies are built with ",(0,l.jsx)(n.code,{children:"opt-level=3"}),", which preserves decent proving performance."]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"running-locally",children:"Running Locally"}),"\n",(0,l.jsx)(n.p,{children:"You can run the cluster services directly from source without Docker. This setup is ideal for development environments where compile time and iteration speed are critical."}),"\n",(0,l.jsx)(n.p,{children:"To get started:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["Run the desired binaries from ",(0,l.jsx)(n.code,{children:"target/release/"})]}),"\n",(0,l.jsxs)(n.li,{children:["Ensure environment variables match ",(0,l.jsx)(n.code,{children:".env.example"})," or customize as needed"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"testing-proofs",children:"Testing Proofs"}),"\n",(0,l.jsx)(n.p,{children:"You can use the provided CLI tool to send test proof requests to your running cluster:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"cargo run --bin sp1-cluster-cli\n"})}),"\n",(0,l.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,l.jsx)(n.p,{children:"When debugging, the fastest approach is to search the logs for failure keywords. Check the logs of worker nodes and the coordinator using terms like:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"panicked"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"WARN"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"ERROR"})}),"\n",(0,l.jsx)(n.li,{children:"failed proof/task ID"}),"\n"]}),"\n",(0,l.jsx)(n.p,{children:"The coordinator also logs periodic summaries of its state, which can offer useful context."}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Note:"})," You can also manually run specific task instances (TODO: link once available) to isolate and debug performance or correctness issues."]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(a,{...e})}):a(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.