- Add `--public`, `--hops`, `--hosts`, and `--debug` router flags; `--public` auto-reseeds from the live network and keeps a status loop running. - Route NetDB lookups through tunnels with Noise_N garlic wrapping, fan out to two floodfills, and fetch unknown RouterInfos in the background. - Back off failed NTCP2 peers and fall back to IPv6 addresses when no IPv4 NTCP2 address is available. - Size session LeaseSet2 expiry from lease end dates and use the destination's X25519 key when present. - Add canonical Ed25519 Destination KeyCertificate constructors with round-trip tests. - Fix DatabaseStore gzip handling to honor the length prefix, and send `Wget/1.11.4` as the reseed User-Agent.
53 lines
1.8 KiB
Plaintext
53 lines
1.8 KiB
Plaintext
// Generated using `moon info`, DON'T EDIT IT
|
|
package "experiments/moon_i2p/netdb"
|
|
|
|
import {
|
|
"experiments/moon_i2p/common",
|
|
"experiments/moon_i2p/i2np",
|
|
"moonbitlang/core/debug",
|
|
}
|
|
|
|
// Values
|
|
pub fn compare_distance(Bytes, Bytes) -> Int32
|
|
|
|
pub fn encode_router_info_store_data(@common.RouterInfo) -> Bytes raise NetDbError
|
|
|
|
pub fn format_utc_date(UInt64) -> String
|
|
|
|
pub fn is_floodfill(@common.RouterInfo) -> Bool
|
|
|
|
pub fn routing_key(@common.Hash, String) -> @common.Hash
|
|
|
|
pub fn xor_distance(@common.Hash, @common.Hash) -> Bytes
|
|
|
|
// Errors
|
|
#derive(Eq, @debug.Debug)
|
|
pub suberror NetDbError {
|
|
Common(@common.CommonError)
|
|
InvalidSignature(String)
|
|
InvalidRecord(String)
|
|
}
|
|
|
|
// Types and methods
|
|
pub struct NetDb {
|
|
routers : Array[(@common.Hash, @common.RouterInfo)]
|
|
leasesets : Array[(@common.Hash, @common.LeaseSet2)]
|
|
}
|
|
pub fn NetDb::closest_peers(Self, @common.Hash, String, Int32, floodfills_only? : Bool, excluded? : Array[@common.Hash]) -> Array[@common.RouterInfo]
|
|
pub fn NetDb::floodfill_count(Self) -> Int32
|
|
pub fn NetDb::get_lease_set2(Self, @common.Hash, UInt32) -> @common.LeaseSet2?
|
|
pub fn NetDb::get_lease_set2_by_b32(Self, String, UInt32) -> @common.LeaseSet2?
|
|
pub fn NetDb::get_router_info(Self, @common.Hash) -> @common.RouterInfo?
|
|
pub fn NetDb::handle_database_lookup(Self, @common.Hash, @common.Hash, Byte, Array[@common.Hash], UInt32, max_peers? : Int32) -> @i2np.I2npPayload raise NetDbError
|
|
pub fn NetDb::handle_database_store(Self, Byte, @common.Hash, Bytes, UInt32) -> Bool raise NetDbError
|
|
pub fn NetDb::leaseset_count(Self) -> Int32
|
|
pub fn NetDb::new() -> Self
|
|
pub fn NetDb::prune_expired(Self, UInt32) -> Int32
|
|
pub fn NetDb::router_count(Self) -> Int32
|
|
pub fn NetDb::store_lease_set2(Self, @common.LeaseSet2, UInt32) -> Bool raise NetDbError
|
|
pub fn NetDb::store_router_info(Self, @common.RouterInfo) -> Bool raise NetDbError
|
|
|
|
// Type aliases
|
|
|
|
// Traits
|