Block import and export (#272)

* Block export and import

* Export and import using std streams

* Made AuthorituId::from_slice private
This commit is contained in:
Arkadiy Paronyan
2018-07-03 20:20:53 +02:00
committed by Gav Wood
parent 5e4ef36e40
commit 4c8f902fa3
4 changed files with 208 additions and 13 deletions
+19
View File
@@ -99,6 +99,25 @@ pub fn new_full(config: Configuration) -> Result<Service<components::FullCompone
Service::new(components::FullComponents { is_validator }, config)
}
/// Creates bare client without any networking.
pub fn new_client(config: Configuration) -> Result<Arc<Client<
<components::FullComponents as Components>::Backend,
<components::FullComponents as Components>::Executor,
Block>>,
error::Error>
{
let db_settings = client_db::DatabaseSettings {
cache_size: None,
path: config.database_path.into(),
pruning: config.pruning,
};
let executor = polkadot_executor::Executor::new();
let is_validator = (config.roles & Role::VALIDATOR) == Role::VALIDATOR;
let components = components::FullComponents { is_validator };
let (client, _) = components.build_client(db_settings, executor, &config.chain_spec)?;
Ok(client)
}
impl<Components> Service<Components>
where
Components: components::Components,