parazyd 4 лет назад
Родитель
Сommit
d77d4dc02c

Разница между файлами не показана из-за своего большого размера
+ 163 - 142
Cargo.lock


+ 7 - 7
Cargo.toml

@@ -34,7 +34,7 @@ members = [
 
 [dependencies]
 # Hard dependencies
-libc = "0.2.121"
+libc = "0.2.123"
 log = "0.4.16"
 thiserror = "1.0.30"
 
@@ -48,7 +48,7 @@ async-executor = {version = "1.4.1", optional = true}
 
 # async-net
 async-native-tls = {version = "0.4.0", optional = true}
-native-tls = {version = "0.2.8", optional = true}
+native-tls = {version = "0.2.10", optional = true}
 
 # Networking
 socket2 = {version = "0.4.4", optional = true}
@@ -62,7 +62,7 @@ rustls-pemfile = {version = "0.3.0", optional = true}
 # Encoding
 hex = {version = "0.4.3", optional = true}
 bs58 = {version = "0.4.0", optional = true}
-toml = {version = "0.5.8", optional = true}
+toml = {version = "0.5.9", optional = true}
 bytes = {version = "1.1.0", optional = true}
 bincode = {version = "1.3.3", optional = true}
 num-bigint = {version = "0.4.3", optional = true}
@@ -75,7 +75,7 @@ dirs = {version = "4.0.0", optional = true}
 subtle = {version = "2.4.1", optional = true}
 lazy_static = {version = "1.4.0", optional = true}
 fxhash = {version = "0.2.1", optional = true}
-indexmap = {version = "1.8.0", optional = true}
+indexmap = {version = "1.8.1", optional = true}
 itertools = {version = "0.10.3", optional = true}
 darkfi-derive = {path = "src/util/derive", optional = true}
 darkfi-derive-internal = {path = "src/util/derive-internal", optional = true}
@@ -114,8 +114,8 @@ wasmer-compiler-singlepass = {version = "2.2.1", optional = true}
 wasmer-middlewares = {version = "2.2.1", optional = true}
 
 # Wallet management
-sqlx = {version = "0.5.11", features = ["runtime-async-std-native-tls", "sqlite"], optional = true}
-libsqlite3-sys = {version = "0.23.2", features = ["bundled-sqlcipher"],  optional = true }
+sqlx = {version = "0.5.12", features = ["runtime-async-std-native-tls", "sqlite"], optional = true}
+libsqlite3-sys = {version = "0.24.2", features = ["bundled-sqlcipher"],  optional = true }
 
 # Blockchain store
 sled = {version = "0.34.7", optional = true}
@@ -141,7 +141,7 @@ optional = true
 
 
 [dev-dependencies]
-clap = {version = "3.1.6", features = ["derive"]}
+clap = {version = "3.1.8", features = ["derive"]}
 
 [features]
 async-runtime = [

+ 3 - 3
bin/cashierd/Cargo.toml

@@ -5,7 +5,7 @@ edition = "2021"
 
 [dependencies.darkfi]
 path = "../../"
-features = ["node", "rpc"]
+features = ["wallet", "node", "rpc"]
 
 [dependencies]
 # Async
@@ -21,7 +21,7 @@ easy-parallel = "3.2.0"
 rand = "0.8.5"
 
 # Misc
-clap = {version = "3.1.6", features = ["derive"]}
+clap = {version = "3.1.8", features = ["derive"]}
 log = "0.4.16"
 num_cpus = "1.13.1"
 simplelog = "0.12.0-alpha1"
@@ -47,7 +47,7 @@ keccak-hasher = {version = "0.15.3", optional = true}
 num-bigint = {version = "0.4.3", features = ["rand", "serde"], optional = true}
 
 # Solana bridge dependencies
-native-tls = {version = "0.2.8", optional = true}
+native-tls = {version = "0.2.10", optional = true}
 async-native-tls = {version = "0.4.0", optional = true}
 solana-client = {version = "1.10.3", optional = true}
 solana-sdk = {version = "1.10.3", optional = true}

+ 2 - 5
bin/cashierd/src/main.rs

@@ -20,11 +20,7 @@ use darkfi::{
         token_id::generate_id2,
         types::DrkTokenId,
     },
-    node::{
-        client::Client,
-        state::State,
-        wallet::{cashierdb::CashierDb, walletdb::WalletDb},
-    },
+    node::{client::Client, state::State},
     rpc::{
         jsonrpc::{error as jsonerr, response as jsonresp, ErrorCode::*, JsonRequest, JsonResult},
         rpcserver::{listen_and_serve, RequestHandler, RpcServerConfig},
@@ -36,6 +32,7 @@ use darkfi::{
         serial::serialize,
         NetworkName,
     },
+    wallet::{cashierdb::CashierDb, walletdb::WalletDb},
     zk::circuit::{MintContract, SpendContract},
     Error, Result,
 };

+ 1 - 1
bin/cashierd/src/service/bridge.rs

@@ -8,8 +8,8 @@ use log::{debug, error};
 
 use darkfi::{
     crypto::{keypair::PublicKey, types::*},
-    node::wallet::cashierdb::TokenKey,
     util::NetworkName,
+    wallet::cashierdb::TokenKey,
     Error, Result,
 };
 

+ 1 - 1
bin/cashierd/src/service/btc.rs

@@ -43,12 +43,12 @@ use secp256k1::{
 use super::bridge::{NetworkClient, TokenNotification, TokenSubscribtion};
 use darkfi::{
     crypto::{keypair::PublicKey as DrkPublicKey, token_id::generate_id2},
-    node::wallet::cashierdb::{CashierDb, TokenKey},
     util::{
         expand_path, load_keypair_to_str,
         serial::{deserialize, serialize, Decodable, Encodable},
         NetworkName,
     },
+    wallet::cashierdb::{CashierDb, TokenKey},
     Error, Result,
 };
 

+ 1 - 1
bin/cashierd/src/service/eth.rs

@@ -16,13 +16,13 @@ use super::bridge::{NetworkClient, TokenNotification, TokenSubscribtion};
 
 use darkfi::{
     crypto::{keypair::PublicKey, token_id::generate_id2},
-    node::wallet::cashierdb::{CashierDb, TokenKey},
     rpc::{jsonrpc, jsonrpc::JsonResult},
     util::{
         parse::truncate,
         serial::{deserialize, serialize, Decodable, Encodable},
         sleep, NetworkName,
     },
+    wallet::cashierdb::{CashierDb, TokenKey},
     Error, Result,
 };
 

+ 1 - 1
bin/cashierd/src/service/sol.rs

@@ -25,7 +25,6 @@ use super::bridge::{NetworkClient, TokenNotification, TokenSubscribtion};
 
 use darkfi::{
     crypto::{keypair::PublicKey, token_id::generate_id2},
-    node::wallet::cashierdb::{CashierDb, TokenKey},
     rpc::{jsonrpc, jsonrpc::JsonResult, websockets, websockets::WsStream},
     util::{
         expand_path, load_keypair_to_str,
@@ -33,6 +32,7 @@ use darkfi::{
         serial::{deserialize, serialize, Decodable, Encodable},
         sleep, NetworkName,
     },
+    wallet::cashierdb::{CashierDb, TokenKey},
     Error, Result,
 };
 

+ 1 - 1
bin/dao-cli/Cargo.toml

@@ -18,7 +18,7 @@ async-executor = "1.4.1"
 easy-parallel = "3.2.0"
 
 # Misc
-clap = {version = "3.1.6", features = ["derive"]}
+clap = {version = "3.1.8", features = ["derive"]}
 log = "0.4.16"
 num_cpus = "1.13.1"
 simplelog = "0.12.0-alpha1"

+ 2 - 2
bin/darkfid/Cargo.toml

@@ -5,7 +5,7 @@ edition = "2021"
 
 [dependencies.darkfi]
 path = "../../"
-features = ["node", "rpc"]
+features = ["wallet", "node", "rpc"]
 
 [dependencies]
 # Async
@@ -17,7 +17,7 @@ async-executor = "1.4.1"
 easy-parallel = "3.2.0"
 
 # Misc
-clap = {version = "3.1.6", features = ["derive"]}
+clap = {version = "3.1.8", features = ["derive"]}
 url = "2.2.2"
 log = "0.4.16"
 num_cpus = "1.13.1"

+ 2 - 2
bin/darkfid/src/main.rs

@@ -25,7 +25,6 @@ use darkfi::{
     node::{
         client::Client,
         state::{ProgramState, State},
-        wallet::walletdb::WalletDb,
     },
     rpc::{
         jsonrpc::{
@@ -38,6 +37,7 @@ use darkfi::{
         cli::{log_config, spawn_config, Config, UrlConfig},
         decode_base10, encode_base10, expand_path, join_config_path, NetworkName,
     },
+    wallet::walletdb::WalletDb,
     zk::circuit::{MintContract, SpendContract},
     Error, Result,
 };
@@ -227,7 +227,7 @@ impl Darkfid {
     // <-- {"jsonrpc": "2.0", "result": true, "id": 1}
     async fn key_gen(&self, id: Value, _params: Value) -> JsonResult {
         let client = self.client.lock().await;
-        match client.key_gen().await {
+        match client.keygen().await {
             Ok(()) => JsonResult::Resp(jsonresp(json!(true), id)),
             Err(e) => JsonResult::Err(jsonerr(ServerError(-32002), Some(e.to_string()), id)),
         }

+ 2 - 1
bin/darkfid2/Cargo.toml

@@ -13,7 +13,8 @@ async-channel = "1.6.1"
 async-executor = "1.4.1"
 async-std = "1.11.0"
 async-trait = "0.1.53"
-ctrlc-async = {version = "3.2.2", default-features = false, features = ["async-std"]}
+chrono = "0.4.19"
+ctrlc-async = {version = "3.2.2", default-features = false, features = ["async-std", "termination"]}
 darkfi = {path = "../../", features = ["blockchain2", "wallet", "rpc", "net"]}
 easy-parallel = "3.2.0"
 futures-lite = "1.12.0"

+ 5 - 4
bin/darkfid2/src/main.rs

@@ -347,15 +347,16 @@ async fn realmain(args: Args, ex: Arc<Executor<'_>>) -> Result<()> {
 
     // JSON-RPC server
     info!("Starting JSON-RPC server");
-    let jsonrpc_task = ex.spawn(listen_and_serve(args.rpc_listen, darkfid)).detach();
+    ex.spawn(listen_and_serve(args.rpc_listen, darkfid)).detach();
 
     // Wait for SIGINT
     shutdown.recv().await?;
     print!("\r");
-    info!("Caught ^C, cleaning up and exiting...");
-    drop(jsonrpc_task);
+    info!("Caught termination signal, cleaning up and exiting...");
 
-    // Flush dbs
+    info!("Flushing database...");
+    let flushed_bytes = sled_db.flush_async().await?;
+    info!("Flushed {} bytes", flushed_bytes);
 
     Ok(())
 }

+ 1 - 1
bin/dnetview/Cargo.toml

@@ -19,7 +19,7 @@ easy-parallel = "3.2.0"
 async-channel = "1.6.1"
 
 # Misc
-clap = "3.1.6"
+clap = "3.1.8"
 rand = "0.8.5"
 simplelog = "0.12.0-alpha1"
 log = "0.4.16"

+ 1 - 1
bin/drk/Cargo.toml

@@ -12,7 +12,7 @@ features = ["rpc"]
 async-std = {version = "1.11.0", features = ["attributes"]}
 
 # Misc
-clap = {version = "3.1.6", features = ["derive"]}
+clap = {version = "3.1.8", features = ["derive"]}
 log = "0.4.16"
 simplelog = "0.12.0-alpha1"
 prettytable-rs = "0.8.0"

+ 1 - 1
bin/gatewayd/Cargo.toml

@@ -16,7 +16,7 @@ async-executor = "1.4.1"
 easy-parallel = "3.2.0"
 
 # Misc
-clap = {version = "3.1.6", features = ["derive"]}
+clap = {version = "3.1.8", features = ["derive"]}
 log = "0.4.16"
 num_cpus = "1.13.1"
 simplelog = "0.12.0-alpha1"

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

@@ -16,7 +16,7 @@ async-executor = "1.4.1"
 easy-parallel = "3.2.0"
 
 # Misc
-clap = {version = "3.1.6", features = ["derive"]}
+clap = {version = "3.1.8", features = ["derive"]}
 log = "0.4.16"
 num_cpus = "1.13.1"
 simplelog = "0.12.0-alpha1"

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

@@ -18,16 +18,15 @@ async-executor = "1.4.1"
 easy-parallel = "3.2.0"
 
 # Misc
-clap = {version = "3.1.6", features = ["derive"]}
+clap = {version = "3.1.8", features = ["derive"]}
 log = "0.4.16"
 num_cpus = "1.13.1"
 simplelog = "0.12.0-alpha1"
 rand = "0.8.5"
 chrono = "0.4.19"
-thiserror = "1.0.24"
+thiserror = "1.0.30"
 
 # Encoding and parsing
 serde_json = "1.0.79"
 serde = {version = "1.0.136", features = ["derive"]}
-ctrlc-async = {version= "3.2.2", features = ["termination"]}
-
+ctrlc-async = {version= "3.2.2", default-features = false, features = ["async-std", "termination"]}

+ 1 - 1
bin/vanityaddr/Cargo.toml

@@ -16,4 +16,4 @@ darkfi = {path = "../../", features = ["crypto"]}
 indicatif = "0.17.0-rc.10"
 num_cpus = "1.13.1"
 rand = "0.8.5"
-rayon = "1.5.1"
+rayon = "1.5.2"

+ 1 - 1
bin/zkas/Cargo.toml

@@ -9,5 +9,5 @@ license = "AGPL-3.0-only"
 edition = "2021"
 
 [dependencies]
-clap = {version = "3.1.6", features = ["derive"]}
+clap = {version = "3.1.8", features = ["derive"]}
 darkfi = {path = "../../", features = ["zkas"]}

+ 1 - 1
example/net.rs

@@ -1,4 +1,4 @@
-use std::{net::SocketAddr, str::FromStr, sync::Arc};
+use std::{net::SocketAddr, sync::Arc};
 
 use async_executor::Executor;
 use clap::Parser;

+ 1 - 1
script/research/consensusd/Cargo.toml

@@ -20,7 +20,7 @@ async-executor = "1.4.1"
 easy-parallel = "3.2.0"
 
 # Misc
-clap = {version = "3.1.6", features = ["derive"]}
+clap = {version = "3.1.8", features = ["derive"]}
 log = "0.4.16"
 num_cpus = "1.13.1"
 simplelog = "0.12.0-alpha1"

+ 1 - 1
script/research/validatord/Cargo.toml

@@ -26,7 +26,7 @@ serde_derive = "1.0.136"
 serde_json = "1.0.79"
 structopt = "0.3.26"
 structopt-toml = "0.5.0"
-toml = "0.5.8"
+toml = "0.5.9"
 
 # Misc
 log = "0.4.16"

+ 3 - 3
src/util/derive-internal/Cargo.toml

@@ -4,6 +4,6 @@ version = "0.3.0"
 edition = "2021"
 
 [dependencies]
-proc-macro2 = "1.0.36"
-quote = "1.0.17"
-syn = {version = "1.0.89", features = ["full", "fold"]}
+proc-macro2 = "1.0.37"
+quote = "1.0.18"
+syn = {version = "1.0.91", features = ["full", "fold"]}

+ 2 - 2
src/util/derive/Cargo.toml

@@ -8,7 +8,7 @@ proc-macro = true
 
 [dependencies]
 proc-macro-crate = "1.1.3"
-proc-macro2 = "1.0.36"
-syn = {version = "1.0.89", features = ["full", "fold"]}
+proc-macro2 = "1.0.37"
+syn = {version = "1.0.91", features = ["full", "fold"]}
 
 darkfi-derive-internal = {path = "../derive-internal"}

Некоторые файлы не были показаны из-за большого количества измененных файлов