Full Makefile project cleanup

This commit is contained in:
parazyd
2023-11-21 15:57:45 +01:00
parent 14b4c96105
commit 673b0ec6b1
25 changed files with 347 additions and 360 deletions

72
.gitignore vendored
View File

@@ -1,50 +1,36 @@
/target
*.pyc
*.pickle
*.sage.py
*.wasm
*.zk.bin
*_circuit_layout.png
.vscode/
.idea/
.cargo/
.DS_Store
.#*
*.profraw
*_original
python-venv
/vendor/*
/target/*
/tmp/*
/cashierd
/dao
/daod
/dhtd
/darkfid
/darkfid2
/darkfi-mmproxy
/darkotc
/dnetview
/drk
/faucetd
/fu
/fud
/genevd
/genev
/ircd
/darkirc
/tau
/taud
/vanityaddr
/bin/zkas/zkas
/zkas
/lilith
/darkwiki
/darkwikid
/zktool
/riscv-bins
/static-bins
# tags, ctags, rusty-tags
TAGS
rusty-tags.emacs
rusty-tags.vi
/bin/darkfid2/darkfid2
/darkfid2
/bin/darkfi-mmproxy/darkfi-mmproxy
/darkfi-mmproxy
/bin/darkirc/darkirc
/darkirc
/bin/genev/genev-cli/genev
/genev
/bin/genev/genevd/genevd
/genevd
/bin/lilith/lilith
/lilith
/bin/tau/taud/taud
/taud
/bin/vanityaddr/vanityaddr
/vanityaddr

206
Cargo.lock generated
View File

@@ -1708,28 +1708,6 @@ dependencies = [
"x509-parser",
]
[[package]]
name = "darkfi-consensus-contract"
version = "0.4.1"
dependencies = [
"blake3",
"bs58",
"chacha20poly1305",
"darkfi",
"darkfi-contract-test-harness",
"darkfi-money-contract",
"darkfi-sdk",
"darkfi-serial",
"getrandom 0.2.11",
"halo2_proofs",
"log",
"rand 0.8.5",
"simplelog",
"sled",
"smol",
"thiserror",
]
[[package]]
name = "darkfi-contract-test-harness"
version = "0.4.1"
@@ -1737,50 +1715,18 @@ dependencies = [
"blake3",
"bs58",
"darkfi",
"darkfi-consensus-contract",
"darkfi-dao-contract",
"darkfi-deployooor-contract",
"darkfi-money-contract",
"darkfi-sdk",
"darkfi-serial",
"darkfi_consensus_contract",
"darkfi_dao_contract",
"darkfi_deployooor_contract",
"darkfi_money_contract",
"log",
"rand 0.8.5",
"simplelog",
"sled",
]
[[package]]
name = "darkfi-dao-contract"
version = "0.4.1"
dependencies = [
"bs58",
"chacha20poly1305",
"darkfi",
"darkfi-contract-test-harness",
"darkfi-money-contract",
"darkfi-sdk",
"darkfi-serial",
"getrandom 0.2.11",
"halo2_proofs",
"log",
"rand 0.8.5",
"simplelog",
"sled",
"smol",
"thiserror",
]
[[package]]
name = "darkfi-deployooor-contract"
version = "0.4.1"
dependencies = [
"async-trait",
"darkfi-sdk",
"darkfi-serial",
"getrandom 0.2.11",
"thiserror",
]
[[package]]
name = "darkfi-derive"
version = "0.4.1"
@@ -1826,27 +1772,6 @@ dependencies = [
"uuid",
]
[[package]]
name = "darkfi-money-contract"
version = "0.4.1"
dependencies = [
"blake3",
"bs58",
"chacha20poly1305",
"darkfi",
"darkfi-contract-test-harness",
"darkfi-sdk",
"darkfi-serial",
"getrandom 0.2.11",
"halo2_proofs",
"log",
"rand 0.8.5",
"simplelog",
"sled",
"smol",
"thiserror",
]
[[package]]
name = "darkfi-sdk"
version = "0.4.1"
@@ -1896,27 +1821,78 @@ dependencies = [
]
[[package]]
name = "darkfid"
name = "darkfi_consensus_contract"
version = "0.4.1"
dependencies = [
"async-trait",
"blake3",
"bs58",
"chacha20poly1305",
"darkfi",
"darkfi-contract-test-harness",
"darkfi-sdk",
"darkfi-serial",
"easy-parallel",
"darkfi_money_contract",
"getrandom 0.2.11",
"halo2_proofs",
"log",
"serde",
"signal-hook",
"signal-hook-async-std",
"rand 0.8.5",
"simplelog",
"sled",
"smol",
"structopt",
"structopt-toml",
"tinyjson",
"url",
"thiserror",
]
[[package]]
name = "darkfi_dao_contract"
version = "0.4.1"
dependencies = [
"bs58",
"chacha20poly1305",
"darkfi",
"darkfi-contract-test-harness",
"darkfi-sdk",
"darkfi-serial",
"darkfi_money_contract",
"getrandom 0.2.11",
"halo2_proofs",
"log",
"rand 0.8.5",
"simplelog",
"sled",
"smol",
"thiserror",
]
[[package]]
name = "darkfi_deployooor_contract"
version = "0.4.1"
dependencies = [
"async-trait",
"darkfi-sdk",
"darkfi-serial",
"getrandom 0.2.11",
"thiserror",
]
[[package]]
name = "darkfi_money_contract"
version = "0.4.1"
dependencies = [
"blake3",
"bs58",
"chacha20poly1305",
"darkfi",
"darkfi-contract-test-harness",
"darkfi-sdk",
"darkfi-serial",
"getrandom 0.2.11",
"halo2_proofs",
"log",
"rand 0.8.5",
"simplelog",
"sled",
"smol",
"thiserror",
]
[[package]]
@@ -1927,11 +1903,11 @@ dependencies = [
"blake3",
"bs58",
"darkfi",
"darkfi-consensus-contract",
"darkfi-contract-test-harness",
"darkfi-money-contract",
"darkfi-sdk",
"darkfi-serial",
"darkfi_consensus_contract",
"darkfi_money_contract",
"easy-parallel",
"log",
"num-bigint",
@@ -2703,33 +2679,6 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
[[package]]
name = "faucetd"
version = "0.4.1"
dependencies = [
"async-trait",
"blake3",
"chrono",
"darkfi",
"darkfi-money-contract",
"darkfi-sdk",
"darkfi-serial",
"easy-parallel",
"log",
"rand 0.8.5",
"rusqlite",
"serde",
"signal-hook",
"signal-hook-async-std",
"simplelog",
"sled",
"smol",
"structopt",
"structopt-toml",
"tinyjson",
"url",
]
[[package]]
name = "fdeflate"
version = "0.3.1"
@@ -2914,27 +2863,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "fud"
version = "0.4.1"
dependencies = [
"async-trait",
"blake3",
"darkfi",
"darkfi-serial",
"easy-parallel",
"log",
"serde",
"signal-hook",
"signal-hook-async-std",
"simplelog",
"smol",
"structopt",
"structopt-toml",
"tinyjson",
"url",
]
[[package]]
name = "funty"
version = "2.0.0"

View File

@@ -20,13 +20,13 @@ doctest = false
[workspace]
members = [
"bin/zkas",
"bin/darkfid",
#"bin/darkfid",
"bin/darkfid2",
"bin/darkfi-mmproxy",
#"bin/drk",
"bin/faucetd",
#"bin/faucetd",
#"bin/fud/fu",
"bin/fud/fud",
#"bin/fud/fud",
"bin/genev/genevd",
"bin/genev/genev-cli",
"bin/darkirc",

134
Makefile
View File

@@ -11,29 +11,26 @@ 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
# Binaries to be built
# List of zkas circuits to compile, used for tests
PROOFS_SRC = $(shell find proof -type f -name '*.zk')
PROOFS_BIN = $(PROOFS_SRC:=.bin)
# List of all binaries built
BINS = \
zkas \
darkfid \
darkfid2 \
faucetd \
darkirc \
darkfi-mmproxy \
genev/genev-cli \
genev/genevd \
darkirc \
genev \
genevd \
lilith \
tau/tau-cli \
tau/taud \
taud \
vanityaddr
# ZK proofs to compile with zkas
PROOFS_SRC = $(shell find proof -type f -name '*.zk') example/simple.zk
PROOFS_BIN = $(PROOFS_SRC:=.bin)
all: $(BINS)
zkas:
$(MAKE) -C bin/zkas \
$(MAKE) -C bin/$@ \
PREFIX="$(PREFIX)" \
CARGO="$(CARGO)" \
RUST_TARGET="$(RUST_TARGET)" \
@@ -44,105 +41,112 @@ $(PROOFS_BIN): zkas $(PROOFS_SRC)
contracts: zkas
$(MAKE) -C src/contract/money
$(MAKE) -C src/contract/dao
$(MAKE) -C src/contract/consensus
$(MAKE) -C src/contract/dao
$(MAKE) -C src/contract/deployooor
darkfid: $(PROOFS_BIN) contracts
$(MAKE) -C bin/darkfid
darkfid2: contracts
$(MAKE) -C bin/darkfid2
faucetd: contracts
$(MAKE) -C bin/faucetd
darkirc: zkas
$(MAKE) -C bin/darkirc \
$(MAKE) -C bin/$@ \
PREFIX="$(PREFIX)" \
CARGO="$(CARGO)" \
RUST_TARGET="$(RUST_TARGET)" \
RUSTFLAGS="$(RUSTFLAGS)"
darkfi-mmproxy:
$(MAKE) -C bin/darkfi-mmproxy \
$(MAKE) -C bin/$@ \
PREFIX="$(PREFIX)" \
CARGO="$(CARGO)" \
RUST_TARGET="$(RUST_TARGET)" \
RUSTFLAGS="$(RUSTFLAGS)"
darkirc: zkas
$(MAKE) -C bin/$@ \
PREFIX="$(PREFIX)" \
CARGO="$(CARGO)" \
RUST_TARGET="$(RUST_TARGET)" \
RUSTFLAGS="$(RUSTFLAGS)"
genev:
$(MAKE) -C bin/genev/genev-cli
$(MAKE) -C bin/genev/genev-cli \
PREFIX="$(PREFIX)" \
CARGO="$(CARGO)" \
RUST_TARGET="$(RUST_TARGET)" \
RUSTFLAGS="$(RUSTFLAGS)"
genevd:
$(MAKE) -C bin/genev/genevd
$(MAKE) -C bin/genev/genevd \
PREFIX="$(PREFIX)" \
CARGO="$(CARGO)" \
RUST_TARGET="$(RUST_TARGET)" \
RUSTFLAGS="$(RUSTFLAGS)"
lilith:
$(MAKE) -C bin/lilith
tau:
$(MAKE) -C bin/tau/tau-cli
$(MAKE) -C bin/$@ \
PREFIX="$(PREFIX)" \
CARGO="$(CARGO)" \
RUST_TARGET="$(RUST_TARGET)" \
RUSTFLAGS="$(RUSTFLAGS)"
taud:
$(MAKE) -C bin/tau/taud
$(MAKE) -C bin/tau/$@ \
PREFIX="$(PREFIX)" \
CARGO="$(CARGO)" \
RUST_TARGET="$(RUST_TARGET)" \
RUSTFLAGS="$(RUSTFLAGS)"
vanityaddr:
$(MAKE) -C bin/vanityaddr
$(MAKE) -C bin/$@ \
PREFIX="$(PREFIX)" \
CARGO="$(CARGO)" \
RUST_TARGET="$(RUST_TARGET)" \
RUSTFLAGS="$(RUSTFLAGS)"
# -- END OF BINS --
fmt:
$(CARGO) fmt
$(CARGO) fmt --all
check: $(PROOFS_BIN) contracts
$(CARGO) hack check --release --feature-powerset --workspace
check: contracts $(PROOFS_BIN)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) hack check --target=$(RUST_TARGET) \
--release --feature-powerset --workspace
clippy: $(PROOFS_BIN) contracts
$(CARGO) clippy --release --all-features --workspace --tests
clippy: contracts $(PROOFS_BIN)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clippy --target=$(RUST_TARGET) \
--release --all-features --workspace --tests
fix: $(PROOFS_BIN) contracts
$(CARGO) clippy --release --all-features --fix --allow-dirty --workspace --tests
fix: contracts $(PROOFS_BIN)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clippy --target=$(RUST_TARGET) \
--release --all-features --workspace --tests --fix --allow-dirty
rustdoc: $(PROOFS_BIN) contracts
$(CARGO) doc --release --all-features --workspace --document-private-items --no-deps
rustdoc: contracts $(PROOFS_BIN)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) doc --target=$(RUST_TARGET) \
--release --all-features --workspace --document-private-items --no-deps
test: $(PROOFS_BIN) contracts
$(CARGO) test --release --all-features --workspace
test: contracts $(PROOFS_BIN)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) test --target=$(RUST_TARGET) \
--release --all-features --workspace
coverage: $(PROOFS_BIN) contracts
$(CARGO) llvm-cov --release --all-features --workspace --html
coverage: contracts $(PROOFS_BIN)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) llvm-cov --target=$(RUST_TARGET) \
--release --all-features --workspace --html
clean:
$(MAKE) -C src/contract/money clean
$(MAKE) -C src/contract/dao clean
$(MAKE) -C src/contract/consensus clean
$(MAKE) -C src/contract/dao clean
$(MAKE) -C src/contract/deployooor clean
$(MAKE) -C bin/zkas clean
$(MAKE) -C bin/darkfid clean
$(MAKE) -C bin/darkfid2 clean
$(MAKE) -C bin/darkfi-mmproxy clean
$(MAKE) -C bin/faucetd clean
$(MAKE) -C bin/darkirc clean
$(MAKE) -C bin/genev/genev-cli clean
$(MAKE) -C bin/genev/genevd clean
$(MAKE) -C bin/lilith clean
$(MAKE) -C bin/tau/tau-cli clean
$(MAKE) -C bin/tau/taud clean
$(MAKE) -C bin/vanityaddr clean
rm -f $(PROOFS_BIN)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clean --target=$(RUST_TARGET) --release
distclean: clean
$(CARGO) clean
rm -rf target
install: $(BINS)
@for i in $(BINS); \
do \
$(MAKE) -C bin/$$i install; \
done;
uninstall:
for i in $(BINS); \
do \
$(MAKE) -C bin/$$i uninstall; \
done;
.PHONY: all contracts check fix fmt clippy rustdoc test coverage distclean clean install uninstall $(BINS)
.PHONY: all $(BINS) fmt check clippy fix rustdoc test coverage clean distclean

View File

@@ -8,6 +8,8 @@ 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
SRC = \
Cargo.toml \
@@ -15,23 +17,25 @@ SRC = \
$(shell find src -type f -name '*.rs') \
$(shell find ../../src -type f -name '*.rs') \
BIN = ../../darkfi-mmproxy
BIN = $(shell grep '^name = ' Cargo.toml | cut -d' ' -f3 | tr -d '"')
all: $(BIN)
$(BIN): $(SRC)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package darkfi-mmproxy
cp -f ../../target/$(RUST_TARGET)/release/darkfi-mmproxy $@
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package $@
cp -f ../../target/$(RUST_TARGET)/release/$@ $@
cp -f ../../target/$(RUST_TARGET)/release/$@ ../../$@
clean:
rm -f $(BIN)
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/darkfi-mmproxy
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/darkfi-mmproxy
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
.PHONY: all clean install uninstall

View File

@@ -11,8 +11,8 @@ edition = "2021"
[dependencies]
# Darkfi
darkfi = {path = "../../", features = ["async-daemonize", "bs58"]}
darkfi-consensus-contract = {path = "../../src/contract/consensus"}
darkfi-money-contract = {path = "../../src/contract/money"}
darkfi_consensus_contract = {path = "../../src/contract/consensus"}
darkfi_money_contract = {path = "../../src/contract/money"}
darkfi-contract-test-harness = {path = "../../src/contract/test-harness"}
darkfi-sdk = {path = "../../src/sdk"}
darkfi-serial = {path = "../../src/serial"}

View File

@@ -6,29 +6,37 @@ 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
SRC = \
Cargo.toml \
../../Cargo.toml \
$(shell find src -type f) \
$(shell find ../../src -type f) \
$(shell find src -type f -name '*.rs') \
$(shell find ../../src -type f -name '*.rs') \
$(shell find ../../src/contract -type f -name '*.wasm')
BIN = ../../darkfid2
BIN = $(shell grep '^name = ' Cargo.toml | cut -d' ' -f3 | tr -d '"')
all: $(BIN)
$(BIN): $(SRC)
$(CARGO) build $(TARGET_PRFX)$(RUST_TARGET) --release --package darkfid2
cp -f ../../target/$(RUST_TARGET)/release/darkfid2 $@
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package $@
cp -f ../../target/$(RUST_TARGET)/release/$@ $@
cp -f ../../target/$(RUST_TARGET)/release/$@ ../../$@
clean:
rm -f $(BIN)
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/darkfid2
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/darkfid2
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
.PHONY: all clean install uninstall

View File

@@ -8,6 +8,15 @@ 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
# zkas compiler binary
ZKAS = ../../zkas
# zkas circuits
PROOFS_SRC = $(shell find proof -type f -name '*.zk')
PROOFS_BIN = $(PROOFS_SRC:=.bin)
SRC = \
Cargo.toml \
@@ -15,43 +24,43 @@ SRC = \
$(shell find src -type f -name '*.rs') \
$(shell find ../../src -type f -name '*.rs') \
BIN = ../../darkirc
ZKAS = ../../zkas
ZKSRC = $(shell find proof -type f -name '*.zk')
ZKBIN = $(ZKSRC:=.bin)
BIN = $(shell grep '^name = ' Cargo.toml | cut -d' ' -f3 | tr -d '"')
all: $(BIN)
$(ZKBIN): $(ZKAS) $(ZKSRC)
$(PROOFS_BIN): $(ZKAS) $(PROOFS_SRC)
$(ZKAS) $(basename $@) -o $@
$(BIN): $(ZKBIN) $(SRC)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package darkirc
cp -f ../../target/$(RUST_TARGET)/release/darkirc $@
$(BIN): $(PROOFS_BIN) $(SRC)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package $@
cp -f ../../target/$(RUST_TARGET)/release/$@ $@
cp -f ../../target/$(RUST_TARGET)/release/$@ ../../$@
android:
docker build -t test:latest . --file android.Dockerfile
# Use this command to get an interactive terminal inside docker:
#docker run -v $(shell pwd)/../../:/root/src -it test:latest /bin/bash
docker run --rm -v $(shell pwd)/../../:/root/src -t test:latest make _aarch64-android
cp -f ../../target/aarch64-linux-android/release/darkirc darkirc.aarch64-android
# To build for android, install the Android NDK (Android Studio)
# and then install cargo-ndk: `cargo install cargo-ndk`.
# After that, add new android rust toolchains:
# - rustup target add aarch64-linux-android
# - rustup target add armv7-linux-androideabi
# - rustup target add x86_64-linux-android
# - rustup target add i686-linux-android
$(BIN).android64:
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) ndk -t arm64-v8a -o ./jniLibs build --release --package $(BIN)
cp -f ../../target/aarch64-linux-android/release/$(BIN) $(BIN).$@
# Invoked inside docker by the command above
# We need to mount this directory as a volume using -v so docker can access it
_aarch64-android:
cargo build --release --target aarch64-linux-android --package darkirc
$(BIN).android32:
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) ndk -t armeabi-v7a -o ./jniLibs build --release --package $(BIN)
cp -f ../../target/armv7-linux-androideabi/release/$(BIN) $(BIN).$@
clean:
rm -f $(BIN)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clean --target=$(RUST_TARGET) --release --package $(BIN)
rm -f $(BIN) ../../$(BIN) $(BIN).android64 $(BIN).android32
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/darkirc
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/darkirc
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
.PHONY: all clean install uninstall

View File

@@ -19,7 +19,7 @@
//! IRC command implemenatations
//!
//! These try to follow the RFCs, modified in order for our P2P stack.
//! Copied from https://simple.wikipedia.org/wiki/List_of_Internet_Relay_Chat_commands
//! Copied from <https://simple.wikipedia.org/wiki/List_of_Internet_Relay_Chat_commands>
//!
//! Unimplemented commands:
//! * `AWAY`
@@ -354,7 +354,7 @@ impl Client {
/// `LIST [<channels> [<server>]]`
///
/// List all channels on the server. If the list `<channels>` is given, it
/// will return the channel topics. If <server> is given, the command will
/// will return the channel topics. If `<server>` is given, the command will
/// be sent to `<server>` for evaluation.
pub async fn handle_cmd_list(&self, _args: &str) -> Result<Vec<ReplyType>> {
if !self.registered.load(SeqCst) {
@@ -431,7 +431,7 @@ impl Client {
/// `MOTD [<server>]`
///
/// Returns the message of the day on <server> or the current server if
/// Returns the message of the day on `<server>` or the current server if
/// it is not stated.
pub async fn handle_cmd_motd(&self, _args: &str) -> Result<Vec<ReplyType>> {
let nick = self.nickname.read().await.to_string();
@@ -448,8 +448,8 @@ impl Client {
/// `NAMES [<channel>]`
///
/// Returns a list of who is on the list of <channel>, by channel name.
/// If <channel> is not used, all users are shown. They are grouped by
/// Returns a list of who is on the list of `<channel>`, by channel name.
/// If `<channel>` is not used, all users are shown. They are grouped by
/// channel name with all users who are not on a channel being shown as
/// part of channel "*".
pub async fn handle_cmd_names(&self, args: &str) -> Result<Vec<ReplyType>> {
@@ -563,7 +563,7 @@ impl Client {
/// `PART <channel>`
///
/// Causes a user to leave the channel <channel>.
/// Causes a user to leave the channel `<channel>`.
pub async fn handle_cmd_part(&self, args: &str) -> Result<Vec<ReplyType>> {
if !self.registered.load(SeqCst) {
self.penalty.fetch_add(1, SeqCst);
@@ -635,7 +635,7 @@ impl Client {
/// `PRIVMSG <msgtarget> <message>`
///
/// Sends <message> to <msgtarget>. The target is usually a user or
/// Sends `<message>` to `<msgtarget>`. The target is usually a user or
/// a channel.
pub async fn handle_cmd_privmsg(&self, args: &str) -> Result<Vec<ReplyType>> {
if !self.registered.load(SeqCst) {
@@ -703,8 +703,8 @@ impl Client {
/// `TOPIC <channel> [<topic>]`
///
/// Used to get the channel topic on <channel>. If <topic> is given, it
/// sets the channel topic to <topic>.
/// Used to get the channel topic on `<channel>`. If `<topic>` is given, it
/// sets the channel topic to `<topic>`.
pub async fn handle_cmd_topic(&self, args: &str) -> Result<Vec<ReplyType>> {
if !self.registered.load(SeqCst) {
self.penalty.fetch_add(1, SeqCst);
@@ -762,7 +762,7 @@ impl Client {
///
/// This command is used at the beginning of a connection to specify the
/// username, hostname, real name, and the initial user modes of the
/// connecting client. <realname> may contain spaces, and thus must be
/// connecting client. `<realname>` may contain spaces, and thus must be
/// prefixed with a colon.
pub async fn handle_cmd_user(&self, args: &str) -> Result<Vec<ReplyType>> {
if self.registered.load(SeqCst) {

View File

@@ -32,7 +32,7 @@ pub const INVALID_SYNTAX: &str = "Syntax error";
/// The first message sent after client registration.
pub const RPL_WELCOME: u16 = 001;
/// `<client> :Your host is <servername>, running version <version`
/// `<client> :Your host is <servername>, running version <version>`
///
/// Part of the post-registration greeting.
pub const RPL_YOURHOST: u16 = 002;
@@ -50,19 +50,19 @@ pub const RPL_ADMINME: u16 = 256;
/// `<client> :<info>`
///
/// Sent as a reply to an ADMIN command. <info> is a string intended to
/// Sent as a reply to an ADMIN command. `<info>` is a string intended to
/// provide information about the location of the server.
pub const RPL_ADMINLOC1: u16 = 257;
/// `<client> :<info>`
///
/// Sent as a reply to an ADMIN command. <info> is a string intended to
/// Sent as a reply to an ADMIN command. `<info>` is a string intended to
/// provide information about whoever runs the server.
pub const RPL_ADMINLOC2: u16 = 258;
/// `<client> :<info>`
///
/// Sent as a reply to an ADMIN command. <info> MUST contain the email
/// Sent as a reply to an ADMIN command. `<info>` MUST contain the email
/// address to contact the administrator(s) of the server.
pub const RPL_ADMINEMAIL: u16 = 259;
@@ -75,12 +75,12 @@ pub const RPL_LISTSTART: u16 = 321;
/// `<client> <channel> <client count> :<topic>`
///
/// Sent as a reply to the LIST command, this numeric sends information
/// about a channel to the client. <channel> is the name of the channel.
/// <client count> is an integer indicating how many clients are joined
/// to that channel. <topic> is the channels topic.
/// about a channel to the client. `<channel>` is the name of the channel.
/// `<client count>` is an integer indicating how many clients are joined
/// to that channel. `<topic>` is the channels topic.
pub const RPL_LIST: u16 = 322;
/// <client> :End of /LIST
/// `<client> :End of /LIST`
///
/// Sent as a reply to the LIST command, this numeric indicates the end
/// of a LIST response.
@@ -89,18 +89,18 @@ pub const RPL_LISTEND: u16 = 323;
/// `<client> <channel> <modestring> <mode arguments>...`
///
/// Sent to a client to inform them of the currently-set modes of a channel.
/// <channel> is the name of the channel.
/// `<channel>` is the name of the channel.
pub const RPL_CHANNELMODEIS: u16 = 324;
/// `<client> <channel> :No topic is set`
///
/// Sent to a client when joining a channel to inform them that the channel
/// with the name <channel> does not have any topic set.
/// with the name `<channel>` does not have any topic set.
pub const RPL_NOTOPIC: u16 = 331;
/// `<client> <channel> :<topic>`
///
/// Sent to a client when joining the <channel> to inform them of the
/// Sent to a client when joining the `<channel>` to inform them of the
/// current topic of the channel.
pub const RPL_TOPIC: u16 = 332;
@@ -159,7 +159,7 @@ pub const ERR_NOSUCHCHANNEL: u16 = 403;
///
/// Indicates a PING or PONG message missing the originator parameter
/// which is required by old IRC servers. Nowadays, this may be used by
/// some servers when the PING <token> is empty.
/// some servers when the PING `<token>` is empty.
pub const ERR_NOORIGIN: u16 = 409;
/// `<client> :No recipient given (<command>)`
@@ -174,7 +174,7 @@ pub const ERR_NORECIPIENT: u16 = 411;
/// delivered because there was no text to send.
pub const ERR_NOTEXTTOSEND: u16 = 412;
/// <client> <nick> :Erroneus nickname
/// `<client> <nick> :Erroneus nickname`
///
/// Returned when a NICK command cannot be successfully completed as
/// the desired nickname contains characters that are disallowed by the server.

View File

@@ -15,7 +15,7 @@ chrono = "0.4.31"
darkfi = {path = "../../", features = ["async-daemonize", "validator"]}
darkfi-serial = {path = "../../src/serial"}
darkfi-sdk = {path = "../../src/sdk"}
darkfi-money-contract = {path = "../../src/contract/money", features = ["no-entrypoint", "client"]}
darkfi_money_contract = {path = "../../src/contract/money", features = ["no-entrypoint", "client"]}
log = "0.4.20"
rand = "0.8.5"
rusqlite = "0.29.0"

View File

@@ -6,29 +6,36 @@ 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
SRC = \
Cargo.toml \
../../../Cargo.toml \
$(shell find src -type f) \
$(shell find ../../../src -type f) \
$(shell find src -type f -name '*.rs') \
$(shell find ../../../src -type f -name '*.rs') \
BIN = ../../../genev
BIN = $(shell grep '^name = ' Cargo.toml | cut -d' ' -f3 | tr -d '"')
all: $(BIN)
$(BIN): $(SRC)
$(CARGO) build $(TARGET_PRFX)$(RUST_TARGET) --release --package genev
cp -f ../../../target/$(RUST_TARGET)/release/genev $@
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package $@
cp -f ../../../target/$(RUST_TARGET)/release/$@ $@
cp -f ../../../target/$(RUST_TARGET)/release/$@ ../../../$@
clean:
rm -f $(BIN)
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/genev
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/genev
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
.PHONY: all clean install uninstall

View File

@@ -6,29 +6,36 @@ 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
SRC = \
Cargo.toml \
../../../Cargo.toml \
$(shell find src -type f) \
$(shell find ../../../src -type f) \
$(shell find src -type f -name '*.rs') \
$(shell find ../../../src -type f -name '*.rs') \
BIN = ../../../genevd
BIN = $(shell grep '^name = ' Cargo.toml | sed 1q | cut -d' ' -f3 | tr -d '"')
all: $(BIN)
$(BIN): $(SRC)
$(CARGO) build $(TARGET_PRFX)$(RUST_TARGET) --release --package genevd
cp -f ../../../target/$(RUST_TARGET)/release/genevd $@
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package $@
cp -f ../../../target/$(RUST_TARGET)/release/$@ $@
cp -f ../../../target/$(RUST_TARGET)/release/$@ ../../../$@
clean:
rm -f $(BIN)
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/genevd
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/genevd
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
.PHONY: all clean install uninstall

View File

@@ -8,6 +8,8 @@ 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
SRC = \
Cargo.toml \
@@ -15,23 +17,25 @@ SRC = \
$(shell find src -type f -name '*.rs') \
$(shell find ../../src -type f -name '*.rs') \
BIN = ../../lilith
BIN = $(shell grep '^name = ' Cargo.toml | cut -d' ' -f3 | tr -d '"')
all: $(BIN)
$(BIN): $(SRC)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package lilith
cp -f ../../target/$(RUST_TARGET)/release/lilith $@
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package $@
cp -f ../../target/$(RUST_TARGET)/release/$@ $@
cp -f ../../target/$(RUST_TARGET)/release/$@ ../../$@
clean:
rm -f $(BIN)
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/lilith
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/lilith
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
.PHONY: all clean install uninstall

View File

@@ -8,6 +8,8 @@ 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
SRC = \
Cargo.toml \
@@ -15,23 +17,25 @@ SRC = \
$(shell find src -type f -name '*.rs') \
$(shell find ../../../src -type f -name '*.rs') \
BIN = ../../../taud
BIN = $(shell grep '^name = ' Cargo.toml | sed 1q | cut -d' ' -f3 | tr -d '"')
all: $(BIN)
$(BIN): $(SRC)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package taud
cp -f ../../../target/$(RUST_TARGET)/release/taud $@
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package $@
cp -f ../../../target/$(RUST_TARGET)/release/$@ $@
cp -f ../../../target/$(RUST_TARGET)/release/$@ ../../../$@
clean:
rm -f $(BIN)
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/taud
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/taud
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
.PHONY: all clean install uninstall

View File

@@ -8,6 +8,8 @@ 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
SRC = \
Cargo.toml \
@@ -15,23 +17,25 @@ SRC = \
$(shell find src -type f -name '*.rs') \
$(shell find ../../src -type f -name '*.rs') \
BIN = ../../vanityaddr
BIN = vanityaddr
all: $(BIN)
$(BIN): $(SRC)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package vanityaddr
cp -f ../../target/$(RUST_TARGET)/release/vanityaddr $@
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package $@
cp -f ../../target/$(RUST_TARGET)/release/$@ $@
cp -f ../../target/$(RUST_TARGET)/release/$@ ../../$@
clean:
rm -f $(BIN)
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/vanityaddr
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/vanityaddr
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
.PHONY: all clean install uninstall

View File

@@ -8,6 +8,8 @@ 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
SRC = \
Cargo.toml \
@@ -16,23 +18,25 @@ SRC = \
$(shell find ../../src/serial -type f -name '*.rs') \
$(shell find ../../src/zkas -type f -name '*.rs')
BIN = ../../zkas
BIN = zkas
all: $(BIN)
$(BIN): $(SRC)
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package zkas
cp -f ../../target/$(RUST_TARGET)/release/zkas $@
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package $@
cp -f ../../target/$(RUST_TARGET)/release/$@ $@
cp -f ../../target/$(RUST_TARGET)/release/$@ ../../$@
clean:
rm -f $(BIN)
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/zkas
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/zkas
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
.PHONY: all clean install uninstall

View File

@@ -153,19 +153,19 @@ impl ValidatorState {
(
"Money Contract",
*MONEY_CONTRACT_ID,
include_bytes!("../contract/money/money_contract.wasm").to_vec(),
include_bytes!("../contract/money/darkfi_money_contract.wasm").to_vec(),
money_contract_deploy_payload,
),
(
"DAO Contract",
*DAO_CONTRACT_ID,
include_bytes!("../contract/dao/dao_contract.wasm").to_vec(),
include_bytes!("../contract/dao/darkfi_dao_contract.wasm").to_vec(),
dao_contract_deploy_payload,
),
(
"Consensus Contract",
*CONSENSUS_CONTRACT_ID,
include_bytes!("../contract/consensus/consensus_contract.wasm").to_vec(),
include_bytes!("../contract/consensus/darkfi_consensus_contract.wasm").to_vec(),
consensus_contract_deploy_payload,
),
];

View File

@@ -25,6 +25,10 @@ PROOFS_BIN = $(PROOFS_SRC:=.bin)
# wasm source files
WASM_SRC = \
Cargo.toml \
../../../Cargo.toml \
../../../src/sdk/Cargo.toml \
../../../src/serial/Cargo.toml \
$(shell find src -type f -name '*.rs') \
$(shell find ../../sdk -type f -name '*.rs') \
$(shell find ../../serial -type f -name '*.rs')

View File

@@ -25,6 +25,10 @@ PROOFS_BIN = $(PROOFS_SRC:=.bin)
# wasm source files
WASM_SRC = \
Cargo.toml \
../../../Cargo.toml \
../../../src/sdk/Cargo.toml \
../../../src/serial/Cargo.toml \
$(shell find src -type f -name '*.rs') \
$(shell find ../../sdk -type f -name '*.rs') \
$(shell find ../../serial -type f -name '*.rs')

View File

@@ -25,6 +25,10 @@ PROOFS_BIN = $(PROOFS_SRC:=.bin)
# wasm source files
WASM_SRC = \
Cargo.toml \
../../../Cargo.toml \
../../../src/sdk/Cargo.toml \
../../../src/serial/Cargo.toml \
$(shell find src -type f -name '*.rs') \
$(shell find ../../sdk -type f -name '*.rs') \
$(shell find ../../serial -type f -name '*.rs')

View File

@@ -25,6 +25,10 @@ PROOFS_BIN = $(PROOFS_SRC:=.bin)
# wasm source files
WASM_SRC = \
Cargo.toml \
../../../Cargo.toml \
../../../src/sdk/Cargo.toml \
../../../src/serial/Cargo.toml \
$(shell find src -type f -name '*.rs') \
$(shell find ../../sdk -type f -name '*.rs') \
$(shell find ../../serial -type f -name '*.rs')

View File

@@ -34,7 +34,7 @@ pub struct Event {
}
impl Event {
/// Create a new event with the given data and an [`EventGraph`] reference.
/// Create a new event with the given data and an `EventGraph` reference.
/// The timestamp of the event will be the current time, and the parents
/// will be `N_EVENT_PARENTS` from the current event graph unreferenced tips.
/// The parents can also include NULL, but this should be handled by the rest

View File

@@ -24,8 +24,10 @@ pub use error::{ClientFailed, ClientResult, Error, Result};
#[cfg(feature = "blockchain")]
pub mod blockchain;
/*
#[cfg(feature = "validator")]
pub mod consensus;
*/
#[cfg(feature = "validator")]
pub mod validator;

View File

@@ -68,19 +68,19 @@ pub fn deploy_native_contracts(
(
"Money Contract",
*MONEY_CONTRACT_ID,
include_bytes!("../contract/money/money_contract.wasm").to_vec(),
include_bytes!("../contract/money/darkfi_money_contract.wasm").to_vec(),
money_contract_deploy_payload,
),
(
"DAO Contract",
*DAO_CONTRACT_ID,
include_bytes!("../contract/dao/dao_contract.wasm").to_vec(),
include_bytes!("../contract/dao/darkfi_dao_contract.wasm").to_vec(),
dao_contract_deploy_payload,
),
(
"Consensus Contract",
*CONSENSUS_CONTRACT_ID,
include_bytes!("../contract/consensus/consensus_contract.wasm").to_vec(),
include_bytes!("../contract/consensus/darkfi_consensus_contract.wasm").to_vec(),
consensus_contract_deploy_payload,
),
];