Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

some groundwork for peer/content discovery #256

Merged
merged 9 commits into from
Jul 22, 2020

Conversation

ljedrz
Copy link
Member

@ljedrz ljedrz commented Jul 21, 2020

Some groundwork for peer and content discovery using libp2p::kad.

Very much a WIP with plenty of prototyping and wild println!s.

Cc #10

Signed-off-by: ljedrz <ljedrz@gmail.com>
@ljedrz ljedrz force-pushed the content_discovery branch from b325b9b to 6428df5 Compare July 22, 2020 09:37
ljedrz added 2 commits July 22, 2020 12:00
Signed-off-by: ljedrz <ljedrz@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
@ljedrz ljedrz force-pushed the content_discovery branch from 6428df5 to e2297fd Compare July 22, 2020 11:32
@ljedrz ljedrz marked this pull request as ready for review July 22, 2020 11:32
@ljedrz ljedrz requested a review from koivunej July 22, 2020 11:32
src/lib.rs Show resolved Hide resolved
src/lib.rs Outdated
@@ -608,6 +616,35 @@ impl<Types: IpfsTypes> Ipfs<Types> {
rx.await?
}

pub async fn bootstrap(&self) -> Result<(), Error> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub async fn bootstrap(&self) -> Result<(), Error> {
// Initiate a query for random key to discover peers.
pub async fn bootstrap(&self) -> Result<(), Error> {

Is there a reason for this to be in the API or is it only while we are not doing this periodically ourselves?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we are doing it at all automatically; I can check

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't seem that way, at least not in tests

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we are not yet doing it automatically, but we probably should eventually.

What is the reason for exposing this as a method? Does kad queue these bootstraps or are they executed concurrently?

Copy link
Member Author

@ljedrz ljedrz Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does kad queue these bootstraps or are they executed concurrently?

good question; I don't know, but I'd expect it to be concurrent; a single call can result in a few logs that the bootstrapping query has completed

http/src/main.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/p2p/behaviour.rs Outdated Show resolved Hide resolved
Signed-off-by: ljedrz <ljedrz@gmail.com>
src/lib.rs Outdated Show resolved Hide resolved
ljedrz and others added 4 commits July 22, 2020 15:35
…_generated_keys

Signed-off-by: ljedrz <ljedrz@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
… names

Signed-off-by: ljedrz <ljedrz@gmail.com>
@ljedrz ljedrz force-pushed the content_discovery branch from 2beae18 to b41490f Compare July 22, 2020 13:48
Signed-off-by: ljedrz <ljedrz@gmail.com>
Copy link
Collaborator

@koivunej koivunej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks! bors r+

@koivunej
Copy link
Collaborator

bors r+

bors bot added a commit that referenced this pull request Jul 22, 2020
256: some groundwork for peer/content discovery r=koivunej a=ljedrz

Some groundwork for peer and content discovery using `libp2p::kad`.

~~Very much a WIP with plenty of prototyping and wild `println!`s.~~

Cc #10

Co-authored-by: ljedrz <ljedrz@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 22, 2020

Build failed:

@koivunej
Copy link
Collaborator

I dont think anything changed with the bitswap so that's probably a transient one.

bors retry

@bors
Copy link
Contributor

bors bot commented Jul 22, 2020

Build succeeded:

@bors bors bot merged commit 6bee0b5 into rs-ipfs:master Jul 22, 2020
@ljedrz ljedrz deleted the content_discovery branch July 22, 2020 14:53
@koivunej koivunej mentioned this pull request Sep 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants