adv-accept: gap tool takes raw hex seeds and a day (--hex epoch:era:label, --day)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
7dfe03d44e
commit
a578aa1402
1 changed files with 14 additions and 1 deletions
|
|
@ -584,10 +584,23 @@ mod gap {
|
|||
|
||||
fn gap_cmd(args: &[String]) {
|
||||
let get = |k: &str, d: &str| -> String { args.windows(2).find(|w| w[0] == k).map(|w| w[1].clone()).unwrap_or_else(|| d.to_string()) };
|
||||
let seeds: Vec<u64> = get("--seeds", "2").split(',').map(|x| x.parse().unwrap()).collect();
|
||||
let seeds: Vec<u64> = if args.windows(2).any(|w| w[0] == "--seeds") { get("--seeds", "2").split(',').map(|x| x.parse().unwrap()).collect() } else { Vec::new() };
|
||||
let day: u64 = get("--day", "20730").parse().unwrap();
|
||||
let threads: usize = get("--threads", "32").parse().unwrap();
|
||||
let zero = args.iter().any(|a| a == "--plant") && get("--plant", "") == "zero-dataset";
|
||||
// `--hex <epoch hex>:<era hex>:<label>` (repeatable): a program named by its raw 32-byte seeds, as a pack or a
|
||||
// sibling lane names it, through the same chain draw (Epoch::chain_program, class v4)
|
||||
for w in args.windows(2) {
|
||||
if w[0] == "--hex" {
|
||||
let parts: Vec<&str> = w[1].split(':').collect();
|
||||
let epoch = unhex(parts[0]).expect("epoch hex");
|
||||
let era = unhex(parts.get(1).copied().unwrap_or(parts[0])).expect("era hex");
|
||||
let label = parts.get(2).copied().unwrap_or("hex-program").to_string();
|
||||
let p = Epoch::chain_program(&epoch, Some(&era), ProgramClass::V4, &label);
|
||||
println!("gap: hex program {label}: epoch {} era {}", hex(&epoch), hex(&era));
|
||||
gap::run(&p, day, threads, zero);
|
||||
}
|
||||
}
|
||||
for k in seeds {
|
||||
let p = if k == 1 {
|
||||
let g = unhex(GENESIS_HEX).unwrap();
|
||||
|
|
|
|||
Loading…
Reference in a new issue