forked from calumrussell/rotala
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request calumrussell#95 from calumrussell/hyperliquid-bina…
…ry-from-file 66 Create hyperliquid binary from file
- Loading branch information
Showing
5 changed files
with
113 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use std::env; | ||
use std::sync::Mutex; | ||
|
||
use actix_web::{web, App, HttpServer}; | ||
use rotala::http::uist_v2::server::*; | ||
use rotala::http::uist_v2::AppState; | ||
use rotala::input::athena::Athena; | ||
use std::path::Path; | ||
|
||
#[actix_web::main] | ||
async fn main() -> std::io::Result<()> { | ||
let args: Vec<String> = env::args().collect(); | ||
|
||
let address: String = args[1].clone(); | ||
let port: u16 = args[2].parse().unwrap(); | ||
let file_path = Path::new(&args[3]); | ||
|
||
let source = Athena::from_file(file_path); | ||
let app_state = AppState::single("Test", source); | ||
|
||
let uist_state = web::Data::new(Mutex::new(app_state)); | ||
|
||
HttpServer::new(move || { | ||
App::new() | ||
.app_data(uist_state.clone()) | ||
.service(info) | ||
.service(init) | ||
.service(fetch_quotes) | ||
.service(tick) | ||
.service(insert_order) | ||
}) | ||
.bind((address, port))? | ||
.run() | ||
.await | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters