mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-04-25 01:08:00 +00:00
Move existing rpc option to revive-dev-node
This commit is contained in:
@@ -326,12 +326,11 @@ impl Platform for ReviveDevNodePolkavmResolcPlatform {
|
||||
) -> anyhow::Result<JoinHandle<anyhow::Result<Box<dyn EthereumNode + Send + Sync>>>> {
|
||||
let genesis_configuration = AsRef::<GenesisConfiguration>::as_ref(&context);
|
||||
let revive_dev_node_configuration = AsRef::<ReviveDevNodeConfiguration>::as_ref(&context);
|
||||
let eth_rpc_configuration = AsRef::<EthRpcConfiguration>::as_ref(&context);
|
||||
|
||||
let revive_dev_node_path = revive_dev_node_configuration.path.clone();
|
||||
let revive_dev_node_consensus = revive_dev_node_configuration.consensus.clone();
|
||||
|
||||
let eth_rpc_connection_strings = eth_rpc_configuration.existing_rpc_url.clone();
|
||||
let eth_rpc_connection_strings = revive_dev_node_configuration.existing_rpc_url.clone();
|
||||
|
||||
let genesis = genesis_configuration.genesis()?.clone();
|
||||
Ok(thread::spawn(move || {
|
||||
@@ -395,12 +394,11 @@ impl Platform for ReviveDevNodeRevmSolcPlatform {
|
||||
) -> anyhow::Result<JoinHandle<anyhow::Result<Box<dyn EthereumNode + Send + Sync>>>> {
|
||||
let genesis_configuration = AsRef::<GenesisConfiguration>::as_ref(&context);
|
||||
let revive_dev_node_configuration = AsRef::<ReviveDevNodeConfiguration>::as_ref(&context);
|
||||
let eth_rpc_configuration = AsRef::<EthRpcConfiguration>::as_ref(&context);
|
||||
|
||||
let revive_dev_node_path = revive_dev_node_configuration.path.clone();
|
||||
let revive_dev_node_consensus = revive_dev_node_configuration.consensus.clone();
|
||||
|
||||
let eth_rpc_connection_strings = eth_rpc_configuration.existing_rpc_url.clone();
|
||||
let eth_rpc_connection_strings = revive_dev_node_configuration.existing_rpc_url.clone();
|
||||
|
||||
let genesis = genesis_configuration.genesis()?.clone();
|
||||
Ok(thread::spawn(move || {
|
||||
|
||||
@@ -40,7 +40,7 @@ use revive_dt_config::*;
|
||||
use revive_dt_node_interaction::{EthereumNode, MinedBlockInformation};
|
||||
use subxt::{OnlineClient, SubstrateConfig};
|
||||
use tokio::sync::OnceCell;
|
||||
use tracing::instrument;
|
||||
use tracing::{instrument, trace};
|
||||
|
||||
use crate::{
|
||||
Node,
|
||||
@@ -140,10 +140,12 @@ impl SubstrateNode {
|
||||
return Ok(self);
|
||||
}
|
||||
|
||||
trace!("Removing the various directories");
|
||||
let _ = remove_dir_all(self.base_directory.as_path());
|
||||
let _ = clear_directory(&self.base_directory);
|
||||
let _ = clear_directory(&self.logs_directory);
|
||||
|
||||
trace!("Creating the various directories");
|
||||
create_dir_all(&self.base_directory)
|
||||
.context("Failed to create base directory for substrate node")?;
|
||||
create_dir_all(&self.logs_directory)
|
||||
@@ -151,6 +153,7 @@ impl SubstrateNode {
|
||||
|
||||
let template_chainspec_path = self.base_directory.join(Self::CHAIN_SPEC_JSON_FILE);
|
||||
|
||||
trace!("Creating the node genesis");
|
||||
let chainspec_json = Self::node_genesis(
|
||||
&self.node_binary,
|
||||
&self.export_chainspec_command,
|
||||
@@ -158,6 +161,7 @@ impl SubstrateNode {
|
||||
)
|
||||
.context("Failed to prepare the chainspec command")?;
|
||||
|
||||
trace!("Writing the node genesis");
|
||||
serde_json::to_writer_pretty(
|
||||
std::fs::File::create(&template_chainspec_path)
|
||||
.context("Failed to create substrate template chainspec file")?,
|
||||
@@ -179,6 +183,7 @@ impl SubstrateNode {
|
||||
|
||||
self.rpc_url = format!("http://127.0.0.1:{proxy_rpc_port}");
|
||||
|
||||
trace!("Spawning the substrate process");
|
||||
let substrate_process = Process::new(
|
||||
"node",
|
||||
self.logs_directory.as_path(),
|
||||
@@ -230,6 +235,7 @@ impl SubstrateNode {
|
||||
}
|
||||
}
|
||||
|
||||
trace!("Spawning eth-rpc process");
|
||||
let eth_proxy_process = Process::new(
|
||||
"proxy",
|
||||
self.logs_directory.as_path(),
|
||||
|
||||
Reference in New Issue
Block a user