-
Notifications
You must be signed in to change notification settings - Fork 36
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
Split go-ipfs/routing/kbucket
into go-libp2p-kbucket
#1
Conversation
- use log.* instead of u.* - use automatic type conversions to .String() (Peer.String() prints nicely, and avoids calling b58 encoding until needed)
and other logging switches. I kept the u.PErr and u.POut in cli commands, as those do need to write raw output directly.
- distinguish log.Error and log.Errorf functions - Initialize structs with field names - A bit of unreachable code (defers)
this is a major refactor of the entire codebase it changes the monolithic peer.Peer into using a peer.ID and a peer.Peerstore. Other changes: - removed handshake3. - testutil vastly simplified peer - secio bugfix + debugging logs - testutil: RandKeyPair - backpressure bugfix: w.o.w. - peer: added hex enc/dec - peer: added a PeerInfo struct PeerInfo is a small struct used to pass around a peer with a set of addresses and keys. This is not meant to be a complete view of the system, but rather to model updates to the peerstore. It is used by things like the routing system. - updated peer/queue + peerset - latency metrics - testutil: use crand for PeerID gen RandPeerID generates random "valid" peer IDs. it does not NEED to generate keys because it is as if we lost the key right away. fine to read some randomness and hash it. to generate proper keys and an ID, use: sk, pk, _ := testutil.RandKeyPair() id, _ := peer.IDFromPublicKey(pk) Also added RandPeerIDFatal helper - removed old spipe - updated seccat - core: cleanup initIdentity - removed old getFromPeerList
refactor test peer creation to be deterministic and reliable a bit of cleanup trying to figure out TestGetFailure add test to verify deterministic peer creation switch put RPC over to use getClosestPeers rm 0xDEADC0DE fix queries not searching peer if its not actually closer
I think it's time to move a lot of the peer-to-peer networking but-not-ipfs-specific things into its own package: p2p. This could in the future be split off into its own library. The first thing to go is the peer.
The crypto package moves into p2p. Nothing in it so far is ipfs specific; everything is p2p-general.
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>
License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>
License: MIT Signed-off-by: Hector Sanjuan <code@hector.link>
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
ipfs/go-log#3 License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
* Update golog in go-ipfs License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch> * Update go-libp2p for go-log License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch> * Update go-libp2p-secio for go-log License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch> * Update go-libp2p-crypto for go-log License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch> * Update go-libp2p-peer for go-log License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch> * Import peersore, it wasn't imported License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch> * Update peerstore License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch> * Update peer License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch> * Update secio License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch> * Update go-libp2p License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
I think that the thirdparty testutil is duplicate code from go-libp2p/testutil, we might be able to handle both of those at the same time. Want me to make a repo for it? The routing keyspace stuff can probably move in here, i believe this is the only place its used. |
travis has been enabled |
@whyrusleeping Thanks! |
LGTM! |
Fix bootstrapping id generation logic
This PR splits
go-ipfs/routing/kbucket
fromgo-ipfs
intolibp2p/go-libp2p-kbucket
README
andLICENCE
(messed up because of my graft)There are two dependencies left to be handled for gx to work.
go-ipfs/thirdparty/testutil
will be dealt with with the rest of the thirdparties.go-ipfs/routing/keyspace
I think could be moved in here as well. @whyrusleeping thoughts?@whyrusleeping if can please enable travis for this repo.
Thanks :)