mirror of
https://github.com/libp2p/go-libp2p-core.git
synced 2025-02-05 05:50:08 +08:00
Interfaces and abstractions that make up go-libp2p
7b2888dfdb
* add SignedEnvelope type * use struct for SignedEnvelope instead of exposing protobuf directly * doc comments for envelopes * tests for SignedEnvelopes * add helpers to make routing records for Host * fix doc comment * go fmt * add method to peerstore to retrieve signed routing records * update to match spec changes * just use nanoseconds * use proto3 & rename fields to match spec changes * use proto3 for routing records * make envelope fields private & validate on unmarshal * use buffer pool for envelope signatures * tests for RoutingState * go fmt * rename Equals -> Equal, add some comments * use test helpers * get rid of unsigned RoutingState struct, only expose SignedRoutingState * rm batching SignedRoutingStates accessor in peerstore the datastore peerstore implementation doesn't support batched reads, so it's no more efficient to get a bunch of states at once than it is to call SignedRoutingState multiple times. * whitespace * expose struct fields & remove accessors * use camelCase in protos for consistency * use multiformats uvarint for length-prefixes * remove payloadType check when unmarhaling * rm stray ref to golang/protobuf * define CertifiedAddrBook to avoid breaking API change * add events for updated addresses and routing state * remove SignedRoutingStateFromHost helper moving this to go-libp2p * add routing state records, extend peerstore API * fix: rebuild protos with new gogofaster generator * filter private addrs from signed routing records * envelope: use byte slices from pool; adjust interface. * move envelope to record package. * move protobuf files; adjust imports everywhere. * rename RoutingStateRecord -> PeerRecord also removes embedded reference to Envelope from the record, as that was confusing. as a result, the CertifiedAddrBook now accepts/returns record.SignedEnvelope instead of a specialized type. * hoist Seq from PeerRecord to SignedEnvelope * test that PeerRecords can't be signed by wrong key * commit go.sum * add Seq field to envelope signature * fix proto_path in Makefile * fix import ordering * comments for PeerRecord proto message also removes the seq field from PeerMessage proto, since it was moved to the SignedEnvelope * use Record type for envelope payloads * rename SignedEnvelope -> Envelope, unmarshal payload in ConsumeEnvelope * return buffer to pool before early return * doc comments * rename CertifiedAddrBook methods, update comments * cache unmarshalled Record payload inside Envelope * doc comments * store reflect.Type when registering Record * Revert "return buffer to pool before early return" |
||
---|---|---|
connmgr | ||
crypto | ||
discovery | ||
event | ||
helpers | ||
host | ||
metrics | ||
mux | ||
network | ||
peer | ||
peerstore | ||
pnet | ||
protocol | ||
record | ||
routing | ||
sec | ||
test | ||
transport | ||
.gitignore | ||
.travis.yml | ||
alias.go | ||
compat-check | ||
go.mod | ||
go.sum | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md | ||
tools.go |
go-libp2p-core
Home to the interfaces and abstractions that make up go-libp2p.
Minimum go version: 1.13
Install
go get github.com/libp2p/go-libp2p-core
Usage
Check out the GoDocs.
Testing
To test instantiations of interfaces and abstractions, you can use the test suite.
License
Dual-licensed under MIT and ASLv2, by way of the Permissive License Stack.