-
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 remote-tracking branch 'origin/main' into feature/deposit-contract
- Loading branch information
Showing
17 changed files
with
288 additions
and
48 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
KAIROS_SERVER_PORT="8000" | ||
KAIROS_SERVER_SOCKET_ADDR="127.0.0.1:7893" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
use std::net::SocketAddr; | ||
|
||
use dotenvy::dotenv; | ||
use kairos_server::{config::ServerConfig, state::BatchStateManager}; | ||
use kairos_server::config::ServerConfig; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
tracing_subscriber::fmt::init(); | ||
dotenv().ok(); | ||
let subscriber = tracing_subscriber::fmt() | ||
.with_max_level(tracing::Level::INFO) | ||
.finish(); | ||
|
||
tracing::subscriber::set_global_default(subscriber).expect("Failed to set subscriber"); | ||
|
||
// loads the environment from the current directories .env file | ||
// if the .env does not exist in the current directory, | ||
// we still go ahead and try to obtain a server config from the environment | ||
let _ = dotenv(); | ||
let config = ServerConfig::from_env() | ||
.unwrap_or_else(|e| panic!("Failed to parse server config from environment: {}", e)); | ||
|
||
let app = kairos_server::app_router(BatchStateManager::new_empty()); | ||
|
||
let axum_addr = SocketAddr::from(([127, 0, 0, 1], config.port)); | ||
|
||
tracing::info!("starting http server on `{}`", axum_addr); | ||
let listener = tokio::net::TcpListener::bind(axum_addr).await.unwrap(); | ||
axum::serve(listener, app).await.unwrap(); | ||
kairos_server::run(config).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
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
Oops, something went wrong.