example/dao: running the example through makefile

This commit is contained in:
Dastan-glitch
2022-11-06 05:29:42 +03:00
parent f2aac746cb
commit 8e381ad43c
8 changed files with 45 additions and 6 deletions

33
Cargo.lock generated
View File

@@ -1147,6 +1147,39 @@ dependencies = [
"url",
]
[[package]]
name = "dao-example"
version = "0.3.0"
dependencies = [
"async-channel",
"async-executor",
"async-std",
"async-trait",
"bs58",
"chacha20poly1305",
"darkfi",
"darkfi-sdk",
"darkfi-serial",
"easy-parallel",
"env_logger",
"futures",
"fxhash",
"group",
"halo2_gadgets",
"halo2_proofs",
"incrementalmerkletree",
"lazy_static",
"log",
"num_cpus",
"pasta_curves",
"rand",
"serde_json",
"simplelog",
"smol",
"thiserror",
"url",
]
[[package]]
name = "daod"
version = "0.3.0"

View File

@@ -44,6 +44,7 @@ members = [
"src/serial/derive-internal",
"example/dchat",
"example/dao",
]
[dependencies]

View File

@@ -66,7 +66,7 @@ test-tx: zkas
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) run --release --features=node,zkas --example tx
test-dao: zkas
RUSTFLAGS="$(RUSTFLAGS)" RUST_LOG=debug $(CARGO) run --release --features=crypto,rpc --example dao
$(MAKE) -C example/dao
cleanbin:
rm -f $(BINS)

View File

@@ -1,5 +1,5 @@
[package]
name = "dao"
name = "dao-example"
version = "0.3.0"
edition = "2021"
authors = ["Dyne.org foundation <foundation@dyne.org>"]
@@ -8,6 +8,7 @@ license = "AGPL-3.0-only"
[dependencies]
darkfi = {path = "../../", features = ["rpc", "crypto", "tx", "node"]}
darkfi-serial = {path = "../../src/serial"}
darkfi-sdk = {path = "../../src/sdk"}
# Async
smol = "1.2.5"
@@ -30,7 +31,7 @@ pasta_curves = "0.4.0"
halo2_gadgets = "0.2.0"
halo2_proofs = "0.2.0"
rand = "0.8.5"
crypto_api_chachapoly = "0.5.0"
chacha20poly1305 = "0.10.1"
group = "0.12.0"
# Encoding and parsing
@@ -41,3 +42,4 @@ fxhash = "0.2.1"
# Utilities
lazy_static = "1.4.0"
url = "2.3.1"
env_logger = "0.9.1"

3
example/dao/Makefile Normal file
View File

@@ -0,0 +1,3 @@
#
dao:
RUST_LOG=debug cargo run --release

View File

@@ -28,7 +28,7 @@ use crate::util::HashableBase;
#[derive(Clone, SerialEncodable, SerialDecodable)]
pub struct DaoBulla(pub pallas::Base);
type MerkleTree = BridgeTree<MerkleNode, MERKLE_DEPTH>;
type MerkleTree = BridgeTree<MerkleNode, { MERKLE_DEPTH }>;
pub struct ProposalVotes {
// TODO: might be more logical to have 'yes_votes_commit' and 'no_votes_commit'

View File

@@ -20,7 +20,7 @@ use darkfi::crypto::keypair::PublicKey;
use darkfi_sdk::crypto::{constants::MERKLE_DEPTH, MerkleNode, Nullifier};
use incrementalmerkletree::bridgetree::BridgeTree;
type MerkleTree = BridgeTree<MerkleNode, MERKLE_DEPTH>;
type MerkleTree = BridgeTree<MerkleNode, { MERKLE_DEPTH }>;
/// The state machine, held in memory.
pub struct State {

View File

@@ -54,7 +54,7 @@ use crate::{
util::{sign, StateRegistry, Transaction, ZkContractTable},
};
type MerkleTree = BridgeTree<MerkleNode, MERKLE_DEPTH>;
type MerkleTree = BridgeTree<MerkleNode, { MERKLE_DEPTH }>;
pub struct OwnCoin {
pub coin: Coin,