|
@@ -24,8 +24,7 @@ use rand::{distributions::Alphanumeric, rngs::OsRng, Rng};
|
|
|
use structopt::StructOpt;
|
|
|
|
|
|
use joystream_node::chain_spec::{
|
|
|
- self, chain_spec_properties, content_config, forum_config, initial_balances, initial_members,
|
|
|
- AccountId,
|
|
|
+ self, chain_spec_properties, forum_config, initial_balances, initial_members, AccountId,
|
|
|
};
|
|
|
|
|
|
use sc_chain_spec::ChainType;
|
|
@@ -85,9 +84,6 @@ enum ChainSpecBuilder {
|
|
|
/// The path to an initial forum data
|
|
|
#[structopt(long, short)]
|
|
|
initial_forum_path: Option<PathBuf>,
|
|
|
- /// The path to an initial content directory data file
|
|
|
- #[structopt(long, short)]
|
|
|
- initial_content_path: Option<PathBuf>,
|
|
|
/// The path to an initial balances file
|
|
|
#[structopt(long, short)]
|
|
|
initial_balances_path: Option<PathBuf>,
|
|
@@ -120,9 +116,6 @@ enum ChainSpecBuilder {
|
|
|
/// The path to an initial forum data
|
|
|
#[structopt(long, short)]
|
|
|
initial_forum_path: Option<PathBuf>,
|
|
|
- /// The path to an initial content directory data file
|
|
|
- #[structopt(long, short)]
|
|
|
- initial_content_path: Option<PathBuf>,
|
|
|
/// The path to an initial balances file
|
|
|
#[structopt(long, short)]
|
|
|
initial_balances_path: Option<PathBuf>,
|
|
@@ -171,20 +164,6 @@ impl ChainSpecBuilder {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /// Returns the path to load initial platform content from
|
|
|
- fn initial_content_path(&self) -> &Option<PathBuf> {
|
|
|
- match self {
|
|
|
- ChainSpecBuilder::New {
|
|
|
- initial_content_path,
|
|
|
- ..
|
|
|
- } => initial_content_path,
|
|
|
- ChainSpecBuilder::Generate {
|
|
|
- initial_content_path,
|
|
|
- ..
|
|
|
- } => initial_content_path,
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/// Returns the path to load initial platform content from
|
|
|
fn initial_balances_path(&self) -> &Option<PathBuf> {
|
|
|
match self {
|
|
@@ -222,7 +201,6 @@ fn genesis_constructor(
|
|
|
sudo_account: &AccountId,
|
|
|
initial_members_path: &Option<PathBuf>,
|
|
|
initial_forum_path: &Option<PathBuf>,
|
|
|
- initial_content_path: &Option<PathBuf>,
|
|
|
initial_balances_path: &Option<PathBuf>,
|
|
|
) -> chain_spec::GenesisConfig {
|
|
|
let authorities = authority_seeds
|
|
@@ -241,14 +219,6 @@ fn genesis_constructor(
|
|
|
.map(|path| forum_config::from_json(sudo_account.clone(), path.as_path()))
|
|
|
.unwrap_or_else(|| forum_config::empty(sudo_account.clone()));
|
|
|
|
|
|
- let (data_directory_config,) = if let Some(path) = initial_content_path {
|
|
|
- let path = path.as_path();
|
|
|
-
|
|
|
- (content_config::data_directory_config_from_json(path),)
|
|
|
- } else {
|
|
|
- (content_config::empty_data_directory_config(),)
|
|
|
- };
|
|
|
-
|
|
|
let initial_account_balances = initial_balances_path
|
|
|
.as_ref()
|
|
|
.map(|path| initial_balances::from_json(path.as_path()))
|
|
@@ -260,7 +230,6 @@ fn genesis_constructor(
|
|
|
endowed_accounts.to_vec(),
|
|
|
members,
|
|
|
forum_cfg,
|
|
|
- data_directory_config,
|
|
|
initial_account_balances,
|
|
|
)
|
|
|
}
|
|
@@ -275,7 +244,6 @@ fn generate_chain_spec(
|
|
|
sudo_account: String,
|
|
|
initial_members_path: Option<PathBuf>,
|
|
|
initial_forum_path: Option<PathBuf>,
|
|
|
- initial_content_path: Option<PathBuf>,
|
|
|
initial_balances_path: Option<PathBuf>,
|
|
|
) -> Result<String, String> {
|
|
|
let parse_account = |address: &String| {
|
|
@@ -309,7 +277,6 @@ fn generate_chain_spec(
|
|
|
&sudo_account,
|
|
|
&initial_members_path,
|
|
|
&initial_forum_path,
|
|
|
- &initial_content_path,
|
|
|
&initial_balances_path,
|
|
|
)
|
|
|
},
|
|
@@ -390,7 +357,6 @@ fn main() -> Result<(), String> {
|
|
|
let chain_spec_path = builder.chain_spec_path().to_path_buf();
|
|
|
let initial_members_path = builder.initial_members_path().clone();
|
|
|
let initial_forum_path = builder.initial_forum_path().clone();
|
|
|
- let initial_content_path = builder.initial_content_path().clone();
|
|
|
let initial_balances_path = builder.initial_balances_path().clone();
|
|
|
let deployment = builder.chain_deployment();
|
|
|
|
|
@@ -442,7 +408,6 @@ fn main() -> Result<(), String> {
|
|
|
sudo_account,
|
|
|
initial_members_path,
|
|
|
initial_forum_path,
|
|
|
- initial_content_path,
|
|
|
initial_balances_path,
|
|
|
)?;
|
|
|
|