go-libp2p/examples
vyzo 7872bd5a44 p2p-circuit v2 (#125)
* v2 client scaffolding

* gomod: go-libp2p-core and go-libp2p-transport-upgrader feature dependencies

* Conn implements network.ConnStat

* add reservation stub

* utilities

* dial scaffolding and v1 compat dialing

* stream handling scaffolding and v1 incoming connection handling

* implement hop tagging

* export timeout variables

* v2 protobuf

* v2 client protocol implementation

* implement Reserve

* go get go-libp2p-swarm@feat/transient-conns

* implement client.New

* rework pb status codes

* client responds with UNEXPECTED_MESSAGE when it's actually an unexpected message

* relay scaffolding, reservation implementation

* implement relaying

* implement missing details

* add options for resources/limit

* gc idle conn counts

* fix clown shoes in cancellation check

* end to end relay test

* untag peers with expired reservations

* add time limit test

* better debug log for accepted conns

* add data limit test

* add v2-v1 compatibility tests

* godocs

* add WithACL relay option

* only return public relay addrs in reservation record

* remove the refresh restriction madness

* set default limit Data to 128K

* fix typo in AllowReserve godoc

* fix some small issues

- remove context from constructor
- remove stream handler when closing the host
- remove the awkward cancellation check from handleStream

* fix tests

* address review comments

- Add deadline for Reserve calls
- Add deadline for dials
- Add some comments for things that confuse aarsh.

* humor aarsh and add initializers for slices

* comment nitpicks

* fix bug in slice pre-allocations

* add deadline to connectV1

* make Relay.Close thread-safe

* untag peers with reservations when closing the relay

* gomod: get go-libp2p-asn-util

* add IP/ASN reservation constraints

* gomod: update deps

* fix e2e test

* increase default limit duration to 2min

* update protocol for vouched relay addrs; provide absolute expiration time instead of TTL

* update for reservation changes

* add voucher to the reservation pb

* TODO about reservation vouchers

* deduplicate protocol ID definitions between relay and client

* add reservation vouchers

* emit and consume reservation vouchers

* improve limit data test

* deduplicate concurrent relay dials to the samke peer

* improve dialer deduplication

* add a short timeout to dialing the relay in order to aid deduplication

* gomod: fix go1.16 madness

* spec compliance: don't include p2p-circuit in reservation addrs

* spec compliance: refuse reservation and connection attempts over relayed connections

* test shim: add empty file in test directory

* spec compliance: update protobuf

* spec compliance: use libp2p envelopes for reservation vouchers

* fix staticcheck

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2021-09-02 20:25:16 +01:00
..
chat Add .gitignore for each example 2021-05-10 11:54:35 +01:00
chat-with-mdns implement the new mDNS spec, move the old mDNS implementation (#1161) 2021-08-18 09:15:56 -07:00
chat-with-rendezvous Add .gitignore for each example 2021-05-10 11:54:35 +01:00
echo test: fix flaky example test 2021-07-22 14:46:15 -07:00
http-proxy Add .gitignore for each example 2021-05-10 11:54:35 +01:00
ipfs-camp-2019 p2p-circuit v2 (#125) 2021-09-02 20:25:16 +01:00
libp2p-host remove secio from examples 2021-07-27 19:27:56 +02:00
multipro fix: deflake multipro echo test 2021-08-03 13:36:29 -07:00
pubsub p2p-circuit v2 (#125) 2021-09-02 20:25:16 +01:00
relay Add .gitignore for each example 2021-05-10 11:54:35 +01:00
routed-echo remove secio from examples 2021-07-27 19:27:56 +02:00
testutils chore: fix staticcheck errors 2021-05-07 18:43:57 -07:00
README.md doc(examples): remove unecessary header info 2021-05-12 10:16:03 -07:00
go.mod sync: update CI config files (#1166) 2021-08-21 11:00:06 +00:00
go.sum p2p-circuit v2 (#125) 2021-09-02 20:25:16 +01:00

README.md

go-libp2p examples and tutorials

In this folder, you can find a variety of examples to help you get started in using go-libp2p. Every example as a specific purpose and some of each incorporate a full tutorial that you can follow through, helping you expand your knowledge about libp2p and p2p networks in general.

Let us know if you find any issue or if you want to contribute and add a new tutorial, feel welcome to submit a pr, thank you!

Examples and Tutorials

For js-libp2p examples, check https://github.com/libp2p/js-libp2p/tree/master/examples