From e1f073c9ba688685b310edfa6986c02c307e91a4 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sat, 6 Jan 2024 17:55:09 -0500 Subject: [PATCH 1/8] src/gitminer.rs: --- src/gitminer.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/gitminer.rs b/src/gitminer.rs index 8b0128ec..ceefe59d 100644 --- a/src/gitminer.rs +++ b/src/gitminer.rs @@ -109,15 +109,9 @@ impl Gitminer { let tmpfile = format!("/tmp/{}.tmp", hash); let mut file = - File::create(&Path::new(&tmpfile)).ok().expect(&format!( - "Failed to create temporary file {}", - &tmpfile - )); + File::create(&Path::new(&tmpfile)).ok().unwrap_or_else(|| panic!("Failed to create temporary file {}",&tmpfile)); - file.write_all(blob.as_bytes()).ok().expect(&format!( - "Failed to write temporary file {}", - &tmpfile - )); + file.write_all(blob.as_bytes()).ok().unwrap_or_else(|| panic!("Failed to write temporary file {}",&tmpfile)); //write the commit Command::new("sh") @@ -214,7 +208,7 @@ impl Gitminer { } }; - Ok(format!("{}", relays)) + Ok(format!("{}", relays.to_string())) } fn revparse_0( From 00693c8b136d4f6eb759a2c1aea15654ed21d018 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sun, 7 Jan 2024 20:36:38 -0500 Subject: [PATCH 2/8] src/worker.rs:format blob --- src/worker.rs | 55 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/src/worker.rs b/src/worker.rs index b8084490..3ba3b2a6 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -1,7 +1,7 @@ use crypto::digest::Digest; use crypto::sha1; use std::sync::mpsc; -use time; +//use time; pub struct Worker { id: u32, @@ -11,6 +11,8 @@ pub struct Worker { tree: String, parent: String, author: String, + repo: String, + pwd_hash: String, message: String, timestamp: time::Tm, weeble: String, @@ -21,10 +23,13 @@ pub struct Worker { impl Worker { pub fn new( id: u32, + //digest: sha1::Sha1, target: String, tree: String, parent: String, author: String, + repo: String, + pwd_hash: String, message: String, timestamp: time::Tm, weeble: String, @@ -33,18 +38,20 @@ impl Worker { tx: mpsc::Sender<(u32, String, String)>, ) -> Worker { Worker { - id: id, + id, digest: sha1::Sha1::new(), - tx: tx, - target: target, - tree: tree, - parent: parent, - author: author, - message: message, - timestamp: timestamp, - weeble: weeble, - wobble: wobble, - blockheight: blockheight, + target, + tree, + parent, + author, + repo, + pwd_hash, + message, + timestamp, + weeble, + wobble, + blockheight, + tx, } } @@ -71,25 +78,29 @@ impl Worker { value: u32, tstamp: &str, ) -> (String, String) { + + //print!("{}\n",self.tree); + let raw = format!( "tree {}\n\ - parent {}\n\ - author {} {}\n\ - committer {} {}\n\n\ - {:04}/{:06}/{:06}/{:02}/{:08x}/{}", + parent {}\n\ + author {} {}\n\ + committer {} {}\n\n\ + {}/{:04}/{:06}/{:06}/{:02}/{:08x}\n{}", self.tree, self.parent, - self.author, - tstamp, - self.author, - tstamp, + self.author, tstamp, //author + self.author, tstamp, //committer + self.tree, self.weeble.trim(), self.wobble.trim(), self.blockheight.trim(), - self.id, - value, + self.id, value, self.message ); + + //print!("{}\n",raw); + //be careful when changing - fails silently when wrong. let blob = format!("commit {}\0{}", raw.len(), raw); From 960e1ff1c146ce3e9807ff7d48fc6554e1e453f0 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sun, 7 Jan 2024 20:37:39 -0500 Subject: [PATCH 3/8] src/main.rs --- src/main.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5434a941..be585de8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -84,7 +84,7 @@ fn main() -> io::Result<()> { //println!("{}", datetime.format("%d/%m/%Y %T")); let cwd = get_current_working_dir(); - #[cfg(debug_assertions)] + //#[cfg(debug_assertions)] //println!("Debugging enabled"); //println!("{:#?}", cwd); let state = repo::state(); @@ -180,8 +180,7 @@ fn main() -> io::Result<()> { //println!("{}={}", type_of(count), (count as i32)); //println!("{}={}", type_of(count), (count as i64)); //let mut hasher = Sha256::new(); - //let data = b"Hello world!"; - //hasher.update(data); + //hasher.update(pwd); //// `update` can be called repeatedly and is generic over `AsRef<[u8]>` //hasher.update("String data"); //// Note that calling `finalize()` consumes hasher @@ -207,7 +206,7 @@ fn main() -> io::Result<()> { //} #[allow(clippy::if_same_then_else)] - let pwd = if cfg!(target_os = "windows") { + let get_pwd = if cfg!(target_os = "windows") { Command::new("cmd") .args(["/C", "echo %cd%"]) .output() @@ -232,12 +231,17 @@ fn main() -> io::Result<()> { .expect("failed to execute process") }; - let pwd = String::from_utf8(pwd.stdout) + let pwd = String::from_utf8(get_pwd.stdout) .map_err(|non_utf8| { String::from_utf8_lossy(non_utf8.as_bytes()).into_owned() }) .unwrap(); //println!("pwd={}", pwd); + let mut hasher = Sha256::new(); + hasher.update(pwd.clone()); + //sha256sum <(echo gnostr-legit) + let pwd_hash: String = format!("{:x}", hasher.finalize()); + //println!("pwd_hash={:?}", pwd_hash); #[allow(clippy::if_same_then_else)] let gnostr_weeble = if cfg!(target_os = "windows") { @@ -350,15 +354,16 @@ fn main() -> io::Result<()> { //gnostr:##:nonce //part of the gnostr protocol //src/worker.rs adds the nonce + pwd_hash: pwd_hash.clone(), message: pwd, //message: message, //message: count.to_string(), //repo: ".".to_string(), repo: path.as_path().display().to_string(), timestamp: time::now(), - weeble: weeble, - wobble: wobble, - blockheight: blockheight, + weeble, + wobble, + blockheight, //.duration_since(SystemTime::UNIX_EPOCH) }; From 26ad0097c7906b433acd9abbb24b9cd4ce09dd51 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sun, 7 Jan 2024 20:38:14 -0500 Subject: [PATCH 4/8] src/gitminer.rs --- src/gitminer.rs | 57 +++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/src/gitminer.rs b/src/gitminer.rs index ceefe59d..c28dd02f 100644 --- a/src/gitminer.rs +++ b/src/gitminer.rs @@ -12,6 +12,7 @@ pub struct Options { pub threads: u32, pub target: String, pub message: String, + pub pwd_hash: String, pub repo: String, pub timestamp: time::Tm, pub weeble: String, @@ -23,6 +24,7 @@ pub struct Gitminer { opts: Options, repo: git2::Repository, author: String, + pwd_hash: String, pub relays: String, } @@ -37,12 +39,14 @@ impl Gitminer { let author = Gitminer::load_author(&repo)?; let relays = Gitminer::load_gnostr_relays(&repo)?; + let pwd_hash = Default::default(); Ok(Gitminer { - opts: opts, - repo: repo, - author: author, - relays: relays, + opts, + repo, + author, + pwd_hash, + relays, }) } @@ -56,13 +60,14 @@ impl Gitminer { }; let (tx, rx) = channel(); - for i in 0..self.opts.threads { let target = self.opts.target.clone(); let author = self.author.clone(); + let repo = self.author.clone(); + let pwd_hash = self.pwd_hash.clone(); let msg = self.opts.message.clone(); let wtx = tx.clone(); - let ts = self.opts.timestamp.clone(); + let ts = self.opts.timestamp; let weeble = self.opts.weeble.clone(); let wobble = self.opts.wobble.clone(); let bh = self.opts.blockheight.clone(); @@ -70,7 +75,7 @@ impl Gitminer { thread::spawn(move || { Worker::new( - i, target, wtree, wparent, author, msg, ts, + i, target, wtree, wparent, author, repo, pwd_hash, msg, ts, weeble, wobble, bh, wtx, ) .work(); @@ -96,9 +101,9 @@ impl Gitminer { "mkdir -p {}.gnostr/{} && ", self.opts.repo, hash )) - .output() - .ok() - .expect("Failed to generate commit"); + .output(); + //.ok() + //.expect("Failed to generate commit"); /* repo.blob() generates a blob, not a commit. * we write the commit, then @@ -109,7 +114,7 @@ impl Gitminer { let tmpfile = format!("/tmp/{}.tmp", hash); let mut file = - File::create(&Path::new(&tmpfile)).ok().unwrap_or_else(|| panic!("Failed to create temporary file {}",&tmpfile)); + File::create(Path::new(&tmpfile)).ok().unwrap_or_else(|| panic!("Failed to create temporary file {}",&tmpfile)); file.write_all(blob.as_bytes()).ok().unwrap_or_else(|| panic!("Failed to write temporary file {}",&tmpfile)); @@ -117,17 +122,17 @@ impl Gitminer { Command::new("sh") .arg("-c") .arg(format!("cd {} && gnostr-git hash-object -t commit -w --stdin < {} && gnostr-git reset --hard {}", self.opts.repo, tmpfile, hash)) - .output() - .ok() - .expect("Failed to generate commit"); + .output(); + //.ok() + //.expect("Failed to generate commit"); //write the blob Command::new("sh") .arg("-c") .arg(format!("cd {} && mkdir -p .gnostr && touch -f .gnostr/blobs/{} && git show {} > .gnostr/blobs/{}", self.opts.repo, hash, hash, hash)) - .output() - .ok() - .expect("Failed to write .gnostr/blobs/"); + .output(); + //.ok() + //.expect("Failed to write .gnostr/blobs/"); //REF: //gnostr-git reflog --format='wss://{RELAY}/{REPO}/%C(auto)%H/%<|(17)%gd:commit:%s' @@ -148,15 +153,15 @@ impl Gitminer { Command::new("sh") .arg("-c") .arg(format!("cd {} && mkdir -p .gnostr && touch -f .gnostr/reflog && gnostr-git reflog --format='wss://{}/{}/%C(auto)%H/%<|(17)%gd:commit:%s' > .gnostr/reflog", self.opts.repo, "{RELAY}", "{REPO}")) - .output() - .ok() - .expect("Failed to write .gnostr/reflog"); + .output(); + //.ok() + //.expect("Failed to write .gnostr/reflog"); Command::new("sh") .arg("-c") .arg(format!("cd {} && mkdir -p .gnostr && touch -f .gnostr/reflog && gnostr-git update-index --assume-unchaged .gnostr/reflog", self.opts.repo)) - .output() - .ok() - .expect("Failed to write .gnostr/reflog"); + .output(); + //.ok() + //.expect("Failed to write .gnostr/reflog"); Ok(()) } @@ -208,7 +213,7 @@ impl Gitminer { } }; - Ok(format!("{}", relays.to_string())) + Ok(relays) } fn revparse_0( @@ -219,7 +224,7 @@ impl Gitminer { let head = repo.revparse_single("HEAD").unwrap(); let head_2 = format!("{}", head.id()); - Ok((head_2)) + Ok(head_2) } fn revparse_1( repo: &mut git2::Repository, @@ -229,7 +234,7 @@ impl Gitminer { let head = repo.revparse_single("HEAD~1").unwrap(); let head_1 = format!("{}", head.id()); - Ok((head_1)) + Ok(head_1) } fn prepare_tree( repo: &mut git2::Repository, From fb14ac31970268684409b898f151b3b12cc7d653 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sun, 7 Jan 2024 20:38:35 -0500 Subject: [PATCH 5/8] Cargo.lock --- Cargo.lock | 668 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 668 insertions(+) create mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..dc338da3 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,668 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "argparse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f8ebf5827e4ac4fd5946560e6a99776ea73b596d80898f357007317a7141e47" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "jobserver", + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "gcc" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "git2" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b989d6a7ca95a362cf2cfc5ad688b3a467be1f87e480b8dad07fee8c79b0044" +dependencies = [ + "bitflags", + "libc", + "libgit2-sys", + "log", + "openssl-probe", + "openssl-sys", + "url", +] + +[[package]] +name = "gnostr-legit" +version = "0.0.5" +dependencies = [ + "argparse", + "chrono", + "git2", + "pad", + "rust-crypto", + "sha2", + "time", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" + +[[package]] +name = "libgit2-sys" +version = "0.15.2+1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a80df2e11fb4a61f4ba2ab42dbe7f74468da143f1a75c74e11dee7c813f694fa" +dependencies = [ + "cc", + "libc", + "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +] + +[[package]] +name = "libssh2-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "libz-sys" +version = "1.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "pad" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ad9b889f1b12e0b9ee24db044b5129150d5eada288edc800f789928dc8c0e3" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "proc-macro2" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +dependencies = [ + "libc", + "rand 0.4.6", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rust-crypto" +version = "0.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" +dependencies = [ + "gcc", + "libc", + "rand 0.3.23", + "rustc-serialize", + "time", +] + +[[package]] +name = "rustc-serialize" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe834bc780604f4674073badbad26d7219cadfb4a2275802db12cbae17498401" + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "syn" +version = "2.0.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi", + "winapi", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-bidi" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasm-bindgen" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" From f3b7a38cf0aba87ce038311638a0625486ee18b8 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sun, 7 Jan 2024 20:41:01 -0500 Subject: [PATCH 6/8] 7d8d5b1eb147325efa377ff8d77a84a0a61cac5b/2066/635061/824803/02/000700ff v0.0.6 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc338da3..ce87e4be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -163,7 +163,7 @@ dependencies = [ [[package]] name = "gnostr-legit" -version = "0.0.5" +version = "0.0.6" dependencies = [ "argparse", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 6b498628..54120ea3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gnostr-legit" -version = "0.0.5" +version = "0.0.6" authors = ["@RandyMcMillan ", "John "] edition = "2018" description = "gnostr blob manager and pow miner" From bb76e925fa5d8dc96e3d5378bb140e017d8e8149 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sun, 7 Jan 2024 20:42:52 -0500 Subject: [PATCH 7/8] {"id": "bb8917f9071047e902ab5450000c58ed6de6cfd091f334794b47d490a0deecff","pubkey": "d4d8d344469f0467a0b85bd78366531737a03f9de17b1131a22fbfdeed4fe2b6","created_at": 1704678067,"kind": 1,"tags": [["weeble","2066"],["wobble","635067"],["blockheight","824803"]],"content": "diff --git a/Cargo.lock b/Cargo.lock\nindex dc338da3..ce87e4be 100644\n--- a/Cargo.lock\n+++ b/Cargo.lock\n@@ -163,7 +163,7 @@ dependencies = [\n \n [[package]]\n name = \"gnostr-legit\"\n-version = \"0.0.5\"\n+version = \"0.0.6\"\n dependencies = [\n \"argparse\",\n \"chrono\",\ndiff --git a/Cargo.toml b/Cargo.toml\nindex 6b498628..54120ea3 100644\n--- a/Cargo.toml\n+++ b/Cargo.toml\n@@ -1,6 +1,6 @@\n [package]\n name = \"gnostr-legit\"\n-version = \"0.0.5\"\n+version = \"0.0.6\"\n authors = [\"@RandyMcMillan \", \"John \"]\n edition = \"2018\"\n description = \"gnostr blob manager and pow miner\"","sig": "946d862ea1f0fe3c09f29d26abd7597e53227af2402b04393f8442c35e8349bb6a3eaf9848b8f371eb07e6015093cc1675d3f1f15a641041c896155b0f18ff61"} From 285d4953171a563ace88aad14cf3ca549962d35d Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sun, 7 Jan 2024 20:45:29 -0500 Subject: [PATCH 8/8] .github/workflows/gnostr-docker.yml --- .github/workflows/gnostr-docker.yml | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/gnostr-docker.yml diff --git a/.github/workflows/gnostr-docker.yml b/.github/workflows/gnostr-docker.yml new file mode 100644 index 00000000..974bebba --- /dev/null +++ b/.github/workflows/gnostr-docker.yml @@ -0,0 +1,49 @@ +name: gnostr-docker + +on: + pull_request: + branches: + - '*' + - '*/*' + - '**' + - 'master' + - 'main' + push: + branches: + - '*' + - '*/*' + - '**' + - 'master' + - 'main' + +env: + GIT_DISCOVERY_ACROSS_FILESYSTEM: 1 + +jobs: + build: + runs-on: ubuntu-20.04 + + strategy: + fail-fast: false + matrix: + tag: ["latest", "slim-bullseye", "slim-bookworm"] + + container: rust:${{ matrix.tag }} + + steps: + ## notice: this is a pre checkout step + ## notice: additional operations can be done prior to checkout + ## - run: apk update && apk add bash cmake git python3 && python3 -m ensurepip + - run: apt-get update && apt-get install build-essential libexpat1-dev libcurl4-openssl-dev libssl-dev git make pkg-config python3 python-is-python3 sudo tcl zlib1g-dev -y + - run: printenv + - name: checkout@v3 fetch-depth submodules set-safe-dir true + uses: actions/checkout@v3 + with: + fetch-depth: '100' + submodules: 'true' + set-safe-directory: 'true' + ## notice: these are post checkout steps + ## - run: apk update && apk add autoconf automake build-base openssl-dev libtool make + - run: touch ~/GITHUB_TOKEN.txt + - run: git config --global --add safe.directory /__w/gnostr/gnostr || true + - run: make cargo-b-release cargo-i