mirror of
https://github.com/MAGICGrants/cuprate-for-explorer.git
synced 2026-01-09 19:47:59 -05:00
* Define Tor Zone, add onion addressing, extend AddressBook, adapt `handle_timed_sync_request`, changes in cuprated + some cleanup In `cuprated`: - Added `Z: NetworkZone` as a generic requirement for `address_book_config`. Now takes the optional node address in argument. - Added `tor_net_seed_nodes` fn for obtaining tor seed nodes. - Added `CrossNetworkInternalPeerId::Tor(_)` variant and `From<InternalPeerId<OnionAddr>>` In `cuprate-wire`: - Added `src/network_address/onion_addr.rs` implementing `OnionAddr` type used by `Tor` network zone. - Implemented parsing, formatting, conversion and validation of `OnionAddr`. - Implemented 2 validation tests and 2 parsing tests for `OnionAddr`. - Documented and cleaned up `src/network_address/epee_builder.rs`. - Changed `u8` `type` field of `TaggedNetworkAddress` to `AddressType` enum equivalent to monerod's `address_type`. - Added additional `host` and `port` fields to `AllFieldedNetworkAddress` collection type. - Added `NetworkAddress:Tor` variant and added conversion to related functions. In `cuprate-address-book`: - Added `our_own_addr: Z::Addr` field to AddressBookConfig. This adds a `Z: NetworkZone` requirement to `AddressBookConfig`. - Adapted code to the new generic requirement. - Implemented handling of new `AddressBookRequest::OwnAddress` for querying the node self specified address for the zone. In `cuprate-p2p`: - If `Z::BROADCAST_OUR_OWN_ADDR` = `true`, `handle_timed_sync_request` will insert the node's address to the peerlist being sent. In `cuprate-p2p-core`: - Removed `#[async_trait::async_trait]` attribute to `impl NetworkZone for *`. - Added `AddressBookRequest::OwnAddress` and `AddressBookResponse::OwnAddress(Option<Z::Addr>)`. - Defined new `Tor` `NetworkZone` * fmt * fix typo and fmt * final edits? * fix test * forgor
36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
// Rust Levin Library
|
|
// Written in 2023 by
|
|
// Cuprate Contributors
|
|
//
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
// in the Software without restriction, including without limitation the rights
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
// furnished to do so, subject to the following conditions:
|
|
//
|
|
// The above copyright notice and this permission notice shall be included in all
|
|
// copies or substantial portions of the Software.
|
|
//
|
|
|
|
//! # Cuprate Wire
|
|
//!
|
|
//! A crate defining Monero network messages and network addresses,
|
|
//! built on top of the [`cuprate_levin`] crate.
|
|
//!
|
|
//! ## License
|
|
//!
|
|
//! This project is licensed under the MIT License.
|
|
|
|
pub mod network_address;
|
|
pub mod p2p;
|
|
|
|
pub use cuprate_levin::BucketError;
|
|
pub use network_address::{NetZone, NetworkAddress, OnionAddr};
|
|
pub use p2p::*;
|
|
|
|
// re-export.
|
|
pub use cuprate_levin as levin;
|
|
|
|
pub type MoneroWireCodec = cuprate_levin::codec::LevinMessageCodec<Message>;
|