parazyd пре 2 година
родитељ
комит
ffe8643812

+ 4 - 6
.github/workflows/ci.yml

@@ -26,13 +26,12 @@ jobs:
 
       - name: Install dependencies (Linux)
         run: |
-          sudo apt update
-          sudo apt -y install build-essential clang libclang-dev llvm-dev libudev-dev pkg-config libasound2-dev
+          sh contrib/dependency_setup.sh
         if: matrix.os == 'ubuntu-latest'
 
       - name: Install dependencies (macOS)
         run: |
-          brew install llvm
+          sh contrib/dependency_setup.sh
         if: matrix.os == 'macos-latest'
 
       - name: Run test units
@@ -66,13 +65,12 @@ jobs:
 
       - name: Install dependencies (Linux)
         run: |
-          sudo apt update
-          sudo apt -y install build-essential clang libclang-dev llvm-dev libasound2-dev
+          sh contrib/dependency_setup.sh
         if: matrix.os == 'ubuntu-latest'
 
       - name: Install dependencies (macOS)
         run: |
-          brew install llvm
+          sh contrib/dependency_setup.sh
         if: matrix.os == 'macos-latest'
 
       - name: Run feature powerset builds

+ 0 - 31
Cargo.lock

@@ -1672,7 +1672,6 @@ dependencies = [
  "darkfi-serial",
  "easy-parallel",
  "futures",
- "libsqlite3-sys",
  "log",
  "rand 0.8.5",
  "rustls-pemfile",
@@ -2603,7 +2602,6 @@ dependencies = [
  "darkfi",
  "darkfi-serial",
  "easy-parallel",
- "libsqlite3-sys",
  "log",
  "serde",
  "signal-hook",
@@ -2754,7 +2752,6 @@ dependencies = [
  "darkfi",
  "darkfi-serial",
  "genevd",
- "libsqlite3-sys",
  "log",
  "simplelog",
  "smol",
@@ -2770,7 +2767,6 @@ dependencies = [
  "darkfi",
  "darkfi-serial",
  "easy-parallel",
- "libsqlite3-sys",
  "log",
  "serde",
  "signal-hook",
@@ -3259,8 +3255,6 @@ version = "0.26.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326"
 dependencies = [
- "cc",
- "openssl-sys",
  "pkg-config",
  "vcpkg",
 ]
@@ -3273,7 +3267,6 @@ dependencies = [
  "darkfi",
  "easy-parallel",
  "futures",
- "libsqlite3-sys",
  "log",
  "semver 1.0.18",
  "serde",
@@ -3614,28 +3607,6 @@ version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
 
-[[package]]
-name = "openssl-src"
-version = "111.27.0+1.1.1v"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06e8f197c82d7511c5b014030c9b1efeda40d7d5f99d23b4ceed3524a5e63f02"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "openssl-sys"
-version = "0.9.91"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac"
-dependencies = [
- "cc",
- "libc",
- "openssl-src",
- "pkg-config",
- "vcpkg",
-]
-
 [[package]]
 name = "option-ext"
 version = "0.2.0"
@@ -5401,7 +5372,6 @@ dependencies = [
  "colored",
  "darkfi",
  "libc",
- "libsqlite3-sys",
  "log",
  "prettytable-rs",
  "serde",
@@ -5428,7 +5398,6 @@ dependencies = [
  "futures",
  "hex",
  "libc",
- "libsqlite3-sys",
  "log",
  "rand 0.8.5",
  "serde",

+ 3 - 3
Cargo.toml

@@ -128,9 +128,9 @@ prettytable-rs = "0.10.0"
 
 # -----BEGIN LIBRARY FEATURES-----
 [features]
-async-serial = [
-    "darkfi-serial/async",
-]
+default = []
+async-daemonize = []
+async-serial = ["darkfi-serial/async"]
 
 async-sdk = [
     "darkfi-sdk/async",

+ 2 - 2
bin/darkfid/Cargo.toml

@@ -12,8 +12,8 @@ edition = "2021"
 async-trait = "0.1.73"
 blake3 = "1.4.1"
 bs58 = "0.5.0"
-darkfi = {path = "../../", features = ["blockchain", "wallet", "rpc", "net", "zkas"]}
-darkfi-sdk = {path = "../../src/sdk"}
+darkfi = {path = "../../", features = ["async-daemonize", "validator"]}
+darkfi-sdk = {path = "../../src/sdk", features = ["async"]}
 darkfi-serial = {path = "../../src/serial"}
 log = "0.4.20"
 sled = "0.34.7"

+ 1 - 1
bin/darkfid/src/rpc_blockchain.rs

@@ -24,11 +24,11 @@ use log::{debug, error};
 use tinyjson::JsonValue;
 
 use darkfi::{
+    blockchain::contract_store::SMART_CONTRACT_ZKAS_DB_NAME,
     rpc::jsonrpc::{
         ErrorCode::{InternalError, InvalidParams, ParseError},
         JsonError, JsonResponse, JsonResult,
     },
-    runtime::vm_runtime::SMART_CONTRACT_ZKAS_DB_NAME,
     util::encoding::base64,
 };
 

+ 1 - 1
bin/darkfid/src/rpc_tx.rs

@@ -158,7 +158,7 @@ impl Darkfid {
             return server_error(RpcError::TxBroadcastFail, id, None)
         }
 
-        let tx_hash = tx.hash().to_string();
+        let tx_hash = tx.hash().unwrap().to_string();
         JsonResponse::new(JsonValue::String(tx_hash), id).into()
     }
 }

+ 1 - 1
bin/darkfid2/Cargo.toml

@@ -10,7 +10,7 @@ edition = "2021"
 
 [dependencies]
 # Darkfi
-darkfi = {path = "../../", features = ["async-runtime", "util"]}
+darkfi = {path = "../../", features = ["async-daemonize"]}
 darkfi-consensus-contract = {path = "../../src/contract/consensus"}
 darkfi-money-contract = {path = "../../src/contract/money"}
 darkfi-contract-test-harness = {path = "../../src/contract/test-harness"}

+ 1 - 1
bin/darkfid2/src/rpc_blockchain.rs

@@ -24,11 +24,11 @@ use log::{debug, error};
 use tinyjson::JsonValue;
 
 use darkfi::{
+    blockchain::contract_store::SMART_CONTRACT_ZKAS_DB_NAME,
     rpc::jsonrpc::{
         ErrorCode::{InternalError, InvalidParams, ParseError},
         JsonError, JsonResponse, JsonResult,
     },
-    runtime::vm_runtime::SMART_CONTRACT_ZKAS_DB_NAME,
     util::encoding::base64,
 };
 

+ 3 - 3
bin/darkfid2/src/rpc_tx.rs

@@ -149,7 +149,7 @@ impl Darkfid {
             return server_error(RpcError::TxBroadcastFail, id, None)
         }
 
-        let tx_hash = tx.hash().to_string();
+        let tx_hash = tx.hash().unwrap().to_string();
         JsonResponse::new(JsonValue::String(tx_hash), id).into()
     }
 
@@ -179,7 +179,7 @@ impl Darkfid {
         };
 
         let pending_txs: Vec<JsonValue> =
-            pending_txs.iter().map(|x| JsonValue::String(x.hash().to_string())).collect();
+            pending_txs.iter().map(|x| JsonValue::String(x.hash().unwrap().to_string())).collect();
 
         JsonResponse::new(JsonValue::Array(pending_txs), id).into()
     }
@@ -215,7 +215,7 @@ impl Darkfid {
         };
 
         let pending_txs: Vec<JsonValue> =
-            pending_txs.iter().map(|x| JsonValue::String(x.hash().to_string())).collect();
+            pending_txs.iter().map(|x| JsonValue::String(x.hash().unwrap().to_string())).collect();
 
         JsonResponse::new(JsonValue::Array(pending_txs), id).into()
     }

+ 1 - 2
bin/darkirc/Cargo.toml

@@ -9,7 +9,7 @@ homepage = "https://dark.fi"
 repository = "https://github.com/darkrenaissance/darkfi"
 
 [dependencies]
-darkfi = {path = "../../", features = ["event-graph", "rpc", "bs58"]}
+darkfi = {path = "../../", features = ["bs58", "toml", "async-daemonize", "event-graph", "rpc"]}
 darkfi-serial = {path = "../../src/serial"}
 
 # TLS
@@ -25,7 +25,6 @@ rand = "0.8.5"
 # Misc
 clap = {version = "4.3.24", features = ["derive"]}
 chrono = "0.4.26"
-libsqlite3-sys = {version = "0.26.0", features = ["bundled-sqlcipher-vendored-openssl"]}
 log = "0.4.20"
 url = "2.4.0"
 

+ 0 - 1
bin/dhtd/dhtd/Cargo.toml

@@ -14,7 +14,6 @@ blake3 = "1.4.1"
 darkfi = {path = "../../../", features = ["dht"]}
 darkfi-serial = {path = "../../../src/serial", features = ["derive", "crypto"]}
 easy-parallel = "3.3.0"
-libsqlite3-sys = {version = "0.26.0", features = ["bundled-sqlcipher-vendored-openssl"]}
 log = "0.4.20"
 rand = "0.8.5"
 simplelog = "0.12.1"

+ 1 - 1
bin/faucetd/Cargo.toml

@@ -12,7 +12,7 @@ edition = "2021"
 async-trait = "0.1.73"
 blake3 = "1.4.1"
 chrono = "0.4.26"
-darkfi = {path = "../../", features = ["blockchain", "wallet", "rpc", "net", "zkas"]}
+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"]}

+ 3 - 2
bin/faucetd/src/main.rs

@@ -50,7 +50,9 @@ use tinyjson::JsonValue;
 use url::Url;
 
 use darkfi::{
-    async_daemonize, cli_desc,
+    async_daemonize,
+    blockchain::contract_store::SMART_CONTRACT_ZKAS_DB_NAME,
+    cli_desc,
     consensus::{
         constants::{
             MAINNET_BOOTSTRAP_TIMESTAMP, MAINNET_GENESIS_HASH_BYTES, MAINNET_GENESIS_TIMESTAMP,
@@ -70,7 +72,6 @@ use darkfi::{
         },
         server::{listen_and_serve, RequestHandler},
     },
-    runtime::vm_runtime::SMART_CONTRACT_ZKAS_DB_NAME,
     system::{sleep, StoppableTask},
     tx::Transaction,
     util::{parse::decode_base10, path::expand_path},

+ 0 - 1
bin/fud/fu/Cargo.toml

@@ -16,7 +16,6 @@ async-std = {version = "1.12.0", features = ["attributes"]}
 
 # Misc
 clap = {version = "4.3.24", features = ["derive"]}
-libsqlite3-sys = {version = "0.26.0", features = ["bundled-sqlcipher-vendored-openssl"]}
 log = "0.4.20"
 serde_json = "1.0.105"
 simplelog = "0.12.1"

+ 0 - 1
bin/fud/fud/Cargo.toml

@@ -15,7 +15,6 @@ darkfi-serial = {path = "../../../src/serial", features = ["hash"]}
 # Misc
 async-trait = "0.1.73"
 blake3 = "1.4.1"
-libsqlite3-sys = {version = "0.26.0", features = ["bundled-sqlcipher-vendored-openssl"]}
 log = "0.4.20"
 tinyjson = "2.5.1"
 url = "2.4.0"

+ 0 - 1
bin/genev/genev-cli/Cargo.toml

@@ -16,7 +16,6 @@ darkfi-serial = {path = "../../../src/serial"}
 
 smol = "1.3.0"
 clap = {version = "4.3.24", features = ["derive"]}
-libsqlite3-sys = {version = "0.26.0", features = ["bundled-sqlcipher-vendored-openssl"]}
 log = "0.4.20"
 simplelog = "0.12.1"
 tinyjson = "2.5.1"

+ 1 - 2
bin/genev/genevd/Cargo.toml

@@ -17,12 +17,11 @@ name = "genevd"
 path = "src/main.rs"
 
 [dependencies]
-darkfi = {path = "../../../", features = ["event-graph", "rpc", "bs58", "util"]}
+darkfi = {path = "../../../", features = ["async-daemonize", "event-graph", "rpc"]}
 darkfi-serial = {path = "../../../src/serial"}
 
 # Misc
 async-trait = "0.1.73"
-libsqlite3-sys = {version = "0.26.0", features = ["bundled-sqlcipher-vendored-openssl"]}
 log = "0.4.20"
 tinyjson = "2.5.1"
 url = "2.4.0"

+ 1 - 2
bin/lilith/Cargo.toml

@@ -9,12 +9,11 @@ homepage = "https://dark.fi"
 repository = "https://github.com/darkrenaissance/darkfi"
 
 [dependencies]
-darkfi = {path = "../../", features = ["net", "rpc"]}
+darkfi = {path = "../../", features = ["toml", "async-daemonize", "net", "rpc"]}
 
 # Misc
 async-trait = "0.1.73"
 futures = "0.3.28"
-libsqlite3-sys = {version = "0.26.0", features = ["bundled-sqlcipher-vendored-openssl"]}
 log = "0.4.20"
 semver = "1.0.18"
 tinyjson = "2.5.1"

+ 0 - 1
bin/tau/tau-cli/Cargo.toml

@@ -16,7 +16,6 @@ taud = {path = "../taud"}
 # Misc
 chrono = "0.4.26"
 colored = "2.0.4"
-libsqlite3-sys = {version = "0.26.0", features = ["bundled-sqlcipher-vendored-openssl"]}
 log = "0.4.20"
 prettytable-rs = "0.10.0"
 simplelog = "0.12.1"

+ 2 - 3
bin/tau/taud/Cargo.toml

@@ -17,8 +17,8 @@ name = "taud"
 path = "src/main.rs"
 
 [dependencies]
-darkfi = { path = "../../../", features = ["event-graph", "rpc", "bs58", "async-serial"]}
-darkfi-serial = { path = "../../../src/serial" }
+darkfi = {path = "../../../", features = ["bs58", "async-daemonize", "event-graph", "rpc"]}
+darkfi-serial = {path = "../../../src/serial"}
 
 # Misc
 async-trait = "0.1.73"
@@ -28,7 +28,6 @@ crypto_box = {version = "0.9.1", features = ["std", "chacha20"]}
 futures = "0.3.28"
 hex = "0.4.3"
 libc = "0.2.147"
-libsqlite3-sys = {version = "0.26.0", features = ["bundled-sqlcipher-vendored-openssl"]}
 log = "0.4.20"
 rand = "0.8.5"
 thiserror = "1.0.47"

+ 2 - 2
src/contract/test-harness/Cargo.toml

@@ -6,9 +6,9 @@ license = "AGPL-3.0-only"
 edition = "2021"
 
 [dependencies]
-darkfi = {path = "../../../", features = ["zk", "tx", "blockchain"]}
+darkfi = {path = "../../../", features = ["validator"]}
 darkfi-sdk = {path = "../../../src/sdk"}
-darkfi-serial = {path = "../../../src/serial", features = ["derive", "crypto"]}
+darkfi-serial = {path = "../../../src/serial", features = ["crypto"]}
 darkfi-dao-contract = {path = "../dao", features = ["client", "no-entrypoint"]}
 darkfi-money-contract = {path = "../money", features = ["client", "no-entrypoint"]}
 darkfi-consensus-contract = {path = "../consensus", features = ["client", "no-entrypoint"]}

+ 1 - 1
src/contract/test-harness/src/vks.rs

@@ -24,7 +24,7 @@ use std::{
 };
 
 use darkfi::{
-    runtime::vm_runtime::SMART_CONTRACT_ZKAS_DB_NAME,
+    blockchain::contract_store::SMART_CONTRACT_ZKAS_DB_NAME,
     zk::{empty_witnesses, ProvingKey, VerifyingKey, ZkCircuit},
     zkas::ZkBinary,
     Result,

+ 1 - 1
src/util/cli.rs

@@ -163,7 +163,7 @@ pub fn get_log_config(verbosity_level: u8) -> simplelog::Config {
 ///     Ok(())
 /// }
 /// ```
-#[cfg(feature = "async-runtime")]
+#[cfg(feature = "async-daemonize")]
 #[macro_export]
 macro_rules! async_daemonize {
     ($realmain:ident) => {