some dependency updates

This commit is contained in:
Horhik 2021-03-13 13:35:46 +03:00
parent 0c7c7b736b
commit 0802c42f8c
6 changed files with 12 additions and 39 deletions

6
.gitignore vendored
View file

@ -1,4 +1,6 @@
/target
./hole.db
hole.db
*.db
/hole.db
/*.db

4
Cargo.lock generated
View file

@ -408,9 +408,10 @@ dependencies = [
[[package]]
name = "fcpv2"
version = "0.0.1"
version = "0.0.2"
dependencies = [
"regex",
"rusqlite",
]
[[package]]
@ -630,6 +631,7 @@ dependencies = [
"async-tls 0.10.0",
"async-trait",
"async-tungstenite",
"chrono",
"fcpv2",
"futures",
"futures-util",

View file

@ -22,6 +22,7 @@ serde = "1.0.116"
serde_derive = "1.0.116"
async-trait = "0.1.42"
simple_logger = "1.11.0"
chrono = "0.4.19"
[dependencies.fcpv2]
path = "../FCPv2"

View file

@ -1,32 +0,0 @@
# Hole Protocol
## Process of messaging
Each user have kind of a bin among freenet network,in which anyone can put message. And for each user this bin is his `USK insert` key. Each message signed by sender. And user can answer to sender, buy putting message at sender insert key if he know it.
## Message request
To receive a new message we have to send `ClientGet` to our `USK request` key with URI like `/user_id-message_version`. As well, the identifier is consists of `user_id-message_number`
For example:
```Bash
ClientGet
URI=USK@myMessageBinKey/messages/user5678-3
Identifier=request-user5678-3
Verbosity=0
ReturnType=direct
EndMessage
```
## Message sending
To send a message to a friend we putting it at his `USK insert` key, with URI like`/my_id-$(number_of_messages_to_this_user + 1)`. And identifier like `user_id-$(number_of_messages_to_this_user + 1)`
For example:
```Bash
ClientGet
URI=USK@myFriendBinKey/messages/user3246-5
Identifier=user3501-5
Verbosity=0
ReturnType=direct
EndMessage
```
## user IDs
- [ ] Probably, for each pair of each people we will have different identifier but... I'm not going to do it in further releases. *TODO*

View file

@ -7,8 +7,8 @@ use tokio::{
},
};
use fcpv2::client::fcp_types::{ClientHello, ClientPut, FcpParser, SSK};
use fcpv2::client::types::FcpRequest;
use fcpv2::client::fcp_types::{ClientHello, ClientPut};
use fcpv2::types::{traits::{FcpRequest, FcpParser}, SSK} ;
pub async fn to_server_sender(mut sender: OwnedWriteHalf, server_receiver: RP) -> io::Result<()> {
while let Ok(res) = server_receiver.recv() {
//TODO from_core_to_server_handler

View file

@ -1,7 +1,7 @@
use crate::chat::types::PackedMessage;
use async_std::io;
use fcpv2::client::fcp_types::{ClientGet, SSK};
use fcpv2::client::types::{FcpRequest, ReturnType};
use fcpv2::client::fcp_types::{ClientGet};
use fcpv2::types::{traits::FcpRequest, ReturnType, SSK};
use std::sync::mpsc::Sender;
type SP = Sender<PackedMessage>;