Collator node workflow (#280)

* arbitrary application logic in CLI

* collation work

* split up exit and work futures in application

* collation node workflow

* typo

* indentation fix

* doc grumbles

* rename Application to Worker

* refactor Worker::exit to exit_only
This commit is contained in:
Robert Habermeier
2018-07-06 15:13:31 +01:00
committed by Sergey Pepyakin
parent 6bfcbd6d59
commit 24f7b548dc
13 changed files with 285 additions and 94 deletions
+7
View File
@@ -79,6 +79,7 @@ pub use chain_spec::ChainSpec;
/// Polkadot service.
pub struct Service<Components: components::Components> {
client: Arc<Client<Components::Backend, Components::Executor, Block>>,
api: Arc<Components::Api>,
network: Arc<NetworkService>,
transaction_pool: Arc<TransactionPool<Components::Api>>,
signal: Option<Signal>,
@@ -213,6 +214,7 @@ impl<Components> Service<Components>
network: network,
transaction_pool: transaction_pool,
signal: Some(signal),
api: api,
_consensus: consensus_service,
})
}
@@ -222,6 +224,11 @@ impl<Components> Service<Components>
self.client.clone()
}
/// Get shared polkadot-api instance. usually the same as the client.
pub fn api(&self) -> Arc<Components::Api> {
self.api.clone()
}
/// Get shared network instance.
pub fn network(&self) -> Arc<NetworkService> {
self.network.clone()