@@ -5,14 +5,18 @@ sidebar_position: 1
55# Getting Started for Developers
66
77import CodeBlock from " @theme/CodeBlock" ;
8+ import Tabs from " @theme/Tabs" ;
9+ import TabItem from " @theme/TabItem" ;
810import InstallRustSh from " !!raw-loader!./scripts/setup/install-rust.sh" ;
911import InstallSystemDepsSh from " !!raw-loader!./scripts/setup/install-system-deps.sh" ;
12+ import InstallSystemDepsMacOSSh from " !!raw-loader!./scripts/setup/install-system-deps-macos.sh" ;
1013import InstallNodejsSh from " !!raw-loader!./scripts/setup/install-nodejs.sh" ;
14+ import InstallNodejsMacOSSh from " !!raw-loader!./scripts/setup/install-nodejs-macos.sh" ;
1115import InstallDockerSh from " !!raw-loader!./scripts/setup/install-docker.sh" ;
16+ import InstallDockerMacOSSh from " !!raw-loader!./scripts/setup/install-docker-macos.sh" ;
1217import InstallWasmToolsSh from " !!raw-loader!./scripts/setup/install-wasm-tools.sh" ;
1318import CloneAndBuildSh from " !!raw-loader!./scripts/setup/clone-and-build.sh" ;
1419import BuildSpecializedSh from " !!raw-loader!./scripts/setup/build-specialized.sh" ;
15- import RunTestsSh from " !!raw-loader!./scripts/setup/run-tests.sh" ;
1620import FormatAndLintSh from " !!raw-loader!./scripts/setup/format-and-lint.sh" ;
1721
1822Welcome to OpenMina development! This guide will help you set up your
@@ -22,8 +26,10 @@ development environment and build OpenMina from source.
2226
2327### System Requirements
2428
25- - ** Operating System** : Ubuntu 20.04+ or Debian 11+ (other Linux distributions
26- may work but are not officially supported)
29+ - ** Operating System** :
30+ - ** Linux** : Ubuntu 20.04+ or Debian 11+ (other Linux distributions may work
31+ but are not officially supported)
32+ - ** macOS** : macOS 12.0+ (Monterey or later)
2733- ** Memory** : At least 8GB RAM (16GB recommended)
2834- ** Storage** : At least 20GB free space
2935- ** Network** : Stable internet connection for downloading dependencies
@@ -32,24 +38,64 @@ development environment and build OpenMina from source.
3238
3339#### 1. Rust Toolchain
3440
35- OpenMina requires both stable and nightly Rust toolchains:
41+ OpenMina requires both stable and nightly Rust toolchains, plus additional tools
42+ for development:
3643
3744<CodeBlock language = " bash" >{ InstallRustSh } </CodeBlock >
3845
46+ This installs:
47+
48+ - Rust 1.84 (stable) and nightly toolchains
49+ - Required components: ` rustfmt ` , ` clippy ` , ` rust-src `
50+ - ` taplo-cli ` : TOML formatter required for ` make format `
51+
3952#### 2. System Dependencies
4053
54+ <Tabs groupId = " operating-systems" >
55+ <TabItem value = " linux" label = " Linux (Ubuntu/Debian)" >
56+
4157<CodeBlock language = " bash" >{ InstallSystemDepsSh } </CodeBlock >
4258
59+ </TabItem >
60+ <TabItem value = " macos" label = " macOS" >
61+
62+ <CodeBlock language = " bash" >{ InstallSystemDepsMacOSSh } </CodeBlock >
63+
64+ </TabItem >
65+ </Tabs >
66+
4367#### 3. Additional Development Tools
4468
4569** Node.js (for documentation and frontend):**
4670
71+ <Tabs groupId = " operating-systems" >
72+ <TabItem value = " linux" label = " Linux (Ubuntu/Debian)" >
73+
4774<CodeBlock language = " bash" >{ InstallNodejsSh } </CodeBlock >
4875
76+ </TabItem >
77+ <TabItem value = " macos" label = " macOS" >
78+
79+ <CodeBlock language = " bash" >{ InstallNodejsMacOSSh } </CodeBlock >
80+
81+ </TabItem >
82+ </Tabs >
83+
4984** Docker (optional, for containerized builds):**
5085
86+ <Tabs groupId = " operating-systems" >
87+ <TabItem value = " linux" label = " Linux (Ubuntu/Debian)" >
88+
5189<CodeBlock language = " bash" >{ InstallDockerSh } </CodeBlock >
5290
91+ </TabItem >
92+ <TabItem value = " macos" label = " macOS" >
93+
94+ <CodeBlock language = " bash" >{ InstallDockerMacOSSh } </CodeBlock >
95+
96+ </TabItem >
97+ </Tabs >
98+
5399#### 4. WASM Tools (for web node development)
54100
55101<CodeBlock language = " bash" >{ InstallWasmToolsSh } </CodeBlock >
@@ -69,7 +115,11 @@ components:
69115
70116### 3. Run Tests
71117
72- <CodeBlock language = " bash" >{ RunTestsSh } </CodeBlock >
118+ You can run a different set of tests. The command ` make help ` will give you the
119+ whole set of targets. You can also visit the file
120+ [ ci.yaml] ( https://github.com/o1-labs/openmina/blob/develop/.github/workflows/ci.yaml )
121+ to explore the targets used for testing in our continuous integration
122+ environment.
73123
74124## Development Workflow
75125
@@ -108,12 +158,24 @@ make clean # Clean build artifacts
108158
109159### Environment Configuration
110160
111- Some components require environment variables:
161+ Some components require environment variables and database setup:
162+
163+ #### SQLite Database (Required for ` make check ` )
164+
165+ The heartbeats processor requires an SQLite database to be initialized before
166+ running ` make check ` :
112167
113168``` bash
114- # For SQLx database operations (heartbeats processor)
169+ # Create the SQLite database with required schema
170+ sqlite3 /tmp/heartbeats.db < tools/heartbeats-processor/schema.sql
171+
172+ # Set the database URL environment variable
115173export DATABASE_URL=" sqlite:///tmp/heartbeats.db"
174+ ```
116175
176+ #### Additional Environment Variables
177+
178+ ``` bash
117179# For archive node development
118180export OPENMINA_ARCHIVE_ADDRESS=" http://localhost:3007"
119181export PG_USER=" openmina"
0 commit comments