Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/werdl/p2pass
https://github.com/werdl/p2pass
Last synced: about 7 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/werdl/p2pass
- Owner: werdl
- Created: 2024-06-08T13:10:53.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-06-08T16:38:53.000Z (5 months ago)
- Last Synced: 2024-06-08T17:58:11.756Z (5 months ago)
- Language: Rust
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# p2pass
> A low-level p2p message passing library for Rust
## Simplicity for the end user
- All that is needed is either an IP and a port, or a base64 encoded p2pass id## Overall Process
```mermaid
sequenceDiagram
participant Alice
participant BobAlice->>Alice: Create ID
Bob->>Bob: Create ID
Alice->>Bob: Talks to Bob
Bob->>Alice: Talks to Alice
```## POV: Alice
```mermaid
graph TD
A[Start] --> B[Generate IpAddr]
B --> C[/Send WAKEUP/]
C --> D{ACK received?}
D -->|Y| E[/Send message/]
D -->|N| C
E --> F{ACK with hash received?}
F -->|Y| G{Hash correct?}
G -->|N| H[/Send ERR/]
G -->|Y| I[/Send GOODBYE/]I --> J([End])
H --> K[Wait for an arbitrary amount of time]
K --> CF -->|N| C
```## POV: Bob
```mermaid
graph TD
A([Start]) --> B{WAKEUP received?}
B --> |Y| C[Spawn and switch to new thread]
B --> |N| BC --> D[/Send ACK/]
D --> E{Message received?}
E --> |Y| F[/Send ACK with hash/]
E --> |N| EF --> G{GOODBYE received?}
G --> |Y| L[Kill thread]
L --> H([End])G --> |N| I{Received ERR?}
I --> |Y| N[Prepare for further messages]
N --> H
I --> |N| L
L --> H```