Refactoring Checkpoint: (WIP)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "node-bench"
|
||||
name = "pez-node-bench"
|
||||
version = "0.9.0-dev"
|
||||
authors.workspace = true
|
||||
description = "Bizinikiwi node integration benchmarks."
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
publish = false
|
||||
documentation = "https://docs.rs/node-bench"
|
||||
documentation = "https://docs.rs/pez-node-bench"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -23,12 +23,12 @@ derive_more = { features = ["display"], workspace = true }
|
||||
fs_extra = { workspace = true }
|
||||
futures = { features = ["thread-pool"], workspace = true }
|
||||
hash-db = { workspace = true, default-features = true }
|
||||
kitchensink-runtime = { workspace = true }
|
||||
pez-kitchensink-runtime = { workspace = true }
|
||||
kvdb = { workspace = true }
|
||||
kvdb-rocksdb = { workspace = true }
|
||||
log = { workspace = true, default-features = true }
|
||||
node-primitives = { workspace = true, default-features = true }
|
||||
node-testing = { workspace = true }
|
||||
pez-node-primitives = { workspace = true, default-features = true }
|
||||
pez-node-testing = { workspace = true }
|
||||
parity-db = { workspace = true }
|
||||
rand = { features = ["small_rng"], workspace = true, default-features = true }
|
||||
pezsc-basic-authorship = { workspace = true, default-features = true }
|
||||
@@ -49,9 +49,9 @@ tempfile = { workspace = true }
|
||||
|
||||
[features]
|
||||
runtime-benchmarks = [
|
||||
"kitchensink-runtime/runtime-benchmarks",
|
||||
"node-primitives/runtime-benchmarks",
|
||||
"node-testing/runtime-benchmarks",
|
||||
"pez-kitchensink-runtime/runtime-benchmarks",
|
||||
"pez-node-primitives/runtime-benchmarks",
|
||||
"pez-node-testing/runtime-benchmarks",
|
||||
"pezsc-basic-authorship/runtime-benchmarks",
|
||||
"pezsc-client-api/runtime-benchmarks",
|
||||
"pezsc-transaction-pool-api/runtime-benchmarks",
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
use std::{borrow::Cow, collections::HashMap, pin::Pin, sync::Arc};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use node_primitives::Block;
|
||||
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
|
||||
use pez_node_primitives::Block;
|
||||
use pez_node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
|
||||
use pezsc_transaction_pool_api::{
|
||||
ImportNotificationStream, PoolStatus, ReadyTransactions, TransactionFor, TransactionSource,
|
||||
TransactionStatusStreamFor, TxHash, TxInvalidityReportMap,
|
||||
@@ -167,18 +167,18 @@ impl core::Benchmark for ConstructionBenchmark {
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct PoolTransaction {
|
||||
data: Arc<OpaqueExtrinsic>,
|
||||
hash: node_primitives::Hash,
|
||||
hash: pez_node_primitives::Hash,
|
||||
}
|
||||
|
||||
impl From<OpaqueExtrinsic> for PoolTransaction {
|
||||
fn from(e: OpaqueExtrinsic) -> Self {
|
||||
PoolTransaction { data: Arc::from(e), hash: node_primitives::Hash::zero() }
|
||||
PoolTransaction { data: Arc::from(e), hash: pez_node_primitives::Hash::zero() }
|
||||
}
|
||||
}
|
||||
|
||||
impl pezsc_transaction_pool_api::InPoolTransaction for PoolTransaction {
|
||||
type Transaction = Arc<OpaqueExtrinsic>;
|
||||
type Hash = node_primitives::Hash;
|
||||
type Hash = pez_node_primitives::Hash;
|
||||
|
||||
fn data(&self) -> &Self::Transaction {
|
||||
&self.data
|
||||
@@ -228,7 +228,7 @@ impl ReadyTransactions for TransactionsIterator {
|
||||
#[async_trait]
|
||||
impl pezsc_transaction_pool_api::TransactionPool for Transactions {
|
||||
type Block = Block;
|
||||
type Hash = node_primitives::Hash;
|
||||
type Hash = pez_node_primitives::Hash;
|
||||
type InPoolTransaction = PoolTransaction;
|
||||
type Error = pezsc_transaction_pool_api::error::Error;
|
||||
|
||||
@@ -238,7 +238,7 @@ impl pezsc_transaction_pool_api::TransactionPool for Transactions {
|
||||
_at: Self::Hash,
|
||||
_source: TransactionSource,
|
||||
_xts: Vec<TransactionFor<Self>>,
|
||||
) -> Result<Vec<Result<node_primitives::Hash, Self::Error>>, Self::Error> {
|
||||
) -> Result<Vec<Result<pez_node_primitives::Hash, Self::Error>>, Self::Error> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use kvdb::KeyValueDB;
|
||||
use node_primitives::Hash;
|
||||
use pez_node_primitives::Hash;
|
||||
use pezsp_trie::{trie_types::TrieDBMutBuilderV1, TrieMut};
|
||||
|
||||
use crate::simple_trie::SimpleTrie;
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use node_primitives::Block;
|
||||
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
|
||||
use pez_node_primitives::Block;
|
||||
use pez_node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
|
||||
use pezsc_client_api::backend::Backend;
|
||||
|
||||
use crate::{
|
||||
|
||||
@@ -30,7 +30,7 @@ mod txpool;
|
||||
|
||||
use clap::Parser;
|
||||
|
||||
use node_testing::bench::{BlockType, DatabaseType as BenchDataBaseType, KeyTypes};
|
||||
use pez_node_testing::bench::{BlockType, DatabaseType as BenchDataBaseType, KeyTypes};
|
||||
|
||||
use crate::{
|
||||
common::SizeType,
|
||||
@@ -43,7 +43,7 @@ use crate::{
|
||||
};
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(name = "node-bench", about = "Node integration benchmarks")]
|
||||
#[command(name = "pez-node-bench", about = "Node integration benchmarks")]
|
||||
struct Opt {
|
||||
/// Show list of all available benchmarks.
|
||||
///
|
||||
|
||||
@@ -20,7 +20,7 @@ use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use hash_db::{AsHashDB, HashDB, Hasher as _, Prefix};
|
||||
use kvdb::KeyValueDB;
|
||||
use node_primitives::Hash;
|
||||
use pez_node_primitives::Hash;
|
||||
use pezsp_trie::DBValue;
|
||||
|
||||
pub type Hasher = pezsp_core::Blake2Hasher;
|
||||
|
||||
@@ -29,7 +29,7 @@ use std::{
|
||||
sync::{Arc, LazyLock},
|
||||
};
|
||||
|
||||
use node_primitives::Hash;
|
||||
use pez_node_primitives::Hash;
|
||||
|
||||
use crate::{
|
||||
core::{self, Mode, Path},
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
|
||||
use pez_node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
|
||||
|
||||
use pezsc_transaction_pool::BasicPool;
|
||||
use pezsc_transaction_pool_api::{TransactionPool, TransactionSource};
|
||||
|
||||
@@ -63,13 +63,13 @@ subxt-signer = { workspace = true, features = ["unstable-eth"] }
|
||||
|
||||
# The Pezkuwi-SDK:
|
||||
pezkuwi-sdk = { features = [
|
||||
"fork-tree",
|
||||
"pez-fork-tree",
|
||||
"pezframe-benchmarking-cli",
|
||||
"frame-remote-externalities",
|
||||
"pezframe-support-procedural-tools",
|
||||
"generate-bags",
|
||||
"mmr-gadget",
|
||||
"mmr-rpc",
|
||||
"pez-generate-bags",
|
||||
"pezmmr-gadget",
|
||||
"pezmmr-rpc",
|
||||
"pezpallet-transaction-payment-rpc",
|
||||
"pezsc-allocator",
|
||||
"pezsc-authority-discovery",
|
||||
@@ -135,7 +135,7 @@ pezkuwi-sdk = { features = [
|
||||
"pezstaging-node-inspect",
|
||||
"pezstaging-tracking-allocator",
|
||||
"std",
|
||||
"subkey",
|
||||
"pez-subkey",
|
||||
"bizinikiwi-build-script-utils",
|
||||
"bizinikiwi-frame-rpc-support",
|
||||
"bizinikiwi-frame-rpc-system",
|
||||
@@ -143,14 +143,14 @@ pezkuwi-sdk = { features = [
|
||||
"bizinikiwi-rpc-client",
|
||||
"bizinikiwi-state-trie-migration-rpc",
|
||||
"bizinikiwi-wasm-builder",
|
||||
"tracing-gum",
|
||||
"pez-tracing-gum",
|
||||
], workspace = true, default-features = true }
|
||||
|
||||
# Shared code between the staging node and kitchensink runtime:
|
||||
kitchensink-runtime = { workspace = true }
|
||||
pez-kitchensink-runtime = { workspace = true }
|
||||
node-inspect = { optional = true, workspace = true, default-features = true }
|
||||
node-primitives = { workspace = true, default-features = true }
|
||||
node-rpc = { workspace = true }
|
||||
pez-node-primitives = { workspace = true, default-features = true }
|
||||
pez-node-rpc = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
assert_cmd = { workspace = true }
|
||||
@@ -176,7 +176,7 @@ tokio-util = { features = ["compat"], workspace = true }
|
||||
wat = { workspace = true }
|
||||
|
||||
# These testing-only dependencies are not exported by the Pezkuwi-SDK crate:
|
||||
node-testing = { workspace = true }
|
||||
pez-node-testing = { workspace = true }
|
||||
pezsc-service-test = { workspace = true }
|
||||
bizinikiwi-cli-test-utils = { workspace = true }
|
||||
|
||||
@@ -197,18 +197,18 @@ pezkuwi-sdk = { features = [
|
||||
default = ["cli"]
|
||||
cli = ["clap", "clap_complete", "node-inspect", "pezkuwi-sdk"]
|
||||
runtime-benchmarks = [
|
||||
"kitchensink-runtime/runtime-benchmarks",
|
||||
"pez-kitchensink-runtime/runtime-benchmarks",
|
||||
"node-inspect?/runtime-benchmarks",
|
||||
"node-primitives/runtime-benchmarks",
|
||||
"node-rpc/runtime-benchmarks",
|
||||
"node-testing/runtime-benchmarks",
|
||||
"pez-node-primitives/runtime-benchmarks",
|
||||
"pez-node-rpc/runtime-benchmarks",
|
||||
"pez-node-testing/runtime-benchmarks",
|
||||
"pezkuwi-sdk/runtime-benchmarks",
|
||||
"pezsc-service-test/runtime-benchmarks",
|
||||
"pezsp-keyring/runtime-benchmarks",
|
||||
"bizinikiwi-cli-test-utils/runtime-benchmarks",
|
||||
]
|
||||
try-runtime = [
|
||||
"kitchensink-runtime/try-runtime",
|
||||
"pez-kitchensink-runtime/try-runtime",
|
||||
"pezkuwi-sdk/try-runtime",
|
||||
"bizinikiwi-cli-test-utils/try-runtime",
|
||||
]
|
||||
|
||||
@@ -20,7 +20,7 @@ use pezkuwi_sdk::*;
|
||||
|
||||
use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput};
|
||||
|
||||
use kitchensink_runtime::{constants::currency::*, BalancesCall};
|
||||
use pez_kitchensink_runtime::{constants::currency::*, BalancesCall};
|
||||
use node_cli::service::{create_extrinsic, FullClient};
|
||||
use pezkuwi_sdk::pezsc_service::config::{ExecutorConfiguration, RpcConfiguration};
|
||||
use pezsc_block_builder::{BlockBuilderBuilder, BuiltBlock};
|
||||
@@ -123,14 +123,14 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
|
||||
}
|
||||
|
||||
fn extrinsic_set_time(now: u64) -> OpaqueExtrinsic {
|
||||
let utx: kitchensink_runtime::UncheckedExtrinsic = generic::UncheckedExtrinsic::new_bare(
|
||||
kitchensink_runtime::RuntimeCall::Timestamp(pezpallet_timestamp::Call::set { now }),
|
||||
let utx: pez_kitchensink_runtime::UncheckedExtrinsic = generic::UncheckedExtrinsic::new_bare(
|
||||
pez_kitchensink_runtime::RuntimeCall::Timestamp(pezpallet_timestamp::Call::set { now }),
|
||||
)
|
||||
.into();
|
||||
utx.into()
|
||||
}
|
||||
|
||||
fn import_block(client: &FullClient, built: BuiltBlock<node_primitives::Block>) {
|
||||
fn import_block(client: &FullClient, built: BuiltBlock<pez_node_primitives::Block>) {
|
||||
let mut params = BlockImportParams::new(BlockOrigin::File, built.block.header);
|
||||
params.state_action =
|
||||
StateAction::ApplyChanges(pezsc_consensus::StorageChanges::Changes(built.storage_changes));
|
||||
|
||||
@@ -21,12 +21,12 @@ use pezkuwi_sdk::*;
|
||||
use codec::{Decode, Encode};
|
||||
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
|
||||
use pezframe_support::Hashable;
|
||||
use kitchensink_runtime::{
|
||||
use pez_kitchensink_runtime::{
|
||||
constants::currency::*, Block, BuildStorage, CheckedExtrinsic, Header, RuntimeCall,
|
||||
RuntimeGenesisConfig, UncheckedExtrinsic,
|
||||
};
|
||||
use node_primitives::{BlockNumber, Hash};
|
||||
use node_testing::keyring::*;
|
||||
use pez_node_primitives::{BlockNumber, Hash};
|
||||
use pez_node_testing::keyring::*;
|
||||
use pezsc_executor::{Externalities, RuntimeVersionOf};
|
||||
use pezsp_core::{
|
||||
storage::well_known_keys,
|
||||
@@ -41,7 +41,7 @@ criterion_main!(benches);
|
||||
|
||||
/// The wasm runtime code.
|
||||
pub fn compact_code_unwrap() -> &'static [u8] {
|
||||
kitchensink_runtime::WASM_BINARY.expect(
|
||||
pez_kitchensink_runtime::WASM_BINARY.expect(
|
||||
"Development wasm binary is not available. Testing is only supported with the flag \
|
||||
disabled.",
|
||||
)
|
||||
@@ -49,16 +49,16 @@ pub fn compact_code_unwrap() -> &'static [u8] {
|
||||
|
||||
const GENESIS_HASH: [u8; 32] = [69u8; 32];
|
||||
|
||||
const TRANSACTION_VERSION: u32 = kitchensink_runtime::VERSION.transaction_version;
|
||||
const TRANSACTION_VERSION: u32 = pez_kitchensink_runtime::VERSION.transaction_version;
|
||||
|
||||
const SPEC_VERSION: u32 = kitchensink_runtime::VERSION.spec_version;
|
||||
const SPEC_VERSION: u32 = pez_kitchensink_runtime::VERSION.spec_version;
|
||||
|
||||
const HEAP_PAGES: u64 = 20;
|
||||
|
||||
type TestExternalities<H> = CoreTestExternalities<H>;
|
||||
|
||||
fn sign(xt: CheckedExtrinsic) -> UncheckedExtrinsic {
|
||||
node_testing::keyring::sign(xt, SPEC_VERSION, TRANSACTION_VERSION, GENESIS_HASH, None)
|
||||
pez_node_testing::keyring::sign(xt, SPEC_VERSION, TRANSACTION_VERSION, GENESIS_HASH, None)
|
||||
}
|
||||
|
||||
fn new_test_ext(genesis_config: &RuntimeGenesisConfig) -> TestExternalities<BlakeTwo256> {
|
||||
@@ -167,7 +167,7 @@ fn bench_execute_block(c: &mut Criterion) {
|
||||
let mut group = c.benchmark_group("execute blocks");
|
||||
|
||||
group.bench_function("wasm", |b| {
|
||||
let genesis_config = node_testing::genesis::config();
|
||||
let genesis_config = pez_node_testing::genesis::config();
|
||||
|
||||
let executor = RuntimeExecutor::builder().build();
|
||||
let runtime_code = RuntimeCode {
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput};
|
||||
use futures::{future, StreamExt};
|
||||
use kitchensink_runtime::{constants::currency::*, BalancesCall, SudoCall};
|
||||
use pez_kitchensink_runtime::{constants::currency::*, BalancesCall, SudoCall};
|
||||
use node_cli::service::{create_extrinsic, fetch_nonce, FullClient, TransactionPool};
|
||||
use node_primitives::AccountId;
|
||||
use pez_node_primitives::AccountId;
|
||||
use pezkuwi_sdk::{
|
||||
pezsc_service::config::{ExecutorConfiguration, RpcConfiguration},
|
||||
pezsc_transaction_pool_api::TransactionPool as _,
|
||||
|
||||
@@ -24,8 +24,8 @@ use crate::service::{create_extrinsic, FullClient};
|
||||
|
||||
use pezkuwi_sdk::*;
|
||||
|
||||
use kitchensink_runtime::{BalancesCall, SystemCall};
|
||||
use node_primitives::{AccountId, Balance};
|
||||
use pez_kitchensink_runtime::{BalancesCall, SystemCall};
|
||||
use pez_node_primitives::{AccountId, Balance};
|
||||
use pezsc_cli::Result;
|
||||
use pezsp_inherents::{InherentData, InherentDataProvider};
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
use pezkuwi_sdk::*;
|
||||
|
||||
use crate::chain_spec::pezsc_service::Properties;
|
||||
use kitchensink_runtime::{
|
||||
use pez_kitchensink_runtime::{
|
||||
genesis_config_presets::{Staker, ENDOWMENT, STASH},
|
||||
wasm_binary_unwrap, Block, MaxNominations, StakerStatus,
|
||||
};
|
||||
@@ -38,8 +38,8 @@ use pezsp_consensus_grandpa::AuthorityId as GrandpaId;
|
||||
use pezsp_core::crypto::UncheckedInto;
|
||||
use pezsp_mixnet::types::AuthorityId as MixnetId;
|
||||
|
||||
pub use kitchensink_runtime::RuntimeGenesisConfig;
|
||||
pub use node_primitives::{AccountId, Balance, Signature};
|
||||
pub use pez_kitchensink_runtime::RuntimeGenesisConfig;
|
||||
pub use pez_node_primitives::{AccountId, Balance, Signature};
|
||||
|
||||
const STAGING_TELEMETRY_URL: &str = "wss://telemetry.pezkuwichain.io/submit/";
|
||||
|
||||
@@ -82,15 +82,15 @@ fn configure_accounts_for_staging_testnet() -> (
|
||||
#[rustfmt::skip]
|
||||
// stash, controller, session-key, beefy id
|
||||
// generated with secret:
|
||||
// for i in 1 2 3 4 ; do for j in stash controller; do subkey inspect "$secret"/fir/$j/$i; done; done
|
||||
// for i in 1 2 3 4 ; do for j in stash controller; do pez_subkey inspect "$secret"/fir/$j/$i; done; done
|
||||
//
|
||||
// and
|
||||
//
|
||||
// for i in 1 2 3 4 ; do for j in session; do subkey inspect --scheme ed25519 "$secret"//fir//$j//$i; done; done
|
||||
// for i in 1 2 3 4 ; do for j in session; do pez_subkey inspect --scheme ed25519 "$secret"//fir//$j//$i; done; done
|
||||
//
|
||||
// and
|
||||
//
|
||||
// for i in 1 2 3 4 ; do for j in session; do subkey inspect --scheme ecdsa "$secret"//fir//$j//$i; done; done
|
||||
// for i in 1 2 3 4 ; do for j in session; do pez_subkey inspect --scheme ecdsa "$secret"//fir//$j//$i; done; done
|
||||
|
||||
let initial_authorities: Vec<(
|
||||
AccountId,
|
||||
@@ -200,7 +200,7 @@ fn configure_accounts_for_staging_testnet() -> (
|
||||
),
|
||||
];
|
||||
|
||||
// generated with secret: subkey inspect "$secret"/fir
|
||||
// generated with secret: pez_subkey inspect "$secret"/fir
|
||||
let root_key: AccountId = array_bytes::hex_n_into_unchecked(
|
||||
// 5Ff3iXP75ruzroPWRP2FYBHWnmGGBSb63857BgnzCoXNxfPo
|
||||
"9ee5e5bdc0ec239eb164f865ecc345ce4c88e76ee002e0f7e318097347471809",
|
||||
@@ -430,7 +430,7 @@ pub fn local_testnet_config() -> ChainSpec {
|
||||
pub(crate) mod tests {
|
||||
use super::*;
|
||||
use crate::service::{new_full_base, NewFullBase};
|
||||
use kitchensink_runtime::genesis_config_presets::well_known_including_eth_accounts;
|
||||
use pez_kitchensink_runtime::genesis_config_presets::well_known_including_eth_accounts;
|
||||
use pezsc_service_test;
|
||||
use pezsp_runtime::{AccountId32, BuildStorage};
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ use crate::{
|
||||
Cli, Subcommand,
|
||||
};
|
||||
use pezframe_benchmarking_cli::*;
|
||||
use kitchensink_runtime::{ExistentialDeposit, RuntimeApi};
|
||||
use node_primitives::Block;
|
||||
use pez_kitchensink_runtime::{ExistentialDeposit, RuntimeApi};
|
||||
use pez_node_primitives::Block;
|
||||
use pezsc_cli::{Result, BizinikiwiCli};
|
||||
use pezsc_service::PartialComponents;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
@@ -31,8 +31,8 @@ use codec::Encode;
|
||||
use pezframe_benchmarking_cli::BIZINIKIWI_REFERENCE_HARDWARE;
|
||||
use pezframe_system_rpc_runtime_api::AccountNonceApi;
|
||||
use futures::prelude::*;
|
||||
use kitchensink_runtime::RuntimeApi;
|
||||
use node_primitives::Block;
|
||||
use pez_kitchensink_runtime::RuntimeApi;
|
||||
use pez_node_primitives::Block;
|
||||
use pezsc_client_api::{Backend, BlockBackend};
|
||||
use pezsc_consensus_babe::{self, SlotProportion};
|
||||
use pezsc_network::{
|
||||
@@ -107,51 +107,51 @@ pub fn fetch_nonce(client: &FullClient, account: pezsp_core::sr25519::Pair) -> u
|
||||
pub fn create_extrinsic(
|
||||
client: &FullClient,
|
||||
sender: pezsp_core::sr25519::Pair,
|
||||
function: impl Into<kitchensink_runtime::RuntimeCall>,
|
||||
function: impl Into<pez_kitchensink_runtime::RuntimeCall>,
|
||||
nonce: Option<u32>,
|
||||
) -> kitchensink_runtime::UncheckedExtrinsic {
|
||||
) -> pez_kitchensink_runtime::UncheckedExtrinsic {
|
||||
let function = function.into();
|
||||
let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed");
|
||||
let best_hash = client.chain_info().best_hash;
|
||||
let best_block = client.chain_info().best_number;
|
||||
let nonce = nonce.unwrap_or_else(|| fetch_nonce(client, sender.clone()));
|
||||
|
||||
let period = kitchensink_runtime::BlockHashCount::get()
|
||||
let period = pez_kitchensink_runtime::BlockHashCount::get()
|
||||
.checked_next_power_of_two()
|
||||
.map(|c| c / 2)
|
||||
.unwrap_or(2) as u64;
|
||||
let tip = 0;
|
||||
let tx_ext: kitchensink_runtime::TxExtension =
|
||||
let tx_ext: pez_kitchensink_runtime::TxExtension =
|
||||
(
|
||||
pezframe_system::AuthorizeCall::<kitchensink_runtime::Runtime>::new(),
|
||||
pezframe_system::CheckNonZeroSender::<kitchensink_runtime::Runtime>::new(),
|
||||
pezframe_system::CheckSpecVersion::<kitchensink_runtime::Runtime>::new(),
|
||||
pezframe_system::CheckTxVersion::<kitchensink_runtime::Runtime>::new(),
|
||||
pezframe_system::CheckGenesis::<kitchensink_runtime::Runtime>::new(),
|
||||
pezframe_system::CheckEra::<kitchensink_runtime::Runtime>::from(generic::Era::mortal(
|
||||
pezframe_system::AuthorizeCall::<pez_kitchensink_runtime::Runtime>::new(),
|
||||
pezframe_system::CheckNonZeroSender::<pez_kitchensink_runtime::Runtime>::new(),
|
||||
pezframe_system::CheckSpecVersion::<pez_kitchensink_runtime::Runtime>::new(),
|
||||
pezframe_system::CheckTxVersion::<pez_kitchensink_runtime::Runtime>::new(),
|
||||
pezframe_system::CheckGenesis::<pez_kitchensink_runtime::Runtime>::new(),
|
||||
pezframe_system::CheckEra::<pez_kitchensink_runtime::Runtime>::from(generic::Era::mortal(
|
||||
period,
|
||||
best_block.saturated_into(),
|
||||
)),
|
||||
pezframe_system::CheckNonce::<kitchensink_runtime::Runtime>::from(nonce),
|
||||
pezframe_system::CheckWeight::<kitchensink_runtime::Runtime>::new(),
|
||||
pezframe_system::CheckNonce::<pez_kitchensink_runtime::Runtime>::from(nonce),
|
||||
pezframe_system::CheckWeight::<pez_kitchensink_runtime::Runtime>::new(),
|
||||
pezpallet_skip_feeless_payment::SkipCheckIfFeeless::from(
|
||||
pezpallet_asset_conversion_tx_payment::ChargeAssetTxPayment::<
|
||||
kitchensink_runtime::Runtime,
|
||||
pez_kitchensink_runtime::Runtime,
|
||||
>::from(tip, None),
|
||||
),
|
||||
pezframe_metadata_hash_extension::CheckMetadataHash::new(false),
|
||||
pezpallet_revive::evm::tx_extension::SetOrigin::<kitchensink_runtime::Runtime>::default(),
|
||||
pezframe_system::WeightReclaim::<kitchensink_runtime::Runtime>::new(),
|
||||
pezpallet_revive::evm::tx_extension::SetOrigin::<pez_kitchensink_runtime::Runtime>::default(),
|
||||
pezframe_system::WeightReclaim::<pez_kitchensink_runtime::Runtime>::new(),
|
||||
);
|
||||
|
||||
let raw_payload = kitchensink_runtime::SignedPayload::from_raw(
|
||||
let raw_payload = pez_kitchensink_runtime::SignedPayload::from_raw(
|
||||
function.clone(),
|
||||
tx_ext.clone(),
|
||||
(
|
||||
(),
|
||||
(),
|
||||
kitchensink_runtime::VERSION.spec_version,
|
||||
kitchensink_runtime::VERSION.transaction_version,
|
||||
pez_kitchensink_runtime::VERSION.spec_version,
|
||||
pez_kitchensink_runtime::VERSION.transaction_version,
|
||||
genesis_hash,
|
||||
best_hash,
|
||||
(),
|
||||
@@ -167,7 +167,7 @@ pub fn create_extrinsic(
|
||||
generic::UncheckedExtrinsic::new_signed(
|
||||
function,
|
||||
pezsp_runtime::AccountId32::from(sender.public()).into(),
|
||||
kitchensink_runtime::Signature::Sr25519(signature),
|
||||
pez_kitchensink_runtime::Signature::Sr25519(signature),
|
||||
tx_ext,
|
||||
)
|
||||
.into()
|
||||
@@ -331,24 +331,24 @@ pub fn new_partial(
|
||||
let rpc_backend = backend.clone();
|
||||
let rpc_statement_store = statement_store.clone();
|
||||
let rpc_extensions_builder =
|
||||
move |subscription_executor: node_rpc::SubscriptionTaskExecutor| {
|
||||
let deps = node_rpc::FullDeps {
|
||||
move |subscription_executor: pez_node_rpc::SubscriptionTaskExecutor| {
|
||||
let deps = pez_node_rpc::FullDeps {
|
||||
client: client.clone(),
|
||||
pool: pool.clone(),
|
||||
select_chain: select_chain.clone(),
|
||||
chain_spec: chain_spec.cloned_box(),
|
||||
babe: node_rpc::BabeDeps {
|
||||
babe: pez_node_rpc::BabeDeps {
|
||||
keystore: keystore.clone(),
|
||||
babe_worker_handle: babe_worker_handle.clone(),
|
||||
},
|
||||
grandpa: node_rpc::GrandpaDeps {
|
||||
grandpa: pez_node_rpc::GrandpaDeps {
|
||||
shared_voter_state: shared_voter_state.clone(),
|
||||
shared_authority_set: shared_authority_set.clone(),
|
||||
justification_stream: justification_stream.clone(),
|
||||
subscription_executor: subscription_executor.clone(),
|
||||
finality_provider: finality_proof_provider.clone(),
|
||||
},
|
||||
beefy: node_rpc::BeefyDeps::<beefy_primitives::ecdsa_crypto::AuthorityId> {
|
||||
beefy: pez_node_rpc::BeefyDeps::<beefy_primitives::ecdsa_crypto::AuthorityId> {
|
||||
beefy_finality_proof_stream: beefy_rpc_links
|
||||
.from_voter_justif_stream
|
||||
.clone(),
|
||||
@@ -362,7 +362,7 @@ pub fn new_partial(
|
||||
mixnet_api: mixnet_api.as_ref().cloned(),
|
||||
};
|
||||
|
||||
node_rpc::create_full(deps).map_err(Into::into)
|
||||
pez_node_rpc::create_full(deps).map_err(Into::into)
|
||||
};
|
||||
|
||||
(rpc_extensions_builder, shared_voter_state2)
|
||||
@@ -722,9 +722,9 @@ pub fn new_full_base<N: NetworkBackend<Block, <Block as BlockT>::Hash>>(
|
||||
// When offchain indexing is enabled, MMR gadget should also run.
|
||||
if is_offchain_indexing_enabled {
|
||||
task_manager.spawn_essential_handle().spawn_blocking(
|
||||
"mmr-gadget",
|
||||
"pezmmr-gadget",
|
||||
None,
|
||||
mmr_gadget::MmrGadget::start(
|
||||
pezmmr_gadget::MmrGadget::start(
|
||||
client.clone(),
|
||||
backend.clone(),
|
||||
pezsp_mmr_primitives::INDEXING_PREFIX.to_vec(),
|
||||
@@ -870,11 +870,11 @@ pub fn new_full(config: Configuration, cli: Cli) -> Result<TaskManager, ServiceE
|
||||
mod tests {
|
||||
use crate::service::{new_full_base, NewFullBase};
|
||||
use codec::Encode;
|
||||
use kitchensink_runtime::{
|
||||
use pez_kitchensink_runtime::{
|
||||
constants::{currency::CENTS, time::SLOT_DURATION},
|
||||
Address, BalancesCall, RuntimeCall, TxExtension,
|
||||
};
|
||||
use node_primitives::{Block, DigestItem, Signature};
|
||||
use pez_node_primitives::{Block, DigestItem, Signature};
|
||||
use pezkuwi_sdk::{pezsc_transaction_pool_api::MaintainedTransactionPool, *};
|
||||
use pezsc_client_api::BlockBackend;
|
||||
use pezsc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy};
|
||||
@@ -1118,7 +1118,7 @@ mod tests {
|
||||
let signature = raw_payload.using_encoded(|payload| signer.sign(payload));
|
||||
let (function, tx_ext, _) = raw_payload.deconstruct();
|
||||
index += 1;
|
||||
let utx: kitchensink_runtime::UncheckedExtrinsic =
|
||||
let utx: pez_kitchensink_runtime::UncheckedExtrinsic =
|
||||
generic::UncheckedExtrinsic::new_signed(
|
||||
function,
|
||||
from.into(),
|
||||
|
||||
@@ -29,13 +29,13 @@ use pezsp_runtime::{
|
||||
traits::Hash as HashT, transaction_validity::InvalidTransaction, ApplyExtrinsicResult,
|
||||
};
|
||||
|
||||
use kitchensink_runtime::{
|
||||
use pez_kitchensink_runtime::{
|
||||
constants::{currency::*, time::SLOT_DURATION},
|
||||
Balances, CheckedExtrinsic, Header, Runtime, RuntimeCall, RuntimeEvent, System,
|
||||
TransactionPayment, Treasury, UncheckedExtrinsic,
|
||||
};
|
||||
use node_primitives::{Balance, Hash};
|
||||
use node_testing::keyring::*;
|
||||
use pez_node_primitives::{Balance, Hash};
|
||||
use pez_node_testing::keyring::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
use wat;
|
||||
|
||||
@@ -48,7 +48,7 @@ use self::common::{sign, *};
|
||||
/// have to execute provided wasm code instead of the native equivalent. This trick is used to
|
||||
/// test code paths that differ between native and wasm versions.
|
||||
pub fn bloaty_code_unwrap() -> &'static [u8] {
|
||||
kitchensink_runtime::WASM_BINARY_BLOATY.expect(
|
||||
pez_kitchensink_runtime::WASM_BINARY_BLOATY.expect(
|
||||
"Development wasm binary is not available. \
|
||||
Testing is only supported with the flag disabled.",
|
||||
)
|
||||
@@ -857,14 +857,14 @@ fn successful_execution_gives_ok() {
|
||||
|
||||
#[test]
|
||||
fn should_import_block_with_test_client() {
|
||||
use node_testing::client::{
|
||||
use pez_node_testing::client::{
|
||||
pezsp_consensus::BlockOrigin, ClientBlockImportExt, TestClientBuilder, TestClientBuilderExt,
|
||||
};
|
||||
|
||||
let client = TestClientBuilder::new().build();
|
||||
let block1 = changes_trie_block();
|
||||
let block_data = block1.0;
|
||||
let block = node_primitives::Block::decode(&mut &block_data[..]).unwrap();
|
||||
let block = pez_node_primitives::Block::decode(&mut &block_data[..]).unwrap();
|
||||
|
||||
futures::executor::block_on(client.import(BlockOrigin::Own, block)).unwrap();
|
||||
}
|
||||
|
||||
@@ -36,12 +36,12 @@ use pezsp_runtime::{
|
||||
};
|
||||
use pezsp_state_machine::TestExternalities as CoreTestExternalities;
|
||||
|
||||
use kitchensink_runtime::{
|
||||
use pez_kitchensink_runtime::{
|
||||
constants::currency::*, Block, BuildStorage, CheckedExtrinsic, Header, Runtime,
|
||||
UncheckedExtrinsic,
|
||||
};
|
||||
use node_primitives::{BlockNumber, Hash};
|
||||
use node_testing::keyring::*;
|
||||
use pez_node_primitives::{BlockNumber, Hash};
|
||||
use pez_node_testing::keyring::*;
|
||||
use pezsp_externalities::Externalities;
|
||||
use pezstaging_node_cli::service::RuntimeExecutor;
|
||||
|
||||
@@ -70,7 +70,7 @@ impl AppCrypto<MultiSigner, MultiSignature> for TestAuthorityId {
|
||||
/// making the binary slimmer. There is a convention to use compact version of the runtime
|
||||
/// as canonical.
|
||||
pub fn compact_code_unwrap() -> &'static [u8] {
|
||||
kitchensink_runtime::WASM_BINARY.expect(
|
||||
pez_kitchensink_runtime::WASM_BINARY.expect(
|
||||
"Development wasm binary is not available. Testing is only supported with the flag \
|
||||
disabled.",
|
||||
)
|
||||
@@ -78,14 +78,14 @@ pub fn compact_code_unwrap() -> &'static [u8] {
|
||||
|
||||
pub const GENESIS_HASH: [u8; 32] = [69u8; 32];
|
||||
|
||||
pub const SPEC_VERSION: u32 = kitchensink_runtime::VERSION.spec_version;
|
||||
pub const SPEC_VERSION: u32 = pez_kitchensink_runtime::VERSION.spec_version;
|
||||
|
||||
pub const TRANSACTION_VERSION: u32 = kitchensink_runtime::VERSION.transaction_version;
|
||||
pub const TRANSACTION_VERSION: u32 = pez_kitchensink_runtime::VERSION.transaction_version;
|
||||
|
||||
pub type TestExternalities<H> = CoreTestExternalities<H>;
|
||||
|
||||
pub fn sign(xt: CheckedExtrinsic) -> UncheckedExtrinsic {
|
||||
node_testing::keyring::sign(xt, SPEC_VERSION, TRANSACTION_VERSION, GENESIS_HASH, None)
|
||||
pez_node_testing::keyring::sign(xt, SPEC_VERSION, TRANSACTION_VERSION, GENESIS_HASH, None)
|
||||
}
|
||||
|
||||
pub fn default_transfer_call() -> pezpallet_balances::Call<Runtime> {
|
||||
@@ -125,7 +125,7 @@ pub fn new_test_ext(code: &[u8]) -> TestExternalities<BlakeTwo256> {
|
||||
pezsp_tracing::try_init_simple();
|
||||
let ext = TestExternalities::new_with_code(
|
||||
code,
|
||||
node_testing::genesis::config().build_storage().unwrap(),
|
||||
pez_node_testing::genesis::config().build_storage().unwrap(),
|
||||
);
|
||||
ext
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@ use pezframe_support::{
|
||||
traits::Currency,
|
||||
weights::{constants::ExtrinsicBaseWeight, IdentityFee, WeightToFee},
|
||||
};
|
||||
use kitchensink_runtime::{
|
||||
use pez_kitchensink_runtime::{
|
||||
constants::{currency::*, time::SLOT_DURATION},
|
||||
Balances, CheckedExtrinsic, Multiplier, Runtime, RuntimeCall, TransactionByteFee,
|
||||
TransactionPayment,
|
||||
};
|
||||
use node_primitives::Balance;
|
||||
use node_testing::keyring::*;
|
||||
use pez_node_primitives::Balance;
|
||||
use pez_node_testing::keyring::*;
|
||||
use pezkuwi_sdk::*;
|
||||
use pezsp_runtime::{traits::One, Perbill};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use codec::Decode;
|
||||
use pezframe_system::offchain::{SendSignedTransaction, Signer, SubmitTransaction};
|
||||
use kitchensink_runtime::{Executive, ExistentialDeposit, Indices, Runtime, UncheckedExtrinsic};
|
||||
use pez_kitchensink_runtime::{Executive, ExistentialDeposit, Indices, Runtime, UncheckedExtrinsic};
|
||||
use pezkuwi_sdk::*;
|
||||
use pezsp_application_crypto::AppCrypto;
|
||||
use pezsp_core::offchain::{testing::TestTransactionPoolExt, TransactionPoolExt};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "node-primitives"
|
||||
name = "pez-node-primitives"
|
||||
version = "2.0.0"
|
||||
authors.workspace = true
|
||||
description = "Bizinikiwi node low-level primitives."
|
||||
@@ -8,7 +8,7 @@ license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
publish = false
|
||||
documentation = "https://docs.rs/node-primitives"
|
||||
documentation = "https://docs.rs/pez-node-primitives"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "node-rpc"
|
||||
name = "pez-node-rpc"
|
||||
version = "3.0.0-dev"
|
||||
authors.workspace = true
|
||||
description = "Bizinikiwi node rpc methods."
|
||||
@@ -8,7 +8,7 @@ license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
publish = false
|
||||
documentation = "https://docs.rs/node-rpc"
|
||||
documentation = "https://docs.rs/pez-node-rpc"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -18,8 +18,8 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
jsonrpsee = { features = ["server"], workspace = true }
|
||||
mmr-rpc = { workspace = true, default-features = true }
|
||||
node-primitives = { workspace = true, default-features = true }
|
||||
pezmmr-rpc = { workspace = true, default-features = true }
|
||||
pez-node-primitives = { workspace = true, default-features = true }
|
||||
pezpallet-transaction-payment-rpc = { workspace = true, default-features = true }
|
||||
pezsc-chain-spec = { workspace = true, default-features = true }
|
||||
pezsc-client-api = { workspace = true, default-features = true }
|
||||
@@ -48,8 +48,8 @@ bizinikiwi-state-trie-migration-rpc = { workspace = true, default-features = tru
|
||||
|
||||
[features]
|
||||
runtime-benchmarks = [
|
||||
"mmr-rpc/runtime-benchmarks",
|
||||
"node-primitives/runtime-benchmarks",
|
||||
"pezmmr-rpc/runtime-benchmarks",
|
||||
"pez-node-primitives/runtime-benchmarks",
|
||||
"pezpallet-transaction-payment-rpc/runtime-benchmarks",
|
||||
"pezsc-chain-spec/runtime-benchmarks",
|
||||
"pezsc-client-api/runtime-benchmarks",
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use jsonrpsee::RpcModule;
|
||||
use node_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Nonce};
|
||||
use pez_node_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Nonce};
|
||||
use pezsc_client_api::AuxStore;
|
||||
use pezsc_consensus_babe::BabeWorkerHandle;
|
||||
use pezsc_consensus_beefy::communication::notification::{
|
||||
@@ -135,7 +135,7 @@ where
|
||||
+ Send
|
||||
+ 'static,
|
||||
C::Api: bizinikiwi_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
|
||||
C::Api: mmr_rpc::MmrRuntimeApi<Block, <Block as pezsp_runtime::traits::Block>::Hash, BlockNumber>,
|
||||
C::Api: pezmmr_rpc::MmrRuntimeApi<Block, <Block as pezsp_runtime::traits::Block>::Hash, BlockNumber>,
|
||||
C::Api: pezpallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
|
||||
C::Api: BabeApi<Block>,
|
||||
C::Api: BlockBuilder<Block>,
|
||||
@@ -146,7 +146,7 @@ where
|
||||
AuthorityId: AuthorityIdBound,
|
||||
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
|
||||
{
|
||||
use mmr_rpc::{Mmr, MmrApiServer};
|
||||
use pezmmr_rpc::{Mmr, MmrApiServer};
|
||||
use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
|
||||
use pezsc_consensus_babe_rpc::{Babe, BabeApiServer};
|
||||
use pezsc_consensus_beefy_rpc::{Beefy, BeefyApiServer};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "kitchensink-runtime"
|
||||
name = "pez-kitchensink-runtime"
|
||||
version = "3.0.0-dev"
|
||||
authors.workspace = true
|
||||
description = "Bizinikiwi node kitchensink runtime."
|
||||
@@ -9,7 +9,7 @@ license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
publish = false
|
||||
documentation = "https://docs.rs/kitchensink-runtime"
|
||||
documentation = "https://docs.rs/pez-kitchensink-runtime"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -39,7 +39,7 @@ primitive-types = { features = [
|
||||
pezkuwi-sdk = { features = ["runtime-full", "tuples-96"], workspace = true }
|
||||
|
||||
# shared code between runtime and node
|
||||
node-primitives = { workspace = true }
|
||||
pez-node-primitives = { workspace = true }
|
||||
|
||||
# Example pallets that are not published:
|
||||
pezpallet-example-mbm = { workspace = true }
|
||||
@@ -54,7 +54,7 @@ with-tracing = ["pezkuwi-sdk/with-tracing"]
|
||||
std = [
|
||||
"codec/std",
|
||||
"log/std",
|
||||
"node-primitives/std",
|
||||
"pez-node-primitives/std",
|
||||
"pezpallet-example-mbm/std",
|
||||
"pezpallet-example-tasks/std",
|
||||
"pezkuwi-sdk/std",
|
||||
@@ -66,7 +66,7 @@ std = [
|
||||
"bizinikiwi-wasm-builder",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"node-primitives/runtime-benchmarks",
|
||||
"pez-node-primitives/runtime-benchmarks",
|
||||
"pezpallet-example-mbm/runtime-benchmarks",
|
||||
"pezpallet-example-tasks/runtime-benchmarks",
|
||||
"pezkuwi-sdk/runtime-benchmarks",
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
/// Money matters.
|
||||
pub mod currency {
|
||||
use node_primitives::Balance;
|
||||
use pez_node_primitives::Balance;
|
||||
|
||||
pub const MILLICENTS: Balance = 1_000_000_000;
|
||||
pub const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent.
|
||||
@@ -32,7 +32,7 @@ pub mod currency {
|
||||
|
||||
/// Time.
|
||||
pub mod time {
|
||||
use node_primitives::{BlockNumber, Moment};
|
||||
use pez_node_primitives::{BlockNumber, Moment};
|
||||
|
||||
/// Since BABE is probabilistic this is the average expected block time that
|
||||
/// we are targeting. Blocks will be produced at a minimum duration defined
|
||||
|
||||
@@ -76,8 +76,8 @@ use pezframe_system::{
|
||||
limits::{BlockLength, BlockWeights},
|
||||
EnsureRoot, EnsureRootWithSuccess, EnsureSigned, EnsureSignedBy, EnsureWithSuccess,
|
||||
};
|
||||
pub use node_primitives::{AccountId, Signature};
|
||||
use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce};
|
||||
pub use pez_node_primitives::{AccountId, Signature};
|
||||
use pez_node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce};
|
||||
use pezpallet_asset_conversion::{AccountIdConverter, Ascending, Chain, WithFirstAsset};
|
||||
use pezpallet_asset_conversion_tx_payment::SwapAssetAdapter;
|
||||
use pezpallet_assets_precompiles::{InlineIdConfig, ERC20};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "node-testing"
|
||||
name = "pez-node-testing"
|
||||
version = "3.0.0-dev"
|
||||
authors.workspace = true
|
||||
description = "Test utilities for Bizinikiwi node."
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
publish = false
|
||||
documentation = "https://docs.rs/node-testing"
|
||||
documentation = "https://docs.rs/pez-node-testing"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -22,10 +22,10 @@ pezframe-metadata-hash-extension = { workspace = true, default-features = true }
|
||||
pezframe-system = { workspace = true, default-features = true }
|
||||
fs_extra = { workspace = true }
|
||||
futures = { workspace = true }
|
||||
kitchensink-runtime = { workspace = true }
|
||||
pez-kitchensink-runtime = { workspace = true }
|
||||
log = { workspace = true, default-features = true }
|
||||
node-cli = { workspace = true }
|
||||
node-primitives = { workspace = true, default-features = true }
|
||||
pez-node-primitives = { workspace = true, default-features = true }
|
||||
pezpallet-asset-conversion = { workspace = true, default-features = true }
|
||||
pezpallet-asset-conversion-tx-payment = { workspace = true, default-features = true }
|
||||
pezpallet-revive = { workspace = true, default-features = true }
|
||||
@@ -57,9 +57,9 @@ tempfile = { workspace = true }
|
||||
runtime-benchmarks = [
|
||||
"pezframe-metadata-hash-extension/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"kitchensink-runtime/runtime-benchmarks",
|
||||
"pez-kitchensink-runtime/runtime-benchmarks",
|
||||
"node-cli/runtime-benchmarks",
|
||||
"node-primitives/runtime-benchmarks",
|
||||
"pez-node-primitives/runtime-benchmarks",
|
||||
"pezpallet-asset-conversion-tx-payment/runtime-benchmarks",
|
||||
"pezpallet-asset-conversion/runtime-benchmarks",
|
||||
"pezpallet-revive/runtime-benchmarks",
|
||||
|
||||
@@ -34,11 +34,11 @@ use crate::{
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use futures::executor;
|
||||
use kitchensink_runtime::{
|
||||
use pez_kitchensink_runtime::{
|
||||
constants::currency::DOLLARS, AccountId, BalancesCall, CheckedExtrinsic, MinimumPeriod,
|
||||
RuntimeCall, Signature, SystemCall, UncheckedExtrinsic,
|
||||
};
|
||||
use node_primitives::Block;
|
||||
use pez_node_primitives::Block;
|
||||
use pezsc_block_builder::BlockBuilderBuilder;
|
||||
use pezsc_client_api::{execution_extensions::ExecutionExtensions, UsageProvider};
|
||||
use pezsc_client_db::PruningMode;
|
||||
@@ -267,7 +267,7 @@ pub struct BlockContentIterator<'a> {
|
||||
iteration: usize,
|
||||
content: BlockContent,
|
||||
runtime_version: pezsc_executor::RuntimeVersion,
|
||||
genesis_hash: node_primitives::Hash,
|
||||
genesis_hash: pez_node_primitives::Hash,
|
||||
keyring: &'a BenchKeyring,
|
||||
}
|
||||
|
||||
@@ -301,13 +301,13 @@ impl<'a> Iterator for BlockContentIterator<'a> {
|
||||
CheckedExtrinsic {
|
||||
format: ExtrinsicFormat::Signed(
|
||||
sender,
|
||||
tx_ext(0, kitchensink_runtime::ExistentialDeposit::get() + 1),
|
||||
tx_ext(0, pez_kitchensink_runtime::ExistentialDeposit::get() + 1),
|
||||
),
|
||||
function: match self.content.block_type {
|
||||
BlockType::RandomTransfersKeepAlive =>
|
||||
RuntimeCall::Balances(BalancesCall::transfer_keep_alive {
|
||||
dest: pezsp_runtime::MultiAddress::Id(receiver),
|
||||
value: kitchensink_runtime::ExistentialDeposit::get() + 1,
|
||||
value: pez_kitchensink_runtime::ExistentialDeposit::get() + 1,
|
||||
}),
|
||||
BlockType::RandomTransfersReaping => {
|
||||
RuntimeCall::Balances(BalancesCall::transfer_allow_death {
|
||||
@@ -315,7 +315,7 @@ impl<'a> Iterator for BlockContentIterator<'a> {
|
||||
// Transfer so that ending balance would be 1 less than existential
|
||||
// deposit so that we kill the sender account.
|
||||
value: 100 * DOLLARS -
|
||||
(kitchensink_runtime::ExistentialDeposit::get() - 1),
|
||||
(pez_kitchensink_runtime::ExistentialDeposit::get() - 1),
|
||||
})
|
||||
},
|
||||
BlockType::Noop =>
|
||||
@@ -610,7 +610,7 @@ impl BenchKeyring {
|
||||
}
|
||||
|
||||
/// Generate genesis with accounts from this keyring endowed with some balance and
|
||||
/// kitchensink_runtime code blob.
|
||||
/// pez_kitchensink_runtime code blob.
|
||||
pub fn as_storage_builder(&self) -> &dyn pezsp_runtime::BuildStorage {
|
||||
self
|
||||
}
|
||||
@@ -620,7 +620,7 @@ impl pezsp_runtime::BuildStorage for BenchKeyring {
|
||||
fn assimilate_storage(&self, storage: &mut pezsp_core::storage::Storage) -> Result<(), String> {
|
||||
storage.top.insert(
|
||||
pezsp_core::storage::well_known_keys::CODE.to_vec(),
|
||||
kitchensink_runtime::wasm_binary_unwrap().into(),
|
||||
pez_kitchensink_runtime::wasm_binary_unwrap().into(),
|
||||
);
|
||||
crate::genesis::config_endowed(self.collect_account_ids()).assimilate_storage(storage)
|
||||
}
|
||||
|
||||
@@ -16,24 +16,24 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
//! Utilities to build a `TestClient` for `kitchensink-runtime`.
|
||||
//! Utilities to build a `TestClient` for `pez-kitchensink-runtime`.
|
||||
|
||||
use pezsp_runtime::BuildStorage;
|
||||
/// Re-export test-client utilities.
|
||||
pub use bizinikiwi_test_client::*;
|
||||
|
||||
/// Call executor for `kitchensink-runtime` `TestClient`.
|
||||
/// Call executor for `pez-kitchensink-runtime` `TestClient`.
|
||||
use node_cli::service::RuntimeExecutor;
|
||||
|
||||
/// Default backend type.
|
||||
pub type Backend = pezsc_client_db::Backend<node_primitives::Block>;
|
||||
pub type Backend = pezsc_client_db::Backend<pez_node_primitives::Block>;
|
||||
|
||||
/// Test client type.
|
||||
pub type Client = client::Client<
|
||||
Backend,
|
||||
client::LocalCallExecutor<node_primitives::Block, Backend, RuntimeExecutor>,
|
||||
node_primitives::Block,
|
||||
kitchensink_runtime::RuntimeApi,
|
||||
client::LocalCallExecutor<pez_node_primitives::Block, Backend, RuntimeExecutor>,
|
||||
pez_node_primitives::Block,
|
||||
pez_kitchensink_runtime::RuntimeApi,
|
||||
>;
|
||||
|
||||
/// Genesis configuration parameters for `TestClient`.
|
||||
@@ -45,7 +45,7 @@ impl bizinikiwi_test_client::GenesisInit for GenesisParameters {
|
||||
let mut storage = crate::genesis::config().build_storage().unwrap();
|
||||
storage.top.insert(
|
||||
pezsp_core::storage::well_known_keys::CODE.to_vec(),
|
||||
kitchensink_runtime::wasm_binary_unwrap().into(),
|
||||
pez_kitchensink_runtime::wasm_binary_unwrap().into(),
|
||||
);
|
||||
storage
|
||||
}
|
||||
@@ -62,8 +62,8 @@ pub trait TestClientBuilderExt: Sized {
|
||||
|
||||
impl TestClientBuilderExt
|
||||
for bizinikiwi_test_client::TestClientBuilder<
|
||||
node_primitives::Block,
|
||||
client::LocalCallExecutor<node_primitives::Block, Backend, RuntimeExecutor>,
|
||||
pez_node_primitives::Block,
|
||||
client::LocalCallExecutor<pez_node_primitives::Block, Backend, RuntimeExecutor>,
|
||||
Backend,
|
||||
GenesisParameters,
|
||||
>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
//! Genesis Configuration.
|
||||
|
||||
use crate::keyring::*;
|
||||
use kitchensink_runtime::{
|
||||
use pez_kitchensink_runtime::{
|
||||
constants::currency::*, AccountId, AssetsConfig, BalancesConfig, IndicesConfig,
|
||||
RuntimeGenesisConfig, SessionConfig, SocietyConfig, StakerStatus, StakingConfig,
|
||||
};
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
//! Test accounts.
|
||||
|
||||
use codec::Encode;
|
||||
use kitchensink_runtime::{CheckedExtrinsic, SessionKeys, TxExtension, UncheckedExtrinsic};
|
||||
use node_primitives::{AccountId, Balance, Nonce};
|
||||
use pez_kitchensink_runtime::{CheckedExtrinsic, SessionKeys, TxExtension, UncheckedExtrinsic};
|
||||
use pez_node_primitives::{AccountId, Balance, Nonce};
|
||||
use pezsp_core::{crypto::get_public_from_string_or_panic, ecdsa, ed25519, sr25519};
|
||||
use pezsp_crypto_hashing::blake2_256;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "subkey"
|
||||
name = "pez-subkey"
|
||||
version = "9.0.0"
|
||||
authors.workspace = true
|
||||
description = "Generate and restore keys for Bizinikiwi based chains such as Pezkuwi, Kusama and a growing number of teyrchains and Bizinikiwi based projects."
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
readme = "README.md"
|
||||
documentation = "https://docs.rs/subkey"
|
||||
documentation = "https://docs.rs/pez-subkey"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -18,7 +18,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[[bin]]
|
||||
path = "src/main.rs"
|
||||
name = "subkey"
|
||||
name = "pez-subkey"
|
||||
|
||||
[dependencies]
|
||||
clap = { features = ["derive"], workspace = true }
|
||||
@@ -3,26 +3,26 @@
|
||||
Subkey is a commandline utility included with Bizinikiwi. It allows generating and restoring keys for Bizinikiwi based
|
||||
chains such as PezkuwiChain, Kusama and a growing number of teyrchains and Bizinikiwi based projects.
|
||||
|
||||
`subkey` provides a few sub-commands to generate keys, check keys, sign messages, verify messages, etc...
|
||||
`pez_subkey` provides a few sub-commands to generate keys, check keys, sign messages, verify messages, etc...
|
||||
|
||||
You can see the full list of commands with `subkey --help`. Most commands have additional help available with for
|
||||
instance `subkey generate --help` for the `generate` command.
|
||||
You can see the full list of commands with `pez_subkey --help`. Most commands have additional help available with for
|
||||
instance `pez_subkey generate --help` for the `generate` command.
|
||||
|
||||
## Safety first
|
||||
|
||||
`subkey` does not need an internet connection to work. Indeed, for the best security, you should be using `subkey` on a
|
||||
`pez_subkey` does not need an internet connection to work. Indeed, for the best security, you should be using `pez_subkey` on a
|
||||
machine that is **not connected** to the internet.
|
||||
|
||||
`subkey` deals with **seeds** and **private keys**. Make sure to use `subkey` in a safe environment (ie. no one looking
|
||||
`pez_subkey` deals with **seeds** and **private keys**. Make sure to use `pez_subkey` in a safe environment (ie. no one looking
|
||||
over your shoulder) and on a safe computer (ie. no one able to check your command history).
|
||||
|
||||
If you save any output of `subkey` into a file, make sure to apply proper permissions and/or delete the file as soon as
|
||||
If you save any output of `pez_subkey` into a file, make sure to apply proper permissions and/or delete the file as soon as
|
||||
possible.
|
||||
|
||||
## Usage
|
||||
|
||||
The following guide explains *some* of the `subkey` commands. For the full list and the most up to date documentation,
|
||||
make sure to check the integrated help with `subkey --help`.
|
||||
The following guide explains *some* of the `pez_subkey` commands. For the full list and the most up to date documentation,
|
||||
make sure to check the integrated help with `pez_subkey --help`.
|
||||
|
||||
### Install with Cargo
|
||||
|
||||
@@ -32,8 +32,8 @@ dependencies and Subkey, respectively:
|
||||
Command:
|
||||
|
||||
```bash
|
||||
# Install only `subkey`, at a specific version of the subkey crate
|
||||
cargo install --force subkey --git https://github.com/pezkuwichain/kurdistan-sdk --version <SET VERSION> --locked
|
||||
# Install only `pez_subkey`, at a specific version of the pez_subkey crate
|
||||
cargo install --force pez_subkey --git https://github.com/pezkuwichain/kurdistan-sdk --version <SET VERSION> --locked
|
||||
# If you run into issues building, you likely are missing deps defined in https://docs.pezkuwichain.io/install/
|
||||
```
|
||||
|
||||
@@ -41,7 +41,7 @@ cargo install --force subkey --git https://github.com/pezkuwichain/kurdistan-sdk
|
||||
|
||||
```bash
|
||||
# Use `--pull=always` with the `latest` tag, or specify a version in a tag
|
||||
docker run -it --pull=always docker.io/parity/subkey:latest <command to subkey>
|
||||
docker run -it --pull=always docker.io/parity/pez_subkey:latest <command to pez_subkey>
|
||||
```
|
||||
|
||||
### Generate a random account
|
||||
@@ -49,7 +49,7 @@ docker run -it --pull=always docker.io/parity/subkey:latest <command to subkey>
|
||||
Generating a new key is as simple as running:
|
||||
|
||||
```bash
|
||||
subkey generate
|
||||
pez_subkey generate
|
||||
```
|
||||
|
||||
The output looks similar to:
|
||||
@@ -90,12 +90,12 @@ SS58 addresses are:
|
||||
|
||||
### Json output
|
||||
|
||||
`subkey` can also generate the output as *json*. This is useful for automation.
|
||||
`pez_subkey` can also generate the output as *json*. This is useful for automation.
|
||||
|
||||
command:
|
||||
|
||||
```bash
|
||||
subkey generate --output-type json
|
||||
pez_subkey generate --output-type json
|
||||
```
|
||||
|
||||
output:
|
||||
@@ -115,7 +115,7 @@ So if you only want to get the `secretSeed` for instance, you can use:
|
||||
command:
|
||||
|
||||
```bash
|
||||
subkey generate --output-type json | jq -r .secretSeed
|
||||
pez_subkey generate --output-type json | jq -r .secretSeed
|
||||
```
|
||||
|
||||
output:
|
||||
@@ -126,10 +126,10 @@ output:
|
||||
|
||||
### Additional user-defined password
|
||||
|
||||
`subkey` supports an additional user-defined secret that will be appended to the seed. Let's see the following example:
|
||||
`pez_subkey` supports an additional user-defined secret that will be appended to the seed. Let's see the following example:
|
||||
|
||||
```bash
|
||||
subkey generate --password extra_secret
|
||||
pez_subkey generate --password extra_secret
|
||||
```
|
||||
|
||||
output:
|
||||
@@ -146,7 +146,7 @@ Using the `inspect` command (see more details below), we see that knowing only t
|
||||
sufficient to recover the account:
|
||||
|
||||
```bash
|
||||
subkey inspect "soup lyrics media market way crouch elevator put moon useful question wide"
|
||||
pez_subkey inspect "soup lyrics media market way crouch elevator put moon useful question wide"
|
||||
```
|
||||
|
||||
which recovers the account `5Fe4sqj2K4fRuzEGvToi4KATqZfiDU7TqynjXG6PZE2dxwyh` and not
|
||||
@@ -155,25 +155,25 @@ which recovers the account `5Fe4sqj2K4fRuzEGvToi4KATqZfiDU7TqynjXG6PZE2dxwyh` an
|
||||
this time passing also the required `password` as shown below:
|
||||
|
||||
```bash
|
||||
subkey inspect --password extra_secret "soup lyrics media market way crouch elevator put moon useful question wide"
|
||||
pez_subkey inspect --password extra_secret "soup lyrics media market way crouch elevator put moon useful question wide"
|
||||
```
|
||||
|
||||
This time, we properly recovered `5He5pZpc7AJ8evPuab37vJF6KkFDqq9uDq2WXh877Qw6iaVC`.
|
||||
|
||||
### Inspecting a key
|
||||
|
||||
If you have *some data* about a key, `subkey inspect` will help you discover more information about it.
|
||||
If you have *some data* about a key, `pez_subkey inspect` will help you discover more information about it.
|
||||
|
||||
If you have **secrets** that you would like to verify for instance, you can use:
|
||||
|
||||
```bash
|
||||
subkey inspect < mnemonic | seed >
|
||||
pez_subkey inspect < mnemonic | seed >
|
||||
```
|
||||
|
||||
If you have only **public data**, you can see a subset of the information:
|
||||
|
||||
```bash
|
||||
subkey inspect --public < pubkey | address >
|
||||
pez_subkey inspect --public < pubkey | address >
|
||||
```
|
||||
|
||||
**NOTE**: While you will be able to recover the secret seed from the mnemonic, the opposite is not possible.
|
||||
@@ -184,7 +184,7 @@ subkey inspect --public < pubkey | address >
|
||||
command:
|
||||
|
||||
```bash
|
||||
subkey inspect 0xa05c75731970cc7868a2fb7cb577353cd5b31f62dccced92c441acd8fee0c92d
|
||||
pez_subkey inspect 0xa05c75731970cc7868a2fb7cb577353cd5b31f62dccced92c441acd8fee0c92d
|
||||
```
|
||||
|
||||
output:
|
||||
@@ -199,11 +199,11 @@ Secret Key URI `0xa05c75731970cc7868a2fb7cb577353cd5b31f62dccced92c441acd8fee0c9
|
||||
|
||||
### Signing
|
||||
|
||||
`subkey` allows using a **secret key** to sign a random message. The signature can then be verified by anyone using your
|
||||
`pez_subkey` allows using a **secret key** to sign a random message. The signature can then be verified by anyone using your
|
||||
**public key**:
|
||||
|
||||
```bash
|
||||
echo -n <msg> | subkey sign --suri <seed|mnemonic>
|
||||
echo -n <msg> | pez_subkey sign --suri <seed|mnemonic>
|
||||
```
|
||||
|
||||
example:
|
||||
@@ -211,7 +211,7 @@ example:
|
||||
```text
|
||||
MESSAGE=hello
|
||||
SURI=0xa05c75731970cc7868a2fb7cb577353cd5b31f62dccced92c441acd8fee0c92d
|
||||
echo -n $MESSAGE | subkey sign --suri $SURI
|
||||
echo -n $MESSAGE | pez_subkey sign --suri $SURI
|
||||
```
|
||||
|
||||
output:
|
||||
@@ -225,11 +225,11 @@ valid.
|
||||
|
||||
### Verifying a signature
|
||||
|
||||
Given a message, a signature and an address, `subkey` can verify whether the **message** has been digitally signed by
|
||||
Given a message, a signature and an address, `pez_subkey` can verify whether the **message** has been digitally signed by
|
||||
the holder (or one of the holders) of the **private key** for the given **address**:
|
||||
|
||||
```bash
|
||||
echo -n <msg> | subkey verify <sig> <address>
|
||||
echo -n <msg> | pez_subkey verify <sig> <address>
|
||||
```
|
||||
|
||||
example:
|
||||
@@ -238,7 +238,7 @@ example:
|
||||
MESSAGE=hello
|
||||
URI=0xfec70cfbf1977c6965b5af10a4534a6a35d548eb14580594d0bc543286892515
|
||||
SIGNATURE=9201af3788ad4f986b800853c79da47155f2e08fde2070d866be4c27ab060466fea0623dc2b51f4392f4c61f25381a62848dd66c5d8217fae3858e469ebd668c
|
||||
echo -n $MESSAGE | subkey verify $SIGNATURE $URI
|
||||
echo -n $MESSAGE | pez_subkey verify $SIGNATURE $URI
|
||||
```
|
||||
|
||||
output:
|
||||
@@ -261,7 +261,7 @@ warned, depending on your hardware this may take a while.
|
||||
command:
|
||||
|
||||
```bash
|
||||
subkey vanity --network pezkuwi --pattern bob
|
||||
pez_subkey vanity --network pezkuwi --pattern bob
|
||||
```
|
||||
|
||||
output:
|
||||
+1
-1
@@ -5,7 +5,7 @@ security and risks in the [Pezkuwi Wiki](https://wiki.network.pezkuwichain.io/do
|
||||
network has a few **test networks**, e.g. **Zagros**. Test networks are a great way to experiment and learn safely as
|
||||
you can lose tokens on those networks without any financial consequences.
|
||||
|
||||
`subkey` generates and provides 2 pieces of **secret** information:
|
||||
`pez_subkey` generates and provides 2 pieces of **secret** information:
|
||||
- **secret phrase**: a bunch of words, exactly 12 by default (can be 12, 15, 18, 21 or 24)
|
||||
- **secret seed**: a big hexadecimal value
|
||||
|
||||
+33
-33
@@ -22,28 +22,28 @@
|
||||
//! for Bizinikiwi based chains such as Pezkuwi, Kusama and a growing number of teyrchains and
|
||||
//! Bizinikiwi based projects.
|
||||
|
||||
//! `subkey` provides a few sub-commands to generate keys, check keys, sign messages, verify
|
||||
//! `pez_subkey` provides a few sub-commands to generate keys, check keys, sign messages, verify
|
||||
//! messages, etc...
|
||||
//!
|
||||
//! You can see the full list of commands with `subkey --help`. Most commands have additional help
|
||||
//! available with for instance `subkey generate --help` for the `generate` command.
|
||||
//! You can see the full list of commands with `pez_subkey --help`. Most commands have additional help
|
||||
//! available with for instance `pez_subkey generate --help` for the `generate` command.
|
||||
//!
|
||||
//! ## Safety first
|
||||
//!
|
||||
//! `subkey` does not need an internet connection to work. Indeed, for the best security, you should
|
||||
//! be using `subkey` on a machine that is **not connected** to the internet.
|
||||
//! `pez_subkey` does not need an internet connection to work. Indeed, for the best security, you should
|
||||
//! be using `pez_subkey` on a machine that is **not connected** to the internet.
|
||||
//!
|
||||
//! `subkey` deals with **seeds** and **private keys**. Make sure to use `subkey` in a safe
|
||||
//! `pez_subkey` deals with **seeds** and **private keys**. Make sure to use `pez_subkey` in a safe
|
||||
//! environment (ie. no one looking over your shoulder) and on a safe computer (ie. no one able to
|
||||
//! check your command history).
|
||||
//!
|
||||
//! If you save any output of `subkey` into a file, make sure to apply proper permissions and/or
|
||||
//! If you save any output of `pez_subkey` into a file, make sure to apply proper permissions and/or
|
||||
//! delete the file as soon as possible.
|
||||
//!
|
||||
//! ## Usage
|
||||
//!
|
||||
//! The following guide explains *some* of the `subkey` commands. For the full list and the most up
|
||||
//! to date documentation, make sure to check the integrated help with `subkey --help`.
|
||||
//! The following guide explains *some* of the `pez_subkey` commands. For the full list and the most up
|
||||
//! to date documentation, make sure to check the integrated help with `pez_subkey --help`.
|
||||
//!
|
||||
//! ### Install with Cargo
|
||||
//!
|
||||
@@ -53,8 +53,8 @@
|
||||
//! Command:
|
||||
//!
|
||||
//! ```bash
|
||||
//! # Install only `subkey`, at a specific version of the subkey crate
|
||||
//! cargo install --force subkey --git https://github.com/pezkuwichain/kurdistan-sdk --version <SET VERSION> --locked
|
||||
//! # Install only `pez_subkey`, at a specific version of the pez_subkey crate
|
||||
//! cargo install --force pez_subkey --git https://github.com/pezkuwichain/kurdistan-sdk --version <SET VERSION> --locked
|
||||
//! # If you run into issues building, you likely are missing deps defined in https://docs.pezkuwichain.io/install/
|
||||
//! ```
|
||||
//!
|
||||
@@ -62,7 +62,7 @@
|
||||
//!
|
||||
//! ```bash
|
||||
//! # Use `--pull=always` with the `latest` tag, or specify a version in a tag
|
||||
//! docker run -it --pull=always docker.io/parity/subkey:latest <command to subkey>
|
||||
//! docker run -it --pull=always docker.io/parity/pez_subkey:latest <command to pez_subkey>
|
||||
//! ```
|
||||
//!
|
||||
//! ### Generate a random account
|
||||
@@ -70,7 +70,7 @@
|
||||
//! Generating a new key is as simple as running:
|
||||
//!
|
||||
//! ```bash
|
||||
//! subkey generate
|
||||
//! pez_subkey generate
|
||||
//! ```
|
||||
//!
|
||||
//! The output looks similar to:
|
||||
@@ -110,12 +110,12 @@
|
||||
//!
|
||||
//! ### Json output
|
||||
//!
|
||||
//! `subkey` can also generate the output as *json*. This is useful for automation.
|
||||
//! `pez_subkey` can also generate the output as *json*. This is useful for automation.
|
||||
//!
|
||||
//! command:
|
||||
//!
|
||||
//! ```bash
|
||||
//! subkey generate --output-type json
|
||||
//! pez_subkey generate --output-type json
|
||||
//! ```
|
||||
//!
|
||||
//! output:
|
||||
@@ -135,7 +135,7 @@
|
||||
//! command:
|
||||
//!
|
||||
//! ```bash
|
||||
//! subkey generate --output-type json | jq -r .secretSeed
|
||||
//! pez_subkey generate --output-type json | jq -r .secretSeed
|
||||
//! ```
|
||||
//!
|
||||
//! output:
|
||||
@@ -146,11 +146,11 @@
|
||||
//!
|
||||
//! ### Additional user-defined password
|
||||
//!
|
||||
//! `subkey` supports an additional user-defined secret that will be appended to the seed. Let's see
|
||||
//! `pez_subkey` supports an additional user-defined secret that will be appended to the seed. Let's see
|
||||
//! the following example:
|
||||
//!
|
||||
//! ```bash
|
||||
//! subkey generate --password extra_secret
|
||||
//! pez_subkey generate --password extra_secret
|
||||
//! ```
|
||||
//!
|
||||
//! output:
|
||||
@@ -167,7 +167,7 @@
|
||||
//! seed** is no longer sufficient to recover the account:
|
||||
//!
|
||||
//! ```bash
|
||||
//! subkey inspect "soup lyrics media market way crouch elevator put moon useful question wide"
|
||||
//! pez_subkey inspect "soup lyrics media market way crouch elevator put moon useful question wide"
|
||||
//! ```
|
||||
//!
|
||||
//! which recovers the account `5Fe4sqj2K4fRuzEGvToi4KATqZfiDU7TqynjXG6PZE2dxwyh` and not
|
||||
@@ -177,26 +177,26 @@
|
||||
//! below:
|
||||
//!
|
||||
//! ```bash
|
||||
//! subkey inspect --password extra_secret "soup lyrics media market way crouch elevator put moon useful question wide"
|
||||
//! pez_subkey inspect --password extra_secret "soup lyrics media market way crouch elevator put moon useful question wide"
|
||||
//! ```
|
||||
//!
|
||||
//! This time, we properly recovered `5He5pZpc7AJ8evPuab37vJF6KkFDqq9uDq2WXh877Qw6iaVC`.
|
||||
//!
|
||||
//! ### Inspecting a key
|
||||
//!
|
||||
//! If you have *some data* about a key, `subkey inspect` will help you discover more information
|
||||
//! If you have *some data* about a key, `pez_subkey inspect` will help you discover more information
|
||||
//! about it.
|
||||
//!
|
||||
//! If you have **secrets** that you would like to verify for instance, you can use:
|
||||
//!
|
||||
//! ```bash
|
||||
//! subkey inspect < mnemonic | seed >
|
||||
//! pez_subkey inspect < mnemonic | seed >
|
||||
//! ```
|
||||
//!
|
||||
//! If you have only **public data**, you can see a subset of the information:
|
||||
//!
|
||||
//! ```bash
|
||||
//! subkey inspect --public < pubkey | address >
|
||||
//! pez_subkey inspect --public < pubkey | address >
|
||||
//! ```
|
||||
//!
|
||||
//! **NOTE**: While you will be able to recover the secret seed from the mnemonic, the opposite is
|
||||
@@ -208,7 +208,7 @@
|
||||
//! command:
|
||||
//!
|
||||
//! ```bash
|
||||
//! subkey inspect 0xa05c75731970cc7868a2fb7cb577353cd5b31f62dccced92c441acd8fee0c92d
|
||||
//! pez_subkey inspect 0xa05c75731970cc7868a2fb7cb577353cd5b31f62dccced92c441acd8fee0c92d
|
||||
//! ```
|
||||
//!
|
||||
//! output:
|
||||
@@ -223,11 +223,11 @@
|
||||
//!
|
||||
//! ### Signing
|
||||
//!
|
||||
//! `subkey` allows using a **secret key** to sign a random message. The signature can then be
|
||||
//! `pez_subkey` allows using a **secret key** to sign a random message. The signature can then be
|
||||
//! verified by anyone using your **public key**:
|
||||
//!
|
||||
//! ```bash
|
||||
//! echo -n <msg> | subkey sign --suri <seed|mnemonic>
|
||||
//! echo -n <msg> | pez_subkey sign --suri <seed|mnemonic>
|
||||
//! ```
|
||||
//!
|
||||
//! example:
|
||||
@@ -235,7 +235,7 @@
|
||||
//! ```text
|
||||
//! MESSAGE=hello
|
||||
//! SURI=0xa05c75731970cc7868a2fb7cb577353cd5b31f62dccced92c441acd8fee0c92d
|
||||
//! echo -n $MESSAGE | subkey sign --suri $SURI
|
||||
//! echo -n $MESSAGE | pez_subkey sign --suri $SURI
|
||||
//! ```
|
||||
//!
|
||||
//! output:
|
||||
@@ -249,12 +249,12 @@
|
||||
//!
|
||||
//! ### Verifying a signature
|
||||
//!
|
||||
//! Given a message, a signature and an address, `subkey` can verify whether the **message** has
|
||||
//! Given a message, a signature and an address, `pez_subkey` can verify whether the **message** has
|
||||
//! been digitally signed by the holder (or one of the holders) of the **private key** for the given
|
||||
//! **address**:
|
||||
//!
|
||||
//! ```bash
|
||||
//! echo -n <msg> | subkey verify <sig> <address>
|
||||
//! echo -n <msg> | pez_subkey verify <sig> <address>
|
||||
//! ```
|
||||
//!
|
||||
//! example:
|
||||
@@ -263,7 +263,7 @@
|
||||
//! MESSAGE=hello
|
||||
//! URI=0xfec70cfbf1977c6965b5af10a4534a6a35d548eb14580594d0bc543286892515
|
||||
//! SIGNATURE=9201af3788ad4f986b800853c79da47155f2e08fde2070d866be4c27ab060466fea0623dc2b51f4392f4c61f25381a62848dd66c5d8217fae3858e469ebd668c
|
||||
//! echo -n $MESSAGE | subkey verify $SIGNATURE $URI
|
||||
//! echo -n $MESSAGE | pez_subkey verify $SIGNATURE $URI
|
||||
//! ```
|
||||
//!
|
||||
//! output:
|
||||
@@ -286,7 +286,7 @@
|
||||
//! command:
|
||||
//!
|
||||
//! ```bash
|
||||
//! subkey vanity --network pezkuwi --pattern bob
|
||||
//! pez_subkey vanity --network pezkuwi --pattern bob
|
||||
//! ```
|
||||
//!
|
||||
//! output:
|
||||
@@ -316,7 +316,7 @@ use pezsc_cli::{
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(
|
||||
name = "subkey",
|
||||
name = "pez_subkey",
|
||||
author = "Parity Team <admin@parity.io>",
|
||||
about = "Utility for generating and restoring with Bizinikiwi keys",
|
||||
version
|
||||
@@ -345,7 +345,7 @@ pub enum Subkey {
|
||||
Verify(VerifyCmd),
|
||||
}
|
||||
|
||||
/// Run the subkey command, given the appropriate runtime.
|
||||
/// Run the pez_subkey command, given the appropriate runtime.
|
||||
pub fn run() -> Result<(), Error> {
|
||||
match Subkey::parse() {
|
||||
Subkey::GenerateNodeKey(cmd) => cmd.run(),
|
||||
+2
-2
@@ -16,8 +16,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
//! Subkey utility, based on kitchensink_runtime.
|
||||
//! Subkey utility, based on pez_kitchensink_runtime.
|
||||
|
||||
fn main() -> Result<(), pezsc_cli::Error> {
|
||||
subkey::run()
|
||||
pez_subkey::run()
|
||||
}
|
||||
Reference in New Issue
Block a user