mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-06-09 20:11:03 +00:00
Complete terminology rebrand to Pezkuwi ecosystem
Applied global changes: Polkadot->Pezkuwi, Parachain->TeyrChain, pallet->pezpallet, frame->pezframe. Updated authors in Cargo.toml to include Kurdistan Tech Institute and pezkuwichain team. Used Cargo aliases to maintain SDK compatibility while using rebranded names in source code.
This commit is contained in:
@@ -24,10 +24,10 @@ serde_json = { workspace = true }
|
||||
# Local
|
||||
evm-runtime-template = { path = "../runtime" }
|
||||
|
||||
# Substrate
|
||||
frame-benchmarking = { workspace = true }
|
||||
frame-benchmarking-cli = { workspace = true }
|
||||
pallet-transaction-payment-rpc = { workspace = true }
|
||||
# Bizinikiwi
|
||||
pezframe-benchmarking = { workspace = true }
|
||||
pezframe-benchmarking-cli = { workspace = true }
|
||||
pezpallet-transaction-payment-rpc = { workspace = true }
|
||||
sc-basic-authorship = { workspace = true }
|
||||
sc-chain-spec = { workspace = true }
|
||||
sc-cli = { workspace = true }
|
||||
@@ -56,13 +56,13 @@ sp-io = { workspace = true }
|
||||
sp-keystore = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-timestamp = { workspace = true }
|
||||
substrate-frame-rpc-system = { workspace = true }
|
||||
substrate-prometheus-endpoint = { workspace = true }
|
||||
bizinikiwi-pezframe-rpc-system = { workspace = true }
|
||||
bizinikiwi-prometheus-endpoint = { workspace = true }
|
||||
|
||||
# Polkadot
|
||||
polkadot-cli = { workspace = true }
|
||||
polkadot-primitives = { workspace = true }
|
||||
xcm = { workspace = true }
|
||||
# Pezkuwi
|
||||
pezkuwi-cli = { workspace = true }
|
||||
pezkuwi-primitives = { workspace = true }
|
||||
staging-xcm = { workspace = true }
|
||||
|
||||
# Cumulus
|
||||
color-print = { workspace = true }
|
||||
@@ -71,10 +71,10 @@ cumulus-client-collator = { workspace = true }
|
||||
cumulus-client-consensus-aura = { workspace = true }
|
||||
cumulus-client-consensus-common = { workspace = true }
|
||||
cumulus-client-consensus-proposer = { workspace = true }
|
||||
cumulus-client-parachain-inherent = { workspace = true }
|
||||
cumulus-client-teyrchain-inherent = { workspace = true }
|
||||
cumulus-client-service = { workspace = true }
|
||||
cumulus-primitives-core = { workspace = true }
|
||||
cumulus-primitives-parachain-inherent = { workspace = true }
|
||||
cumulus-primitives-teyrchain-inherent = { workspace = true }
|
||||
cumulus-relay-chain-interface = { workspace = true }
|
||||
cumulus-test-relay-sproof-builder = { workspace = true }
|
||||
|
||||
@@ -96,16 +96,16 @@ nimbus-consensus = { workspace = true }
|
||||
tc-consensus = { workspace = true }
|
||||
|
||||
[build-dependencies]
|
||||
substrate-build-script-utils = { workspace = true }
|
||||
bizinikiwi-build-script-utils = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
async-backing = []
|
||||
runtime-benchmarks = [ "evm-runtime-template/runtime-benchmarks", "frame-benchmarking-cli/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "polkadot-cli/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "sc-service/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "tc-consensus/runtime-benchmarks" ]
|
||||
runtime-benchmarks = [ "evm-runtime-template/runtime-benchmarks", "pezframe-benchmarking-cli/runtime-benchmarks", "pezframe-benchmarking/runtime-benchmarks", "pezkuwi-cli/runtime-benchmarks", "pezkuwi-primitives/runtime-benchmarks", "sc-service/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "tc-consensus/runtime-benchmarks" ]
|
||||
tanssi = []
|
||||
try-runtime = [
|
||||
"evm-runtime-template/try-runtime",
|
||||
"polkadot-cli/try-runtime",
|
||||
"pezkuwi-cli/try-runtime",
|
||||
"sp-runtime/try-runtime",
|
||||
]
|
||||
txpool = [ "fc-rpc/txpool" ]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
|
||||
use bizinikiwi_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
|
||||
|
||||
fn main() {
|
||||
generate_cargo_keys();
|
||||
|
||||
@@ -18,7 +18,7 @@ use sp_runtime::traits::{IdentifyAccount, Verify};
|
||||
|
||||
use crate::contracts::{parse_contracts, ContractsPath};
|
||||
|
||||
/// Specialized `ChainSpec` for the normal parachain runtime.
|
||||
/// Specialized `ChainSpec` for the normal teyrchain runtime.
|
||||
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;
|
||||
|
||||
/// The default XCM version to set in genesis config.
|
||||
@@ -36,9 +36,9 @@ pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Pu
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Extensions {
|
||||
/// The relay chain of the Parachain.
|
||||
/// The relay chain of the TeyrChain.
|
||||
pub relay_chain: String,
|
||||
/// The id of the Parachain.
|
||||
/// The id of the TeyrChain.
|
||||
pub para_id: u32,
|
||||
}
|
||||
|
||||
@@ -224,8 +224,8 @@ fn testnet_genesis(
|
||||
"balances": {
|
||||
"balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::<Vec<_>>(),
|
||||
},
|
||||
"parachainInfo": {
|
||||
"parachainId": id,
|
||||
"teyrchainInfo": {
|
||||
"teyrchainId": id,
|
||||
},
|
||||
"collatorSelection": {
|
||||
"invulnerables": invulnerables.iter().cloned().map(|(acc, _)| acc).collect::<Vec<_>>(),
|
||||
@@ -250,7 +250,7 @@ fn testnet_genesis(
|
||||
"evm": {
|
||||
"accounts": accounts
|
||||
},
|
||||
"polkadotXcm": {
|
||||
"pezkuwiXcm": {
|
||||
"safeXcmVersion": Some(SAFE_XCM_VERSION),
|
||||
},
|
||||
"sudo": { "key": Some(root) }
|
||||
@@ -304,8 +304,8 @@ fn testnet_genesis(
|
||||
"balances": {
|
||||
"balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::<Vec<_>>(),
|
||||
},
|
||||
"parachainInfo": {
|
||||
"parachainId": id,
|
||||
"teyrchainInfo": {
|
||||
"teyrchainId": id,
|
||||
},
|
||||
"treasury": {},
|
||||
"evmChainId": {
|
||||
@@ -314,7 +314,7 @@ fn testnet_genesis(
|
||||
"evm": {
|
||||
"accounts": accounts
|
||||
},
|
||||
"polkadotXcm": {
|
||||
"pezkuwiXcm": {
|
||||
"safeXcmVersion": Some(SAFE_XCM_VERSION),
|
||||
},
|
||||
"sudo": { "key": Some(root) }
|
||||
|
||||
@@ -29,19 +29,19 @@ pub enum Subcommand {
|
||||
/// Remove the whole chain.
|
||||
PurgeChain(cumulus_client_cli::PurgeChainCmd),
|
||||
|
||||
/// Export the genesis head data of the parachain.
|
||||
/// Export the genesis head data of the teyrchain.
|
||||
///
|
||||
/// Head data is the encoded block header.
|
||||
#[command(alias = "export-genesis-state")]
|
||||
ExportGenesisHead(cumulus_client_cli::ExportGenesisHeadCommand),
|
||||
|
||||
/// Export the genesis wasm of the parachain.
|
||||
/// Export the genesis wasm of the teyrchain.
|
||||
ExportGenesisWasm(cumulus_client_cli::ExportGenesisWasmCommand),
|
||||
|
||||
/// Sub-commands concerned with benchmarking.
|
||||
/// The pallet benchmarking moved to the `pallet` sub-command.
|
||||
/// The pezpallet benchmarking moved to the `pezpallet` sub-command.
|
||||
#[command(subcommand)]
|
||||
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
|
||||
Benchmark(pezframe_benchmarking_cli::BenchmarkCmd),
|
||||
|
||||
/// Try-runtime has migrated to a standalone
|
||||
/// [CLI](<https://github.com/paritytech/try-runtime-cli>). The subcommand exists as a stub and
|
||||
@@ -94,14 +94,14 @@ impl ExtendedBuildSpecCmd {
|
||||
|
||||
const AFTER_HELP_EXAMPLE: &str = color_print::cstr!(
|
||||
r#"<bold><underline>Examples:</></>
|
||||
<bold>parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json</>
|
||||
<bold>teyrchain-template-node build-spec --disable-default-bootnode > plain-teyrchain-chainspec.json</>
|
||||
Export a chainspec for a local testnet in json format.
|
||||
<bold>parachain-template-node --chain plain-parachain-chainspec.json --tmp -- --chain paseo-local</>
|
||||
Launch a full node with chain specification loaded from plain-parachain-chainspec.json.
|
||||
<bold>parachain-template-node</>
|
||||
Launch a full node with default parachain <italic>local-testnet</> and relay chain <italic>paseo-local</>.
|
||||
<bold>parachain-template-node --collator</>
|
||||
Launch a collator with default parachain <italic>local-testnet</> and relay chain <italic>paseo-local</>.
|
||||
<bold>teyrchain-template-node --chain plain-teyrchain-chainspec.json --tmp -- --chain paseo-local</>
|
||||
Launch a full node with chain specification loaded from plain-teyrchain-chainspec.json.
|
||||
<bold>teyrchain-template-node</>
|
||||
Launch a full node with default teyrchain <italic>local-testnet</> and relay chain <italic>paseo-local</>.
|
||||
<bold>teyrchain-template-node --collator</>
|
||||
Launch a collator with default teyrchain <italic>local-testnet</> and relay chain <italic>paseo-local</>.
|
||||
"#
|
||||
);
|
||||
#[derive(Debug, clap::Parser)]
|
||||
@@ -139,7 +139,7 @@ pub struct Cli {
|
||||
#[derive(Debug)]
|
||||
pub struct RelayChainCli {
|
||||
/// The actual relay chain cli object.
|
||||
pub base: polkadot_cli::RunCmd,
|
||||
pub base: pezkuwi_cli::RunCmd,
|
||||
|
||||
/// Optional chain id that should be passed to the relay chain.
|
||||
pub chain_id: Option<String>,
|
||||
@@ -157,7 +157,7 @@ impl RelayChainCli {
|
||||
) -> Self {
|
||||
let extension = crate::chain_spec::Extensions::try_get(&*para_config.chain_spec);
|
||||
let chain_id = extension.map(|e| e.relay_chain.clone());
|
||||
let base_path = para_config.base_path.path().join("polkadot");
|
||||
let base_path = para_config.base_path.path().join("pezkuwi");
|
||||
Self {
|
||||
base_path: Some(base_path),
|
||||
chain_id,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use evm_runtime_template::Block;
|
||||
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
|
||||
use pezframe_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
|
||||
use log::info;
|
||||
use sc_cli::{
|
||||
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
|
||||
NetworkParams, Result, RpcEndpoint, SharedParams, SubstrateCli,
|
||||
NetworkParams, Result, RpcEndpoint, SharedParams, BizinikiwiCli,
|
||||
};
|
||||
use sc_service::config::{BasePath, PrometheusConfig};
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
@@ -29,9 +29,9 @@ fn load_spec(
|
||||
})
|
||||
}
|
||||
|
||||
impl SubstrateCli for Cli {
|
||||
impl BizinikiwiCli for Cli {
|
||||
fn impl_name() -> String {
|
||||
"Parachain Collator Template".into()
|
||||
"TeyrChain Collator Template".into()
|
||||
}
|
||||
|
||||
fn impl_version() -> String {
|
||||
@@ -40,9 +40,9 @@ impl SubstrateCli for Cli {
|
||||
|
||||
fn description() -> String {
|
||||
format!(
|
||||
"Parachain Collator Template\n\nThe command-line arguments provided first will be \
|
||||
passed to the parachain node, while the arguments provided after -- will be passed \
|
||||
to the relay chain node.\n\n{} <parachain-args> -- <relay-chain-args>",
|
||||
"TeyrChain Collator Template\n\nThe command-line arguments provided first will be \
|
||||
passed to the teyrchain node, while the arguments provided after -- will be passed \
|
||||
to the relay chain node.\n\n{} <teyrchain-args> -- <relay-chain-args>",
|
||||
Self::executable_name()
|
||||
)
|
||||
}
|
||||
@@ -52,7 +52,7 @@ impl SubstrateCli for Cli {
|
||||
}
|
||||
|
||||
fn support_url() -> String {
|
||||
"https://github.com/paritytech/polkadot-sdk/issues/new".into()
|
||||
"https://github.com/paritytech/pezkuwi-sdk/issues/new".into()
|
||||
}
|
||||
|
||||
fn copyright_start_year() -> i32 {
|
||||
@@ -67,9 +67,9 @@ impl SubstrateCli for Cli {
|
||||
}
|
||||
}
|
||||
|
||||
impl SubstrateCli for RelayChainCli {
|
||||
impl BizinikiwiCli for RelayChainCli {
|
||||
fn impl_name() -> String {
|
||||
"Parachain Collator Template".into()
|
||||
"TeyrChain Collator Template".into()
|
||||
}
|
||||
|
||||
fn impl_version() -> String {
|
||||
@@ -78,9 +78,9 @@ impl SubstrateCli for RelayChainCli {
|
||||
|
||||
fn description() -> String {
|
||||
format!(
|
||||
"Parachain Collator Template\n\nThe command-line arguments provided first will be \
|
||||
passed to the parachain node, while the arguments provided after -- will be passed \
|
||||
to the relay chain node.\n\n{} <parachain-args> -- <relay-chain-args>",
|
||||
"TeyrChain Collator Template\n\nThe command-line arguments provided first will be \
|
||||
passed to the teyrchain node, while the arguments provided after -- will be passed \
|
||||
to the relay chain node.\n\n{} <teyrchain-args> -- <relay-chain-args>",
|
||||
Self::executable_name()
|
||||
)
|
||||
}
|
||||
@@ -90,7 +90,7 @@ impl SubstrateCli for RelayChainCli {
|
||||
}
|
||||
|
||||
fn support_url() -> String {
|
||||
"https://github.com/paritytech/polkadot-sdk/issues/new".into()
|
||||
"https://github.com/paritytech/pezkuwi-sdk/issues/new".into()
|
||||
}
|
||||
|
||||
fn copyright_start_year() -> i32 {
|
||||
@@ -98,7 +98,7 @@ impl SubstrateCli for RelayChainCli {
|
||||
}
|
||||
|
||||
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
|
||||
polkadot_cli::Cli::from_iter([RelayChainCli::executable_name()].iter()).load_spec(id)
|
||||
pezkuwi_cli::Cli::from_iter([RelayChainCli::executable_name()].iter()).load_spec(id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,19 +152,19 @@ pub fn run() -> Result<()> {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
|
||||
runner.sync_run(|config| {
|
||||
let polkadot_cli = RelayChainCli::new(
|
||||
let pezkuwi_cli = RelayChainCli::new(
|
||||
&config,
|
||||
[RelayChainCli::executable_name()].iter().chain(cli.relay_chain_args.iter()),
|
||||
);
|
||||
|
||||
let polkadot_config = SubstrateCli::create_configuration(
|
||||
&polkadot_cli,
|
||||
&polkadot_cli,
|
||||
let pezkuwi_config = BizinikiwiCli::create_configuration(
|
||||
&pezkuwi_cli,
|
||||
&pezkuwi_cli,
|
||||
config.tokio_handle.clone(),
|
||||
)
|
||||
.map_err(|err| format!("Relay chain argument error: {}", err))?;
|
||||
|
||||
cmd.run(config, polkadot_config)
|
||||
cmd.run(config, pezkuwi_config)
|
||||
})
|
||||
},
|
||||
Some(Subcommand::ExportGenesisHead(cmd)) => {
|
||||
@@ -235,31 +235,31 @@ pub fn run() -> Result<()> {
|
||||
|
||||
let para_id = chain_spec::Extensions::try_get(&*config.chain_spec)
|
||||
.map(|e| e.para_id)
|
||||
.ok_or("Could not find parachain ID in chain-spec.")?;
|
||||
.ok_or("Could not find teyrchain ID in chain-spec.")?;
|
||||
|
||||
let polkadot_cli = RelayChainCli::new(
|
||||
let pezkuwi_cli = RelayChainCli::new(
|
||||
&config,
|
||||
[RelayChainCli::executable_name()].iter().chain(cli.relay_chain_args.iter()),
|
||||
);
|
||||
|
||||
let id = ParaId::from(para_id);
|
||||
|
||||
let parachain_account =
|
||||
AccountIdConversion::<polkadot_primitives::AccountId>::into_account_truncating(
|
||||
let teyrchain_account =
|
||||
AccountIdConversion::<pezkuwi_primitives::AccountId>::into_account_truncating(
|
||||
&id,
|
||||
);
|
||||
|
||||
let tokio_handle = config.tokio_handle.clone();
|
||||
let polkadot_config =
|
||||
SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, tokio_handle)
|
||||
let pezkuwi_config =
|
||||
BizinikiwiCli::create_configuration(&pezkuwi_cli, &pezkuwi_cli, tokio_handle)
|
||||
.map_err(|err| format!("Relay chain argument error: {}", err))?;
|
||||
|
||||
info!("Parachain Account: {parachain_account}");
|
||||
info!("TeyrChain Account: {teyrchain_account}");
|
||||
info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" });
|
||||
|
||||
crate::service::start_parachain_node(
|
||||
crate::service::start_teyrchain_node(
|
||||
config,
|
||||
polkadot_config,
|
||||
pezkuwi_config,
|
||||
collator_options,
|
||||
&cli.eth,
|
||||
id,
|
||||
@@ -324,7 +324,7 @@ impl CliConfiguration<Self> for RelayChainCli {
|
||||
where
|
||||
F: FnOnce(&mut sc_cli::LoggerBuilder),
|
||||
{
|
||||
unreachable!("PolkadotCli is never initialized; qed");
|
||||
unreachable!("PezkuwiCli is never initialized; qed");
|
||||
}
|
||||
|
||||
fn chain_id(&self, is_dev: bool) -> Result<String> {
|
||||
|
||||
@@ -11,7 +11,7 @@ use fc_rpc::EthTask;
|
||||
pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool};
|
||||
pub use fc_storage::{StorageOverride, StorageOverrideHandler};
|
||||
use futures::{future, prelude::*};
|
||||
// Substrate
|
||||
// Bizinikiwi
|
||||
use sc_client_api::BlockchainEvents;
|
||||
use sc_executor::{HostFunctions, WasmExecutor};
|
||||
use sc_network_sync::SyncingService;
|
||||
@@ -55,7 +55,7 @@ pub struct EthConfiguration {
|
||||
#[arg(long)]
|
||||
pub enable_dev_signer: bool,
|
||||
|
||||
/// The dynamic-fee pallet target gas price set by block author
|
||||
/// The dynamic-fee pezpallet target gas price set by block author
|
||||
#[arg(long, default_value = "1")]
|
||||
pub target_gas_price: u64,
|
||||
|
||||
@@ -181,7 +181,7 @@ pub async fn spawn_frontier_tasks<RuntimeApi, Executor>(
|
||||
read_notification_timeout: Duration::from_secs(30),
|
||||
check_indexed_blocks_interval: Duration::from_secs(60),
|
||||
},
|
||||
fc_mapping_sync::SyncStrategy::Parachain,
|
||||
fc_mapping_sync::SyncStrategy::TeyrChain,
|
||||
sync,
|
||||
pubsub_notification_sinks,
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Substrate Parachain Node Template CLI
|
||||
//! Bizinikiwi TeyrChain Node Template CLI
|
||||
|
||||
#![warn(missing_docs)]
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool};
|
||||
pub use fc_storage::StorageOverride;
|
||||
use fp_rpc::{ConvertTransaction, ConvertTransactionRuntimeApi, EthereumRuntimeRPCApi};
|
||||
use jsonrpsee::RpcModule;
|
||||
// Substrate
|
||||
// Bizinikiwi
|
||||
use sc_client_api::{
|
||||
backend::{Backend, StorageProvider},
|
||||
client::BlockchainEvents,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! A collection of node-specific RPC methods.
|
||||
//! Substrate provides the `sc-rpc` crate, which defines the core RPC layer
|
||||
//! used by Substrate nodes. This file extends those RPC definitions with
|
||||
//! Bizinikiwi provides the `sc-rpc` crate, which defines the core RPC layer
|
||||
//! used by Bizinikiwi nodes. This file extends those RPC definitions with
|
||||
//! capabilities that are specific to this project's runtime configuration.
|
||||
|
||||
#![warn(missing_docs)]
|
||||
@@ -68,8 +68,8 @@ where
|
||||
+ StorageProvider<Block, BE>
|
||||
+ BlockchainEvents<Block>
|
||||
+ 'static,
|
||||
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
|
||||
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
|
||||
C::Api: pezpallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
|
||||
C::Api: bizinikiwi_pezframe_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
|
||||
C::Api: sp_consensus_aura::AuraApi<Block, AuraId>,
|
||||
C::Api: BlockBuilder<Block>,
|
||||
C::Api: fp_rpc::ConvertTransactionRuntimeApi<Block>,
|
||||
@@ -79,8 +79,8 @@ where
|
||||
CT: fp_rpc::ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + 'static,
|
||||
BE: Backend<Block> + 'static,
|
||||
{
|
||||
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
|
||||
use substrate_frame_rpc_system::{System, SystemApiServer};
|
||||
use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
|
||||
use bizinikiwi_pezframe_rpc_system::{System, SystemApiServer};
|
||||
|
||||
let mut module = RpcExtension::new(());
|
||||
let FullDeps { client, pool, eth } = deps;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Service and ServiceFactory implementation. Specialized wrapper over
|
||||
//! substrate service.
|
||||
//! bizinikiwi service.
|
||||
|
||||
// std
|
||||
use std::{path::Path, sync::Arc, time::Duration};
|
||||
@@ -8,7 +8,7 @@ use cumulus_client_cli::CollatorOptions;
|
||||
// Cumulus Imports
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use cumulus_client_collator::service::CollatorService;
|
||||
use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport;
|
||||
use cumulus_client_consensus_common::TeyrChainBlockImport as TTeyrChainBlockImport;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use cumulus_client_consensus_proposer::Proposer;
|
||||
use cumulus_client_service::{
|
||||
@@ -27,8 +27,8 @@ use cumulus_relay_chain_interface::RelayChainInterface;
|
||||
use evm_runtime_template::opaque::Hash;
|
||||
// Local Runtime Types
|
||||
use evm_runtime_template::{configs::TransactionConverter, opaque::Block, RuntimeApi};
|
||||
// Substrate Imports
|
||||
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
||||
// Bizinikiwi Imports
|
||||
use pezframe_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
||||
use sc_client_api::Backend;
|
||||
use sc_consensus::ImportQueue;
|
||||
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
|
||||
@@ -43,7 +43,7 @@ use sp_core::U256;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use sp_keystore::KeystorePtr;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use substrate_prometheus_endpoint::Registry;
|
||||
use bizinikiwi_prometheus_endpoint::Registry;
|
||||
|
||||
use crate::eth::{
|
||||
db_config_dir, new_frontier_partial, spawn_frontier_tasks, BackendType, EthConfiguration,
|
||||
@@ -52,35 +52,35 @@ use crate::eth::{
|
||||
|
||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||
pub type HostFunctions =
|
||||
(sp_io::SubstrateHostFunctions, cumulus_client_service::storage_proof_size::HostFunctions);
|
||||
(sp_io::BizinikiwiHostFunctions, cumulus_client_service::storage_proof_size::HostFunctions);
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
pub type HostFunctions = (
|
||||
sp_io::SubstrateHostFunctions,
|
||||
sp_io::BizinikiwiHostFunctions,
|
||||
cumulus_client_service::storage_proof_size::HostFunctions,
|
||||
frame_benchmarking::benchmarking::HostFunctions,
|
||||
pezframe_benchmarking::benchmarking::HostFunctions,
|
||||
);
|
||||
|
||||
type ParachainExecutor = WasmExecutor<HostFunctions>;
|
||||
type TeyrChainExecutor = WasmExecutor<HostFunctions>;
|
||||
|
||||
type ParachainClient = TFullClient<Block, RuntimeApi, ParachainExecutor>;
|
||||
type TeyrChainClient = TFullClient<Block, RuntimeApi, TeyrChainExecutor>;
|
||||
|
||||
type ParachainBackend = TFullBackend<Block>;
|
||||
type TeyrChainBackend = TFullBackend<Block>;
|
||||
|
||||
type ParachainBlockImport = TParachainBlockImport<Block, Arc<ParachainClient>, ParachainBackend>;
|
||||
type TeyrChainBlockImport = TTeyrChainBlockImport<Block, Arc<TeyrChainClient>, TeyrChainBackend>;
|
||||
|
||||
/// Assembly of PartialComponents (enough to run chain ops subcommands)
|
||||
pub type Service = PartialComponents<
|
||||
ParachainClient,
|
||||
ParachainBackend,
|
||||
TeyrChainClient,
|
||||
TeyrChainBackend,
|
||||
(),
|
||||
sc_consensus::DefaultImportQueue<Block>,
|
||||
sc_transaction_pool::TransactionPoolHandle<Block, ParachainClient>,
|
||||
sc_transaction_pool::TransactionPoolHandle<Block, TeyrChainClient>,
|
||||
(
|
||||
ParachainBlockImport,
|
||||
TeyrChainBlockImport,
|
||||
Option<Telemetry>,
|
||||
Option<TelemetryWorkerHandle>,
|
||||
FrontierBackend<ParachainClient>,
|
||||
FrontierBackend<TeyrChainClient>,
|
||||
Arc<dyn fc_storage::StorageOverride<Block>>,
|
||||
),
|
||||
>;
|
||||
@@ -109,7 +109,7 @@ pub fn new_partial(
|
||||
.default_heap_pages
|
||||
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });
|
||||
|
||||
let executor = ParachainExecutor::builder()
|
||||
let executor = TeyrChainExecutor::builder()
|
||||
.with_execution_method(config.executor.wasm_method)
|
||||
.with_onchain_heap_alloc_strategy(heap_pages)
|
||||
.with_offchain_heap_alloc_strategy(heap_pages)
|
||||
@@ -149,7 +149,7 @@ pub fn new_partial(
|
||||
import_queue(config, client.clone(), backend.clone(), &task_manager);
|
||||
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
let block_import = ParachainBlockImport::new(client.clone(), backend.clone());
|
||||
let block_import = TeyrChainBlockImport::new(client.clone(), backend.clone());
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
let import_queue = build_import_queue(
|
||||
client.clone(),
|
||||
@@ -210,15 +210,15 @@ pub fn new_partial(
|
||||
|
||||
#[cfg(feature = "tanssi")]
|
||||
pub fn import_queue(
|
||||
parachain_config: &Configuration,
|
||||
client: Arc<ParachainClient>,
|
||||
backend: Arc<ParachainBackend>,
|
||||
teyrchain_config: &Configuration,
|
||||
client: Arc<TeyrChainClient>,
|
||||
backend: Arc<TeyrChainBackend>,
|
||||
task_manager: &TaskManager,
|
||||
) -> (ParachainBlockImport, sc_consensus::BasicQueue<Block>) {
|
||||
) -> (TeyrChainBlockImport, sc_consensus::BasicQueue<Block>) {
|
||||
// The nimbus import queue ONLY checks the signature correctness
|
||||
// Any other checks corresponding to the author-correctness should be done
|
||||
// in the runtime
|
||||
let block_import = ParachainBlockImport::new(client.clone(), backend);
|
||||
let block_import = TeyrChainBlockImport::new(client.clone(), backend);
|
||||
|
||||
let import_queue = nimbus_consensus::import_queue(
|
||||
client,
|
||||
@@ -229,7 +229,7 @@ pub fn import_queue(
|
||||
Ok((time,))
|
||||
},
|
||||
&task_manager.spawn_essential_handle(),
|
||||
parachain_config.prometheus_registry(),
|
||||
teyrchain_config.prometheus_registry(),
|
||||
false,
|
||||
)
|
||||
.expect("function never fails");
|
||||
@@ -237,23 +237,23 @@ pub fn import_queue(
|
||||
(block_import, import_queue)
|
||||
}
|
||||
|
||||
/// Start a node with the given parachain `Configuration` and relay chain
|
||||
/// Start a node with the given teyrchain `Configuration` and relay chain
|
||||
/// `Configuration`.
|
||||
///
|
||||
/// This is the actual implementation that is abstract over the executor and the
|
||||
/// runtime api.
|
||||
#[sc_tracing::logging::prefix_logs_with("Parachain")]
|
||||
#[sc_tracing::logging::prefix_logs_with("TeyrChain")]
|
||||
async fn start_node_impl(
|
||||
parachain_config: Configuration,
|
||||
polkadot_config: Configuration,
|
||||
teyrchain_config: Configuration,
|
||||
pezkuwi_config: Configuration,
|
||||
collator_options: CollatorOptions,
|
||||
eth_config: &EthConfiguration,
|
||||
para_id: ParaId,
|
||||
hwbench: Option<sc_sysinfo::HwBench>,
|
||||
) -> sc_service::error::Result<(TaskManager, Arc<ParachainClient>)> {
|
||||
let parachain_config = prepare_node_config(parachain_config);
|
||||
) -> sc_service::error::Result<(TaskManager, Arc<TeyrChainClient>)> {
|
||||
let teyrchain_config = prepare_node_config(teyrchain_config);
|
||||
|
||||
let params = new_partial(¶chain_config, eth_config)?;
|
||||
let params = new_partial(&teyrchain_config, eth_config)?;
|
||||
|
||||
let FrontierPartialComponents { filter_pool, fee_history_cache, fee_history_cache_limit } =
|
||||
new_frontier_partial(eth_config)?;
|
||||
@@ -266,8 +266,8 @@ async fn start_node_impl(
|
||||
|
||||
let frontier_backend = Arc::new(frontier_backend);
|
||||
let net_config = FullNetworkConfiguration::<_, _, sc_network::NetworkWorker<Block, Hash>>::new(
|
||||
¶chain_config.network,
|
||||
parachain_config.prometheus_config.as_ref().map(|cfg| cfg.registry.clone()),
|
||||
&teyrchain_config.network,
|
||||
teyrchain_config.prometheus_config.as_ref().map(|cfg| cfg.registry.clone()),
|
||||
);
|
||||
|
||||
let client = params.client.clone();
|
||||
@@ -275,8 +275,8 @@ async fn start_node_impl(
|
||||
let mut task_manager = params.task_manager;
|
||||
|
||||
let relay_chain_interface = build_relay_chain_interface(
|
||||
polkadot_config,
|
||||
¶chain_config,
|
||||
pezkuwi_config,
|
||||
&teyrchain_config,
|
||||
telemetry_worker_handle,
|
||||
&mut task_manager,
|
||||
collator_options.clone(),
|
||||
@@ -290,8 +290,8 @@ async fn start_node_impl(
|
||||
#[cfg(feature = "tanssi")]
|
||||
let (relay_chain_interface, _) = relay_chain_interface;
|
||||
|
||||
let validator = parachain_config.role.is_authority();
|
||||
let prometheus_registry = parachain_config.prometheus_registry().cloned();
|
||||
let validator = teyrchain_config.role.is_authority();
|
||||
let prometheus_registry = teyrchain_config.prometheus_registry().cloned();
|
||||
let transaction_pool = params.transaction_pool.clone();
|
||||
let import_queue_service = params.import_queue.service();
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
@@ -299,7 +299,7 @@ async fn start_node_impl(
|
||||
|
||||
let (network, system_rpc_tx, tx_handler_controller, sync_service) =
|
||||
build_network(BuildNetworkParams {
|
||||
parachain_config: ¶chain_config,
|
||||
teyrchain_config: &teyrchain_config,
|
||||
net_config,
|
||||
client: client.clone(),
|
||||
transaction_pool: transaction_pool.clone(),
|
||||
@@ -311,7 +311,7 @@ async fn start_node_impl(
|
||||
})
|
||||
.await?;
|
||||
|
||||
if parachain_config.offchain_worker.enabled {
|
||||
if teyrchain_config.offchain_worker.enabled {
|
||||
use futures::FutureExt;
|
||||
|
||||
task_manager.spawn_handle().spawn(
|
||||
@@ -325,7 +325,7 @@ async fn start_node_impl(
|
||||
transaction_pool.clone(),
|
||||
)),
|
||||
network_provider: Arc::new(network.clone()),
|
||||
is_validator: parachain_config.role.is_authority(),
|
||||
is_validator: teyrchain_config.role.is_authority(),
|
||||
enable_http_requests: false,
|
||||
custom_extensions: move |_| vec![],
|
||||
})?
|
||||
@@ -414,7 +414,7 @@ async fn start_node_impl(
|
||||
client: client.clone(),
|
||||
transaction_pool: transaction_pool.clone(),
|
||||
task_manager: &mut task_manager,
|
||||
config: parachain_config,
|
||||
config: teyrchain_config,
|
||||
keystore: params.keystore_container.keystore(),
|
||||
backend: backend.clone(),
|
||||
network: network.clone(),
|
||||
@@ -518,10 +518,10 @@ async fn start_node_impl(
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
/// Build the import queue for the parachain runtime.
|
||||
/// Build the import queue for the teyrchain runtime.
|
||||
fn build_import_queue(
|
||||
client: Arc<ParachainClient>,
|
||||
block_import: ParachainBlockImport,
|
||||
client: Arc<TeyrChainClient>,
|
||||
block_import: TeyrChainBlockImport,
|
||||
config: &Configuration,
|
||||
telemetry: Option<TelemetryHandle>,
|
||||
task_manager: &TaskManager,
|
||||
@@ -547,14 +547,14 @@ fn build_import_queue(
|
||||
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn start_consensus(
|
||||
client: Arc<ParachainClient>,
|
||||
#[cfg(feature = "async-backing")] backend: Arc<ParachainBackend>,
|
||||
block_import: ParachainBlockImport,
|
||||
client: Arc<TeyrChainClient>,
|
||||
#[cfg(feature = "async-backing")] backend: Arc<TeyrChainBackend>,
|
||||
block_import: TeyrChainBlockImport,
|
||||
prometheus_registry: Option<&Registry>,
|
||||
telemetry: Option<TelemetryHandle>,
|
||||
task_manager: &TaskManager,
|
||||
relay_chain_interface: Arc<dyn RelayChainInterface>,
|
||||
transaction_pool: Arc<sc_transaction_pool::TransactionPoolHandle<Block, ParachainClient>>,
|
||||
transaction_pool: Arc<sc_transaction_pool::TransactionPoolHandle<Block, TeyrChainClient>>,
|
||||
keystore: KeystorePtr,
|
||||
relay_chain_slot_duration: Duration,
|
||||
para_id: ParaId,
|
||||
@@ -631,18 +631,18 @@ fn start_consensus(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Start a parachain node.
|
||||
pub async fn start_parachain_node(
|
||||
parachain_config: Configuration,
|
||||
polkadot_config: Configuration,
|
||||
/// Start a teyrchain node.
|
||||
pub async fn start_teyrchain_node(
|
||||
teyrchain_config: Configuration,
|
||||
pezkuwi_config: Configuration,
|
||||
collator_options: CollatorOptions,
|
||||
eth_config: &EthConfiguration,
|
||||
para_id: ParaId,
|
||||
hwbench: Option<sc_sysinfo::HwBench>,
|
||||
) -> sc_service::error::Result<(TaskManager, Arc<ParachainClient>)> {
|
||||
) -> sc_service::error::Result<(TaskManager, Arc<TeyrChainClient>)> {
|
||||
start_node_impl(
|
||||
parachain_config,
|
||||
polkadot_config,
|
||||
teyrchain_config,
|
||||
pezkuwi_config,
|
||||
collator_options,
|
||||
eth_config,
|
||||
para_id,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::{collections::BTreeMap, sync::Arc};
|
||||
|
||||
use cumulus_client_parachain_inherent::ParachainInherentData;
|
||||
use cumulus_client_teyrchain_inherent::TeyrChainInherentData;
|
||||
use cumulus_primitives_core::PersistedValidationData;
|
||||
use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
|
||||
// Frontier
|
||||
@@ -9,7 +9,7 @@ pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool};
|
||||
pub use fc_storage::StorageOverride;
|
||||
use fp_rpc::{ConvertTransaction, ConvertTransactionRuntimeApi, EthereumRuntimeRPCApi};
|
||||
use jsonrpsee::RpcModule;
|
||||
// Substrate
|
||||
// Bizinikiwi
|
||||
use sc_client_api::{
|
||||
backend::{Backend, StorageProvider},
|
||||
client::BlockchainEvents,
|
||||
@@ -134,7 +134,7 @@ where
|
||||
};
|
||||
|
||||
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
|
||||
// Create a dummy parachain inherent data provider which is required to pass
|
||||
// Create a dummy teyrchain inherent data provider which is required to pass
|
||||
// the checks by the para chain system. We use dummy values because in the 'pending context'
|
||||
// neither do we have access to the real values nor do we need them.
|
||||
let (relay_parent_storage_root, relay_chain_state) = RelayStateSproofBuilder {
|
||||
@@ -143,19 +143,19 @@ where
|
||||
}
|
||||
.into_state_root_and_proof();
|
||||
let vfp = PersistedValidationData {
|
||||
// This is a hack to make `cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases`
|
||||
// This is a hack to make `cumulus_pezpallet_teyrchain_system::RelayNumberStrictlyIncreases`
|
||||
// happy. Relay parent number can't be bigger than u32::MAX.
|
||||
relay_parent_number: u32::MAX,
|
||||
relay_parent_storage_root,
|
||||
..Default::default()
|
||||
};
|
||||
let parachain_inherent_data = ParachainInherentData {
|
||||
let teyrchain_inherent_data = TeyrChainInherentData {
|
||||
validation_data: vfp,
|
||||
relay_chain_state,
|
||||
downward_messages: Default::default(),
|
||||
horizontal_messages: Default::default(),
|
||||
};
|
||||
Ok((timestamp, parachain_inherent_data, mocked_authorities_noting))
|
||||
Ok((timestamp, teyrchain_inherent_data, mocked_authorities_noting))
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! A collection of node-specific RPC methods.
|
||||
//! Substrate provides the `sc-rpc` crate, which defines the core RPC layer
|
||||
//! used by Substrate nodes. This file extends those RPC definitions with
|
||||
//! Bizinikiwi provides the `sc-rpc` crate, which defines the core RPC layer
|
||||
//! used by Bizinikiwi nodes. This file extends those RPC definitions with
|
||||
//! capabilities that are specific to this project's runtime configuration.
|
||||
|
||||
#![warn(missing_docs)]
|
||||
@@ -70,8 +70,8 @@ where
|
||||
+ StorageProvider<Block, BE>
|
||||
+ BlockchainEvents<Block>
|
||||
+ 'static,
|
||||
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
|
||||
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
|
||||
C::Api: pezpallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
|
||||
C::Api: bizinikiwi_pezframe_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
|
||||
C::Api: BlockBuilder<Block>,
|
||||
C::Api: fp_rpc::ConvertTransactionRuntimeApi<Block>,
|
||||
C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,
|
||||
@@ -80,8 +80,8 @@ where
|
||||
CT: fp_rpc::ConvertTransaction<<Block as BlockT>::Extrinsic> + Send + Sync + 'static,
|
||||
BE: Backend<Block> + 'static,
|
||||
{
|
||||
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
|
||||
use substrate_frame_rpc_system::{System, SystemApiServer};
|
||||
use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
|
||||
use bizinikiwi_pezframe_rpc_system::{System, SystemApiServer};
|
||||
|
||||
let mut module = RpcExtension::new(());
|
||||
let FullDeps { client, pool, deny_unsafe, eth } = deps;
|
||||
|
||||
Reference in New Issue
Block a user