sync: pezkuwi-sdk templates/minimal ile senkronize edildi

- node/src/* guncelendi
- runtime/src/lib.rs guncelendi (pezsp_keyring import fix)
- pezpallets/template/src/* guncelendi
This commit is contained in:
2025-12-25 11:24:40 +03:00
parent 57c7bf64e5
commit 2094b221cc
10 changed files with 122 additions and 91 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
// This file is part of pezkuwi-sdk.
// This file is part of Bizinikiwi.
// Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,13 +21,13 @@ use pezkuwi_sdk::{
*,
};
/// This is a specialization of the general bizinikiwi ChainSpec type.
/// This is a specialization of the general Bizinikiwi ChainSpec type.
pub type ChainSpec = pezsc_service::GenericChainSpec;
fn props() -> Properties {
let mut properties = Properties::new();
properties.insert("tokenDecimals".to_string(), 0.into());
properties.insert("tokenSymbol".to_string(), "PEZ".into());
properties.insert("tokenSymbol".to_string(), "MINI".into());
properties
}
@@ -36,7 +36,7 @@ pub fn development_chain_spec() -> Result<ChainSpec, String> {
.with_name("Development")
.with_id("dev")
.with_chain_type(ChainType::Development)
.with_genesis_config_preset_name(pezsp_genesis_builder::DEV_RUNTIME_PRESET)
.with_genesis_config_preset_name(pezkuwi_sdk::pezsp_genesis_builder::DEV_RUNTIME_PRESET)
.with_properties(props())
.build())
}
+13 -4
View File
@@ -1,7 +1,8 @@
// This file is part of pezkuwi-sdk.
// This file is part of Bizinikiwi.
// Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -14,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use pezkuwi_sdk::{pezsc_cli::RunCmd, *};
use pezkuwi_sdk::*;
#[derive(Debug, Clone)]
pub enum Consensus {
@@ -48,7 +49,7 @@ pub struct Cli {
pub consensus: Consensus,
#[clap(flatten)]
pub run: RunCmd,
pub run: pezsc_cli::RunCmd,
}
#[derive(Debug, clap::Subcommand)]
@@ -58,8 +59,16 @@ pub enum Subcommand {
Key(pezsc_cli::KeySubcommand),
/// Build a chain specification.
/// DEPRECATED: `build-spec` command will be removed after 1/04/2026. Use `export-chain-spec`
/// command instead.
#[deprecated(
note = "build-spec command will be removed after 1/04/2026. Use export-chain-spec command instead"
)]
BuildSpec(pezsc_cli::BuildSpecCmd),
/// Export the chain specification.
ExportChainSpec(pezsc_cli::ExportChainSpecCmd),
/// Validate blocks.
CheckBlock(pezsc_cli::CheckBlockCmd),
+20 -9
View File
@@ -1,6 +1,6 @@
// This file is part of pezkuwi-sdk.
// This file is part of Bizinikiwi.
// Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -50,8 +50,9 @@ impl BizinikiwiCli for Cli {
fn load_spec(&self, id: &str) -> Result<Box<dyn pezsc_service::ChainSpec>, String> {
Ok(match id {
"dev" => Box::new(chain_spec::development_chain_spec()?),
path =>
Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?),
path => {
Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?)
},
})
}
}
@@ -62,6 +63,7 @@ pub fn run() -> pezsc_cli::Result<()> {
match &cli.subcommand {
Some(Subcommand::Key(cmd)) => cmd.run(&cli),
#[allow(deprecated)]
Some(Subcommand::BuildSpec(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
@@ -74,6 +76,10 @@ pub fn run() -> pezsc_cli::Result<()> {
Ok((cmd.run(client, import_queue), task_manager))
})
},
Some(Subcommand::ExportChainSpec(cmd)) => {
let chain_spec = cli.load_spec(&cmd.chain)?;
cmd.run(chain_spec)
},
Some(Subcommand::ExportBlocks(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
@@ -117,13 +123,18 @@ pub fn run() -> pezsc_cli::Result<()> {
None => {
let runner = cli.create_runner(&cli.run)?;
runner.run_node_until_exit(|config| async move {
match config.network.network_backend.unwrap_or_default() {
pezsc_network::config::NetworkBackendType::Libp2p =>
service::new_full::<pezsc_network::NetworkWorker<_, _>>(config, cli.consensus)
.map_err(pezsc_cli::Error::Service),
match config.network.network_backend {
pezsc_network::config::NetworkBackendType::Libp2p => service::new_full::<
pezsc_network::NetworkWorker<_, _>,
>(
config, cli.consensus
)
.map_err(pezsc_cli::Error::Service),
pezsc_network::config::NetworkBackendType::Litep2p => service::new_full::<
pezsc_network::Litep2pNetworkBackend,
>(config, cli.consensus)
>(
config, cli.consensus
)
.map_err(pezsc_cli::Error::Service),
}
})
+1 -1
View File
@@ -1,6 +1,6 @@
// This file is part of Pezkuwi Sdk.
// Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
+2 -2
View File
@@ -1,6 +1,6 @@
// This file is part of pezkuwi-sdk.
// This file is part of Bizinikiwi.
// Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
+8 -8
View File
@@ -1,6 +1,6 @@
// This file is part of pezkuwi-sdk.
// This file is part of Bizinikiwi.
// Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,8 +16,8 @@
// limitations under the License.
//! A collection of node-specific RPC methods.
//! bizinikiwi provides the `pezsc-rpc` crate, which defines the core RPC layer
//! used by bizinikiwi 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)]
@@ -48,15 +48,15 @@ where
C: Send
+ Sync
+ 'static
+ pezsp_api::ProvideRuntimeApi<OpaqueBlock>
+ pezkuwi_sdk::pezsp_api::ProvideRuntimeApi<OpaqueBlock>
+ HeaderBackend<OpaqueBlock>
+ HeaderMetadata<OpaqueBlock, Error = BlockChainError>
+ 'static,
C::Api: pezsp_block_builder::BlockBuilder<OpaqueBlock>,
C::Api: pezframe_rpc_system::AccountNonceApi<OpaqueBlock, AccountId, Nonce>,
C::Api: pezkuwi_sdk::pezsp_block_builder::BlockBuilder<OpaqueBlock>,
C::Api: bizinikiwi_frame_rpc_system::AccountNonceApi<OpaqueBlock, AccountId, Nonce>,
P: TransactionPool + 'static,
{
use pezkuwi_sdk::pezframe_rpc_system::{System, SystemApiServer};
use pezkuwi_sdk::bizinikiwi_frame_rpc_system::{System, SystemApiServer};
let mut module = RpcModule::new(());
let FullDeps { client, pool } = deps;
+7 -6
View File
@@ -1,6 +1,6 @@
// This file is part of pezkuwi-sdk.
// This file is part of Bizinikiwi.
// Copyright (C) Pezkuwi Foundation. and Kurdistan Blockchain Technologies Institute (KBTI) 2024.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,12 +24,12 @@ use pezkuwi_sdk::{
pezsc_service::{error::Error as ServiceError, Configuration, TaskManager},
pezsc_telemetry::{Telemetry, TelemetryWorker},
pezsc_transaction_pool_api::OffchainTransactionPoolFactory,
pezsp_runtime::traits::Block as BlockT,
*,
};
use pezsp_runtime::traits::Block as BlockT;
use std::sync::Arc;
type HostFunctions = pezsp_io::BizinikiwiHostFunctions;
type HostFunctions = pezkuwi_sdk::pezsp_io::BizinikiwiHostFunctions;
#[docify::export]
pub(crate) type FullClient =
@@ -194,6 +194,7 @@ pub fn new_full<Network: pezsc_network::NetworkBackend<Block, <Block as BlockT>:
sync_service,
config,
telemetry: telemetry.as_mut(),
tracing_execute_block: None,
})?;
let proposer = pezsc_basic_authorship::ProposerFactory::new(
@@ -214,7 +215,7 @@ pub fn new_full<Network: pezsc_network::NetworkBackend<Block, <Block as BlockT>:
select_chain,
consensus_data_provider: None,
create_inherent_data_providers: move |_, ()| async move {
Ok(pezsp_timestamp::InherentDataProvider::from_system_time())
Ok(pezkuwi_sdk::pezsp_timestamp::InherentDataProvider::from_system_time())
},
};
@@ -250,7 +251,7 @@ pub fn new_full<Network: pezsc_network::NetworkBackend<Block, <Block as BlockT>:
commands_stream: Box::pin(commands_stream),
consensus_data_provider: None,
create_inherent_data_providers: move |_, ()| async move {
Ok(pezsp_timestamp::InherentDataProvider::from_system_time())
Ok(pezkuwi_sdk::pezsp_timestamp::InherentDataProvider::from_system_time())
},
};
let authorship_future = pezsc_consensus_manual_seal::run_manual_seal(params);