MCPcopy Create free account
hub / github.com/base/base / parse_node

Function parse_node

crates/execution/cli/src/lib.rs:163–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

161
162 #[test]
163 fn parse_node() {
164 // clap 4.x validates env var values even when the CLI arg is explicitly provided.
165 // Override OTEL_EXPORTER_OTLP_PROTOCOL (which may be set to `http/protobuf` in CI)
166 // to a value accepted by reth's OtlpProtocol enum.
167 // SAFETY: this is a single-test context; no other thread concurrently reads this var.
168 unsafe { std::env::set_var("OTEL_EXPORTER_OTLP_PROTOCOL", "http") };
169 let cmd = Cli::<RollupArgs>::parse_from([
170 "base-reth",
171 "node",
172 "--chain",
173 "base",
174 "--datadir",
175 "/mnt/datadirs/base",
176 "--instance",
177 "2",
178 "--http",
179 "--http.addr",
180 "0.0.0.0",
181 "--ws",
182 "--ws.addr",
183 "0.0.0.0",
184 "--http.api",
185 "admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots",
186 "--rollup.sequencer-http",
187 "https://mainnet-sequencer.base.org",
188 "--rpc-max-tracing-requests",
189 "1000000",
190 "--rpc.gascap",
191 "18446744073709551615",
192 "--rpc.max-connections",
193 "429496729",
194 "--rpc.max-logs-per-response",
195 "0",
196 "--rpc.max-subscriptions-per-connection",
197 "10000",
198 "--metrics",
199 "9003",
200 "--tracing-otlp=http://localhost:4318/v1/traces",
201 "--log.file.max-size",
202 "100",
203 ]);
204
205 match cmd.command {
206 Commands::Node(command) => {
207 assert_eq!(command.chain.as_ref(), &BaseChainSpec::mainnet());
208 }
209 _ => panic!("unexpected command"),
210 }
211 }
212}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected