2 Commits

Author SHA1 Message Date
Dave
c528160d34 Moved websocket out onto the root 2025-06-12 16:32:22 -04:00
Dave
0126614dd3 Moved stdin onto root 2025-06-12 16:27:41 -04:00
6 changed files with 6 additions and 7 deletions

View File

@@ -6,8 +6,6 @@ use bft_json_crdt::{
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
pub mod keys; pub mod keys;
pub mod stdin;
pub mod websocket;
#[add_crdt_fields] #[add_crdt_fields]
#[derive(Clone, CrdtNode, Serialize, Deserialize, Debug)] #[derive(Clone, CrdtNode, Serialize, Deserialize, Debug)]

View File

@@ -1,4 +1,3 @@
use bft_crdt::websocket;
use bft_crdt::TransactionList; use bft_crdt::TransactionList;
use bft_json_crdt::json_crdt::{BaseCrdt, SignedOp}; use bft_json_crdt::json_crdt::{BaseCrdt, SignedOp};
use cli::Commands; use cli::Commands;
@@ -9,7 +8,9 @@ pub mod bft_crdt;
pub(crate) mod cli; pub(crate) mod cli;
pub(crate) mod init; pub(crate) mod init;
pub mod node; pub mod node;
mod stdin;
pub mod utils; pub mod utils;
pub mod websocket;
#[tokio::main] #[tokio::main]
pub async fn run() { pub async fn run() {
@@ -42,7 +43,7 @@ async fn setup(name: &String) -> SideNode {
let (incoming_sender, incoming_receiver) = mpsc::channel::<SignedOp>(32); let (incoming_sender, incoming_receiver) = mpsc::channel::<SignedOp>(32);
let (stdin_sender, stdin_receiver) = std::sync::mpsc::channel(); let (stdin_sender, stdin_receiver) = std::sync::mpsc::channel();
task::spawn(async move { task::spawn(async move {
bft_crdt::stdin::input(stdin_sender); stdin::input(stdin_sender);
}); });
// Wire the websocket client to the incoming channel // Wire the websocket client to the incoming channel

View File

@@ -3,7 +3,7 @@ use bft_json_crdt::json_crdt::{BaseCrdt, SignedOp};
use fastcrypto::ed25519::Ed25519KeyPair; use fastcrypto::ed25519::Ed25519KeyPair;
use tokio::sync::mpsc; use tokio::sync::mpsc;
use crate::{bft_crdt::websocket::Client, bft_crdt::TransactionList, utils}; use crate::{bft_crdt::TransactionList, utils, websocket::Client};
pub struct SideNode { pub struct SideNode {
crdt: BaseCrdt<TransactionList>, crdt: BaseCrdt<TransactionList>,

View File

@@ -2,7 +2,7 @@ use bft_json_crdt::{
json_crdt::{BaseCrdt, SignedOp}, json_crdt::{BaseCrdt, SignedOp},
keypair::make_keypair, keypair::make_keypair,
}; };
use crdt_node::{bft_crdt::websocket::Client, bft_crdt::TransactionList, node::SideNode, utils}; use crdt_node::{bft_crdt::TransactionList, node::SideNode, utils, websocket};
use tokio::sync::mpsc; use tokio::sync::mpsc;
#[tokio::test] #[tokio::test]
@@ -42,7 +42,7 @@ async fn setup(_: &str) -> SideNode {
let (_, stdin_receiver) = std::sync::mpsc::channel(); let (_, stdin_receiver) = std::sync::mpsc::channel();
// Finally, create the node and return it // Finally, create the node and return it
let handle = Client::new(incoming_sender).await; let handle = websocket::Client::new(incoming_sender).await;
let node = SideNode::new( let node = SideNode::new(
crdt, crdt,
bft_crdt_keys, bft_crdt_keys,