Skip to content
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

[Enhancement] Dynamic Peerlist adding / removing #7880

Open
obo20 opened this issue Jan 25, 2021 · 3 comments · May be fixed by #9425
Open

[Enhancement] Dynamic Peerlist adding / removing #7880

obo20 opened this issue Jan 25, 2021 · 3 comments · May be fixed by #9425
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked

Comments

@obo20
Copy link

obo20 commented Jan 25, 2021

IPFS currently provides peering functionality seen here: https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#peeringpeers

This feature is a great first step towards things but a big problem still exists in that the node needs to be reset each time a new peer is added to this list.

As a a Peerlist gets larger and larger, the amount of nodes that need to be reset each time a new peer gets added becomes larger and larger. For production environments this isn't acceptable and is why we have yet to fully utilize this functionality within Pinata.

It would be super helpful if there was a way to add / remove peers to this list via a simple API command instead of having to actively update the ipfs config file / resetting the node.

@obo20 obo20 added the kind/enhancement A net-new feature or improvement to an existing feature label Jan 25, 2021
@obo20 obo20 changed the title [Enhancement [Enhancement] Dynamic Peerlist adding / removing Jan 25, 2021
@gammazero gammazero added the exp/novice Someone with a little familiarity can pick up label Jan 28, 2021
@Stebalien Stebalien added help wanted Seeking public contribution on this issue status/ready Ready to be worked labels Feb 12, 2021
@Stebalien
Copy link
Member

Stebalien commented Feb 12, 2021

The system was designed to support this, we just need a new command.

Design

The user should be able to add/remove peerings from the command line. Furthermore, these peerings should be temporary unless the user specifies that the peering should be saved in the config.

> ipfs swarm peering add [--save] ADDRESSES...
> ipfs swarm peering rm [--save] IDs...

Command: add

  1. Call AddrInfosFromP2pAddrs (from go-libp2p-core/peer) on the addresses to get back a set of peer INFOs.
  2. Call IpfsNode.Peering.AddPeer on each addr info.
  3. If --save is passed, add/update these peers in the config.

Command: rm

  1. Call IpfsNode.Peering.RemovePeer on each ID.
  2. If --save is passed, remove these peers from the config.

@lidel
Copy link
Member

lidel commented May 14, 2021

👍 for adding this (right now people will abuse ipfs bootstrap as it's easier than editing the config).
FYSA Brave will provide GUI for adding peers, and they are forced to use config for now.

@lidel lidel added the P2 Medium: Good to have, but can wait until someone steps up label May 14, 2021
@samuelbacaner
Copy link

I opened #9192 to add the --save feature to commit the changes to the configuration. Please take a look if able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked
Projects
None yet
5 participants