-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
migrate to go-libp2p-core. #6384
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
Conversation
2b0a6e3
to
249fe9e
Compare
closes #6391 License: MIT Signed-off-by: Raúl Kripalani <[email protected]>
Something is broken with the cache.
@@ -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) { |
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.
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) { |
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.
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. |
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.
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 { |
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.
Small bug fix, just in case.
@Kubuxu could I get a review on the second commit? I've reviewed the first commit. |
migrate to go-libp2p-core. This commit was moved from ipfs/kubo@1a32379
migrate to go-libp2p-core. This commit was moved from ipfs/kubo@1a32379
Migrates go-ipfs to go-libp2p-core.
Prerequisites -- update go.mod and remove replace directives once these PRs are merged and released: