orbitdb-archive / orbit

A distributed, serverless, peer-to-peer chat application on IPFS
MIT License
1.64k stars 117 forks source link

Make sure that two instances of the electron can run simultaneously #167

Closed haadcode closed 7 years ago

haadcode commented 7 years ago

It should be possible to run two instances of the Orbit Electron app simultaneously.

This may or may not be the case atm, so we need to make sure that this is possible.

theobat commented 7 years ago

I fired 2 versions on the same machine, it seems fine until I press enter on the second username, it freezes Looking at the logs: First

2016-10-29T21:20:28.949Z [DEBUG] ipfs-daemon: Starting IPFS daemon
2016-10-29T21:20:31.122Z [DEBUG] ipfs-daemon: IPFS daemon started at 127.0.0.1 34847
2016-10-29T21:20:31.122Z [DEBUG] ipfs-daemon: Gateway at 0.0.0.0:33606/ipfs/

Second

2016-10-29T21:39:21.263Z [DEBUG] ipfs-daemon: Starting IPFS daemon
2016-10-29T21:39:21.547Z [DEBUG] ipfs-daemon: IPFS daemon started at undefined undefined
2016-10-29T21:39:30.962Z [DEBUG] ipfs-daemon: Gateway at localhost:8080/ipfs/

pointing at : ipfs-dameon

haadcode commented 7 years ago

@theobat Thanks for looking into this! I have an idea what's going on. Can you try the same but with the other daemon launched with IPFS_PATH=/some/other/dir? At the moment, if two instances are launched, they will both use the same IPFS data directory and I think this is what's causing the problems.

As for this issue, we were discussing (offline) that we should provide a configuration screen when starting Orbit so that the user can define their custom IPFS data path if they wanted to, enabling two instances. See https://github.com/haadcode/orbit/issues/166.

Another thing I'd like to do is to namespace the data dirs per username, but that requires a bit more work https://github.com/haadcode/orbit/issues/163.

theobat commented 7 years ago

Yep, that fixed the problem, it's fine with n instances as long as they have different ipfs path. Now even if I implement #166 I think it would be good to get a default path incrementing by default so that the user does not have to do it by himself, don't you think ?

haadcode commented 7 years ago

What do you mean by "default path incrementing"? Do you mean always using a unique path or something else?

theobat commented 7 years ago

I mean a unique path per electron instances which can be overridden by the user (with the ui of #166) (we don't need it to be unique at any run, a uuid would be overkill in my opinion)

haadcode commented 7 years ago

:+1: