Skip to content

Commit 3b4eaf7

Browse files
committed
Merge branch 'multi-node-setup' of github.com:chainwayxyz/citrea-e2e into new-sequencer-config
2 parents a56459f + 297b575 commit 3b4eaf7

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

src/config/mod.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,23 @@ where
123123
throttle,
124124
};
125125

126-
// Write configs to files
127-
if let Some(config) = conf.node_config() {
128-
let config_path = dir.join(format!("{}_config.toml", conf.kind));
126+
conf.write_to_file()?;
127+
128+
Ok(conf)
129+
}
130+
131+
// Write configs to files
132+
pub fn write_to_file(&self) -> Result<()> {
133+
let dir = &self.base.dir;
134+
if let Some(config) = self.node_config() {
135+
let config_path = dir.join(format!("{}_config.toml", self.kind));
129136
config_to_file(config, &config_path)?;
130137
}
131138

132-
let rollup_path = dir.join(format!("{}_rollup_config.toml", conf.kind));
133-
config_to_file(&conf.rollup, &rollup_path)?;
139+
let rollup_path = dir.join(format!("{}_rollup_config.toml", self.kind));
140+
config_to_file(&self.rollup, &rollup_path)?;
134141

135-
Ok(conf)
142+
Ok(())
136143
}
137144
}
138145

src/node.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -327,16 +327,8 @@ where
327327
));
328328
copy_directory(old_dir, &new_dir)?;
329329

330-
// Replace the config files with the new ones
331-
let rollup_config_path = new_dir.join(format!("{}_rollup_config.toml", config.kind()));
332-
config_to_file(&config.rollup, &rollup_config_path)?;
333-
if let Some(node_config) = config.node_config() {
334-
let node_config_path = new_dir.join(format!("{}_config.toml", config.kind()));
335-
config_to_file(&node_config, &node_config_path)?;
336-
}
330+
config.write_to_file()?;
337331

338-
config.set_dir(new_dir);
339-
// Replace config contents
340332
*self.spawn_output() = Self::spawn(config, extra_args)?;
341333
self.wait_for_ready(None).await
342334
}

0 commit comments

Comments
 (0)