2015-12-22 22:19:50 +01:00
|
|
|
extern crate ethcore_util as util;
|
2016-01-07 16:08:12 +01:00
|
|
|
extern crate ethcore;
|
|
|
|
extern crate rustc_serialize;
|
2016-01-14 22:38:49 +01:00
|
|
|
extern crate log;
|
2016-01-09 23:21:57 +01:00
|
|
|
extern crate env_logger;
|
2015-12-22 22:19:50 +01:00
|
|
|
|
|
|
|
use std::io::*;
|
2016-01-14 22:38:49 +01:00
|
|
|
use std::env;
|
|
|
|
use log::{LogRecord, LogLevelFilter};
|
|
|
|
use env_logger::LogBuilder;
|
2016-01-07 16:08:12 +01:00
|
|
|
use util::hash::*;
|
2016-01-13 23:15:44 +01:00
|
|
|
use ethcore::service::ClientService;
|
2016-01-09 18:50:45 +01:00
|
|
|
use ethcore::ethereum;
|
2015-12-22 22:19:50 +01:00
|
|
|
|
2016-01-14 22:38:49 +01:00
|
|
|
fn setup_log() {
|
|
|
|
let format = |record: &LogRecord| {
|
|
|
|
format!("{} - {}", record.level(), record.args())
|
|
|
|
};
|
|
|
|
|
|
|
|
let mut builder = LogBuilder::new();
|
|
|
|
builder.format(format).filter(None, LogLevelFilter::Info);
|
|
|
|
|
|
|
|
if env::var("RUST_LOG").is_ok() {
|
|
|
|
builder.parse(&env::var("RUST_LOG").unwrap());
|
|
|
|
}
|
|
|
|
|
|
|
|
builder.init().unwrap();
|
|
|
|
}
|
|
|
|
|
2015-12-22 22:19:50 +01:00
|
|
|
fn main() {
|
2016-01-14 22:38:49 +01:00
|
|
|
setup_log();
|
2016-01-11 12:28:59 +01:00
|
|
|
let spec = ethereum::new_frontier();
|
2016-01-13 23:15:44 +01:00
|
|
|
let mut _service = ClientService::start(spec).unwrap();
|
2015-12-22 22:19:50 +01:00
|
|
|
loop {
|
|
|
|
let mut cmd = String::new();
|
|
|
|
stdin().read_line(&mut cmd).unwrap();
|
2016-01-07 16:08:12 +01:00
|
|
|
if cmd == "quit\n" || cmd == "exit\n" || cmd == "q\n" {
|
2015-12-22 22:19:50 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|