Commit Graph

130 Commits

Author SHA1 Message Date
Marten Seemann 72f0a64180 chore: update deps 2021-10-19 14:49:47 +02:00
Marten Seemann d01b892679 update go-libp2p-swarm to v0.7.0 2021-10-19 10:39:32 +02:00
Marten Seemann 2828a61f9c move circuitv2 tests to the relay package 2021-10-12 15:09:29 +02:00
Marten Seemann adb93ce704 chore: update zeroconf to v2.1.1 2021-10-05 21:58:27 +01:00
Marten Seemann 077325cde7 pass notifees to the mDNS constructor, add dedicated Start method 2021-10-05 13:00:44 +01:00
Marten Seemann 64693c6074 use the new mDNS service in the chat-with-mdns example 2021-10-05 12:54:12 +01:00
Marten Seemann 79a210072d
Merge pull request #1193 from libp2p/natmgr-remove-goprocess
remove goprocess from the NATManager
2021-09-29 13:47:44 +01:00
Marten Seemann 0aeef559d0 add an option to start the relay v2 2021-09-27 14:18:18 +01:00
Marten Seemann 20f296f2e9 chore: update go-tcp-transport to v0.3.0 2021-09-27 13:30:40 +01:00
Marten Seemann 4028c3c578 remove goprocess from the NATManager 2021-09-25 15:15:35 +01:00
Marten Seemann 4975f0abe5 remove dependency on github.com/ipfs/go-detect-race 2021-09-25 14:29:26 +01:00
vyzo 22b62cfd65
autorelay support for circuitv2 relays (#1198)
* move host/relay to host/autorelay

* move autorelay wrapper host to package

* support v2 relays in autorelay

* test autorelay with both v1 and v2 relays

* fix test race

* go mod tidy examples/pubsub/chat

static checker complains; sigh.

* refactor reservation refresh loop

* merge background and refresh goroutines

* handle pushes synchronously from reservation refresh failures

* make connmanager tag a package level constant

* dont sleep to wait for identify, use IdentifyWait

* make relay protocol ids package-level constants

* add comment about v1 relays not having reservations

* use errgrp instead of WaitGroup with atomic int

* fix variable capture bug

* go get x/sync
2021-09-25 05:47:39 -07:00
vyzo d1e26810a0
Add standalone implementation of v1 Relay (#1186)
* add circuitv1 protobuf

* add implementation of v1 circuit relay

Intended to be used by standalone daemons and tests

* remove references to go-libp2p-circuit from production code

* update tests to use the in-tree v1 Relay

* use go-log/v2 in relay v1 impl

* use in-tree v1 relay in relay example

* remove go-libp2p-circuit dep from examples go.mod, go mod tidy
2021-09-20 00:29:42 -07:00
Marten Seemann b7bee3855c remove the context from the libp2p and from the Host contructor 2021-09-18 14:06:56 +02:00
Marten Seemann 29da01af70 update go-libp2p-core to v0.10.0 2021-09-17 18:50:15 +02:00
vyzo 79d995404c
Use circuitv2 code (#1183)
* move circuitv2 to p2p/protocol

* update circuitv2 imports

* RIP circuit v2; use circuitv2

* fix autorelay test

* fix holepunch test

* fix relay example
2021-09-10 02:43:58 -07:00
Marten Seemann 3c25b386d9 merge branch 'hole-punching' 2021-09-08 18:23:13 +01:00
Marten Seemann 964880b872
Merge pull request #1174 from libp2p/circuitv2
move the circuit v2 code here
2021-09-07 14:24:30 +01:00
Marten Seemann 2d07a0d973 chore: update go-libp2p-autonat to v0.5.0 2021-08-30 10:57:52 +01:00
Marten Seemann e86c4ed31f make QUIC a default transport 2021-08-28 15:25:35 +01:00
web3-bot 0741d17496
sync: update CI config files (#1166) 2021-08-21 11:00:06 +00:00
Marten Seemann ec3c9cbf49
implement the new mDNS spec, move the old mDNS implementation (#1161)
* move the current mdns discovery implementation to discovery_legacy

* use libp2p/zeroconf for mDNS discovery

* rename the discovery package to mdns

* don't store the context

* use a wait group for clean shutdown of the mdns resolver

* add comment about port numbers

* move the mdns packages p2p/discovery
2021-08-18 09:15:56 -07:00
Marten Seemann 650a77b7ff update dependencies 2021-08-17 13:15:00 +02:00
Steven Allen 8217b1f094 fix: deflake multipro echo test
Specifically, wait for the handlers to finish printing before exiting.
2021-08-03 13:36:29 -07:00
Marten Seemann 366bdea5a4 chore: update deps 2021-07-28 14:28:57 +02:00
Marten Seemann e2bab1cc5a remove secio from examples 2021-07-27 19:27:56 +02:00
Steven Allen a060bf9eba test: fix flaky example test
If we run the listener async, we might get expected events out of order.
2021-07-22 14:46:15 -07:00
Marten Seemann 255eb5dfd8 update go-tcp-transport to v0.2.4 2021-07-16 18:37:13 +02:00
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
Lasse Johnsen af49ef4b87 Error assignment fix 2021-07-02 16:05:08 +01:00
Marten Seemann 0d8dd216b7 update go-tcp-transport to v0.2.3 and go-multiaddr to v0.3.3 2021-06-23 19:08:23 -07:00
Jakub Sztandera 8c975722a1
Update go-libp2p in examples to fix CI
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2021-06-07 18:57:24 +02:00
Marten Seemann cb45a3df61 run go mod tidy in the examples 2021-05-12 10:56:07 -07:00
Steven Allen bffc18861f doc(examples): remove incorrect readme
The described command depends on the user's environment and is unlikely
to be portable. Remove it so as not to confuse users.
2021-05-12 10:16:48 -07:00
Steven Allen 1c7f26e08c doc(examples): remove unecessary header info
This is already covered in the project readme.
2021-05-12 10:16:03 -07:00
Steven Allen 10c163ba09 doc(examples): remove outdated troubleshooting
All hail go modules. Go path issues like this are no longer an issue.
2021-05-12 10:15:31 -07:00
Ian Davis d18fa0f710
Add .gitignore for each example 2021-05-10 11:54:35 +01:00
Ian Davis c58256dfd9
Delete examples license and obsolete CI configs 2021-05-10 11:45:26 +01:00
Steven Allen 127b58b758 fix: remove deprecated pubsub calls in examples 2021-05-07 18:44:01 -07:00
Steven Allen 9243a830cb chore: fix staticcheck errors 2021-05-07 18:43:57 -07:00
Steven Allen 141f163d72 chore: remove broken example
This example doesn't actually work.
2021-05-07 18:10:47 -07:00
Steven Allen 1c2abee4fb fix: fix example import paths 2021-05-07 17:59:04 -07:00
Ian Davis 0343b56ad5
chore: add tests for examples 2021-05-07 14:52:47 +01:00
Ian Davis 76e1ce667e
Fix up example readmes, submodules and gitignore 2021-05-05 11:32:17 +01:00
Ian Davis d340059a80
chore: bring examples back into repository 2021-05-05 10:57:48 +01:00
Steven Allen 0ee6c5a218 extract libp2p examples to go-libp2p-examples
Repo: https://github.com/libp2p/go-lib2p-examples
2018-07-27 11:41:28 -07:00
Steven Allen 67fb60d95b switch to google's uuid library 2018-07-12 13:25:02 +02:00
Christophe de Carvalho Pereira Martins e6f29fdadc
add a link to options.go in the host example
so reader can see all the supported configuration for the
host constructor
2018-06-06 14:54:51 +02:00
Christophe de Carvalho Pereira Martins f842b5569d
update README of the host example
fixes #333
2018-06-06 14:37:30 +02:00
Steven Allen 41c6834850 refactor for transport changes
Also, make the libp2p constructor fully useful. There should now be no need to
manually construct a swarm/host.
2018-06-04 21:22:24 -07:00