Database backend (#133)

* DB backend

* DB backend

* Cleanup

* Clean build files after running tests

* Fixed comment

* add OOM lang item to runtime-io
This commit is contained in:
Arkadiy Paronyan
2018-05-02 13:36:36 +02:00
committed by Gav Wood
parent 5a56fbcea3
commit 04cbcd0655
26 changed files with 682 additions and 141 deletions
+10
View File
@@ -27,6 +27,7 @@ extern crate time;
extern crate futures;
extern crate tokio_core;
extern crate ctrlc;
extern crate fdlimit;
extern crate ed25519;
extern crate triehash;
extern crate substrate_codec as codec;
@@ -98,6 +99,7 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
// TODO [ToDr] Split parameters parsing from actual execution.
let log_pattern = matches.value_of("log").unwrap_or("");
init_logger(log_pattern);
fdlimit::raise_fd_limit();
let mut config = service::Configuration::default();
@@ -111,6 +113,8 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
.to_string_lossy()
.into();
config.database_path = db_path(&base_path).to_string_lossy().into();
let mut role = service::Role::FULL;
if matches.is_present("collator") {
info!("Starting collator.");
@@ -204,6 +208,12 @@ fn keystore_path(base_path: &Path) -> PathBuf {
path
}
fn db_path(base_path: &Path) -> PathBuf {
let mut path = base_path.to_owned();
path.push("db");
path
}
fn network_path(base_path: &Path) -> PathBuf {
let mut path = base_path.to_owned();
path.push("network");