Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

service: --random-ports flag for init #794

Closed
NatoBoram opened this issue May 24, 2019 · 10 comments · Fixed by #926
Closed

service: --random-ports flag for init #794

NatoBoram opened this issue May 24, 2019 · 10 comments · Fixed by #926
Assignees
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 P3 Low: Not priority right now status/ready Ready to be worked

Comments

@NatoBoram
Copy link

NatoBoram commented May 24, 2019

Describe the feature you are proposing

  • An init flag to generate a configuration using random ports
  • A daemon flag to use random ports

Additional context

In order to join multiple clusters, we have to start multiple instances of IPFS-Cluster and change the ports of each instances. It'd be nice to have something easy to set up secondary nodes with random ports.

If it's possible to use /tcp/0 to get a random port on each startups, then I think there should have an init flag to set it up automatically once.

@NatoBoram NatoBoram added kind/enhancement A net-new feature or improvement to an existing feature need/review Needs a review labels May 24, 2019
@vasa-develop
Copy link
Collaborator

I am working on something like IPTB for IPFS Cluster. Is that what we are looking for here?

@lanzafame
Copy link
Contributor

lanzafame commented May 26, 2019 via email

@vasa-develop
Copy link
Collaborator

I don't think that it will be a plugin. Let's call it IPCTB just for that sake of the conversation.
It's a CLI which uses IPTB code for managing Libp2p peers.

How will it work?

  • Initialize n number of cluster peers.
ipctb init --count n

NOTE: As cluster peers are not of much use until we have libp2p(IPFS) peers connected to each instance, should we initialize libp2p peers too(within this command)? So, this will initialize a number of Libp2p peers on separate ports and these peers will be mapped with the initialized cluster peers.

  • Start the initialized cluster peers
ipctb start
  • Connect CLI to a nth cluster peer (assume n = 0)
ipctb shell 0

Now you can execute commands as if you were using IPFS Cluster CLI. Just replace ipfs-cluster-crl with ipctb

For eg.

  • Get peer Id
ipctb id

These are some ideas. Is this what we are looking for @NatoBoram @lanzafame ?

@lanzafame
Copy link
Contributor

lanzafame commented May 26, 2019 via email

@vasa-develop
Copy link
Collaborator

Oh! That's cool.
Thanks for pointing that out. I will use this approach then.
I will create a sample implementation, and we can see if it works for us ;)

@hsanjuan
Copy link
Collaborator

@hsanjuan hsanjuan added exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue status/ready Ready to be worked and removed need/review Needs a review labels Jun 10, 2019
@hsanjuan
Copy link
Collaborator

Let's scope this convo: I have created an issue for the IPTB side: #817

This issue is about having an init flag that configures random ports in the same fashion as go-ipfs (the implementer should look at go-ipfs and see how they choose the ports and grab inspiration from there).

@hsanjuan hsanjuan changed the title Facilitate running multiple IPFS-Cluster on a single machine service: --random-ports flag for init Jul 23, 2019
@hsanjuan hsanjuan added the P3 Low: Not priority right now label Jul 23, 2019
@kishansagathiya
Copy link
Contributor

I would rather like to have a shell script for this than put it in main cluster code, since this is clearly another layer on cluster.
Something like ipfs-cluster-helper (but that is outdated, very basic and for two peers only)

@hsanjuan
Copy link
Collaborator

hsanjuan commented Sep 6, 2019

Please investigate how IPFS does it and report back. It's functionality that is handy.

@kishansagathiya
Copy link
Contributor

The PR used in IPFS ipfs/go-ipfs-config#17 (easy)
it adds an option --profile=randomports to tell that you want random ports

In case of IPFS, they are supporting random ports to stay uncensored (ipfs/kubo#5176 (comment)). If cluster could face such problem of port-banning by government (with collaborative cluster usecase mostly yes), it makes sense to support it.

But if it is just about testing you want more than just supporting random ports. Say you want to run a 10 node cluster, you want to automate those 10 init calls and then 10 daemon calls too.

# for free to join this conversation on GitHub. Already have an account? # 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 P3 Low: Not priority right now status/ready Ready to be worked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants