Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
869b70c
:)
expenses Jun 30, 2020
31c65a6
Slight tidy
expenses Jun 30, 2020
6ad0d79
Remove ServiceBuilderCommand
expenses Jun 30, 2020
b7399d6
Remove whitespace
expenses Jun 30, 2020
746186d
Merge remote-tracking branch 'parity/master' into ashley-chainops
expenses Jul 1, 2020
4db2f17
Merge branch 'ashley-chainops' of github.com:paritytech/substrate int…
expenses Jul 1, 2020
4020ff4
Keep task manager alive for check_block/import_blocks
expenses Jul 1, 2020
23c6f29
Pass task_manager to run_until_exit
expenses Jul 1, 2020
256ede8
Merge remote-tracking branch 'parity/master' into ashley-chainops
expenses Jul 1, 2020
66d0466
WIP
expenses Jul 1, 2020
8a5938c
Merge remote-tracking branch 'parity/master' into ashley-remove-servi…
expenses Jul 2, 2020
a8bdb37
Merge remote-tracking branch 'parity/master' into ashley-remove-servi…
expenses Jul 2, 2020
e44d988
WIP
expenses Jul 3, 2020
5185c16
Merge remote-tracking branch 'parity/master' into ashley-remove-servi…
expenses Jul 3, 2020
70e7fcd
Remove finality grandpa changes and fix transaction pool tests
expenses Jul 3, 2020
2d75728
Get rid of the macros
expenses Jul 3, 2020
d0f5ca2
Merge remote-tracking branch 'parity/master' into ashley-remove-servi…
expenses Jul 8, 2020
109b715
Merge remote-tracking branch 'parity/master' into ashley-remove-servi…
expenses Jul 8, 2020
2be524b
Simplify a few chain components creation APIs related to the service
expenses Jul 9, 2020
2bea18f
Merge remote-tracking branch 'parity/master' into ashley-txpool
expenses Jul 9, 2020
b452e17
Fix basic-authorship doc tests
expenses Jul 9, 2020
cf49f81
Remove DefaultQueue
expenses Jul 9, 2020
6c3b9ce
Update client/service/src/builder.rs
expenses Jul 9, 2020
fbb48b9
Move ExecutionExtensions comment around
expenses Jul 9, 2020
5abe000
Merge branch 'ashley-txpool' into ashley-remove-service-builder
expenses Jul 9, 2020
6f170f0
Remove unused BlakeTwo256
expenses Jul 9, 2020
37d1e10
Merge branch 'ashley-txpool' into ashley-remove-service-builder
expenses Jul 9, 2020
bca293d
Merge remote-tracking branch 'parity/master' into ashley-remove-servi…
expenses Jul 10, 2020
c0dc11d
Add sc-prelude
expenses Jul 10, 2020
fd699d9
Merge remote-tracking branch 'origin/master' into ashley-remove-servi…
expenses Jul 17, 2020
cce5562
Rename sc-prelude to sc-service-prelude
expenses Jul 17, 2020
03de1c7
Rename to sc-service-types
expenses Jul 17, 2020
eeb1c1d
Merge remote-tracking branch 'origin/master' into ashley-remove-servi…
expenses Jul 17, 2020
93ec9a3
Merge remote-tracking branch 'origin/master' into ashley-remove-servi…
expenses Jul 20, 2020
7744a9e
Improve service types
expenses Jul 20, 2020
5d52cd9
Merge remote-tracking branch 'origin/master' into ashley-remove-servi…
expenses Jul 20, 2020
3a1d2ec
Fix line widths
expenses Jul 20, 2020
472ce1a
Merge remote-tracking branch 'origin/master' into ashley-remove-servi…
expenses Jul 21, 2020
84022fe
Remove sc-service-types and move type definitions to crates
expenses Jul 21, 2020
a7ab615
Merge remote-tracking branch 'origin/master' into ashley-remove-servi…
expenses Jul 21, 2020
52f9c95
Update bin/node-template/node/src/service.rs
expenses Jul 21, 2020
bb1cb5a
Merge remote-tracking branch 'origin/master' into ashley-remove-servi…
expenses Jul 22, 2020
ed14ad1
Add TLightClientWithHash
expenses Jul 22, 2020
319ba0c
Rework types
expenses Jul 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename to sc-service-types
  • Loading branch information
expenses committed Jul 17, 2020
commit 03de1c7c094d15e4fb8296db007379daf7979cff
33 changes: 16 additions & 17 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ members = [
"client/rpc",
"client/rpc-api",
"client/service",
"client/service/prelude",
"client/service/test",
"client/service/types",
"client/state-db",
"client/telemetry",
"client/transaction-pool",
Expand Down
2 changes: 1 addition & 1 deletion bin/node-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ sc-client-api = { version = "2.0.0-rc4", path = "../../../client/api" }
sp-runtime = { version = "2.0.0-rc4", path = "../../../primitives/runtime" }
sc-basic-authorship = { path = "../../../client/basic-authorship", version = "0.8.0-rc4"}
sp-api = { version = "2.0.0-rc4", path = "../../../primitives/api" }
sc-service-prelude = { version = "0.8.0-rc4", path = "../../../client/service/prelude" }
sc-service-types = { version = "0.8.0-rc4", path = "../../../client/service/types" }

node-template-runtime = { version = "2.0.0-rc4", path = "../runtime" }

Expand Down
5 changes: 3 additions & 2 deletions bin/node-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ native_executor_instance!(

mod prelude {
use super::*;
sc_service_prelude::setup_types!(Block, RuntimeApi, Executor);
sc_service_types::setup_types!(Block, RuntimeApi, Executor);
}

use prelude::full;
Expand All @@ -31,7 +31,8 @@ pub fn new_full_params(config: Configuration) -> Result<(
sc_service::ServiceParams<
Block, full::Client, full::AuraImportQueue, full::BasicPool, (), full::Backend,
>,
full::LongestChain, sp_inherents::InherentDataProviders, full::GrandpaBlockImport<full::LongestChain>,
full::LongestChain, sp_inherents::InherentDataProviders,
full::GrandpaBlockImport<full::LongestChain>,
full::GrandpaLink<full::LongestChain>
), ServiceError> {
let inherent_data_providers = sp_inherents::InherentDataProviders::new();
Expand Down
3 changes: 1 addition & 2 deletions bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ sp-keyring = { version = "2.0.0-rc4", path = "../../../primitives/keyring" }
sp-io = { version = "2.0.0-rc4", path = "../../../primitives/io" }
sp-consensus = { version = "0.8.0-rc4", path = "../../../primitives/consensus/common" }
sp-transaction-pool = { version = "2.0.0-rc4", path = "../../../primitives/transaction-pool" }
sp-api = { version = "2.0.0-rc4", path = "../../../primitives/api" }

# client dependencies
sc-client-api = { version = "2.0.0-rc4", path = "../../../client/api" }
Expand All @@ -76,7 +75,7 @@ sc-service = { version = "0.8.0-rc4", default-features = false, path = "../../..
sc-tracing = { version = "2.0.0-rc4", path = "../../../client/tracing" }
sc-telemetry = { version = "2.0.0-rc4", path = "../../../client/telemetry" }
sc-authority-discovery = { version = "0.8.0-rc4", path = "../../../client/authority-discovery" }
sc-service-prelude = { version = "0.8.0-rc4", path = "../../../client/service/prelude" }
sc-service-types = { version = "0.8.0-rc4", path = "../../../client/service/types" }

# frame dependencies
pallet-indices = { version = "2.0.0-rc4", path = "../../../frame/indices" }
Expand Down
21 changes: 11 additions & 10 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ use sp_runtime::traits::Block as BlockT;
use futures::prelude::*;
use sc_client_api::{ExecutorProvider, RemoteBackend};
use sp_core::traits::BareCryptoStorePtr;
use sc_consensus_babe::BabeLink;

mod prelude {
use super::*;
use node_executor::Executor;
sc_service_types::setup_types!(Block, RuntimeApi, Executor);
}

use prelude::{full, light};

pub fn new_full_params(config: Configuration) -> Result<(
sc_service::ServiceParams<
Expand All @@ -45,7 +54,7 @@ pub fn new_full_params(config: Configuration) -> Result<(
>,
(
full::BabeBlockImport<full::GrandpaBlockImport<full::LongestChain>>,
full::GrandpaLink<full::LongestChain>, BabeLink
full::GrandpaLink<full::LongestChain>, BabeLink<Block>,
),
grandpa::SharedVoterState,
full::LongestChain,
Expand Down Expand Up @@ -152,19 +161,11 @@ pub fn new_full_params(config: Configuration) -> Result<(
Ok((params, import_setup, rpc_setup, select_chain, inherent_data_providers))
}

mod prelude {
use super::*;
use node_executor::Executor;
sc_service_prelude::setup_types!(Block, RuntimeApi, Executor);
}

use prelude::{full, light, BabeLink};

/// Creates a full service from the configuration.
pub fn new_full_base(
config: Configuration,
with_startup_data: impl FnOnce(
&full::BabeBlockImport<full::GrandpaBlockImport<full::LongestChain>>, &BabeLink,
&full::BabeBlockImport<full::GrandpaBlockImport<full::LongestChain>>, &BabeLink<Block>,
)
) -> Result<(
TaskManager, InherentDataProviders, Arc<full::Client>,
Expand Down
22 changes: 0 additions & 22 deletions client/service/prelude/Cargo.toml

This file was deleted.

78 changes: 0 additions & 78 deletions client/service/prelude/src/lib.rs

This file was deleted.

22 changes: 22 additions & 0 deletions client/service/types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "sc-service-types"
version = "0.8.0-rc4"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"
description = "Easy to use type definitions"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
sc-service = { path = "..", version = "0.8.0-rc4"}
sc-finality-grandpa = { path = "../../finality-grandpa", version = "0.8.0-rc4"}
sc-consensus = { path = "../../consensus/common", version = "0.8.0-rc4"}
sc-consensus-aura = { path = "../../consensus/aura", version = "0.8.0-rc4"}
sc-consensus-babe = { path = "../../consensus/babe", version = "0.8.0-rc4"}
sc-transaction-pool = { path = "../../transaction-pool", version = "2.0.0-rc4"}
sc-network = { path = "../../network" }
sp-api = { path = "../../../primitives/api" }
92 changes: 92 additions & 0 deletions client/service/types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.

// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Substrate is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.

pub use sc_service as _service;
pub use sc_finality_grandpa as _grandpa;
pub use sc_consensus as _consensus;
pub use sc_consensus_aura as _aura;
pub use sc_consensus_babe as _babe;
pub use sc_transaction_pool as _transaction_pool;
pub use sc_network as _network;
pub use sp_api as _sp_api;

#[macro_export]
macro_rules! setup_types {
($block:ty, $runtime_api:ty, $executor:ty) => {
use $crate::{
_service as service, _grandpa as grandpa, _consensus as consensus, _aura as aura,
_transaction_pool as transaction_pool, _sp_api as sp_api, _network as network,
_babe as babe,
};

/// Type definitions for a full client.
pub mod full {
use super::*;

/// A full client.
pub type Client = service::TFullClient<$block, $runtime_api, $executor>;
/// A full backend.
pub type Backend = service::TFullBackend<$block>;
/// A GRANDPA block import.
pub type GrandpaBlockImport<SelectChain> = grandpa::GrandpaBlockImport<
Backend, $block, Client, SelectChain
>;
/// A GRANDPA link. Connects the block import to the GRANDPA service.
pub type GrandpaLink<SelectChain> = grandpa ::LinkHalf<
$block, Client, SelectChain
>;
/// A basic select chain implementation.
pub type LongestChain = consensus::LongestChain<Backend, $block>;
/// A basic transaction pool.
pub type BasicPool = transaction_pool::BasicPool<
transaction_pool::FullChainApi<Client, $block>, $block
>;
/// An import queue for AURA.
pub type AuraImportQueue = aura::AuraImportQueue<
$block, sp_api::TransactionFor<Client, $block>
>;
/// An import queue for BABE.
pub type BabeImportQueue = babe::BabeImportQueue<
$block, sp_api::TransactionFor<Client, $block>
>;
/// A block import for BABE. Wraps around another block import.
pub type BabeBlockImport<BlockImport> = babe::BabeBlockImport<
$block, Client, BlockImport
>;
}

/// Type definitions for a light client.
pub mod light {
use super::*;

/// A light client.
pub type Client = service::TLightClient<$block, $runtime_api, $executor>;
/// A network fetcher for a light client.
pub type Fetcher = network::config::OnDemand<$block>;
/// A basic transaction pool.
pub type BasicPool = transaction_pool::BasicPool<
transaction_pool::LightChainApi<Client, Fetcher, $block>, $block
>;
}
}
}

#[cfg(test)]
mod tests {
mod prelude {
setup_types!((), (), ());
}
}