mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-08-25 06:41:13 +00:00
feat: adding rpc interfaces into sequencer and node
This commit is contained in:
@@ -9,6 +9,7 @@ serde_json.workspace = true
|
||||
env_logger.workspace = true
|
||||
log.workspace = true
|
||||
serde.workspace = true
|
||||
actix.workspace = true
|
||||
|
||||
actix-web.workspace = true
|
||||
tokio.workspace = true
|
||||
@@ -38,4 +39,7 @@ path = "../zkvm"
|
||||
path = "../node_rpc"
|
||||
|
||||
[dependencies.node_core]
|
||||
path = "../node_core"
|
||||
path = "../node_core"
|
||||
|
||||
[dependencies.rpc_primitives]
|
||||
path = "../rpc_primitives"
|
||||
@@ -0,0 +1,17 @@
|
||||
use anyhow::Result;
|
||||
use log::info;
|
||||
use node_rpc::new_http_server;
|
||||
use rpc_primitives::RpcConfig;
|
||||
|
||||
pub async fn main_runner() -> Result<()> {
|
||||
env_logger::init();
|
||||
|
||||
let http_server = new_http_server(RpcConfig::default())?;
|
||||
info!("HTTP server started");
|
||||
let _http_server_handle = http_server.handle();
|
||||
tokio::spawn(http_server);
|
||||
|
||||
loop {
|
||||
//ToDo: Insert activity into main loop
|
||||
}
|
||||
}
|
||||
+14
-3
@@ -1,5 +1,16 @@
|
||||
//ToDo: Add node_runner module
|
||||
use anyhow::Result;
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use node_runner::main_runner;
|
||||
|
||||
pub const NUM_THREADS: usize = 4;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
actix::System::with_tokio_rt(|| {
|
||||
tokio::runtime::Builder::new_multi_thread()
|
||||
.worker_threads(NUM_THREADS)
|
||||
.enable_all()
|
||||
.build()
|
||||
.unwrap()
|
||||
})
|
||||
.block_on(main_runner())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user