minerd: moved from script/research into bin

This commit is contained in:
skoupidi
2024-02-13 13:23:02 +02:00
parent 38a83c8b40
commit 34b750dc5e
11 changed files with 74 additions and 14 deletions

7
.gitignore vendored
View File

@@ -11,8 +11,11 @@ witness.json
/bin/zkas/zkas
/zkas
/bin/darkfid2/darkfid2
/darkfid2
/bin/darkfid/darkfid
/darkfid
/bin/minerd/minerd
/minerd
/bin/darkfi-mmproxy/darkfi-mmproxy
/darkfi-mmproxy

21
Cargo.lock generated
View File

@@ -4195,6 +4195,27 @@ dependencies = [
"unicase",
]
[[package]]
name = "minerd"
version = "0.4.1"
dependencies = [
"darkfi",
"darkfi-sdk",
"darkfi-serial",
"easy-parallel",
"log",
"num-bigint",
"serde",
"signal-hook",
"signal-hook-async-std",
"simplelog",
"smol",
"structopt",
"structopt-toml",
"tinyjson",
"url",
]
[[package]]
name = "minimal-lexical"
version = "0.2.1"

View File

@@ -21,6 +21,7 @@ doctest = false
members = [
"bin/zkas",
"bin/darkfid",
"bin/minerd",
"bin/darkfi-mmproxy",
"bin/drk",
#"bin/fud/fu",

View File

@@ -19,6 +19,7 @@ PROOFS_BIN = $(PROOFS_SRC:=.bin)
BINS = \
zkas \
darkfid \
minerd \
darkfi-mmproxy \
darkirc \
genev \
@@ -52,6 +53,13 @@ darkfid: contracts
RUST_TARGET="$(RUST_TARGET)" \
RUSTFLAGS="$(RUSTFLAGS)"
minerd:
$(MAKE) -C bin/$@ \
PREFIX="$(PREFIX)" \
CARGO="$(CARGO)" \
RUST_TARGET="$(RUST_TARGET)" \
RUSTFLAGS="$(RUSTFLAGS)"
darkfi-mmproxy:
$(MAKE) -C bin/$@ \
PREFIX="$(PREFIX)" \
@@ -150,6 +158,7 @@ clean:
$(MAKE) -C src/contract/deployooor clean
$(MAKE) -C bin/zkas clean
$(MAKE) -C bin/darkfid clean
$(MAKE) -C bin/minerd clean
$(MAKE) -C bin/darkfi-mmproxy clean
$(MAKE) -C bin/darkirc clean
$(MAKE) -C bin/genev/genev-cli clean

View File

@@ -8,13 +8,11 @@ repository = "https://github.com/darkrenaissance/darkfi"
license = "AGPL-3.0-only"
edition = "2021"
[workspace]
[dependencies]
# Darkfi
darkfi = {path = "../../../", features = ["async-daemonize", "validator"]}
darkfi-sdk = {path = "../../../src/sdk"}
darkfi-serial = {path = "../../../src/serial", features = ["async"]}
darkfi = {path = "../../", features = ["async-daemonize", "validator"]}
darkfi-sdk = {path = "../../src/sdk"}
darkfi-serial = {path = "../../src/serial", features = ["async"]}
# Misc
log = "0.4.20"
@@ -35,7 +33,3 @@ smol = "1.3.0"
serde = {version = "1.0.195", features = ["derive"]}
structopt = "0.3.26"
structopt-toml = "0.5.1"
[patch.crates-io]
halo2_proofs = {git="https://github.com/parazyd/halo2", branch="v4"}
halo2_gadgets = {git="https://github.com/parazyd/halo2", branch="v4"}

35
bin/minerd/Makefile Normal file
View File

@@ -0,0 +1,35 @@
.POSIX:
# Install prefix
PREFIX = $(HOME)/.cargo
# Cargo binary
CARGO = cargo +nightly
# Compile target
RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
# Uncomment when doing musl static builds
#RUSTFLAGS = -C target-feature=+crt-static -C link-self-contained=yes
BIN = $(shell grep '^name = ' Cargo.toml | cut -d' ' -f3 | tr -d '"')
all: $(BIN)
$(BIN):
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package $@
cp -f ../../target/$(RUST_TARGET)/release/$@ $@
cp -f ../../target/$(RUST_TARGET)/release/$@ ../../$@
clean:
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clean --target=$(RUST_TARGET) --release --package $(BIN)
rm -f $(BIN) ../../$(BIN)
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
.PHONY: all clean install uninstall

View File

@@ -1,3 +0,0 @@
/target
Cargo.lock
rustfmt.toml