diff --git a/.gitignore b/.gitignore
index 10f61db..5d12fc9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,6 @@
# ide
.vscode
+
+# lint
+.protolint.yaml
\ No newline at end of file
diff --git a/Cargo.toml b/Cargo.toml
index b240274..84d729f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "hetu"
+name = "chronos"
version = "0.1.0"
edition = "2021"
@@ -9,10 +9,6 @@ members = [
"crates/accumulator",
"crates/vlc",
"crates/cops",
- "tools/replication-control",
- "tools/replication-control-messages",
- "tools/kademlia-control-messages",
- "zchronod/zchronod",
"demos/test_conflict",
"demos/coll-tx",
"demos/vlc-dag"
@@ -29,9 +25,7 @@ async-trait = "0.1.74"
axum = "0.7.1"
borsh = { version = "1.2.0", features = ["derive"] }
ethnum = "1.5.0"
-kademlia-control-messages = { version = "0.1.0", path = "tools/kademlia-control-messages" }
rand = "0.8.5"
-replication-control-messages = { version = "0.1.0", path = "tools/replication-control-messages" }
secp256k1 = { version = "0.28.0", features = [
"hashes",
"rand",
@@ -41,6 +35,6 @@ tokio = { version = "1.33.0", features = ["full"] }
tokio-util = "0.7.10"
[lib]
-name = "test"
+name = "chronos"
path = "src/lib.rs"
diff --git a/README.md b/README.md
index 25956e5..402776a 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,72 @@
-# Hetu
+# Chronos
-This is the developing prototype of Hetu, a general-propose message-passing framework which consider causality as first class citizen.
+## Overview
-Project layout:
+This repository is the developing prototype of Hetu chronos, a general-propose message-passing framework which consider causality as first class citizen.
-* `src/` the shared core definitions, including multiplex-enabled transport abstraction, Tokio-integration helpers, cryptography-related types, etc.
-* `docs/` high-level design documents
-* `tools/` scripts for testing and benchmarking
+The chronos is a novel logical clock system designed for open networks with Byzantine participants, offering improved fault tolerance and performance. It introduces a customizable validator abstraction and has been successfully applied to develop decentralized applications with minimal overhead.
+
+## Layout & Toc
+
+Chronos organization layout is as follows:
+
+* [`crates/`](./crates/) the common dependences and core functional crates folder.
+* [`demos/`](./demos/) some use cases of applied the Chronos and proposals.
+* [`docs/`](./docs/) design and applied documents for demonstrating thoughts.
+* `src/` the source codebase of shared definitions and some common codes.
+
+## Features
+
+The Chronos is a novel verifiable logical clock system that can target many problems that can't be handled by the regular logical clock.
+
+Here are some core new features are provided by the Chronos:
+
+* [x] Programmable and verifiable vector logic clock
+* [x] Provides networks events causality partially order graph capability
+* [x] High-performance replication state machine with logical clock Byzantine fault tolerance
+* [x] Three verifiable warranties are provided: clock update proof, monotonicity proof, application-specific proof
+* [x] Three validation backends are supported: quorum certificate, trusted hardware (TEE), verifiable computation (ZKP)
+
+Please refer to [hetu key research](https://github.com/hetu-project#hetu-key-research) for more details
+
+## Applied scenarios
+
+Regular logical clock have been applied in many scenarios. As follows:
+
+- Weakly consistent storage systems
+ - `Cops: causally Consistent Data Store`
+- Causally ordered broadcast
+ - [Reference: vlc + p2p combined](https://github.com/NagaraTech/hetu-docs/blob/main/Zeb/vlc.md)
+- Deadlock detection
+ - `Mutual exclusion` of shared resources in a distributed system
+ - Bakery algorithm
+- Distributed snapshots
+- Distributed system debugging.
+
+For sure, the verifiable logical clock is an enhanced version of a regular logical clock that can do everything a regular clock can do.
+
+
+## Building
+
+```sh
+git clone https://github.com/hetu-project/chronos.git
+
+cd chronos
+
+cargo build
+```
+
+## Contributing
+
+We welcome all contributions! There are many ways to contribute to the project, including but not limited to:
+
+- Cloning code repo and opening a [PR](https://github.com/hetu-project/chronos/pulls).
+- Submitting feature requests or [bugs](https://github.com/hetu-project/chronos/issues).
+- Improving our product or contribution [documentation](./docs/).
+- Contributing [use cases](./demos/) to a feature request.
+
+## Contact
+
+- [Open an Issue](https://github.com/hetu-project/chronos/issues)
+- [Hetu Protocol](https://github.com/hetu-project#hetu-key-research)
+- [Follow us on Twitter](https://x.com/hetu_protocol)
\ No newline at end of file
diff --git a/crates/README.md b/crates/README.md
new file mode 100644
index 0000000..096215e
--- /dev/null
+++ b/crates/README.md
@@ -0,0 +1,22 @@
+# Core Functional Crates
+
+The crates folder of Chronos includes core functional code crates and utility libraries, etc.
+
+## [vlc](./vlc/)
+
+- This verifiable logical clock crate implements a verifiable logical clock construct.
+- The clock can be used in a peer-to-peer network to order events.
+- Any node in the network can verify the correctness of the clock.
+
+## [accumulator](./accumulator/)
+
+- A simple accumulator application.
+- Each accumulator node maintains a set of strings. Upon receiving a string from a client, the node adds the string to its state, and broadcast the new state to other nodes in the network.
+- All nodes eventually converge to the same state, by merging received states into their own states.
+
+## [cops](./cops/)
+
+- A causally consistent data store inspired by [COPS](https://www.cs.cmu.edu/~dga/papers/cops-sosp2011.pdf).
+- The data store maintains a set of key-value pairs.
+- It provides causal consistency to clients.
+
diff --git a/demos/README.md b/demos/README.md
index 129f59a..09f8ca6 100644
--- a/demos/README.md
+++ b/demos/README.md
@@ -1,3 +1,34 @@
-## demos
+# Demos
The demos folder of VLC includes code and document collections, including usage examples, design plans, integration, etc.
+
+## [VLC-Dag](./vlc-dag/)
+
+A vlc-dag application. The vlc-dag use case demo is base on the simple accumulator application.
+
+Please reference on [crates/accumulator](../crates/accumulator/). But add new features as follow:
+
+* Defined the vertex and edge of the event & clock propagation dag.
+* Support the LMDB to persistence storage for now,
+* Maybe time-series db,like influxDB, or related postgre more suitable.
+* Support increment state sync with peers using p2p communication protocol.
+
+So we can use the vertex and edge from db to reconstruct clock propagation dag.
+
+## [Randomness](./Randomness/)
+
+This use case demo is mainly consist of two proposals.
+
+#### VLC & BLS Proposal
+Randomness serves a vital role in nearly every aspect of current society,the idea is to intergrate the ablility of logical clocks into random generator. To generate verifiable, fair random numbers, the proposal integrates BLS.
+
+#### VLC & VRF Proposal
+Randomness serves a vital role in nearly every aspect of current society,the idea is to intergrate the ablility of logical clocks into random generator. To generate verifiable, fair random numbers, the proposal integrates VRF.
+
+## [Test-Conflict](./test_conflict/)
+
+This use case domo is designed to detect software version conflict by applied vector clock.
+
+## [Coll-Tx](./coll-tx/)
+
+The coll-tx demo is about collecting simple utxo transaction with cops and vlc.
\ No newline at end of file
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000..14eb62f
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,8 @@
+# Document warehouse
+
+This document warehouse mainly consist of following parts:
+
+## Applied specification
+ - [vlc and application brief description](./applied/vlc%20and%20application%20brief%20description.md)
+## Design Documents
+ - [Concurrent Stateful Apps with Sessions](./design/Concurrent%20Stateful%20Apps%20with%20Sessions.md)libraries
\ No newline at end of file
diff --git a/docs/applied/vlc and application brief description.md b/docs/applied/vlc and application brief description.md
new file mode 100644
index 0000000..757a783
--- /dev/null
+++ b/docs/applied/vlc and application brief description.md
@@ -0,0 +1,73 @@
+# vlc and application brief description
+
+# Prerequisites
+
+## **Lamport clock**
+
+The Lamport clock is a logical clock used to `order events` in a distributed system. It provides a way to capture the "`happens-before`" relationship between events, which is essential for understanding `causality`.
+
+
+
+### Examples
+
+Consider two processes, P1 and P2:
+
+- P1 starts with a clock value of 1, performs an event (clock becomes 2), and sends a message to P2 with the timestamp 2.
+- P2 receives the message with timestamp 2, and updates its clock to `max(current clock, 2) + 1` (e.g., if P2's current clock was 1, it becomes 3).
+
+### Conclusions
+
+- `Cannot capture concurrent events` (events that are not causally related).
+ - As shown in the above picture, `events a and b`
+- It constructs `fail to work` in an open network with `Byzantine participants`.
+
+## **Vector clock**
+
+Vector clocks are an `extension of Lamport clocks` that provide more detailed information about the causality of events. Each process `maintains a vector of clock values`, one for each process in the system.
+
+
+
+### Examples
+
+Consider two processes, P1 and P2:
+
+- P1's vector clock is initially `[0, 0]`. It performs an event, updating to `[1, 0]`, and sends a message to P2.
+- P2's vector clock is `[0, 0]`. Upon receiving the message with vector clock `[1, 0]`, it updates to `[1, 1]` (assuming it performs an event after receiving).
+
+### Conclusions
+
+- It constructs `fail to work` in an open network with `Byzantine participants`.
+
+# VLC (Verifiable Logical Clock)
+
+Without reliable logical clocks, systems and applications `are forced to use expensive BFT SMR` protocols which `enforces total order` of requests, `even though` their application semantics may `only require partial ordering` guarantees.
+
+## Chrono overview
+
+So, vlc (verifiable logical clock) is construct atop on vector clock, and add the verifiable proof feature. The chrono is as a concrete instance of VLC. More detail could read the paper of [`Building a Verifiable Logical Clock for P2P Networks`](https://arxiv.org/pdf/2405.13349)
+
+
+
+## Validator backends
+
+
+
+# Applications & use cases
+
+Two use cases, `causally Consistent Data Store` and `mutual exclusion`, are introduced in detail in [paper](https://arxiv.org/pdf/2405.13349).
+
+## Regular logical clock use case
+
+Regular logical clock have been applied in many scenarios. As follows:
+
+- Weakly consistent storage systems
+ - `Cops: causally Consistent Data Store`
+- Causally ordered broadcast
+ - [Reference: vlc + p2p combined](https://github.com/NagaraTech/hetu-docs/blob/main/Zeb/vlc.md)
+- Deadlock detection
+ - `Mutual exclusion` of shared resources in a distributed system
+ - Bakery algorithm
+- Distributed snapshots
+- Distributed system debugging.
+
+For sure, the verifiable logical clock is an enhanced version of a regular logical clock that can do everything a regular clock can do.
diff --git a/docs/session.md b/docs/design/Concurrent Stateful Apps with Sessions.md
similarity index 100%
rename from docs/session.md
rename to docs/design/Concurrent Stateful Apps with Sessions.md
diff --git a/docs/public/img/chronos-overview.png b/docs/public/img/chronos-overview.png
new file mode 100644
index 0000000..49aae0e
Binary files /dev/null and b/docs/public/img/chronos-overview.png differ
diff --git a/docs/public/img/chronos-validator-backends.png b/docs/public/img/chronos-validator-backends.png
new file mode 100644
index 0000000..070a82d
Binary files /dev/null and b/docs/public/img/chronos-validator-backends.png differ
diff --git a/docs/public/img/lamport-clock.png b/docs/public/img/lamport-clock.png
new file mode 100644
index 0000000..0a2a4c6
Binary files /dev/null and b/docs/public/img/lamport-clock.png differ
diff --git a/docs/public/img/vector-clock.png b/docs/public/img/vector-clock.png
new file mode 100644
index 0000000..d199ee9
Binary files /dev/null and b/docs/public/img/vector-clock.png differ
diff --git a/tools/kademlia-control-messages/Cargo.toml b/tools/kademlia-control-messages/Cargo.toml
deleted file mode 100644
index 3e90234..0000000
--- a/tools/kademlia-control-messages/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-name = "kademlia-control-messages"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-serde = { version = "1.0.193", features = ["derive"] }
diff --git a/tools/kademlia-control-messages/src/lib.rs b/tools/kademlia-control-messages/src/lib.rs
deleted file mode 100644
index b1814de..0000000
--- a/tools/kademlia-control-messages/src/lib.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-use std::net::IpAddr;
-
-use serde::{Deserialize, Serialize};
-
-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-
-pub struct Config {
- pub seed: u64,
- pub num_host_peer: usize,
- pub hosts: Vec,
- pub index: (usize, usize),
-}
-
-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-pub struct FindPeer {
- pub target: [u8; 32],
- pub count: usize,
-}
diff --git a/tools/replication-control-messages/Cargo.toml b/tools/replication-control-messages/Cargo.toml
deleted file mode 100644
index 6aeed05..0000000
--- a/tools/replication-control-messages/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-name = "replication-control-messages"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-serde = { version = "1.0.193", features = ["derive"] }
diff --git a/tools/replication-control-messages/src/lib.rs b/tools/replication-control-messages/src/lib.rs
deleted file mode 100644
index 54879d2..0000000
--- a/tools/replication-control-messages/src/lib.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-use std::{collections::HashMap, net::SocketAddr, ops::Range};
-
-use serde::{Deserialize, Serialize};
-
-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-pub struct Client {
- pub id_range: Range,
- pub addr_book: AddrBook,
- pub num_replica: usize,
- pub num_faulty: usize,
- pub protocol: Protocol,
-}
-
-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-pub struct Replica {
- pub id: u8,
- pub addr_book: AddrBook,
- pub num_replica: usize,
- pub num_faulty: usize,
- pub protocol: Protocol,
-}
-
-#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
-pub struct AddrBook {
- pub replica_addrs: HashMap,
- pub client_addrs: HashMap,
-}
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
-pub enum Protocol {
- Unreplicated,
- Pbft,
-}
diff --git a/tools/replication-control/Cargo.toml b/tools/replication-control/Cargo.toml
deleted file mode 100644
index 98bd9c4..0000000
--- a/tools/replication-control/Cargo.toml
+++ /dev/null
@@ -1,13 +0,0 @@
-[package]
-name = "replication-control"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-anyhow = { version = "1.0.75", features = ["backtrace"] }
-replication-control-messages = { version = "0.1.0", path = "../replication-control-messages" }
-reqwest = { version = "0.11.22", default-features = false, features = ["json"] }
-tokio = { version = "1.34.0", features = ["full"] }
-tokio-util = "0.7.10"
diff --git a/tools/replication-control/src/main.rs b/tools/replication-control/src/main.rs
deleted file mode 100644
index 65da144..0000000
--- a/tools/replication-control/src/main.rs
+++ /dev/null
@@ -1,138 +0,0 @@
-use std::{convert::identity, sync::OnceLock, time::Duration};
-
-use messages::AddrBook;
-use replication_control_messages as messages;
-use tokio::{
- task::JoinSet,
- time::{sleep, timeout},
-};
-use tokio_util::sync::CancellationToken;
-
-#[tokio::main]
-async fn main() -> anyhow::Result<()> {
- CLIENT
- .set(
- reqwest::Client::builder()
- .timeout(Duration::from_secs(1))
- .build()?,
- )
- .unwrap();
- let result = benchmark_session(messages::Protocol::Unreplicated).await?;
- // let result = benchmark_session(messages::Protocol::Pbft).await?;
- println!("{result:?}");
- Ok(())
-}
-
-static CLIENT: OnceLock = OnceLock::new();
-
-async fn client_session(config: messages::Client, url: String) -> anyhow::Result<(f32, Duration)> {
- let client = CLIENT.get().unwrap();
- client
- .post(format!("{url}/run-client"))
- .json(&config)
- .send()
- .await?
- .error_for_status()?;
- loop {
- sleep(Duration::from_secs(1)).await;
- let result = client
- .post(format!("{url}/join-client"))
- .send()
- .await?
- .error_for_status()?
- .json()
- .await?;
- if let Some(result) = result {
- break Ok(result);
- }
- }
-}
-
-async fn replica_session(url: String, shutdown: CancellationToken) -> anyhow::Result<()> {
- let client = CLIENT.get().unwrap();
- while timeout(Duration::from_secs(1), shutdown.cancelled())
- .await
- .is_err()
- {
- client
- .get(format!("{url}/ok"))
- .send()
- .await?
- .error_for_status()?;
- }
- client
- .post(format!("{url}/reset-replica"))
- .send()
- .await?
- .error_for_status()?;
- Ok(())
-}
-
-async fn benchmark_session(protocol: messages::Protocol) -> anyhow::Result<(f32, Duration)> {
- let client = CLIENT.get().unwrap();
- let mut addr_book = AddrBook::default();
- addr_book
- .client_addrs
- .insert(0, ([127, 0, 0, 1], 20000).into());
- for i in 0..4 {
- addr_book
- .replica_addrs
- .insert(i, ([127, 0, 0, 1], 30000 + i as u16).into());
- }
- let num_faulty = match protocol {
- messages::Protocol::Unreplicated => 0,
- _ => 1,
- };
- let num_replica = 3 * num_faulty + 1;
-
- let mut replica_sessions = JoinSet::new();
- let shutdown = CancellationToken::new();
- let urls = [
- "http://127.0.0.1:10000",
- "http://127.0.0.1:10001",
- "http://127.0.0.1:10002",
- "http://127.0.0.1:10003",
- ];
- for (i, url) in urls.into_iter().enumerate().take(num_replica) {
- let config = messages::Replica {
- id: i as _,
- addr_book: addr_book.clone(),
- num_replica,
- num_faulty,
- protocol,
- };
- client
- .post(format!("{url}/run-replica"))
- .json(&config)
- .send()
- .await?
- .error_for_status()?;
- replica_sessions.spawn(replica_session(url.into(), shutdown.clone()));
- }
- let mut client_sessions = JoinSet::new();
- let config = messages::Client {
- id_range: 0..1,
- addr_book,
- num_replica,
- num_faulty,
- protocol,
- };
- let url = "http://127.0.0.1:10004".into();
- client_sessions.spawn(client_session(config, url));
- let mut throughput_sum = 0.;
- let mut latency_sum = Duration::ZERO;
- while let Some(client_result) = tokio::select! {
- result = client_sessions.join_next() => result,
- result = replica_sessions.join_next() => Err(result.unwrap().map_err(Into::into).and_then(identity).unwrap_err())?,
- } {
- // println!("{client_result:?}");
- let (throughput, latency) = client_result??;
- throughput_sum += throughput;
- latency_sum += latency * throughput as _;
- }
- shutdown.cancel();
- while let Some(replica_result) = replica_sessions.join_next().await {
- replica_result??
- }
- Ok((throughput_sum, latency_sum / throughput_sum.ceil() as _))
-}
diff --git a/zchronod/db_sql/Cargo.lock b/zchronod/db_sql/Cargo.lock
deleted file mode 100644
index db6f0f8..0000000
--- a/zchronod/db_sql/Cargo.lock
+++ /dev/null
@@ -1,387 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "addr2line"
-version = "0.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
-dependencies = [
- "gimli",
-]
-
-[[package]]
-name = "adler"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-
-[[package]]
-name = "async-trait"
-version = "0.1.79"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.58",
-]
-
-[[package]]
-name = "backtrace"
-version = "0.3.71"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d"
-dependencies = [
- "addr2line",
- "cc",
- "cfg-if 1.0.0",
- "libc",
- "miniz_oxide",
- "object",
- "rustc-demangle",
-]
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "cc"
-version = "1.0.92"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41"
-
-[[package]]
-name = "cfg-if"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "cloudabi"
-version = "0.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
-name = "convert_case"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
-
-[[package]]
-name = "derive_more"
-version = "0.99.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
-dependencies = [
- "convert_case",
- "proc-macro2",
- "quote",
- "rustc_version",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "either"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
-
-[[package]]
-name = "gimli"
-version = "0.28.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
-
-[[package]]
-name = "itertools"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "libc"
-version = "0.2.153"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
-
-[[package]]
-name = "lock_api"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75"
-dependencies = [
- "scopeguard",
-]
-
-[[package]]
-name = "memchr"
-version = "2.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
-
-[[package]]
-name = "miniz_oxide"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
-dependencies = [
- "adler",
-]
-
-[[package]]
-name = "object"
-version = "0.32.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
-
-[[package]]
-name = "parking_lot"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e"
-dependencies = [
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b93f386bb233083c799e6e642a9d73db98c24a5deeb95ffc85bf281255dffc98"
-dependencies = [
- "cfg-if 0.1.10",
- "cloudabi",
- "libc",
- "redox_syscall",
- "smallvec",
- "winapi",
-]
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.79"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.1.57"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
-
-[[package]]
-name = "rustc-demangle"
-version = "0.1.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
-
-[[package]]
-name = "rustc_version"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
-
-[[package]]
-name = "semver"
-version = "1.0.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca"
-
-[[package]]
-name = "shrinkwraprs"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e63e6744142336dfb606fe2b068afa2e1cca1ee6a5d8377277a92945d81fa331"
-dependencies = [
- "bitflags",
- "itertools",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "smallvec"
-version = "1.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
-
-[[package]]
-name = "syn"
-version = "1.0.109"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "syn"
-version = "2.0.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.58",
-]
-
-[[package]]
-name = "tokio"
-version = "1.37.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
-dependencies = [
- "backtrace",
- "pin-project-lite",
-]
-
-[[package]]
-name = "tracing"
-version = "0.1.40"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
-dependencies = [
- "pin-project-lite",
- "tracing-attributes",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-attributes"
-version = "0.1.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.58",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
-dependencies = [
- "once_cell",
-]
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "zchronod_db_sql"
-version = "0.1.0"
-dependencies = [
- "async-trait",
- "derive_more",
- "once_cell",
- "parking_lot",
- "shrinkwraprs",
- "thiserror",
- "tokio",
- "tracing",
-]
diff --git a/zchronod/db_sql/Cargo.toml b/zchronod/db_sql/Cargo.toml
deleted file mode 100644
index 3857761..0000000
--- a/zchronod/db_sql/Cargo.toml
+++ /dev/null
@@ -1,16 +0,0 @@
-[package]
-name = "db_sql"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-parking_lot = "0.10"
-once_cell = "1.4.1"
-thiserror = "1.0.58"
-derive_more = "0.99"
-tokio = "1.37.0"
-async-trait = "0.1.79"
-tracing = "0.1.40"
-shrinkwraprs = "0.3.0"
\ No newline at end of file
diff --git a/zchronod/db_sql/src/api.rs b/zchronod/db_sql/src/api.rs
deleted file mode 100644
index d11ea65..0000000
--- a/zchronod/db_sql/src/api.rs
+++ /dev/null
@@ -1,70 +0,0 @@
-use std::path::{Path, PathBuf};
-use std::sync::Arc;
-use std::sync::atomic::AtomicUsize;
-use shrinkwraprs::Shrinkwrap;
-use derive_more::Into;
-use crate::error::DatabaseResult;
-use crate::raw_db::RAW_DB_HANDLER;
-
-#[derive(Clone, Debug, Shrinkwrap, Into)]
-pub struct DbWrite(DbRead);
-
-impl DbWrite {
- pub fn open(
- path_prefix: &Path,
- kind: Kind,
- ) -> DatabaseResult {
- RAW_DB_HANDLER.get_or_insert(&kind, path_prefix, |kind| {
- Self::new(Some(path_prefix), kind)
- })
- }
- pub fn new(
- path_prefix: Option<&Path>,
- kind: Kind,
- ) -> DatabaseResult {
- todo!()
- }
-}
-
-pub trait DbKindT: Clone + std::fmt::Debug + Send + Sync + 'static {
- fn kind(&self) -> DbKind;
-
- fn filename(&self) -> PathBuf {
- let mut path = self.filename_inner();
- path.set_extension("sqlite3");
- path
- }
-
- fn filename_inner(&self) -> PathBuf;
-
- fn if_corrupt_wipe(&self) -> bool;
-}
-
-#[derive(Clone, Debug, PartialEq, Eq, Hash, derive_more::Display)]
-/// Specifies the environment used by a Conductor
-pub struct DbKindZchronod;
-
-impl DbKindT for DbKindZchronod {
- fn kind(&self) -> DbKind {
- DbKind::Zchronod
- }
-
- fn filename_inner(&self) -> PathBuf {
- ["zchronod", "zchronod"].iter().collect()
- }
-
- fn if_corrupt_wipe(&self) -> bool {
- false
- }
-}
-#[derive(Clone, Debug, PartialEq, Eq, Hash, derive_more::Display)]
-pub enum DbKind {
- //todo add db kind
- Zchronod,
-}
-
-#[derive(Clone, Debug)]
-pub struct DbRead {
- kind: Kind,
- path: PathBuf,
-}
\ No newline at end of file
diff --git a/zchronod/db_sql/src/error.rs b/zchronod/db_sql/src/error.rs
deleted file mode 100644
index 17eb384..0000000
--- a/zchronod/db_sql/src/error.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-use thiserror::Error;
-#[derive(Error, Debug)]
-pub enum DatabaseError {
- //todo add error type
-}
-
-pub type DatabaseResult = Result;
diff --git a/zchronod/db_sql/src/lib.rs b/zchronod/db_sql/src/lib.rs
deleted file mode 100644
index 33e6bbb..0000000
--- a/zchronod/db_sql/src/lib.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-pub mod raw_db;
-pub mod error;
-pub mod api;
\ No newline at end of file
diff --git a/zchronod/db_sql/src/raw_db.rs b/zchronod/db_sql/src/raw_db.rs
deleted file mode 100644
index ddf1efb..0000000
--- a/zchronod/db_sql/src/raw_db.rs
+++ /dev/null
@@ -1,66 +0,0 @@
-use std::any::Any;
-use std::collections::HashMap;
-use std::path::{Path, PathBuf};
-use once_cell::sync::Lazy;
-use crate::api::{DbKindT, DbWrite};
-use crate::error::DatabaseResult;
-
-pub struct RawDb {
- dbs: parking_lot::RwLock>>,
-}
-
-pub static RAW_DB_HANDLER: Lazy = Lazy::new(|| {
- /// get panic info if error occurs
- let orig_handler = std::panic::take_hook();
- std::panic::set_hook(Box::new(move |panic_info| {
- eprintln!("FATAL PANIC {:#?}", panic_info);
- orig_handler(panic_info);
- }));
-
- RawDb::init()
-});
-
-impl RawDb {
- pub fn init() -> Self {
- RawDb {
- dbs: parking_lot::RwLock::new(HashMap::new()),
- }
- }
- pub(super) fn get_or_insert(
- &self,
- kind: &Kind,
- path_prefix: &Path,
- insert: F,
- ) -> DatabaseResult>
- where
- Kind: DbKindT + Send + Sync + 'static,
- F: FnOnce(Kind) -> DatabaseResult>,
- {
- let path = path_prefix.join(kind.filename());
-
- let ret = self
- .dbs
- .read()
- .get(&path)
- .and_then(|d| d.downcast_ref::>().cloned());
- match ret {
- Some(ret) => Ok(ret),
- None => match self.dbs.write().entry(path) {
- // Note that this downcast is safe because the path is created
- // from the kind so will always be the correct type.
- std::collections::hash_map::Entry::Occupied(o) => Ok(o
- .get()
- .downcast_ref::>()
- .expect("Downcast to db kind failed. This is a bug")
- .clone()),
- std::collections::hash_map::Entry::Vacant(v) => {
- // If the db is missing we run the closure to create it.
- // Note the `Kind` is enforced by the closure return type.
- let db = insert(kind.clone())?;
- v.insert(Box::new(db.clone()));
- Ok(db)
- }
- },
- }
- }
-}
\ No newline at end of file
diff --git a/zchronod/node_api/Cargo.lock b/zchronod/node_api/Cargo.lock
deleted file mode 100644
index 1ce98b0..0000000
--- a/zchronod/node_api/Cargo.lock
+++ /dev/null
@@ -1,140 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "equivalent"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
-
-[[package]]
-name = "hashbrown"
-version = "0.14.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
-
-[[package]]
-name = "indexmap"
-version = "2.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
-dependencies = [
- "equivalent",
- "hashbrown",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.79"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "ryu"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1"
-
-[[package]]
-name = "serde"
-version = "1.0.197"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.197"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "serde_yaml"
-version = "0.9.34+deprecated"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
-dependencies = [
- "indexmap",
- "itoa",
- "ryu",
- "serde",
- "unsafe-libyaml",
-]
-
-[[package]]
-name = "syn"
-version = "2.0.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
-
-[[package]]
-name = "unsafe-libyaml"
-version = "0.2.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
-
-[[package]]
-name = "zchronod_node_api"
-version = "0.1.0"
-dependencies = [
- "serde",
- "serde_yaml",
- "thiserror",
-]
diff --git a/zchronod/node_api/Cargo.toml b/zchronod/node_api/Cargo.toml
deleted file mode 100644
index 8598ba5..0000000
--- a/zchronod/node_api/Cargo.toml
+++ /dev/null
@@ -1,11 +0,0 @@
-[package]
-name = "node_api"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-thiserror = "1.0.22"
-serde_yaml = "0.9"
-serde = { version = "1.0", features = [ "derive" ] }
\ No newline at end of file
diff --git a/zchronod/node_api/src/config.rs b/zchronod/node_api/src/config.rs
deleted file mode 100644
index 1cab577..0000000
--- a/zchronod/node_api/src/config.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-use std::path::PathBuf;
-use std::path::Path;
-use crate::error::{ZchronodConfigError, ZchronodConfigResult};
-use serde::Deserialize;
-use serde::Serialize;
-
-/// Zchronod Node Config
-#[derive(Clone, Deserialize, Serialize, Debug, Default)]
-pub struct ZchronodConfig {
- pub storage_root_path: Option,
-}
-
-#[derive(Clone, serde::Serialize, serde::Deserialize, Debug, Default)]
-pub struct StorageRootPath(PathBuf);
-
-impl StorageRootPath {
- pub fn as_path(&self) -> &Path {
- &self.0
- }
-}
-
-impl ZchronodConfig {
- pub fn load_config(path: PathBuf) -> ZchronodConfigResult {
- let p: &Path = path.as_ref();
- let config_yaml = std::fs::read_to_string(p).map_err(|err| match err {
- e @ std::io::Error { .. } if e.kind() == std::io::ErrorKind::NotFound => {
- ZchronodConfigError::ConfigMissing(path.into())
- }
- _ => err.into(),
- })?;
- serde_yaml::from_str(&config_yaml).map_err(ZchronodConfigError::SerializationError)
- }
-}
\ No newline at end of file
diff --git a/zchronod/node_api/src/error.rs b/zchronod/node_api/src/error.rs
deleted file mode 100644
index 8b8b9e7..0000000
--- a/zchronod/node_api/src/error.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-use std::path::PathBuf;
-use thiserror::Error;
-
-pub type ZchronodConfigResult = Result;
-
-#[derive(Error, Debug)]
-pub enum ZchronodConfigError {
- #[error("No conductor config found at this path: {0}")]
- ConfigMissing(PathBuf),
-
- #[error("Config deserialization error: {0}")]
- SerializationError(#[from] serde_yaml::Error),
-
- #[error("Error while performing IO for the Zchronod: {0}")]
- IoError(#[from] std::io::Error),
-}
-
-
-pub type ZchronodResult = Result;
-
-#[derive(Error, Debug)]
-pub enum ZchronodError {}
\ No newline at end of file
diff --git a/zchronod/node_api/src/lib.rs b/zchronod/node_api/src/lib.rs
deleted file mode 100644
index cc4a4de..0000000
--- a/zchronod/node_api/src/lib.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-pub mod config;
-pub mod error;
-
diff --git a/zchronod/p2p/Cargo.lock b/zchronod/p2p/Cargo.lock
deleted file mode 100644
index 25b7706..0000000
--- a/zchronod/p2p/Cargo.lock
+++ /dev/null
@@ -1,7 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "zchronod_p2p"
-version = "0.1.0"
diff --git a/zchronod/p2p/Cargo.toml b/zchronod/p2p/Cargo.toml
deleted file mode 100644
index a564b62..0000000
--- a/zchronod/p2p/Cargo.toml
+++ /dev/null
@@ -1,8 +0,0 @@
-[package]
-name = "p2p"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
diff --git a/zchronod/p2p/src/lib.rs b/zchronod/p2p/src/lib.rs
deleted file mode 100644
index e69de29..0000000
diff --git a/zchronod/tools/Cargo.lock b/zchronod/tools/Cargo.lock
deleted file mode 100644
index e5fa78f..0000000
--- a/zchronod/tools/Cargo.lock
+++ /dev/null
@@ -1,533 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "addr2line"
-version = "0.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
-dependencies = [
- "gimli",
-]
-
-[[package]]
-name = "adler"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-
-[[package]]
-name = "autocfg"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
-
-[[package]]
-name = "backtrace"
-version = "0.3.71"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d"
-dependencies = [
- "addr2line",
- "cc",
- "cfg-if",
- "libc",
- "miniz_oxide",
- "object",
- "rustc-demangle",
-]
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "bytes"
-version = "1.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
-
-[[package]]
-name = "cc"
-version = "1.0.91"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fd97381a8cc6493395a5afc4c691c1084b3768db713b73aa215217aa245d153"
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "futures"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-executor",
- "futures-io",
- "futures-sink",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
-dependencies = [
- "futures-core",
- "futures-sink",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
-
-[[package]]
-name = "futures-executor"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
-dependencies = [
- "futures-core",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-io"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
-
-[[package]]
-name = "futures-macro"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "futures-sink"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
-
-[[package]]
-name = "futures-task"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
-
-[[package]]
-name = "futures-util"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-macro",
- "futures-sink",
- "futures-task",
- "memchr",
- "pin-project-lite",
- "pin-utils",
- "slab",
-]
-
-[[package]]
-name = "gimli"
-version = "0.28.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
-
-[[package]]
-name = "hermit-abi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
-
-[[package]]
-name = "libc"
-version = "0.2.153"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
-
-[[package]]
-name = "lock_api"
-version = "0.4.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
-dependencies = [
- "autocfg",
- "scopeguard",
-]
-
-[[package]]
-name = "memchr"
-version = "2.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
-
-[[package]]
-name = "miniz_oxide"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
-dependencies = [
- "adler",
-]
-
-[[package]]
-name = "mio"
-version = "0.8.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
-dependencies = [
- "libc",
- "wasi",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "num_cpus"
-version = "1.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
-name = "object"
-version = "0.32.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
-
-[[package]]
-name = "parking_lot"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
-dependencies = [
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.9.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall",
- "smallvec",
- "windows-targets 0.48.5",
-]
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.79"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
-name = "rustc-demangle"
-version = "0.1.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
-
-[[package]]
-name = "scopeguard"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
-
-[[package]]
-name = "signal-hook-registry"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "slab"
-version = "0.4.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "smallvec"
-version = "1.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
-
-[[package]]
-name = "socket2"
-version = "0.5.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871"
-dependencies = [
- "libc",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "syn"
-version = "2.0.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "tokio"
-version = "1.37.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
-dependencies = [
- "backtrace",
- "bytes",
- "libc",
- "mio",
- "num_cpus",
- "parking_lot",
- "pin-project-lite",
- "signal-hook-registry",
- "socket2",
- "tokio-macros",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "tokio-macros"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
-
-[[package]]
-name = "wasi"
-version = "0.11.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
-
-[[package]]
-name = "windows-sys"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
-dependencies = [
- "windows-targets 0.48.5",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
-dependencies = [
- "windows-targets 0.52.4",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
-dependencies = [
- "windows_aarch64_gnullvm 0.48.5",
- "windows_aarch64_msvc 0.48.5",
- "windows_i686_gnu 0.48.5",
- "windows_i686_msvc 0.48.5",
- "windows_x86_64_gnu 0.48.5",
- "windows_x86_64_gnullvm 0.48.5",
- "windows_x86_64_msvc 0.48.5",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
-dependencies = [
- "windows_aarch64_gnullvm 0.52.4",
- "windows_aarch64_msvc 0.52.4",
- "windows_i686_gnu 0.52.4",
- "windows_i686_msvc 0.52.4",
- "windows_x86_64_gnu 0.52.4",
- "windows_x86_64_gnullvm 0.52.4",
- "windows_x86_64_msvc 0.52.4",
-]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
-
-[[package]]
-name = "zchronod_tools"
-version = "0.1.0"
-dependencies = [
- "futures",
- "once_cell",
- "tokio",
-]
diff --git a/zchronod/tools/Cargo.toml b/zchronod/tools/Cargo.toml
deleted file mode 100644
index dd04ab2..0000000
--- a/zchronod/tools/Cargo.toml
+++ /dev/null
@@ -1,11 +0,0 @@
-[package]
-name = "tools"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-once_cell = "1.13.0"
-tokio = { version = "1.27", features = [ "full" ] }
-futures = "0.3"
\ No newline at end of file
diff --git a/zchronod/tools/src/lib.rs b/zchronod/tools/src/lib.rs
deleted file mode 100644
index aec2ce5..0000000
--- a/zchronod/tools/src/lib.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-//! this crate is for tools function in the zchronod repository.
-
-pub mod tokio_zhronod;
\ No newline at end of file
diff --git a/zchronod/tools/src/tokio_zhronod.rs b/zchronod/tools/src/tokio_zhronod.rs
deleted file mode 100644
index 0fe1b0b..0000000
--- a/zchronod/tools/src/tokio_zhronod.rs
+++ /dev/null
@@ -1,106 +0,0 @@
-use once_cell::sync::Lazy;
-use tokio::runtime::Runtime;
-
-pub static TOKIO: Lazy = Lazy::new(|| new_runtime(None, None));
-
-/// Instantiate a new runtime.
-pub fn new_runtime(worker_threads: Option, max_blocking_threads: Option) -> Runtime {
- // we want to use multiple threads
- let mut builder = tokio::runtime::Builder::new_multi_thread();
-
- builder
- // we use both IO and Time tokio utilities
- .enable_all()
- // give our threads a descriptive name (they'll be numbered too)
- .thread_name("holochain-tokio-thread");
-
- if let Some(worker_threads) = worker_threads {
- builder.worker_threads(worker_threads);
- };
-
- if let Some(max_blocking_threads) = max_blocking_threads {
- builder.max_blocking_threads(max_blocking_threads);
- };
-
- builder
- // build the runtime
- .build()
- // panic if we cannot (we cannot run without it)
- .expect("can build tokio runtime")
-}
-
-fn block_on_given(f: F, runtime: &Runtime) -> F::Output
- where
- F: futures::future::Future,
-{
- let _g = runtime.enter();
- tokio::task::block_in_place(|| runtime.block_on(f))
-}
-
-/// Run a blocking thread on `TOKIO` with a timeout.
-pub fn block_on(
- f: F,
- timeout: std::time::Duration,
-) -> Result
- where
- F: futures::future::Future,
-{
- block_on_given(async { tokio::time::timeout(timeout, f).await }, &TOKIO)
-}
-
-/// Run a blocking thread on `TOKIO`.
-pub fn block_forever_on(f: F) -> F::Output
- where
- F: futures::future::Future,
-{
- block_on_given(f, &TOKIO)
-}
-
-/// Run a a task on the `TOKIO` static runtime.
-pub fn run_on(f: F) -> F::Output
- where
- F: futures::future::Future,
-{
- TOKIO.block_on(f)
-}
-
-#[cfg(test)]
-mod test {
- use super::*;
-
- #[tokio::test(flavor = "multi_thread")]
- async fn block_forever_on_works() {
- block_forever_on(async { println!("stdio can block") });
- assert_eq!(1, super::block_forever_on(async { 1 }));
-
- let r = "1";
- let test1 = super::block_forever_on(async { r.to_string() });
- assert_eq!("1", &test1);
-
- // - wasm style use case -
- // we are in a non-tokio context
- let test2 = std::thread::spawn(|| {
- let r = "2";
- super::block_forever_on(async { r.to_string() })
- })
- .join()
- .unwrap();
- assert_eq!("2", &test2);
- }
-
- #[tokio::test(flavor = "multi_thread")]
- async fn block_on_allows_spawning() {
- let r = "works";
- let test = block_forever_on(tokio::task::spawn(async move { r.to_string() })).unwrap();
- assert_eq!("works", &test);
- }
-
- // test calling without an existing reactor
- #[test]
- fn block_on_works() {
- assert_eq!(
- Ok(1),
- block_on(async { 1 }, std::time::Duration::from_millis(0))
- );
- }
-}
diff --git a/zchronod/websocket/Cargo.lock b/zchronod/websocket/Cargo.lock
deleted file mode 100644
index c5c00e1..0000000
--- a/zchronod/websocket/Cargo.lock
+++ /dev/null
@@ -1,716 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "addr2line"
-version = "0.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
-dependencies = [
- "gimli",
-]
-
-[[package]]
-name = "adler"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-
-[[package]]
-name = "autocfg"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
-
-[[package]]
-name = "backtrace"
-version = "0.3.71"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d"
-dependencies = [
- "addr2line",
- "cc",
- "cfg-if",
- "libc",
- "miniz_oxide",
- "object",
- "rustc-demangle",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "byteorder"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
-
-[[package]]
-name = "bytes"
-version = "1.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
-
-[[package]]
-name = "cc"
-version = "1.0.92"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41"
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crypto-common"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
-dependencies = [
- "generic-array",
- "typenum",
-]
-
-[[package]]
-name = "data-encoding"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
-
-[[package]]
-name = "digest"
-version = "0.10.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
-dependencies = [
- "block-buffer",
- "crypto-common",
-]
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "futures"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-executor",
- "futures-io",
- "futures-sink",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
-dependencies = [
- "futures-core",
- "futures-sink",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
-
-[[package]]
-name = "futures-executor"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
-dependencies = [
- "futures-core",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-io"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
-
-[[package]]
-name = "futures-macro"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "futures-sink"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
-
-[[package]]
-name = "futures-task"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
-
-[[package]]
-name = "futures-util"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-macro",
- "futures-sink",
- "futures-task",
- "memchr",
- "pin-project-lite",
- "pin-utils",
- "slab",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
-dependencies = [
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi",
-]
-
-[[package]]
-name = "gimli"
-version = "0.28.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
-
-[[package]]
-name = "http"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258"
-dependencies = [
- "bytes",
- "fnv",
- "itoa",
-]
-
-[[package]]
-name = "httparse"
-version = "1.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
-
-[[package]]
-name = "idna"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6"
-dependencies = [
- "unicode-bidi",
- "unicode-normalization",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
-
-[[package]]
-name = "libc"
-version = "0.2.153"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
-
-[[package]]
-name = "log"
-version = "0.4.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
-
-[[package]]
-name = "memchr"
-version = "2.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
-
-[[package]]
-name = "miniz_oxide"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
-dependencies = [
- "adler",
-]
-
-[[package]]
-name = "mio"
-version = "0.8.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
-dependencies = [
- "libc",
- "wasi",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "object"
-version = "0.32.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.79"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "rand"
-version = "0.8.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
-dependencies = [
- "libc",
- "rand_chacha",
- "rand_core",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
-dependencies = [
- "ppv-lite86",
- "rand_core",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
-dependencies = [
- "getrandom",
-]
-
-[[package]]
-name = "rustc-demangle"
-version = "0.1.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
-
-[[package]]
-name = "sha1"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
-[[package]]
-name = "slab"
-version = "0.4.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "socket2"
-version = "0.5.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871"
-dependencies = [
- "libc",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "syn"
-version = "2.0.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
-dependencies = [
- "tinyvec_macros",
-]
-
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
-
-[[package]]
-name = "tokio"
-version = "1.37.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
-dependencies = [
- "backtrace",
- "bytes",
- "libc",
- "mio",
- "pin-project-lite",
- "socket2",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "tokio-tungstenite"
-version = "0.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38"
-dependencies = [
- "futures-util",
- "log",
- "tokio",
- "tungstenite",
-]
-
-[[package]]
-name = "tungstenite"
-version = "0.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1"
-dependencies = [
- "byteorder",
- "bytes",
- "data-encoding",
- "http",
- "httparse",
- "log",
- "rand",
- "sha1",
- "thiserror",
- "url",
- "utf-8",
-]
-
-[[package]]
-name = "typenum"
-version = "1.17.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
-
-[[package]]
-name = "unicode-bidi"
-version = "0.3.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
-
-[[package]]
-name = "unicode-normalization"
-version = "0.1.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5"
-dependencies = [
- "tinyvec",
-]
-
-[[package]]
-name = "url"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633"
-dependencies = [
- "form_urlencoded",
- "idna",
- "percent-encoding",
-]
-
-[[package]]
-name = "utf-8"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
-
-[[package]]
-name = "version_check"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
-
-[[package]]
-name = "wasi"
-version = "0.11.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
-
-[[package]]
-name = "windows-sys"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
-dependencies = [
- "windows-targets 0.48.5",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
-dependencies = [
- "windows-targets 0.52.4",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
-dependencies = [
- "windows_aarch64_gnullvm 0.48.5",
- "windows_aarch64_msvc 0.48.5",
- "windows_i686_gnu 0.48.5",
- "windows_i686_msvc 0.48.5",
- "windows_x86_64_gnu 0.48.5",
- "windows_x86_64_gnullvm 0.48.5",
- "windows_x86_64_msvc 0.48.5",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
-dependencies = [
- "windows_aarch64_gnullvm 0.52.4",
- "windows_aarch64_msvc 0.52.4",
- "windows_i686_gnu 0.52.4",
- "windows_i686_msvc 0.52.4",
- "windows_x86_64_gnu 0.52.4",
- "windows_x86_64_gnullvm 0.52.4",
- "windows_x86_64_msvc 0.52.4",
-]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.52.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
-
-[[package]]
-name = "zchronod_websocket"
-version = "0.1.0"
-dependencies = [
- "futures",
- "log",
- "tokio",
- "tokio-tungstenite",
-]
diff --git a/zchronod/websocket/Cargo.toml b/zchronod/websocket/Cargo.toml
deleted file mode 100644
index c3a4ebd..0000000
--- a/zchronod/websocket/Cargo.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-[package]
-name = "websocket"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-tokio = { version = "1.36.0", features = ["full"] }
-log = "0.4.21"
-tokio-tungstenite = "0.21.0"
-futures = "0.3.30"
-serde_json = "1.0.115"
-serde = { version = "1.0", features = ["derive"] }
-serde_bytes = "0.11.6"
diff --git a/zchronod/websocket/src/lib.rs b/zchronod/websocket/src/lib.rs
deleted file mode 100644
index 6a935b3..0000000
--- a/zchronod/websocket/src/lib.rs
+++ /dev/null
@@ -1,484 +0,0 @@
-mod test;
-
-use std::io::Error;
-use std::sync::Arc;
-use log::info;
-use tokio_tungstenite::accept_async;
-use tokio_tungstenite::tungstenite::protocol::Message;
-use futures::{SinkExt, StreamExt};
-use serde::{Serialize, Deserialize};
-
-#[derive(Debug,Serialize, Deserialize)]
-pub enum WireMessage {
- /// A message without a response.
- Signal {
- data: Vec,
- },
-
- /// A request that requires a response.
- Request {
- /// The id of this request.
- id: u64,
- data: Vec,
- },
-
- /// The response to a request.
- Response {
- /// The id of the request that this response is for.
- id: u64,
- data: Option>,
- },
-}
-
-impl WireMessage {
- /// Deserialize a WireMessage through serde_json
- fn try_from_bytes(b: Vec) -> std::io::Result {
- let w: WireMessage = serde_json::from_slice(&b)?;
- Ok(w)
- }
-
- /// Create a new request message with serde_json message (with new unique msg id).
- fn request(s: Vec) -> std::io::Result<(Message, u64)>
- {
- static ID: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1);
- let id = ID.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
- let s1 = Self::Request {
- id,
- data: s,
- };
- let s2 = serde_json::to_vec(&s1).map_err(Error::other)?;
- Ok((Message::Binary(s2),id))
- }
-
- /// Create a new response message.
- fn response(id: u64, s: Vec) -> std::io::Result
- {
- let s1 = Self::Response {
- id,
- data: Some(s),
- };
- let s2 = serde_json::to_vec(&s1).map_err(Error::other)?;
- Ok(Message::Binary(s2))
- }
-}
-
-pub struct WebsocketRespond {
- id: u64,
- core: WsCoreSync,
-}
-
-impl std::fmt::Debug for WebsocketRespond {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- f.debug_struct("WebsocketRespond")
- .field("id", &self.id)
- .finish()
- }
-}
-
-impl WebsocketRespond {
- /// Respond to an incoming request.
- pub async fn respond(self, s: Vec) -> std::io::Result<()>
- {
- use futures::sink::SinkExt;
- self.core
- .exec(move |_, core| async move {
- tokio::time::timeout(core.timeout, async {
- let s = WireMessage::response(self.id, s)?;
- core.send.lock().await.send(s).await.map_err(Error::other)?;
- Ok(())
- })
- .await
- .map_err(Error::other)?
- })
- .await
- }
-}
-
-/// Types of messages that can be received by a WebsocketReceiver.
-#[derive(Debug)]
-pub enum ReceiveMessage
-{
- /// Received a signal from the remote.
- Signal(Vec),
-
- /// Received a request from the remote.
- Request(Vec, WebsocketRespond),
-}
-
-pub struct WebsocketListener {
- config: Arc,
- pub listener: tokio::net::TcpListener,
-}
-
-impl WebsocketListener {
- /// Get the bound local address of this listener.
- pub fn local_addr(&self) -> std::io::Result {
- self.listener.local_addr()
- }
-
- /// Bind a new websocket listener.
- pub async fn bind(
- config: Arc,
- addr: A,
- ) -> std::io::Result {
- let listener = tokio::net::TcpListener::bind(addr).await?;
-
- let addr = listener.local_addr()?;
- info!("WebsocketListener Listening {}",addr);
- Ok(Self { config, listener })
- }
-
- /// accept incoming connection for server
- pub async fn accept(&self) -> std::io::Result<(WebsocketSender, WebsocketReceiver)> {
- let (stream, addr) = self.listener.accept().await?;
- info!("Accept Incoming Websocket Connection");
- let stream =
- tokio_tungstenite::accept_async_with_config(stream, Some(self.config.to_tungstenite()))
- .await
- .map_err(Error::other)?;
- split(stream, self.config.default_request_timeout, addr)
- }
-}
-
-#[derive(Clone)]
-pub struct WebsocketSender(WsCoreSync, std::time::Duration);
-
-impl WebsocketSender {
- pub async fn request(&self, s: Vec) -> std::io::Result>
- {
- self.request_timeout(s, self.1).await
- }
-
- pub async fn request_timeout(&self, s: Vec, timeout: std::time::Duration) -> std::io::Result>
- {
- let timeout_at = tokio::time::Instant::now() + timeout;
- use futures::sink::SinkExt;
-
- let (s, id) = WireMessage::request(s)?;
-
- /// Drop helper to remove our response callback if we timeout.
- struct D(Callback_Map, u64);
-
- impl Drop for D {
- fn drop(&mut self) {
- self.0.remove(self.1);
- }
- }
-
- let (resp_s, resp_r) = tokio::sync::oneshot::channel();
-
- let _drop = self
- .0
- .exec(move |_, core| async move {
- // create the drop helper
- let drop = D(core.callback.clone(), id);
-
- // register the response callback
- core.callback.insert(id, resp_s);
-
- tokio::time::timeout_at(timeout_at, async move {
- // send the actual message
- core.send.lock().await.send(s).await.map_err(Error::other)?;
-
- Ok(drop)
- })
- .await
- .map_err(Error::other)?
- })
- .await?;
-
- tokio::time::timeout_at(timeout_at, async {
- // await the response
- let resp = resp_r
- .await
- .map_err(|_| Error::other("ResponderDropped"))??;
-
- Ok(resp)
- })
- .await
- .map_err(Error::other)?
- }
-
-}
-
-pub struct WebsocketReceiver(
- WsCoreSync,
- std::net::SocketAddr,
- tokio::task::JoinHandle<()>,
-);
-
-impl WebsocketReceiver {
- fn new(core: WsCoreSync, addr: std::net::SocketAddr) -> Self {
- let core2 = core.clone();
- let ping_task = tokio::task::spawn(async move {
- loop {
- tokio::time::sleep(std::time::Duration::from_secs(5)).await;
- let core = core2.0.lock().unwrap().as_ref().cloned();
- if let Some(core) = core {
- use futures::sink::SinkExt;
- if core
- .send
- .lock()
- .await
- .send(Message::Ping(Vec::new()))
- .await
- .is_err()
- {
- core2.close();
- }
- } else {
- break;
- }
- }
- });
- Self(core, addr, ping_task)
- }
-
- /// Peer address.
- pub fn peer_addr(&self) -> std::net::SocketAddr {
- self.1
- }
-
- /// Receive the next message.
- pub async fn recv(&mut self) -> std::io::Result
- {
- match self.recv_inner().await {
- Err(err) => {
- info!("WebsocketReceiver Error");
- Err(err)
- }
- Ok(msg) => Ok(msg),
- }
- }
-
- async fn recv_inner(&mut self) -> std::io::Result
- {
- use futures::sink::SinkExt;
- use futures::stream::StreamExt;
- loop {
- if let Some(result) = self
- .0
- .exec(move |core_sync, core| async move {
- let msg = core
- .recv
- .lock()
- .await
- .next()
- .await
- .ok_or(Error::other("ReceiverClosed"))?
- .map_err(Error::other)?;
- let msg = match msg {
- Message::Text(s) => s.into_bytes(),
- Message::Binary(b) => b,
- Message::Ping(b) => {
- core.send
- .lock()
- .await
- .send(Message::Pong(b))
- .await
- .map_err(Error::other)?;
- return Ok(None);
- }
- Message::Pong(_) => return Ok(None),
- Message::Close(frame) => {
- return Err(Error::other(format!("ReceivedCloseFrame: {frame:?}")));
- }
- Message::Frame(_) => return Err(Error::other("UnexpectedRawFrame")),
- };
- match WireMessage::try_from_bytes(msg)? {
- WireMessage::Request { id, data } => {
- let resp = WebsocketRespond {
- id,
- core: core_sync,
- };
- Ok(Some(ReceiveMessage::Request(data, resp)))
- }
- WireMessage::Response { id, data } => {
- if let Some(sender) = core.callback.remove(id) {
- if let Some(data) = data {
- let _ = sender.send(Ok(data));
- }
- }
- Ok(None)
- }
- WireMessage::Signal { data } => Ok(Some(ReceiveMessage::Signal(data))),
- }
- })
- .await?
- {
- return Ok(result);
- }
- }
- }
-}
-
-type WsSendSync = Arc, tokio_tungstenite::tungstenite::protocol::Message>>>;
-type WsRecvSync = Arc>>>;
-
-#[derive(Clone)]
-struct Callback_Map(Arc>>>>>);
-
-impl Callback_Map {
- pub fn close(&self) {
- if let Ok(mut lock) = self.0.lock() {
- for (_, s) in lock.drain() {
- let _ = s.send(Err(Error::other("ConnectionClosed")));
- }
- }
- }
-
- pub fn insert(&self, id: u64, sender: tokio::sync::oneshot::Sender>>) {
- self.0.lock().unwrap().insert(id, sender);
- }
-
- pub fn remove(&self, id: u64) -> Option>>> {
- self.0.lock().unwrap().remove(&id)
- }
-}
-
-#[derive(Clone)]
-struct WsCoreSync(Arc>>);
-
-impl WsCoreSync {
- fn close(&self) {
- if let Some(core) = self.0.lock().unwrap().take() {
- core.callback.close();
- tokio::task::spawn(async move {
- use futures::sink::SinkExt;
- let _ = core.send.lock().await.close().await;
- });
- }
- }
-
- fn close_if_err(&self, r: std::io::Result) -> std::io::Result {
- match r {
- Err(err) => {
- self.close();
- Err(err)
- }
- Ok(res) => Ok(res),
- }
- }
-
- pub async fn exec(&self, c: C) -> std::io::Result
- where
- F: std::future::Future