Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Prev Previous commit
Next Next commit
More work
  • Loading branch information
tomaka committed Oct 30, 2019
commit ca27dcd63f69c8a53d235021f5773f295f3024e9
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ console_log = { version = "0.1.2", optional = true }
js-sys = { version = "0.3.22", optional = true }
wasm-bindgen = { version = "0.2.45", optional = true }
wasm-bindgen-futures = { version = "0.3.22", optional = true }
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d", optional = true }
# TODO: need the feature
rand6 = { package = "rand", version = "0.6", features = ["wasm-bindgen"] }

[dev-dependencies]
keystore = { package = "substrate-keystore", path = "../../core/keystore" }
Expand All @@ -93,6 +96,6 @@ vergen = "3.0.4"
[features]
default = ["cli"]
# TODO: docs
browser = ["clear_on_drop", "console_error_panic_hook", "console_log", "js-sys", "libp2p", "wasm-bindgen", "wasm-bindgen-futures", "rand/wasm-bindgen"]
browser = ["clear_on_drop", "console_error_panic_hook", "console_log", "js-sys", "libp2p", "wasm-bindgen", "wasm-bindgen-futures", "kvdb-memorydb", "rand/wasm-bindgen"]
# TODO: docs
cli = ["substrate-cli", "transaction-factory", "tokio", "exit-future", "ctrlc", "client_db/kvdb-rocksdb"]
6 changes: 5 additions & 1 deletion node/cli/src/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use futures::{prelude::*, sync::oneshot, sync::mpsc};
use libp2p::wasm_ext;
use log::{debug, info};
use std::sync::Arc;
use substrate_service::{AbstractService, RpcSession, Roles as ServiceRoles, Configuration};
use substrate_service::{AbstractService, RpcSession, Roles as ServiceRoles, Configuration, config::DatabaseConfig};
use wasm_bindgen::prelude::*;

/// Starts the client.
Expand All @@ -46,6 +46,10 @@ fn start_inner(wasm_ext: wasm_ext::ffi::Transport) -> Result<Client, Box<dyn std
config.telemetry_external_transport = Some(wasm_ext);
config.roles = ServiceRoles::FULL;
config.name = "Browser node".to_string();
config.database = {
let db = Arc::new(kvdb_memorydb::create(10));
DatabaseConfig::Custom(db)
};
// TODO: config.database

//info!("{}", version.name);
Expand Down