Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ asyncio
Attributes
auditability
Auliffe
autonat
auxdata
babystep
backpressure
bech
Behaviour
bimap
bindgen
bkioshn
Expand Down Expand Up @@ -48,6 +50,7 @@ ciphertexts
Coap
codegen
codepoints
connexa
coti
coverallsapp
cpus
Expand All @@ -62,6 +65,7 @@ Datelike
DBSTATUS
dbsync
dcbor
dcutr
decompressor
delegators
devnet
Expand Down Expand Up @@ -141,6 +145,7 @@ jormungandr
Jörmungandr
jsonschema
Justfile
keypair
kiduri
labelloc
lcov
Expand Down Expand Up @@ -245,6 +250,7 @@ pytype
qpsg
qrcode
quic
rafal
rankdir
rapidoc
readlinkat
Expand Down
2 changes: 1 addition & 1 deletion rust/c509-certificate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ hex = "0.4.3"
oid = "0.2.1"
oid-registry = "0.7.1"
asn1-rs = "0.6.2"
anyhow = "1.0.95"
anyhow = "1.0.99"
bimap = "0.6.3"
strum = "0.26.3"
strum_macros = "0.26.4"
Expand Down
7 changes: 5 additions & 2 deletions rust/hermes-ipfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ repository.workspace = true
workspace = true

[dependencies]
anyhow = "1.0.95"
anyhow = "1.0.100"
derive_more = {version = "2.0.1", features = ["from","into","display"] }
ipld-core = { version = "0.4.1", features = ["serde"]}
# A fork of crates-io version with updated dependencies (`libp2p` and `ring` in particular).
# rev-26b99cb as at July 30, 2025
rust-ipfs = { version = "0.15.0", git = "https://github.com/dariusc93/rust-ipfs", rev = "26b99cb" }
rust-ipfs = { version = "0.15.0", git = "https://github.com/dariusc93/rust-ipfs", rev = "0a6269e05a4ccfaa547a47a56f92171e4abc0564" }
tokio = "1.46.0"
futures = "0.3.31"
libp2p = "0.56.0"
connexa = { version = "0.4.1", features = ["identify", "dcutr", "gossipsub", "autonat", "relay", "kad", "keypair_base64_encoding", "ping", "request-response", "request-response-misc", "rendezvous", "mdns"] }

[dev-dependencies]
# Dependencies used by examples
Expand Down
7 changes: 4 additions & 3 deletions rust/hermes-ipfs/examples/hermes-ipfs-cli.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//! Hermes IPFS VFS compatibility

use clap::{Parser, Subcommand};
use hermes_ipfs::{HermesIpfs, IpfsBuilder};
use connexa::dummy;
use hermes_ipfs::{HermesIpfs, HermesIpfsBuilder};
use lipsum::lipsum;
use rust_ipfs::IpfsPath;

Expand Down Expand Up @@ -44,11 +45,11 @@ async fn main() -> anyhow::Result<()> {
let args = Cli::parse();
let base_dir = dirs::data_dir().unwrap_or_else(|| std::path::PathBuf::from("."));
let ipfs_data_path = base_dir.as_path().join("hermes/ipfs");
let builder = IpfsBuilder::new()
let builder = HermesIpfsBuilder::<dummy::Behaviour>::new()
.with_default()
.set_default_listener()
// TODO(saibatizoku): Re-Enable default transport config when libp2p Cert bug is fixed
.disable_tls()
//.enable_secure_websocket()
.set_disk_storage(ipfs_data_path);
let hermes_node: HermesIpfs = builder.start().await?.into();
match args.command {
Expand Down
24 changes: 4 additions & 20 deletions rust/hermes-ipfs/examples/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
//! * The task that reads lines from stdin and publishes them as either node.
use std::io::Write;

use hermes_ipfs::{FutureExt, HermesIpfs, StreamExt, pin_mut};
use rust_ipfs::PubsubEvent;
use futures::{FutureExt, StreamExt, pin_mut};
use hermes_ipfs::HermesIpfs;
use rustyline_async::Readline;

#[allow(clippy::indexing_slicing)]
Expand Down Expand Up @@ -57,15 +57,11 @@ async fn start_bootstrapped_nodes() -> anyhow::Result<(HermesIpfs, HermesIpfs)>
/// Main function
async fn main() -> anyhow::Result<()> {
let topic = String::from("ipfs-chat");
let option_topic = Option::Some(topic.clone());

// Initialize the repo and start a daemon
let (hermes_a, hermes_b) = start_bootstrapped_nodes().await?;
let (mut rl, mut stdout) = Readline::new(format!("{} > ", "Write message to publish"))?;

let mut event_stream = hermes_a.pubsub_events(option_topic.clone()).await?;
let mut event_stream_b = hermes_b.pubsub_events(option_topic).await?;

let stream = hermes_a.pubsub_subscribe(topic.clone()).await?;
let stream_b = hermes_b.pubsub_subscribe(topic.clone()).await?;

Expand All @@ -79,24 +75,12 @@ async fn main() -> anyhow::Result<()> {
tokio::select! {
data = stream.next() => {
if let Some(msg) = data {
writeln!(stdout, "NODE A RECV: {}", String::from_utf8_lossy(&msg.data))?;
writeln!(stdout, "NODE A RECV: {:?}", &msg)?;
}
}
data = stream_b.next() => {
if let Some(msg) = data {
writeln!(stdout, "NODE B RECV: {}", String::from_utf8_lossy(&msg.data))?;
}
}
Some(event) = event_stream.next() => {
match event {
PubsubEvent::Subscribe { peer_id, topic } => writeln!(stdout, "{peer_id} subscribed to {topic:?}")?,
PubsubEvent::Unsubscribe { peer_id, topic } => writeln!(stdout, "{peer_id} unsubscribed from {topic:?}")?,
}
}
Some(event) = event_stream_b.next() => {
match event {
PubsubEvent::Subscribe { peer_id , topic} => writeln!(stdout, "{peer_id} subscribed to {topic:?}")?,
PubsubEvent::Unsubscribe { peer_id, topic } => writeln!(stdout, "{peer_id} unsubscribed from {topic:?}")?,
writeln!(stdout, "NODE B RECV: {:?}", &msg)?;
}
}
line = rl.readline().fuse() => match line {
Expand Down
3 changes: 2 additions & 1 deletion rust/hermes-ipfs/examples/put-get-dht.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ async fn main() -> anyhow::Result<()> {
println!("* Hermes IPFS node A is publishing 'my_key' to DHT.");
hermes_ipfs_a.dht_put(b"my_key", ipfs_file).await?;
println!("* Hermes IPFS node B is getting 'my_key' from DHT.");
let data_retrieved = hermes_ipfs_b.dht_get(b"my_key").await?;
let key: Vec<u8> = "my_key".bytes().collect();
let data_retrieved = hermes_ipfs_b.dht_get(key).await?;
let data = String::from_utf8(data_retrieved)?;
println!(" Got data: {data:?}");
// Stop the nodes and exit.
Expand Down
Loading
Loading