cuprate/p2p/src/protocol.rs
Boog900 8557073c15
p2p changes (#38)
* start re-working p2p to work with change monero-wire

* start re-working p2p to work with change monero-wire

adds back some changes from #22

* change the peer module to use the new API + fix a couple bugs

* remove peer set for now

* add try_from/from conversion between `Message` and
`Request`/`Response`

* Allow specifying other parameters in levin-cuprate

* add new `LevinCommand` enum and clean up monero-wire message de/encoding

* fix issues with merge

* start splitting up p2p crate into smaller crates.

* add monerod action from serai to test network code

* remove tracing in tests
2023-11-30 18:09:05 +00:00

29 lines
724 B
Rust

pub mod internal_network;
pub use internal_network::{InternalMessageRequest, InternalMessageResponse};
use monero_wire::messages::CoreSyncData;
/// A request to a [`tower::Service`] that handles sync states.
pub enum CoreSyncDataRequest {
/// Get our [`CoreSyncData`].
GetOurs,
/// Handle an incoming [`CoreSyncData`].
NewIncoming(CoreSyncData),
}
/// A response from a [`tower::Service`] that handles sync states.
pub enum CoreSyncDataResponse {
/// Our [`CoreSyncData`]
Ours(CoreSyncData),
/// The incoming [`CoreSyncData`] is ok.
Ok,
}
/// The direction of a connection.
pub enum Direction {
/// An inbound connection.
Inbound,
/// An outbound connection.
Outbound,
}