-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
278 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
[package] | ||
name = "hash_hunter" | ||
version = "0.1.0" | ||
version = "0.2.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
clap = { version = "4.5.20", features = ["derive"] } | ||
rand = "0.8" | ||
clap = { version = "4.5.21", features = ["derive"] } | ||
rand = "0.8.5" | ||
secp256k1 = { version = "0.30.0", features = ["rand"] } | ||
sha3 = "0.10" | ||
sha3 = "0.10.8" | ||
hex = "0.4.3" | ||
dashmap = "6.1.0" | ||
rayon = "1.10.0" | ||
num_cpus = "1.16.0" | ||
colored = "2.0.0" | ||
indicatif = "0.17.8" | ||
serde_json = "1.0.128" | ||
regex = "1.11.0" | ||
colored = "2.1.0" | ||
indicatif = "0.17.9" | ||
serde_json = "1.0.133" | ||
regex = "1.11.1" | ||
chrono = "0.4.38" | ||
config = "0.14" | ||
serde = { version = "1.0.215", features = ["derive"] } | ||
serde_yaml = "0.9.33" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
steps: | ||
# create buildx instance | ||
- name: "gcr.io/cloud-builders/docker" | ||
args: ["buildx", "create", "--name", "builder", "--use"] | ||
|
||
# build and push the container image for multiple platforms | ||
- name: "gcr.io/cloud-builders/docker" | ||
args: | ||
- "buildx" | ||
- "build" | ||
- "--platform" | ||
- "linux/amd64,linux/arm64" | ||
- "-t" | ||
- "gcr.io/$PROJECT_ID/hash_hunter:latest" | ||
- "--push" | ||
- "." | ||
|
||
images: | ||
- "gcr.io/$PROJECT_ID/hash_hunter:latest" | ||
|
||
timeout: "1800s" | ||
options: | ||
machineType: "E2_HIGHCPU_8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
use serde::Deserialize; | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Config { | ||
pub version: String, | ||
pub app: App, | ||
pub search: Search, | ||
pub performance: Performance, | ||
pub output: Output, | ||
pub docker: Docker, | ||
pub security: Security, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct App { | ||
pub name: String, | ||
pub version: String, | ||
pub description: String, | ||
pub warning: String, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Search { | ||
pub patterns: Patterns, | ||
pub validation: Validation, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Patterns { | ||
pub start: String, | ||
pub end: String, | ||
pub regex: String, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Validation { | ||
pub use_checksum: bool, | ||
pub min_zeros: usize, // Changed from u32 to usize | ||
pub verify_addresses: bool, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Performance { | ||
pub step_size: u64, | ||
pub max_tries: u64, | ||
pub log_interval_ms: u64, | ||
pub threads: String, | ||
pub resources: Resources, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Resources { | ||
pub cpu_limit: f32, | ||
pub memory_limit: String, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Output { | ||
pub directory: String, | ||
pub files: Files, | ||
pub progress_bar: ProgressBar, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Files { | ||
pub log: String, | ||
pub success_marker: String, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct ProgressBar { | ||
pub template: String, | ||
pub chars: String, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Docker { | ||
pub base_image: String, | ||
pub builder_image: String, // Corrected field name from build_image to builder_image | ||
pub platforms: Vec<String>, | ||
pub healthcheck: Healthcheck, | ||
pub volumes: Vec<Volume>, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Healthcheck { | ||
pub interval: String, | ||
pub timeout: String, | ||
pub retries: u32, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Volume { | ||
pub source: String, | ||
pub target: String, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Security { | ||
pub skip_confirmation: bool, | ||
pub entropy: Entropy, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Entropy { | ||
pub guesses_per_second: f64, | ||
pub min_bits: u32, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# configuration | ||
version: "1.0" | ||
|
||
# app settings | ||
app: | ||
name: "hash_hunter" | ||
version: "0.1.0" | ||
description: "Ethereum vanity address generator" | ||
warning: "THIS IS A PROOF OF CONCEPT - DO NOT USE IN PRODUCTION" | ||
|
||
# search params | ||
search: | ||
patterns: | ||
start: "69" | ||
end: "69696969" | ||
regex: "" | ||
validation: | ||
use_checksum: true | ||
min_zeros: 0 | ||
verify_addresses: true | ||
|
||
# performance settings | ||
performance: | ||
step_size: 50000 | ||
max_tries: 10000000000 | ||
log_interval_ms: 15000 | ||
threads: "auto" # uses num_cpus::get() | ||
resources: | ||
cpu_limit: 7.5 | ||
memory_limit: "8G" | ||
|
||
# output settings | ||
output: | ||
directory: "gen" | ||
files: | ||
log: "hunter.log" | ||
success_marker: "SUCCESS" | ||
progress_bar: | ||
template: "{spinner:.green} [{elapsed_precise}] [{wide_bar:.cyan/blue}] {pos}/{len} ({eta})" | ||
chars: "#>-" | ||
|
||
# docker settings | ||
docker: | ||
base_image: "ubuntu:22.04" | ||
builder_image: "rust:1.82" | ||
platforms: | ||
- "linux/amd64" | ||
- "linux/arm64" | ||
healthcheck: | ||
interval: "30s" | ||
timeout: "10s" | ||
retries: 3 | ||
volumes: | ||
- source: "./gen" | ||
target: "/usr/src/app/gen" | ||
|
||
# security settings | ||
security: | ||
skip_confirmation: false | ||
entropy: | ||
guesses_per_second: 1e12 | ||
min_bits: 160 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[supervisord] | ||
nodaemon=true | ||
user=root | ||
|
||
[program:hash_hunter] | ||
command=hash_hunter %(ENV_HASH_HUNTER_ARGS)s | ||
directory=/usr/src/app | ||
autostart=true | ||
autorestart=true | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
stderr_logfile=/dev/stderr | ||
stderr_logfile_maxbytes=0 |