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.3k
refactor: ipns routing logic moved to instantiation #1701
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
assigned vasco-santos
Nov 7, 2018
Tested |
vasco-santos
changed the title
[WIP] chore: ipns routing logic moved to instantiation
chore: ipns routing logic moved to instantiation
Nov 7, 2018
vasco-santos
force-pushed
the
chore/ipns-routing-moved-to-instantiation
branch
from
November 11, 2018 02:36
9f7fb87
to
73d3686
Compare
fsdiogo
suggested changes
Nov 12, 2018
vasco-santos
force-pushed
the
chore/ipns-routing-moved-to-instantiation
branch
2 times, most recently
from
November 13, 2018 10:08
1c98e7d
to
5a07d44
Compare
Closed
fsdiogo
approved these changes
Nov 14, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
vasco-santos
force-pushed
the
chore/ipns-routing-moved-to-instantiation
branch
from
November 14, 2018 15:51
5a07d44
to
8c3b843
Compare
alanshaw
suggested changes
Nov 16, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P.S. commit message prefixes should be "refactor: " for this ;) |
alanshaw
changed the title
chore: ipns routing logic moved to instantiation
refactor: ipns routing logic moved to instantiation
Nov 16, 2018
vasco-santos
force-pushed
the
chore/ipns-routing-moved-to-instantiation
branch
6 times, most recently
from
November 17, 2018 00:44
538ff23
to
b25bcc1
Compare
@alanshaw addressed your review, changed the commit message prefix and added a bunch of tests to the |
vasco-santos
force-pushed
the
chore/ipns-routing-moved-to-instantiation
branch
from
November 17, 2018 01:00
b25bcc1
to
fa1d79c
Compare
alanshaw
suggested changes
Nov 19, 2018
src/core/ipns/republisher.js
Outdated
@@ -98,16 +100,16 @@ class IpnsRepublisher { | |||
} | |||
|
|||
// keychain needs pass to get the cryptographic keys | |||
if (this._ipfs._keychain && Boolean(pass)) { | |||
this._ipfs._keychain.listKeys((err, list) => { | |||
if (this._keychain && Boolean(pass)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this._keychain
be null
?
vasco-santos
force-pushed
the
chore/ipns-routing-moved-to-instantiation
branch
from
November 19, 2018 11:01
a66deba
to
5f95002
Compare
vasco-santos
force-pushed
the
chore/ipns-routing-moved-to-instantiation
branch
from
November 19, 2018 16:06
5f95002
to
ade2d1c
Compare
@vasco-santos would you mind rebasing this now the pin fixes are in? |
It is already running the CI rebased 😀 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the
ipns
routing logic is inside thepublish
/resolve
logic.Aiming to allow easily pluggable routings to
ipns
, I created this PR where the routing logic was moved from theipns.publish
/ipns.resolve
to the instantiation ofipns
.With this, we can add a
TieredDatastore
toipns
with an array of datastores. This array can have the node repo's datastore, the DHT, the ipfs/js-datastore-pubsub, among others in the future. As a result, insideipns
logic, we will haverouting.put
androuting.get
abstracted to all the enabled datastores.The routing received by
ipns
will differ according to the node state. In theinit
andpre-start
step, it will only receive theOfflineDatastore
aka Repo's datastore. This is necessary to the offline features ofIPNS
, such asinitializeKeyspace
. Finally, in the end of thestart
step, that is, when all the services are running,ipns
routing will have the mentionedTieredDatastore
, containing all the intended datastores.Moreover, the
routing
keys used toput
records and public keys, where modified according to the new ones being used ongo-ipfs
Note: this logic was implemented in ipfs/js-ipfs/pull/1559, which is currently blocked due to an interop problem with the topic (ipfs/interop#39). This way, I extracted this from that PR, in order to allow the implementation of
IPNS over DHT
. Once this is merged, I will also rebase thePubsub
PR with this, maintaing only the pubsub specific code in that PR.