diff --git a/protocols/autonat/CHANGELOG.md b/protocols/autonat/CHANGELOG.md index 1ed17892..545e988a 100644 --- a/protocols/autonat/CHANGELOG.md +++ b/protocols/autonat/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.4.1 + +- Export `DEFAULT_PROTOCOL_NAME`. + # 0.4.0 - Update to `libp2p-core` `v0.33.0`. diff --git a/protocols/autonat/Cargo.toml b/protocols/autonat/Cargo.toml index cb5866b0..0c142d01 100644 --- a/protocols/autonat/Cargo.toml +++ b/protocols/autonat/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-autonat" edition = "2021" rust-version = "1.56.1" description = "NAT and firewall detection for libp2p" -version = "0.4.0" +version = "0.4.1" authors = ["David Craven ", "Elena Frank "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/protocols/autonat/src/lib.rs b/protocols/autonat/src/lib.rs index d55ab3ac..3a1bf63c 100644 --- a/protocols/autonat/src/lib.rs +++ b/protocols/autonat/src/lib.rs @@ -27,7 +27,7 @@ pub use self::{ Behaviour, Config, Event, InboundProbeError, InboundProbeEvent, NatStatus, OutboundProbeError, OutboundProbeEvent, ProbeId, }, - protocol::ResponseError, + protocol::{ResponseError, DEFAULT_PROTOCOL_NAME}, }; pub use libp2p_request_response::{InboundFailure, OutboundFailure}; diff --git a/protocols/autonat/src/protocol.rs b/protocols/autonat/src/protocol.rs index 13647a4f..f39c22aa 100644 --- a/protocols/autonat/src/protocol.rs +++ b/protocols/autonat/src/protocol.rs @@ -29,9 +29,12 @@ use std::{convert::TryFrom, io}; #[derive(Clone, Debug)] pub struct AutoNatProtocol; +/// The protocol name used for negotiating with multistream-select. +pub const DEFAULT_PROTOCOL_NAME: &[u8] = b"/libp2p/autonat/1.0.0"; + impl ProtocolName for AutoNatProtocol { fn protocol_name(&self) -> &[u8] { - b"/libp2p/autonat/1.0.0" + DEFAULT_PROTOCOL_NAME } }