mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-08-26 07:11:13 +00:00
fix: debug updates on node-sequencer synchronization
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::Result;
|
||||
use node_core::config::NodeConfig;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::BufReader;
|
||||
|
||||
pub fn from_file(config_home: PathBuf) -> Result<NodeConfig> {
|
||||
let file = File::open(config_home)?;
|
||||
let reader = BufReader::new(file);
|
||||
|
||||
Ok(serde_json::from_reader(reader)?)
|
||||
}
|
||||
+20
-11
@@ -1,31 +1,40 @@
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use consensus::ConsensusManager;
|
||||
use log::info;
|
||||
use networking::peer_manager::PeerManager;
|
||||
use node_core::{config::NodeConfig, NodeCore};
|
||||
use node_core::NodeCore;
|
||||
use node_rpc::new_http_server;
|
||||
use rpc_primitives::RpcConfig;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
pub mod config;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[clap(version)]
|
||||
struct Args {
|
||||
/// Path to configs
|
||||
home_dir: PathBuf,
|
||||
}
|
||||
|
||||
pub async fn main_runner() -> Result<()> {
|
||||
env_logger::init();
|
||||
|
||||
//ToDo: Change it
|
||||
let node_config = NodeConfig {
|
||||
home: PathBuf::new(),
|
||||
override_rust_log: None,
|
||||
sequencer_addr: "addr".to_string(),
|
||||
seq_poll_timeout_secs: 1,
|
||||
};
|
||||
let args = Args::parse();
|
||||
let Args { home_dir } = args;
|
||||
|
||||
let node_core = NodeCore::start_from_config_update_chain(node_config.clone()).await?;
|
||||
let app_config = config::from_file(home_dir.join("node_config.json"))?;
|
||||
|
||||
let port = app_config.port;
|
||||
|
||||
let node_core = NodeCore::start_from_config_update_chain(app_config.clone()).await?;
|
||||
let wrapped_node_core = Arc::new(Mutex::new(node_core));
|
||||
|
||||
let http_server = new_http_server(
|
||||
RpcConfig::default(),
|
||||
node_config.clone(),
|
||||
RpcConfig::with_port(port),
|
||||
app_config.clone(),
|
||||
wrapped_node_core.clone(),
|
||||
)?;
|
||||
info!("HTTP server started");
|
||||
|
||||
Reference in New Issue
Block a user