diff --git a/side-node/src/websocket/mod.rs b/side-node/src/websocket/mod.rs index ff8f6fc..7e9553d 100644 --- a/side-node/src/websocket/mod.rs +++ b/side-node/src/websocket/mod.rs @@ -19,31 +19,23 @@ pub(crate) async fn start( let _ = list_transaction_crdt::send(count, bft_crdt, &mut ws, &keys).await; let msg = ws.receive().await?; - // println!("Received: {:?}", msg); // deserialize the received websocket Frame into a string let msg = msg.into_text().unwrap().0; // deserialize the message into a Transaction struct let incoming_operation: SignedOp = serde_json::from_str(&msg).unwrap(); - // let hash = sha256::digest(incoming_operation.inner.hash()); - // let hash = incoming_operation.inner.hash(); + let author = general_purpose::STANDARD.encode(&incoming_operation.author()); println!("Received from {:?}", author); bft_crdt.apply(incoming_operation.clone()); - // println!("New crdt state is: {}", bft_crdt.doc.view()); - count = count + 1; interval.tick().await; } } -// fn every_two_seconds() -> time::Interval { -// time::interval(time::Duration::from_secs(2)) -// } - fn every_ten_seconds() -> time::Interval { time::interval(time::Duration::from_secs(10)) }