Updates
This commit is contained in:
@@ -8,7 +8,7 @@ use tracing_subscriber;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(name = "hero-openrpc-server")]
|
||||
#[command(about = "Hero OpenRPC Server - WebSocket and Unix socket JSON-RPC server")]
|
||||
#[command(about = "Hero OpenRPC Server - JSON-RPC over HTTP/WS")]
|
||||
struct Cli {
|
||||
#[command(subcommand)]
|
||||
command: Commands,
|
||||
@@ -34,12 +34,6 @@ enum Commands {
|
||||
#[arg(long, default_value = "127.0.0.1:9944")]
|
||||
addr: SocketAddr,
|
||||
},
|
||||
/// Start Unix socket server
|
||||
Unix {
|
||||
/// Unix socket path
|
||||
#[arg(long, default_value = "/tmp/hero-openrpc.sock")]
|
||||
socket_path: PathBuf,
|
||||
},
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
@@ -65,14 +59,6 @@ async fn main() -> Result<()> {
|
||||
info!("Starting WebSocket server on {}", addr);
|
||||
Transport::WebSocket(addr)
|
||||
}
|
||||
Commands::Unix { socket_path } => {
|
||||
info!("Starting Unix socket server on {:?}", socket_path);
|
||||
// Remove existing socket file if it exists
|
||||
if socket_path.exists() {
|
||||
std::fs::remove_file(&socket_path)?;
|
||||
}
|
||||
Transport::Unix(socket_path)
|
||||
}
|
||||
};
|
||||
|
||||
let config = OpenRpcServerConfig {
|
||||
|
Reference in New Issue
Block a user