Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

migrate to go-libp2p-core. #6384

Merged
merged 5 commits into from Jun 3, 2019
Merged

migrate to go-libp2p-core. #6384

merged 5 commits into from Jun 3, 2019

Conversation

raulk
Copy link
Member

@raulk raulk commented May 28, 2019

Migrates go-ipfs to go-libp2p-core.

Prerequisites -- update go.mod and remove replace directives once these PRs are merged and released:

@raulk raulk changed the title migrate to go-libp2p-core. [WIP] migrate to go-libp2p-core. May 28, 2019
@Stebalien Stebalien force-pushed the libp2p-core branch 2 times, most recently from 2b0a6e3 to 249fe9e Compare May 31, 2019 04:24
@Stebalien Stebalien changed the title [WIP] migrate to go-libp2p-core. migrate to go-libp2p-core. May 31, 2019
closes #6391

License: MIT
Signed-off-by: Raúl Kripalani <raul@protocol.ai>
@@ -315,23 +294,36 @@ func bootstrapWritePeers(w io.Writer, prefix string, peers []string) error {
return nil
}

func bootstrapAdd(r repo.Repo, cfg *config.Config, peers []config.BootstrapPeer) ([]config.BootstrapPeer, error) {
func bootstrapAdd(r repo.Repo, cfg *config.Config, peers []string) ([]string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

The BootstrapPeer type no longer exists as it was an alias for IPFSAddr.

func bootstrapRemove(r repo.Repo, cfg *config.Config, toRemove []config.BootstrapPeer) ([]config.BootstrapPeer, error) {
removed := make([]config.BootstrapPeer, 0, len(toRemove))
keep := make([]config.BootstrapPeer, 0, len(cfg.Bootstrap))
func bootstrapRemove(r repo.Repo, cfg *config.Config, toRemove []string) ([]string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

This now has a new feature: One can remove a peer /ip4/.../tcp/.../p2p/QmFoo with ipfs bootstrap rm /p2p/QmFoo (no transport).

//
// Once per address specified. However, I'm not sure of
// a good backwards compat solution. Right now, I'm just
// preserving the current behavior.
Copy link
Member

Choose a reason for hiding this comment

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

Bleh. I'd prefer to print the multiaddrs.

@@ -531,7 +497,7 @@ func resolveAddresses(ctx context.Context, addrs []string) ([]ma.Multiaddr, erro
// filter out addresses that still doesn't end in `ipfs/Qm...`
found := 0
for _, raddr := range raddrs {
if _, last := ma.SplitLast(raddr); last.Protocol().Code == ma.P_IPFS {
if _, last := ma.SplitLast(raddr); last != nil && last.Protocol().Code == ma.P_IPFS {
Copy link
Member

Choose a reason for hiding this comment

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

Small bug fix, just in case.

@Stebalien
Copy link
Member

@Kubuxu could I get a review on the second commit? I've reviewed the first commit.

@Stebalien Stebalien merged commit 1a32379 into master Jun 3, 2019
@Stebalien Stebalien deleted the libp2p-core branch June 3, 2019 16:49
hacdias pushed a commit to ipfs/boxo that referenced this pull request Jan 27, 2023
migrate to go-libp2p-core.

This commit was moved from ipfs/kubo@1a32379
gammazero pushed a commit to ipfs/boxo that referenced this pull request Sep 29, 2023
migrate to go-libp2p-core.

This commit was moved from ipfs/kubo@1a32379
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants