Updated some dependencies, got rid of Bitcoin stuff which wasn't in use

This commit is contained in:
Dave
2025-06-12 15:24:19 -04:00
parent 693ce3fafe
commit a8a5422ea8
12 changed files with 324 additions and 1455 deletions

View File

@@ -6,34 +6,24 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.86"
async-trait = "0.1.52"
bdk = { version = "0.29.0", default-feature = false, features = ["all-keys"] }
bdk_esplora = "0.15.0"
bdk_sqlite = "0.2.0"
bdk_wallet = { version = "1.0.0-alpha.13", features = ["all-keys"] }
anyhow = "1.0.98"
async-trait = "0.1.88"
bft-json-crdt = { path = "../crates/bft-json-crdt" }
bft-crdt-derive = { path = "../crates/bft-json-crdt/bft-crdt-derive" }
bitcoin = { version = "0.32.2", features = ["rand"] }
clap = { version = "4.5.4", features = ["derive"] }
dirs = "5.0.1"
electrum-client = "0.20"
clap = { version = "4.5.40", features = ["derive"] }
dirs = "6.0.0"
ezsockets = { version = "*", features = ["client"] }
fastcrypto = "0.1.8"
indexmap = { version = "2.2.6", features = ["serde"] }
reqwest = { version = "*", features = ["blocking"] }
# serde_cbor = "0.11.2" # move to this once we need to pack things in CBOR
fastcrypto = "0.1.9"
indexmap = { version = "2.9.0", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.117"
sha256 = "1.5.0"
tokio = { version = "1.37.0", features = ["full"] }
toml = "0.8.14"
tracing = "0.1.32"
# tracing-subscriber = "0.3.9"
serde_json = "1.0.140"
sha256 = "1.6.0"
tokio = { version = "1.45.1", features = ["full"] }
toml = "0.8.23"
tracing = "0.1.41"
[dev-dependencies]
uuid = { version = "1.8.0", features = ["v4"] }
uuid = { version = "1.17.0", features = ["v4"] }
[features]
default = ["bft", "logging-list", "logging-json"]

View File

@@ -18,7 +18,7 @@ pub(crate) struct Args {
#[derive(Subcommand)]
pub(crate) enum Commands {
/// Placeholder for future BTC commands
Btc {},
// Btc {},
/// runs the Side Node
Run { name: String },

View File

@@ -2,7 +2,7 @@ use std::path::PathBuf;
use config::SideNodeConfig;
use crate::{bft_crdt, bitcoin, utils};
use crate::{bft_crdt, utils}; //bitcoin
pub(crate) mod config;
@@ -14,7 +14,7 @@ pub(crate) fn init(home: PathBuf, config: SideNodeConfig) -> Result<(), std::io:
bft_crdt::keys::write(&bft_crdt_key_path)?;
println!("Writing bitcoin key to: {:?}", bitcoin_key_path);
bitcoin::keys::write(&bitcoin_key_path)?;
// bitcoin::keys::write(&bitcoin_key_path)?;
println!("Writing config to: {:?}", config_path);
config::write_toml(&config, &config_path).expect("unable to write config file");

View File

@@ -6,7 +6,7 @@ use node::SideNode;
use tokio::{sync::mpsc, task};
pub mod bft_crdt;
pub mod bitcoin;
// pub mod bitcoin;
pub(crate) mod cli;
pub(crate) mod init;
pub mod node;
@@ -28,9 +28,9 @@ pub async fn run() {
let mut node = setup(name).await;
node.start().await;
}
Some(Commands::Btc {}) => {
let _ = bitcoin::driver::run().await;
}
// Some(Commands::Btc {}) => {
// let _ = bitcoin::driver::run().await;
// }
None => println!("No command provided. Exiting. See --help for more information."),
}
}
@@ -40,8 +40,8 @@ async fn setup(name: &String) -> SideNode {
// First, load up the keys and create a bft-bft-crdt
let side_dir = utils::home(name);
let bft_crdt_keys = bft_crdt::keys::load_from_file(&side_dir);
let keys = bitcoin::keys::load_from_file(&side_dir).unwrap();
let bitcoin_wallet = bitcoin::clients::electrum::create_wallet(keys).unwrap();
// let keys = bitcoin::keys::load_from_file(&side_dir).unwrap();
// let bitcoin_wallet = bitcoin::clients::electrum::create_wallet(keys).unwrap();
let crdt = BaseCrdt::<TransactionList>::new(&bft_crdt_keys);
// Channels for internal communication, and a tokio task for stdin input
@@ -56,7 +56,7 @@ async fn setup(name: &String) -> SideNode {
let node = SideNode::new(
crdt,
bft_crdt_keys,
bitcoin_wallet,
// bitcoin_wallet,
incoming_receiver,
stdin_receiver,
handle,

View File

@@ -1,4 +1,4 @@
use bdk::database::MemoryDatabase;
// use bdk::database::MemoryDatabase;
use bft_json_crdt::json_crdt::{BaseCrdt, SignedOp};
use fastcrypto::ed25519::Ed25519KeyPair;
use tokio::sync::mpsc;
@@ -8,7 +8,7 @@ use crate::{bft_crdt::websocket::Client, bft_crdt::TransactionList, utils};
pub struct SideNode {
crdt: BaseCrdt<TransactionList>,
bft_crdt_keys: fastcrypto::ed25519::Ed25519KeyPair,
_bitcoin_wallet: bdk::Wallet<MemoryDatabase>, // currently not read anywhere
// _bitcoin_wallet: bdk::Wallet<MemoryDatabase>, // currently not read anywhere
incoming_receiver: mpsc::Receiver<SignedOp>,
stdin_receiver: std::sync::mpsc::Receiver<String>,
handle: ezsockets::Client<Client>,
@@ -18,7 +18,7 @@ impl SideNode {
pub fn new(
crdt: BaseCrdt<TransactionList>,
bft_crdt_keys: Ed25519KeyPair,
bitcoin_wallet: bdk::Wallet<MemoryDatabase>,
// bitcoin_wallet: bdk::Wallet<MemoryDatabase>,
incoming_receiver: mpsc::Receiver<SignedOp>,
stdin_receiver: std::sync::mpsc::Receiver<String>,
handle: ezsockets::Client<Client>,
@@ -26,7 +26,7 @@ impl SideNode {
let node = Self {
crdt,
bft_crdt_keys,
_bitcoin_wallet: bitcoin_wallet,
// _bitcoin_wallet: bitcoin_wallet,
incoming_receiver,
stdin_receiver,
handle,

View File

@@ -1,7 +1,7 @@
use bft_json_crdt::json_crdt::BaseCrdt;
use bft_json_crdt::keypair::make_keypair;
use bft_json_crdt::op::ROOT_ID;
use side_node::bft_crdt::TransactionList;
use crdt_node::bft_crdt::TransactionList;
// case 1 - send valid updates
#[test]
@@ -11,9 +11,9 @@ fn test_valid_updates() {
let keypair1 = make_keypair();
let mut crdt1 = BaseCrdt::<TransactionList>::new(&keypair1);
let val_a = side_node::utils::fake_generic_transaction_json(String::from("a"));
let val_b = side_node::utils::fake_generic_transaction_json(String::from("b"));
let val_c = side_node::utils::fake_generic_transaction_json(String::from("c"));
let val_a = crdt_node::utils::fake_generic_transaction_json(String::from("a"));
let val_b = crdt_node::utils::fake_generic_transaction_json(String::from("b"));
let val_c = crdt_node::utils::fake_generic_transaction_json(String::from("c"));
let _a = crdt1
.doc

View File

@@ -2,9 +2,7 @@ use bft_json_crdt::{
json_crdt::{BaseCrdt, SignedOp},
keypair::make_keypair,
};
use side_node::{
bft_crdt::websocket::Client, bft_crdt::TransactionList, bitcoin, node::SideNode, utils,
};
use crdt_node::{bft_crdt::websocket::Client, bft_crdt::TransactionList, node::SideNode, utils};
use tokio::sync::mpsc;
#[tokio::test]
@@ -37,9 +35,9 @@ async fn test_distribute_via_websockets() {
async fn setup(_: &str) -> SideNode {
// First, load up the keys and create a bft-bft-crdt
let bft_crdt_keys = make_keypair();
let mnemonic_words = bitcoin::keys::make_mnemonic();
let keys = bitcoin::keys::get(mnemonic_words).unwrap();
let bitcoin_wallet = bitcoin::clients::electrum::create_wallet(keys).unwrap();
// let mnemonic_words = bitcoin::keys::make_mnemonic();
// let keys = bitcoin::keys::get(mnemonic_words).unwrap();
// let bitcoin_wallet = bitcoin::clients::electrum::create_wallet(keys).unwrap();
let crdt = BaseCrdt::<TransactionList>::new(&bft_crdt_keys);
// Channels for internal communication, and a tokio task for stdin input
@@ -51,7 +49,7 @@ async fn setup(_: &str) -> SideNode {
let node = SideNode::new(
crdt,
bft_crdt_keys,
bitcoin_wallet,
// bitcoin_wallet,
incoming_receiver,
stdin_receiver,
handle,