Skip to content
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

fix: remove --reward-cycle from stacks-signer run #4542

Merged
merged 1 commit into from Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 13 additions & 5 deletions stacks-signer/src/cli.rs
Expand Up @@ -55,7 +55,7 @@ pub enum Command {
/// Run a DKG round through the stacker-db instance
Dkg(RunDkgArgs),
/// Run the signer, waiting for events from the stacker-db instance
Run(RunDkgArgs),
Run(RunSignerArgs),
/// Generate necessary files for running a collection of signers
GenerateFiles(GenerateFilesArgs),
/// Generate a signature for Stacking transactions
Expand Down Expand Up @@ -124,7 +124,7 @@ pub struct PutChunkArgs {
/// Arguments for the dkg-sign and sign command
pub struct SignArgs {
/// Path to config file
#[arg(long, value_name = "FILE")]
#[arg(long, short, value_name = "FILE")]
pub config: PathBuf,
/// The reward cycle the signer is registered for and wants to sign for
/// Note: this must be the current reward cycle of the node
Expand All @@ -138,16 +138,24 @@ pub struct SignArgs {
}

#[derive(Parser, Debug, Clone)]
/// Arguments for the Run and Dkg commands
/// Arguments for the Dkg command
pub struct RunDkgArgs {
/// Path to config file
#[arg(long, value_name = "FILE")]
#[arg(long, short, value_name = "FILE")]
pub config: PathBuf,
/// The reward cycle the signer is registered for and wants to peform DKG for
#[arg(long, short)]
pub reward_cycle: u64,
}

#[derive(Parser, Debug, Clone)]
/// Arguments for the Run command
pub struct RunSignerArgs {
/// Path to config file
#[arg(long, short, value_name = "FILE")]
pub config: PathBuf,
}

#[derive(Parser, Debug, Clone)]
/// Arguments for the generate-files command
pub struct GenerateFilesArgs {
hstove marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -230,7 +238,7 @@ pub struct GenerateStackingSignatureArgs {
#[arg(short, long)]
pub reward_cycle: u64,
/// Path to config file
#[arg(long, value_name = "FILE")]
#[arg(long, short, value_name = "FILE")]
pub config: PathBuf,
/// Topic for signature
#[arg(long)]
Expand Down
4 changes: 2 additions & 2 deletions stacks-signer/src/main.rs
Expand Up @@ -46,7 +46,7 @@ use stacks_common::util::secp256k1::{MessageSignature, Secp256k1PublicKey};
use stacks_common::{debug, error};
use stacks_signer::cli::{
Cli, Command, GenerateFilesArgs, GenerateStackingSignatureArgs, GetChunkArgs,
GetLatestChunkArgs, PutChunkArgs, RunDkgArgs, SignArgs, StackerDBArgs,
GetLatestChunkArgs, PutChunkArgs, RunDkgArgs, RunSignerArgs, SignArgs, StackerDBArgs,
};
use stacks_signer::config::{build_signer_config_tomls, GlobalConfig};
use stacks_signer::runloop::{RunLoop, RunLoopCommand};
Expand Down Expand Up @@ -252,7 +252,7 @@ fn handle_dkg_sign(args: SignArgs) {
spawned_signer.running_signer.stop();
}

fn handle_run(args: RunDkgArgs) {
fn handle_run(args: RunSignerArgs) {
debug!("Running signer...");
let spawned_signer = spawn_running_signer(&args.config);
println!("Signer spawned successfully. Waiting for messages to process...");
Expand Down