BFT gossip (#106)

* CLI options and keystore integration

* Replace multiqueue with future::mpsc

* BFT gossip

* Revert to app_dirs

* generate_from_seed commented
This commit is contained in:
Arkadiy Paronyan
2018-04-03 18:06:34 +02:00
committed by Robert Habermeier
parent 67ce6f9e36
commit 5983a6654e
8 changed files with 146 additions and 38 deletions
+7 -4
View File
@@ -26,7 +26,6 @@ use parking_lot::Mutex;
use substrate_network as net;
use tokio_core::reactor;
use client::BlockchainEvents;
use substrate_keyring::Keyring;
use primitives::{Hash, AuthorityId};
use primitives::block::{Id as BlockId, HeaderHash, Header};
use polkadot_primitives::parachain::{BlockData, Extrinsic, CandidateReceipt};
@@ -136,14 +135,18 @@ struct Network(Arc<net::ConsensusService>);
impl Service {
/// Create and start a new instance.
pub fn new<C>(client: Arc<C>, network: Arc<net::ConsensusService>, transaction_pool: Arc<Mutex<TransactionPool>>, best_header: &Header) -> Service
pub fn new<C>(
client: Arc<C>,
network: Arc<net::ConsensusService>,
transaction_pool: Arc<Mutex<TransactionPool>>,
key: ed25519::Pair,
best_header: &Header) -> Service
where C: BlockchainEvents + bft::BlockImport + bft::Authorities + PolkadotApi + Send + Sync + 'static
{
let best_header = best_header.clone();
let thread = thread::spawn(move || {
let mut core = reactor::Core::new().expect("tokio::Core could not be created");
let key = Arc::new(Keyring::One.into());
let key = Arc::new(key);
let factory = ProposerFactory {
client: client.clone(),
transaction_pool: transaction_pool.clone(),