|
1 | | -use std::{fs::File, path::PathBuf, sync::Arc}; |
2 | | - |
3 | 1 | use anyhow::Context; |
4 | 2 | use ledger::proofs::provers::BlockProver; |
5 | | -use node::{ |
6 | | - account::AccountSecretKey, |
7 | | - snark::{BlockVerifier, TransactionVerifier}, |
8 | | - transition_frontier::genesis::GenesisConfig, |
9 | | -}; |
10 | | - |
11 | 3 | use mina_node_account::AccountPublicKey; |
12 | | -use reqwest::Url; |
13 | | - |
| 4 | +use mina_node_native::{archive::config::ArchiveStorageOptions, tracing, NodeBuilder}; |
14 | 5 | use node::{ |
| 6 | + account::AccountSecretKey, |
15 | 7 | core::log::inner::Level, |
16 | 8 | p2p::{connection::outgoing::P2pConnectionOutgoingInitOpts, identity::SecretKey}, |
17 | 9 | service::Recorder, |
| 10 | + snark::{BlockVerifier, TransactionVerifier}, |
| 11 | + transition_frontier::genesis::GenesisConfig, |
18 | 12 | SnarkerStrategy, |
19 | 13 | }; |
20 | | - |
21 | | -use mina_node_native::{archive::config::ArchiveStorageOptions, tracing, NodeBuilder}; |
| 14 | +use reqwest::Url; |
| 15 | +use std::{fs::File, path::PathBuf, sync::Arc}; |
22 | 16 |
|
23 | 17 | /// Mina node configuration and runtime options |
24 | 18 | /// |
@@ -216,6 +210,28 @@ pub struct Node { |
216 | 210 | #[arg(long, requires = "producer")] |
217 | 211 | pub coinbase_receiver: Option<AccountPublicKey>, |
218 | 212 |
|
| 213 | + /// Enable recording of node state and actions for debugging and replay |
| 214 | + /// |
| 215 | + /// Recording captures the node's state transitions and input actions, |
| 216 | + /// enabling deterministic replay for debugging and testing purposes. |
| 217 | + /// |
| 218 | + /// Available modes: |
| 219 | + /// - `none`: No recording (default) |
| 220 | + /// - `state-with-input-actions`: Records initial state and all input |
| 221 | + /// actions to the `recorder/` directory within the working directory |
| 222 | + /// |
| 223 | + /// Recorded data can be replayed using the `mina replay` command to |
| 224 | + /// reproduce the exact sequence of state transitions for debugging. |
| 225 | + /// |
| 226 | + /// # Example |
| 227 | + /// |
| 228 | + /// ```bash |
| 229 | + /// # Record node execution |
| 230 | + /// mina node --network devnet --record state-with-input-actions |
| 231 | + /// |
| 232 | + /// # Replay recorded execution |
| 233 | + /// mina replay state-with-input-actions ~/.mina/recorder |
| 234 | + /// ``` |
219 | 235 | #[arg(long, default_value = "none", env)] |
220 | 236 | pub record: String, |
221 | 237 |
|
|
0 commit comments