Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(Host) : main.rs update #131

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions host/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Required for SP1
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

// Copyright 2023 RISC Zero, Inc.
Expand All @@ -14,12 +16,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

mod error;
mod execution;
mod preflight;
mod provider_db;
mod request;
mod server;
pub mod error;
pub mod execution;
pub mod preflight;
pub mod provider_db;
pub mod request;
pub mod server;

use std::{alloc, fmt::Debug, fs::File, io::BufReader, path::PathBuf};

Expand Down Expand Up @@ -58,7 +60,7 @@ pub struct Opt {
max_log: usize,

#[structopt(long, require_equals = true, default_value = "host/config/config.json")]
/// Path to a config file that includes sufficient json args to request
/// Path to a config file that includes sufficent json args to request
/// a proof of specified type. Curl json-rpc overrides its contents
config_path: PathBuf,

Expand All @@ -75,7 +77,7 @@ pub struct Opt {
async fn main() -> Result<()> {
env_logger::init();
let opt = Opt::from_args();
let config = get_config(None).unwrap();
let config = get_config(None)?;
println!("Start config:\n{:#?}", config);
println!("Args:\n{:#?}", opt);

Expand All @@ -100,15 +102,15 @@ fn subscribe_log(
.filename_prefix("raiko.log")
.max_log_files(max_log)
.build(log_path)
.expect("initializing rolling file appender failed");
.ok()?;
let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender);
let subscriber = subscriber_builder.json().with_writer(non_blocking).finish();
tracing::subscriber::set_global_default(subscriber).unwrap();
tracing::subscriber::set_global_default(subscriber).ok()?;
Some(_guard)
}
None => {
let subscriber = subscriber_builder.finish();
tracing::subscriber::set_global_default(subscriber).unwrap();
tracing::subscriber::set_global_default(subscriber).ok()?;
None
}
}
Expand Down
Loading