mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 05:47:58 +00:00
Support custom genesis block (#12291)
* Set genesis block data using the built genesis block * Make resolve_state_version_from_wasm a separate function and some small refactorings Useful for the commit following. * Introduce trait BuildGenesisBlock Substrate users can use this trait to implement their custom genesis block when constructing the client. * Make call_executor test compile * cargo +nightly fmt --all * Fix test * Remove unnecessary clone * FMT * Apply review suggestions * Revert changes to new_full_client() and new_full_parts() signature * Remove needless `Block` type in `resolve_state_version_from_wasm`
This commit is contained in:
@@ -34,6 +34,7 @@ pub use sc_network_common::{
|
||||
|
||||
use prometheus_endpoint::Registry;
|
||||
use sc_chain_spec::ChainSpec;
|
||||
use sc_network::config::SyncMode;
|
||||
pub use sc_telemetry::TelemetryEndpoints;
|
||||
pub use sc_transaction_pool::Options as TransactionPoolOptions;
|
||||
use sp_core::crypto::SecretString;
|
||||
@@ -238,6 +239,22 @@ impl Configuration {
|
||||
};
|
||||
ProtocolId::from(protocol_id_full)
|
||||
}
|
||||
|
||||
/// Returns true if the genesis state writting will be skipped while initializing the genesis
|
||||
/// block.
|
||||
pub fn no_genesis(&self) -> bool {
|
||||
matches!(self.network.sync_mode, SyncMode::Fast { .. } | SyncMode::Warp { .. })
|
||||
}
|
||||
|
||||
/// Returns the database config for creating the backend.
|
||||
pub fn db_config(&self) -> sc_client_db::DatabaseSettings {
|
||||
sc_client_db::DatabaseSettings {
|
||||
trie_cache_maximum_size: self.trie_cache_maximum_size,
|
||||
state_pruning: self.state_pruning.clone(),
|
||||
source: self.database.clone(),
|
||||
blocks_pruning: self.blocks_pruning,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Available RPC methods.
|
||||
|
||||
Reference in New Issue
Block a user