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

Method new

actions/harness/src/node.rs:183–213  ·  view source on GitHub ↗

Construct a new `TestRollupNode` from pre-built components. The `pipeline`, `engine`, and `p2p` are the three actors that the node orchestrates. `safe_head` is the L2 genesis head from which derivation starts. `rollup_config` is used for Engine API version selection. Call [`initialize`] before the first [`step`] or [`run_until_idle`]. [`initialize`]: TestRollupNode::initialize [`step`]: TestRol

(
        pipeline: P,
        engine: ActionEngineClient,
        p2p: TestGossipTransport,
        safe_head: L2BlockInfo,
        rollup_config: Arc<RollupConfig>,
        l2_provider: ActionL2Chai

Source from the content-addressed store, hash-verified

181 /// [`step`]: TestRollupNode::step
182 /// [`run_until_idle`]: TestRollupNode::run_until_idle
183 pub fn new(
184 pipeline: P,
185 engine: ActionEngineClient,
186 p2p: TestGossipTransport,
187 safe_head: L2BlockInfo,
188 rollup_config: Arc<RollupConfig>,
189 l2_provider: ActionL2ChainProvider,
190 ) -> Self {
191 let safedb_dir =
192 tempfile::TempDir::new().expect("TestRollupNode: failed to create safedb temp dir");
193 let safe_db = Arc::new(
194 SafeDB::open(safedb_dir.path().join("safedb"))
195 .expect("TestRollupNode: failed to open safedb"),
196 );
197 Self {
198 pipeline,
199 engine,
200 p2p,
201 safe_head,
202 unsafe_head: safe_head,
203 finalized_head: safe_head,
204 finalized_l1_number: None,
205 safe_head_history: Vec::new(),
206 derived_tx_counts: Vec::new(),
207 derived_user_tx_counts: Vec::new(),
208 derived_l1_info_txs: Vec::new(),
209 rollup_config,
210 safe_db,
211 l2_provider,
212 }
213 }
214
215 /// Initialize the pipeline by sending the genesis activation signal.
216 ///

Callers

nothing calls this directly

Calls 2

newFunction · 0.50
pathMethod · 0.45

Tested by

no test coverage detected