Skip to content

Commit effb587

Browse files
committed
Bump and stub incompatible functions
1 parent 3032539 commit effb587

File tree

3 files changed

+66
-61
lines changed

3 files changed

+66
-61
lines changed

rust/c509-certificate/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ hex = "0.4.3"
2323
oid = "0.2.1"
2424
oid-registry = "0.7.1"
2525
asn1-rs = "0.6.2"
26-
anyhow = "1.0.95"
26+
anyhow = "1.0.99"
2727
bimap = "0.6.3"
2828
strum = "0.26.3"
2929
strum_macros = "0.26.4"

rust/hermes-ipfs/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ repository.workspace = true
1313
workspace = true
1414

1515
[dependencies]
16-
anyhow = "1.0.95"
16+
anyhow = "1.0.100"
1717
derive_more = {version = "2.0.1", features = ["from","into","display"] }
1818
ipld-core = { version = "0.4.1", features = ["serde"]}
1919
# A fork of crates-io version with updated dependencies (`libp2p` and `ring` in particular).
2020
# rev-26b99cb as at July 30, 2025
21-
rust-ipfs = { version = "0.15.0", git = "https://github.com/dariusc93/rust-ipfs", rev = "26b99cb" }
21+
rust-ipfs = { version = "0.15.0", git = "https://github.com/dariusc93/rust-ipfs", rev = "0a6269e05a4ccfaa547a47a56f92171e4abc0564" }
2222
tokio = "1.46.0"
23+
futures = "0.3.31"
24+
libp2p = "0.56.0"
2325

2426
[dev-dependencies]
2527
# Dependencies used by examples

rust/hermes-ipfs/src/lib.rs

Lines changed: 61 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
//!
33
//! Provides support for storage, and `PubSub` functionality.
44
5+
#![allow(unused, dead_code, deprecated)]
6+
57
use std::str::FromStr;
68

79
use derive_more::{Display, From, Into};
10+
use futures::{pin_mut, stream::BoxStream, Stream, StreamExt};
811
/// IPFS Content Identifier.
912
pub use ipld_core::cid::Cid;
1013
/// IPLD
1114
pub use ipld_core::ipld::Ipld;
15+
use libp2p::gossipsub::{Message as PubsubMessage, MessageId as PubsubMessageId};
1216
/// `rust_ipfs` re-export.
1317
pub use rust_ipfs;
14-
/// libp2p re-exports.
15-
pub use rust_ipfs::libp2p::futures::{pin_mut, stream::BoxStream, FutureExt, StreamExt};
1618
/// Peer Info type.
1719
pub use rust_ipfs::p2p::PeerInfo;
1820
/// Enum for specifying paths in IPFS.
@@ -27,23 +29,17 @@ pub use rust_ipfs::Ipfs;
2729
pub use rust_ipfs::Multiaddr;
2830
/// Peer ID type.
2931
pub use rust_ipfs::PeerId;
30-
/// Stream for `PubSub` Topic Subscriptions.
31-
pub use rust_ipfs::SubscriptionStream;
32-
/// Builder type for IPFS Node configuration.
33-
use rust_ipfs::UninitializedIpfsDefault as UninitializedIpfs;
3432
use rust_ipfs::{
35-
dag::ResolveError,
36-
libp2p::gossipsub::{Message as PubsubMessage, MessageId as PubsubMessageId},
37-
unixfs::AddOpt,
38-
PubsubEvent, Quorum,
33+
builder::UninitializedIpfs, dag::ResolveError, dummy, gossipsub::IntoGossipsubTopic,
34+
unixfs::AddOpt, PubsubEvent, Quorum, ToRecordKey,
3935
};
4036

4137
#[derive(Debug, Display, From, Into)]
4238
/// `PubSub` Message ID.
4339
pub struct MessageId(pub PubsubMessageId);
4440

4541
/// Builder type for IPFS Node configuration.
46-
pub struct IpfsBuilder(UninitializedIpfs);
42+
pub struct IpfsBuilder(UninitializedIpfs<dummy::Behaviour>);
4743

4844
impl IpfsBuilder {
4945
#[must_use]
@@ -78,25 +74,25 @@ impl IpfsBuilder {
7874
)
7975
}
8076

81-
#[must_use]
82-
/// Set the transport configuration for the IPFS node.
83-
pub fn set_transport_configuration(
84-
self,
85-
transport: rust_ipfs::p2p::TransportConfig,
86-
) -> Self {
87-
Self(self.0.set_transport_configuration(transport))
88-
}
89-
90-
#[must_use]
91-
/// Disable TLS for the IPFS node.
92-
pub fn disable_tls(self) -> Self {
93-
let transport = rust_ipfs::p2p::TransportConfig {
94-
enable_quic: false,
95-
enable_secure_websocket: false,
96-
..Default::default()
97-
};
98-
Self(self.0.set_transport_configuration(transport))
99-
}
77+
// #[must_use]
78+
// /// Set the transport configuration for the IPFS node.
79+
// pub fn set_transport_configuration(
80+
// self,
81+
// transport: rust_ipfs::p2p::TransportConfig,
82+
// ) -> Self {
83+
// Self(self.0.set_transport_configuration(transport))
84+
// }
85+
86+
// #[must_use]
87+
// /// Disable TLS for the IPFS node.
88+
// pub fn disable_tls(self) -> Self {
89+
// let transport = rust_ipfs::p2p::TransportConfig {
90+
// enable_quic: false,
91+
// enable_secure_websocket: false,
92+
// ..Default::default()
93+
// };
94+
// Self(self.0.set_transport_configuration(transport))
95+
// }
10096

10197
/// Start the IPFS node.
10298
///
@@ -134,7 +130,7 @@ impl HermesIpfs {
134130
.with_default()
135131
.set_default_listener()
136132
// TODO(saibatizoku): Re-Enable default transport config when libp2p Cert bug is fixed
137-
.disable_tls()
133+
//.disable_tls()
138134
.start()
139135
.await?;
140136
Ok(HermesIpfs { node })
@@ -394,7 +390,7 @@ impl HermesIpfs {
394390
key: impl AsRef<[u8]>,
395391
value: impl Into<Vec<u8>>,
396392
) -> anyhow::Result<()> {
397-
self.node.dht_put(key, value, Quorum::One).await
393+
self.node.dht_put(key, value.into(), Quorum::One).await
398394
}
399395

400396
/// Get content from DHT.
@@ -412,7 +408,7 @@ impl HermesIpfs {
412408
/// Returns error if unable to get content from DHT
413409
pub async fn dht_get(
414410
&self,
415-
key: impl AsRef<[u8]>,
411+
key: impl AsRef<[u8]> + ToRecordKey,
416412
) -> anyhow::Result<Vec<u8>> {
417413
let record_stream = self.node.dht_get(key).await?;
418414
pin_mut!(record_stream);
@@ -473,7 +469,8 @@ impl HermesIpfs {
473469
&self,
474470
topic: impl Into<Option<String>>,
475471
) -> anyhow::Result<BoxStream<'static, PubsubEvent>> {
476-
self.node.pubsub_events(topic).await
472+
//self.node.pubsub_events(topic).await
473+
todo!()
477474
}
478475

479476
/// Subscribes to a pubsub topic.
@@ -489,12 +486,16 @@ impl HermesIpfs {
489486
/// ## Errors
490487
///
491488
/// Returns error if unable to subscribe to pubsub topic.
492-
pub async fn pubsub_subscribe(
493-
&self,
494-
topic: impl Into<String>,
495-
) -> anyhow::Result<SubscriptionStream> {
496-
self.node.pubsub_subscribe(topic).await
497-
}
489+
// pub async fn pubsub_subscribe(
490+
// &self,
491+
// topic: impl Into<String>,
492+
// ) -> anyhow::Result<SubscriptionStream> {
493+
// self.node.pubsub_subscribe(topic).await
494+
495+
// // TODO ?
496+
// // self.node.pubsub_subscribe(topic.into()).await?;
497+
// // let stream = self.node.pubsub_listener(topic.into()).await?;
498+
// }
498499

499500
/// Unsubscribes from a pubsub topic.
500501
///
@@ -511,9 +512,10 @@ impl HermesIpfs {
511512
/// Returns error if unable to unsubscribe from pubsub topic.
512513
pub async fn pubsub_unsubscribe(
513514
&self,
514-
topic: impl Into<String>,
515+
topic: impl Into<String> + IntoGossipsubTopic,
515516
) -> anyhow::Result<bool> {
516-
self.node.pubsub_unsubscribe(topic).await
517+
//self.node.pubsub_unsubscribe(topic).await
518+
todo!()
517519
}
518520

519521
/// Publishes a message to a pubsub topic.
@@ -535,10 +537,11 @@ impl HermesIpfs {
535537
topic: impl Into<String>,
536538
message: Vec<u8>,
537539
) -> anyhow::Result<MessageId> {
538-
self.node
539-
.pubsub_publish(topic, message)
540-
.await
541-
.map(std::convert::Into::into)
540+
// self.node
541+
// .pubsub_publish(topic, message)
542+
// .await
543+
// .map(std::convert::Into::into)
544+
todo!()
542545
}
543546

544547
/// Ban peer from node.
@@ -647,15 +650,15 @@ impl FromStr for GetIpfsFile {
647650
}
648651
}
649652

650-
/// Handle stream of messages from the IPFS pubsub topic
651-
pub fn subscription_stream_task(
652-
stream: SubscriptionStream,
653-
handler: fn(PubsubMessage),
654-
) -> tokio::task::JoinHandle<()> {
655-
tokio::spawn(async move {
656-
pin_mut!(stream);
657-
while let Some(msg) = stream.next().await {
658-
handler(msg);
659-
}
660-
})
661-
}
653+
///// Handle stream of messages from the IPFS pubsub topic
654+
// pub fn subscription_stream_task(
655+
// stream: SubscriptionStream,
656+
// handler: fn(PubsubMessage),
657+
// ) -> tokio::task::JoinHandle<()> {
658+
// tokio::spawn(async move {
659+
// pin_mut!(stream);
660+
// while let Some(msg) = stream.next().await {
661+
// handler(msg);
662+
// }
663+
// })
664+
// }

0 commit comments

Comments
 (0)