This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Two peers with same Identity #1316
Comments
Oh, geez, I see the problem. In I wonder if a better solution is to make it a function that returns a new config object. Otherwise every consumer needs to be careful about copying first. |
Mr0grog
added a commit
to Mr0grog/js-ipfs
that referenced
this issue
Apr 23, 2018
Because the default config was a JSON file, it was treated as a singleton object. In some parts of the code, data got added to it, leading to race conditions when creating multiple nodes simultaneously. To make that harder to do accidentally, the default config is now a *function* that returns a unique configuration object on each call. Fixes ipfs#1316. License: MIT Signed-off-by: Rob Brackett <rob@robbrackett.com>
This was referenced Apr 23, 2018
daviddias
pushed a commit
that referenced
this issue
Apr 30, 2018
…ing it doubly used (#1324) * Change default config from JSON file to JS module Because the default config was a JSON file, it was treated as a singleton object. In some parts of the code, data got added to it, leading to race conditions when creating multiple nodes simultaneously. To make that harder to do accidentally, the default config is now a *function* that returns a unique configuration object on each call. Fixes #1316. License: MIT Signed-off-by: Rob Brackett <rob@robbrackett.com> * Fix lint errors License: MIT Signed-off-by: Rob Brackett <rob@robbrackett.com>
This was referenced Nov 25, 2023
This was referenced Jan 18, 2024
This was referenced May 13, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If you create two nodes in parallel, then they end up having the same Identity. When the script below is run you end up with configuration files which contain the same Identity:
I tried this on js-ipfs master (64c3bfb).
I debugged it a bit, but then I hit a dead end. I don't really understand how the initial configuration is created. It seems that some default configuration is written to disk, which is then overridden.
The text was updated successfully, but these errors were encountered: