From e247b69adb0f0158e20df7dec0bf78e6966c417b Mon Sep 17 00:00:00 2001 From: twosatsmaxi <112330467+twosatsmaxi@users.noreply.github.com> Date: Thu, 18 Apr 2024 02:20:56 +0530 Subject: [PATCH] Generate sample batch.yaml in env command (#3530) --- src/subcommand/env.rs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/subcommand/env.rs b/src/subcommand/env.rs index 53f4c1863f..b107f14084 100644 --- a/src/subcommand/env.rs +++ b/src/subcommand/env.rs @@ -1,4 +1,4 @@ -use {super::*, colored::Colorize, std::net::TcpListener}; +use {super::*, crate::wallet::batch, colored::Colorize, std::net::TcpListener}; struct KillOnDrop(process::Child); @@ -64,6 +64,32 @@ rpcport={bitcoind_port} ), )?; + fs::write(absolute.join("inscription.txt"), "FOO")?; + + let yaml = serde_yaml::to_string(&batch::File { + etching: Some(batch::Etching { + divisibility: 0, + rune: "FOO".parse::().unwrap(), + supply: "2000".parse().unwrap(), + premine: "1000".parse().unwrap(), + symbol: 'ยข', + terms: Some(batch::Terms { + amount: "1000".parse().unwrap(), + cap: 1, + ..default() + }), + turbo: false, + }), + inscriptions: vec![batch::Entry { + file: Some("env/inscription.txt".into()), + ..default() + }], + ..default() + }) + .unwrap(); + + fs::write(absolute.join("batch.yaml"), yaml)?; + let _bitcoind = KillOnDrop( Command::new("bitcoind") .arg(format!("-conf={}", absolute.join("bitcoin.conf").display()))