2024-06-06 19:25:54 +01:00
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
loop {
|
|
|
|
|
let _ = list_transaction_crdt::send(count, bft_crdt, &mut ws, &keys).await;
|
|
|
|
|
|
|
|
|
|
let msg = ws.receive().await?;
|
|
|
|
|
|
|
|
|
|
// deserialize the received websocket Frame into a string
|
|
|
|
|
let msg = msg.into_text().unwrap().0;
|
2024-05-29 18:17:34 +01:00
|
|
|
|
2024-06-06 19:25:54 +01:00
|
|
|
// deserialize the message into a Transaction struct
|
|
|
|
|
let incoming_operation: SignedOp = serde_json::from_str(&msg).unwrap();
|
|
|
|
|
|
|
|
|
|
let author = general_purpose::STANDARD.encode(&incoming_operation.author());
|
|
|
|
|
println!("Received from {:?}", author);
|
|
|
|
|
|
|
|
|
|
bft_crdt.apply(incoming_operation.clone());
|
|
|
|
|
|
|
|
|
|
count = count + 1;
|
|
|
|
|
interval.tick().await;
|
2024-06-05 18:22:11 +01:00
|
|
|
}
|
2024-06-06 19:25:54 +01:00
|
|
|
|
|
|
|
|
*/
|