Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions cli/src/commands/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ pub struct Node {

/// Enable block producer with this key file
///
/// MINA_PRIVKEY_PASS must be set to decrypt the keyfile
/// MINA_PRIVKEY_PASS must be set to decrypt the keyfile if it is password-protected
#[arg(long, env, group = "producer")]
pub producer_key: Option<PathBuf>,
#[arg(env = "MINA_PRIVKEY_PASS")]
pub producer_key_password: Option<String>,

/// Password used to decrypt the producer key file.
#[arg(env = "MINA_PRIVKEY_PASS", default_value = "")]
pub producer_key_password: String,

/// Address to send coinbase rewards to (if this node is producing blocks).
/// If not provided, coinbase rewards will be sent to the producer
Expand Down Expand Up @@ -222,13 +224,12 @@ impl Node {
.block_verifier_index(block_verifier_index.clone())
.work_verifier_index(work_verifier_index.clone());

if let (Some(producer_key_path), Some(pasword)) =
(self.producer_key, &self.producer_key_password)
{
if let Some(producer_key_path) = self.producer_key {
let password = &self.producer_key_password;
node::core::info!(node::core::log::system_time(); summary = "loading provers index");
let provers = BlockProver::make(Some(block_verifier_index), Some(work_verifier_index));
node::core::info!(node::core::log::system_time(); summary = "loaded provers index");
node_builder.block_producer_from_file(provers, producer_key_path, pasword)?;
node_builder.block_producer_from_file(provers, producer_key_path, password)?;

if let Some(pub_key) = self.coinbase_receiver {
node_builder
Expand Down
Loading