Skip to content

Add doc test for OpProofsExEx setup #342

@emhane

Description

@emhane

Describe the feature

Add a doc test to show how to build the node with node builder SDK with OpProofsExEx and rpc overrides. This doc test makes sense in the reth-optimism-exex lib.rs, assuming it's no issue with cyclical deps in dev dependencies (possibly an issue when publishing crate, but can move the doc test to another crate if needed in that case when upstreaming). See how check_launch is used here:

#[test]
fn test_basic_setup() {
// parse CLI -> config
let config = NodeConfig::new(BASE_MAINNET.clone());
let db = create_test_rw_db();
let args = RollupArgs::default();
let op_node = OpNode::new(args);
let _builder = NodeBuilder::new(config)
.with_database(db)
.with_types_and_provider::<OpNode, BlockchainProvider<NodeTypesWithDBAdapter<OpNode, _>>>()
.with_components(op_node.components())
.with_add_ons(op_node.add_ons())
.on_component_initialized(move |ctx| {
let _provider = ctx.provider();
Ok(())
})
.on_node_started(|_full_node| Ok(()))
.on_rpc_started(|_ctx, handles| {
let _client = handles.rpc.http_client();
Ok(())
})
.extend_rpc_modules(|ctx| {
let _ = ctx.config();
let _ = ctx.node().provider();
Ok(())
})
.check_launch();
}

Additional context

No response

Metadata

Metadata

Assignees

Labels

A-exexArea: execution extensionA-sdkArea: node builder SDKK-docsKind: docsK-testKind: testW-historical-proofsWorkstream: historical-proofs

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions