Questions tagged [libp2p]

Libp2p is a modular peer-to-peer networking stack used by IPFS and others.

Libp2p is a modular peer-to-peer networking stack used by and others. It is the result of the collective experience of building a distributed system (IPFS). In essence, a peer using libp2p will be able to communicate with another peer utilizing a variety of different transports, including connection relay, and talk over various protocols, negotiated on demand.

71 questions
5
votes
1 answer

Can an ipfs node query a remote peer to list their pins?

The IPFS cli/http api has an ipfs pin ls command that lists pinned hashes. However, this only works to query the local node. Is there a way to run the same command against a remote node, e.g., something like $ ipfs pin ls Which would act…
user10917065
4
votes
2 answers

IPFS- How to send message from a peer to another?

I am looking for a solution to send a message from an IPFS peer to another in the github doc I found this code that connect a peer to another one : ipfs.swarm.connect(addr, function (err) { if (err) { throw err } // if no err is present,…
maroodb
  • 1,026
  • 2
  • 16
  • 28
3
votes
1 answer

libp2p - How to discover initial peers?

In the bitcoin p2p core client, the initial peers are found, as stated, as: When started for the first time, programs don’t know the IP addresses of any active full nodes. In order to discover some IP addresses, they query one or more DNS names…
Anon21
  • 2,961
  • 6
  • 37
  • 46
3
votes
1 answer

go-libp2p - receiving bytes from stream

I'm building my first go-libp2p application and trying to modify the echo example to read a []byte instead of a string as in the example. In my code, I changed the doEcho function to run io.ReadAll(s) instead of bufio.NewReader(s) followed by…
chnski
  • 557
  • 1
  • 4
  • 20
3
votes
0 answers

Libp2p DHT peer discovery example in JS

According to Libp2p documentation DHT can be used for peer discovery. Also, Filecoin claims that they are using libp2p Kademlia DHT for discovering peers in go. So far I have not been able to find any working examples of how to set it up in JS. When…
3
votes
1 answer

Difference between multiplex and multistream

What is the difference between multistream (yamux, multistream-select, ..) and multiplex (mplex)? I'd like to utilize one TCP connection for RPC, HTTP, etc (one client is behind firewall) like this: conn = tcp.connect("server.com:1111") conn1, conn2…
mq7
  • 1,125
  • 2
  • 11
  • 21
2
votes
1 answer

Program using libp2p to connect using TCP, QUIC or both

I a m writting a P2P application, and I want to decide to send a message to a peer using TCP or QUIC, for a benchmark of the protocols and also for leting the user decide (I want the quic protocol to the the pefered one). But i am having trouble to…
2
votes
1 answer

Rust libp2p cannot find function development_transport in crate libp2p

My code keeps getting the error 'cannot find function development_transport in crate 'libp2p'. When I go the libp2p library (click on the import statement in the editor) it shows the function development_transport in that file (lib.rs) of libp2p.…
Tjardo
  • 86
  • 7
2
votes
1 answer

Implementing peer discovery in libp2p

Is peer discovery in libp2p (e.g. peers telling each other about peers they know about, and managing lists of connected nodes) in Rust controlled entirely at the level of a NetworkBehavior? It looks like one option is to use Kademlia which looks…
kimon
  • 2,481
  • 2
  • 23
  • 33
2
votes
1 answer

How to log peer messages in IPFS / libp2p in the browser?

I did a test to see what would happen if I try getting a CID that doesn't exist, to see if I could continuously ask every peer in IPFS. It doesn't seem to work. I "connect" to around 10 peers, then it gives up. I'm not sure I'm actually "connecting"…
cooldude101
  • 1,215
  • 2
  • 14
  • 29
2
votes
1 answer

How to make go-ipfs use ws-star for punsub

When i use wss in go-ipfs, it throw not support wss so i can’t use /dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star i wanna make js-ipfs and go-ipfs can join same pubsub topic does any other address can make it or how can make…
bluelovers
  • 1,035
  • 2
  • 10
  • 22
1
vote
0 answers

Unable to connect to peers via DHT if I run my node on MacOS

I'm working on a simple project to get to know how to use DHT. Here it is: https://github.com/ashish10677/dht-implementation This project simply runs a libp2p node and and publishes it's peer id. Other machines can run the same program using the…
1
vote
0 answers

libp2p: Do I need multiple protocols or can I reuse the same, for 2 near-identical functions?

I am new to libp2p. I am designing a new libp2p protocol. I have 2 different message types, which means, messages with different structure and content. Do I need a different protocol for each and therefore and independent handler, or can I reuse…
loophole
  • 37
  • 4
1
vote
1 answer

Can I keep the same ID in libp2p across restarts?

I am writing a test app. For this, it would be ideal if my libp2p nodes would keep their IDs across restarts - otherwise I need to think of some intermediate service which keeps track of NodeIDs for the nodes to connect during a test. Can I do…
loophole
  • 37
  • 4
1
vote
1 answer

Why two stream are required when connecting nodes with libp2p? When handler is called after the peer is connected?

I am following this example - https://github.com/libp2p/go-libp2p/tree/master/examples/chat-with-mdns Here we are initiating a node and using mdns for discovering other nodes on the same local network. I am a bit confused about the connection…
Dhairya Verma
  • 661
  • 1
  • 9
  • 15
1
2 3 4 5