New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPFS ignores PeerID passed by libp2p instance - too many ways of passing peer-id #3590
Comments
|
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
|
Thank you for the report!
|
|
@momack2 the configuration issue here is a conflict between a user configuring libp2p via
So what happens in this case is that IPFS repo already has a PeerId defined, but IPFS allows libp2p to be configured with another PeerId, which will be overwritten by IPFS when setting the repo's PeerId. With the above considerations, this is a
As a side note, there is a lot of room for configuration improvements on EDIT: We are only talking about the peerId here, but I suspect this problem might exist on other configuration properties like the swarm addresses configured in IPFS config file, which are forwarded to the libp2p config (and probably overwrite user provided configs within libp2p scope) |
|
@vasco-santos: who owns the next steps here? |
|
This needs an analysis of the scope of this issue first, as this is not only a This can be included in protocol/web3-dev-team#82 or as a maintenance task (probably for the onboarding team?) |
|
Seems like a simple v0 is just to define what does and doesn't work in the docs, and the work around that EmiM suggested (aka if you're using IPFS, your libp2p configurations will be overwritten and need to be passed directly to the IPFS constructor). Seems like something that @johnnymatthews @johndmulhausen can document! |
EmiM commentedMar 15, 2021
Version:
"ipfs": "0.52"
Platform:
Linux rf-Lenovo-ideapad-320-15IKB 5.8.0-44-generic #50~20.04.1-Ubuntu SMP Wed Feb 10 21:07:30 UTC 2021 x86_64 x86_64 x86_64 GNU/Linuxnodejslibp2p
Severity:
Low/Medium
Description:
IPFS ignores PeerID passed by libp2p instance.
This is the draft of my code:
The result of running the code above: Identity.PeerID saved in config file created by IPFS differs from peerID passed to libp2p. It causes further syncing problems with library that uses ipfs - orbitdb.
What I expect: IPFS uses peerID that I passed to libp2p.
What happened: IPFS completely ignores the peerID I passed and creates its own peerID. It uses
privateKeyfromoptionsor private key from Repo.I managed to fix the problem by passing
privateKey: peerID.toJSON().privKeyto IPFS.create.It's very confusing, especially that there are multiple ways of passing peer-id to IPFS and one of them that I would expect to work, doesn't work.
I've created a topic on your forum: https://discuss.ipfs.io/t/ipfs-ignores-peerid-passed-to-custom-libp2p-instance/10452, @vasco-santos suggested that IPFS could:
or
Besides that, I think that IPFS should not ignore PeerID from libp2p.
The text was updated successfully, but these errors were encountered: