Skip to content

Commit 837a1df

Browse files
authored
Merge pull request #1443 from o1-labs/dw/frontend-document-env
Frontend: document MinaEnv interface
2 parents b8b8e58 + c8d56af commit 837a1df

File tree

2 files changed

+100
-3
lines changed

2 files changed

+100
-3
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,144 @@
1+
/**
2+
* Main environment configuration interface for the Mina Rust frontend.
3+
* This interface defines all possible configuration options that can be set
4+
* per environment (development, production, local, etc.).
5+
*
6+
* To configure a frontend instance, modify the appropriate environment file:
7+
* - Development: src/environments/environment.ts
8+
* - Production: src/environments/environment.prod.ts
9+
* - Local: src/environments/environment.local.ts
10+
* - WebNode: src/environments/environment.webnodelocal.ts
11+
* - Producer: src/environments/environment.producer.ts
12+
* - Fuzzing: src/environments/environment.fuzzing.ts
13+
*
14+
* @see {@link https://github.com/o1-labs/mina-rust/tree/develop/frontend/src/environments}
15+
*/
116
export interface MinaEnv {
17+
/** Whether this is a production build */
218
production: boolean;
19+
20+
/** Array of Mina node configurations to connect to */
321
configs: MinaNode[];
22+
23+
/** Human-readable identifier for this environment (e.g., "Dev FE") */
424
identifier?: string;
25+
26+
/** Hide the top toolbar in the UI */
527
hideToolbar?: boolean;
28+
29+
/** Hide node statistics display */
630
hideNodeStats?: boolean;
31+
32+
/** Allow adding custom nodes through the UI */
733
canAddNodes?: boolean;
34+
35+
/** Show the WebNode landing page */
836
showWebNodeLandingPage?: boolean;
37+
38+
/** Show the leaderboard/uptime tracking feature */
939
showLeaderboard?: boolean;
40+
41+
/** Hide the peers pill in the status bar */
1042
hidePeersPill?: boolean;
43+
44+
/** Hide the transactions pill in the status bar */
1145
hideTxPill?: boolean;
46+
47+
/** Sentry error tracking configuration */
1248
sentry?: {
49+
/** Sentry Data Source Name for error reporting */
1350
dsn: string;
51+
/** Origins to trace for performance monitoring */
1452
tracingOrigins: string[];
1553
};
54+
55+
/** Global configuration shared across all nodes */
1656
globalConfig?: {
57+
/** Feature flags configuration defining which UI sections are available */
1758
features?: FeaturesConfig;
59+
/** GraphQL endpoint URL for blockchain queries */
1860
graphQL?: string;
61+
/** Firebase configuration for leaderboard and hosting */
1962
firebase?: any;
63+
/** Enable heartbeat/uptime tracking functionality */
2064
heartbeats?: boolean;
2165
};
2266
}
2367

68+
/**
69+
* Configuration for a single Mina node connection.
70+
* Each node can have different endpoints and feature sets enabled.
71+
*/
2472
export interface MinaNode {
73+
/** Display name for this node (e.g., "Local rust node", "Producer-0") */
2574
name: string;
75+
76+
/** Base URL for the node's API endpoint (e.g., "http://127.0.0.1:3000") */
2677
url?: string;
78+
79+
/** URL for memory profiling endpoint */
2780
memoryProfiler?: string;
81+
82+
/** URL for debugger interface */
2883
debugger?: string;
84+
85+
/** Node-specific feature configuration (overrides globalConfig.features) */
2986
features?: FeaturesConfig;
87+
88+
/** Whether this is a user-added custom node */
3089
isCustom?: boolean;
90+
91+
/** Whether this node runs in the browser as a WebNode */
3192
isWebNode?: boolean;
3293
}
3394

95+
/**
96+
* Feature flags configuration that controls which UI sections and sub-features
97+
* are available. Each feature can have multiple sub-features enabled.
98+
*
99+
* @example
100+
* ```typescript
101+
* features: {
102+
* 'dashboard': [], // Dashboard tab (no sub-features)
103+
* 'nodes': ['overview', 'live'], // Nodes tab with overview and live sub-tabs
104+
* 'network': ['messages', 'blocks'] // Network tab with specific sub-sections
105+
* }
106+
* ```
107+
*/
34108
export type FeaturesConfig = Partial<{
109+
/** Main dashboard view */
35110
'dashboard': string[];
111+
112+
/** Node management and monitoring features */
36113
'nodes': string[];
114+
115+
/** State machine and action tracking */
37116
'state': string[];
117+
118+
/** Network topology, messages, and peer connections */
38119
'network': string[];
120+
121+
/** SNARK proof generation and verification */
39122
'snarks': string[];
123+
124+
/** System resource monitoring (memory, CPU) */
40125
'resources': string[];
126+
127+
/** Block production and slot tracking */
41128
'block-production': string[];
129+
130+
/** Transaction mempool monitoring */
42131
'mempool': string[];
132+
133+
/** Performance benchmarking tools */
43134
'benchmarks': string[];
135+
136+
/** Fuzzing and testing tools */
44137
'fuzzing': string[];
45138
}>;
46139

140+
/**
141+
* Union type of all available feature names.
142+
* Used for type safety when referencing features in code.
143+
*/
47144
export type FeatureType = keyof FeaturesConfig;

website/docs/developers/circuits.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ are created and distributed using the original Mina codebase:
241241

242242
:::warning Work in Progress
243243

244-
This should be updated when a release of the OCaml node happens that contains code to
245-
export circuits, and when command to export circuits is added, and CI is updated
246-
to check for latest circuits
244+
This should be updated when a release of the OCaml node happens that contains
245+
code to export circuits, and when command to export circuits is added, and CI is
246+
updated to check for latest circuits
247247

248248
:::
249249

0 commit comments

Comments
 (0)