(StackOverflow bounty) Can't put records to IPFS DHT #2266
-
Hi, I'm trying to build on the ipfs-kad.rs example to create a new record in the IPFS DHT. In the snippet below I'm trying to create a /pk entry because, unlike IPNS entries, it doesn't require any complex data structures. let mut key = "/pk/".bytes().collect::<Vec<_>>();
key.append(&mut local_peer_id.to_bytes());
let key = Key::from(key);
let value = local_key.public().into_protobuf_encoding();
match swarm.behaviour_mut().put_record(Record{
key,
value,
publisher: None,
expires: None
}, Quorum::One) {
Ok(ok) => {
println!("Success start put record");
}
Err(err) => {
eprintln!("Cannot start put record {:?}", err);
}
} Note: The rest of the code is the same as in https://github.com/libp2p/rust-libp2p/blob/master/examples/ipfs-kad.rs, except for listening to additional events in the main event loop. When this runs, I can see This behaviour is specific to the IPFS DHT, as this same code runs fine in https://github.com/libp2p/rust-libp2p/blob/master/examples/ipfs-private.rs. It'd be great if you could either point out what I'm doing wrong, or even better yet, update the examples to demonstrate how to properly put records in the IPFS DHT. Edit There is a StackOverflow bounty for answering this question: https://stackoverflow.com/questions/69599760/put-record-into-dht |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
A couple of things worth looking into:
|
Beta Was this translation helpful? Give feedback.
-
@mxinden @thomaseizinger seems that there's a bug that is breaking interop with go-libp2p-based IPFS DHT nodes - see #2309 |
Beta Was this translation helpful? Give feedback.
@mxinden @thomaseizinger seems that there's a bug that is breaking interop with go-libp2p-based IPFS DHT nodes - see #2309