-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dockerize node in preparation for release #12
Conversation
fbielejec
commented
Jun 13, 2023
•
edited
Loading
edited
- dockerized node
- custom chainspec to cli for it
- chain can be run with explicit opt-in instant-seal argument
- basic e2e setup for CI
b0658fc
to
362de9a
Compare
9c3889b
to
89f9def
Compare
…lty-adjustment Install proper difficulty adjustment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've taken a quick look at this and it looks good. @notlesh could please also take a look?
#[derive(Debug, clap::Parser)] | ||
pub struct BuildSpecCmd { | ||
#[clap(flatten)] | ||
pub base: sc_cli::BuildSpecCmd, | ||
|
||
/// Chain name. | ||
#[arg(long, default_value = "Academy PoW")] | ||
pub chain_name: String, | ||
|
||
/// Chain ID is a short identifier of the chain | ||
#[arg(long, value_name = "ID", default_value = "academy_pow")] | ||
pub chain_id: String, | ||
|
||
/// AccountIds of the optional rich accounts | ||
#[arg(long, value_delimiter = ',', value_parser = parse_account_id, num_args=1..)] | ||
pub endowed_accounts: Option<Vec<AccountId>>, | ||
|
||
/// The type of the chain. Possible values: "dev", "local", "live" (default) | ||
#[arg(long, value_name = "TYPE", value_parser = parse_chaintype, default_value = "live")] | ||
pub chain_type: ChainType, | ||
|
||
#[arg(long, default_value = "4_000_000")] | ||
pub initial_difficulty: u32, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool idea! I never thought of this.
node/src/command.rs
Outdated
@@ -151,7 +174,12 @@ pub fn run() -> sc_cli::Result<()> { | |||
.run | |||
.sr25519_public_key | |||
.unwrap_or_else(|| sp_core::sr25519::Public::from_raw([0; 32])); | |||
let instant_seal = cli.run.base.is_dev()?; | |||
|
|||
let instant_seal = cli.run.base.is_dev()? || cli.run.instant_seal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you've added a proper flag, we might wat to remove the original --dev
check. OTOH, I guess most people using dev would prefer instant seal. So actually, I have no opinion on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just wanted to stay backwards compatible - but same here, not a fan of implicit settings - so removing it.
/// Generate AccountId based on string command line argument. | ||
fn parse_account_id(s: &str) -> Result<AccountId, String> { | ||
Ok(AccountId::from_string(s).expect("Passed string is not a hex encoding of a public key")) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a function for this immediately below. If this new one is better please remove the old one. See also #6 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#6 can of course be a follow up, just wanted you to know about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to take #6 but I'd rather not overload this large PR any more
|
||
/// AccountIds of the optional rich accounts | ||
#[arg(long, value_delimiter = ',', value_parser = parse_account_id, num_args=1..)] | ||
pub endowed_accounts: Option<Vec<AccountId>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not make this a mapping of account_id -> balance?
LGTM, but I'm not much of a Docker expert :) |