Commit Graph

86 Commits

Author SHA1 Message Date
Marten Seemann 9dc18edc26 switch from github.com/libp2p/go-libp2p-transport-upgrader to p2p/net/upgrader 2022-04-27 01:46:40 +02:00
Marten Seemann de5875fd9c switch from github.com/libp2p/go-conn-security-multistream to p2p/net/conn-security-multistream 2022-04-26 13:23:15 +01:00
Marten Seemann 43e4e51b74
rename the yamux package (#1452) 2022-04-25 12:03:16 -07:00
Marten Seemann f3bdb4b53c switch from github.com/libp2p/go-libp2p-yamux to p2p/muxer/yamux 2022-04-22 18:10:16 +01:00
Marten Seemann dfc3a3f24a switch from github.com/libp2p/go-tcp-transport to p2p/transport/tcp 2022-04-22 14:48:25 +01:00
Marten Seemann 3effab121a switch from github.com/libp2p/go-libp2p-swarm to p2p/net/swarm 2022-04-21 13:35:04 +01:00
Marten Seemann fc2c34e045 switch from github.com/libp2p/go-libp2p-blankhost to p2p/host/blank 2022-04-19 14:41:06 +01:00
Marten Seemann 7e767cbc22 correctly handle static relays 2022-03-31 11:31:05 +01:00
Marten Seemann 29fd1022a4 implement relay discovery in autorelay 2022-03-31 11:29:41 +01:00
vyzo df2301ba95 use the resource manager in libp2p bundled services, initialize default one 2022-01-18 12:27:07 +04:00
Marten Seemann 5f9c4075aa add a ResourceManager option 2022-01-18 12:25:32 +04:00
Marten Seemann 4268804809 make go-libp2p build when using the resource manager dependencies 2022-01-18 12:25:31 +04:00
Marten Seemann 4269c5f7b2 stop using go-libp2p-discovery 2022-01-16 15:32:30 +04:00
Marten Seemann d24f4f20f8 add an option for the swarm dial timeout 2022-01-04 13:37:21 +04:00
Marten Seemann 0f0cc4e4a0 use the transport.Upgrader interface 2022-01-04 13:20:59 +04:00
Marten Seemann 741348ec9c update import paths to use p2p/host/autonat 2021-12-22 13:26:20 +04:00
Marten Seemann 4141cac6f9 pass static relays to EnableAutoRelay 2021-11-14 15:33:59 +04:00
Marten Seemann e024655a40 introduce options to configure the AutoRelay 2021-11-14 14:56:47 +04:00
Gus Eggert 7a35d0df97
feat: plumb through peerstore context changes (#1237) 2021-11-12 13:43:02 -05:00
Marten Seemann d01b892679 update go-libp2p-swarm to v0.7.0 2021-10-19 10:39:32 +02:00
Marten Seemann 605f189723 check presence and type of transport constructor options 2021-09-29 15:33:25 +01:00
Marten Seemann efb3b27038 pass options to transport constructors 2021-09-29 15:33:24 +01:00
Marten Seemann 0aeef559d0 add an option to start the relay v2 2021-09-27 14:18:18 +01:00
Steven Allen f15c2a8d95
Merge pull request #1204 from libp2p/fix/allow-variadic
fix: skip variadic params in constructors
2021-09-26 16:11:12 +01:00
Steven Allen c07f74fd44 fix: skip variadic params in constructors
We use them for "options". Ideally we'd be able to forward options
through, but that would require real dependency injection.
2021-09-26 11:51:19 +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
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
Marten Seemann 729386c495 don't use a context to shut down the circuitv2 2021-09-17 11:37:28 +02:00
Marten Seemann f3acea0d61 don't use the context to shut down the relay 2021-09-10 11:30:27 +01: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 8206fcda76
signalling for hole punching (#1168)
* hole punching protocol

* implement the new retry logic (opening a new stream per hole punch)

* rename the holepunch.HolePunchService to holepunch.Service

* remove stream handler when closing

* remove misleading comment from protobuf, add link to spec

* remove unnecessary netNotifiee.HolePunchService

* simplify receiving from the timer channel

* don't defer the closing of the hole punching stream

* only accept hole punch streams from relayed peers

* refactor error logging

* fix incorrect counting of incoming hole punch attempts

* rename HolePunch to DirectConnect

* fix usage of the wait group to close the hole punch service

* use a gc to the garbage collect the holepunch tracer

* check directionality of connection when accepting the hole punch stream

* add comment why we only call Connect once

* move deduplication logic to the holepunch service

Co-authored-by: aarshkshah1992 <aarshkshah1992@gmail.com>
2021-09-08 09:41:48 -07:00
Marten Seemann 2d07a0d973 chore: update go-libp2p-autonat to v0.5.0 2021-08-30 10:57:52 +01:00
Marten Seemann 82a43f7abd remove deprecated basichost.New constructor 2021-08-16 16:49:28 +02:00
web3-bot 218f33bc62 run gofmt -s 2021-04-29 21:35:37 +00:00
Steven Allen 2ad02f79b2 chore: update to go-log v2 2021-04-29 14:15:17 -07:00
vyzo b313b4af98 option for custom dns resolver 2021-04-12 12:42:56 +03:00
Will Scott c2c5918483
fix autonat race
fix #7947
move `BasicHost.AutoNat` to a private field (it has no public method and shouldn't be accessed afaik.
Instead add a setter for config that sets it while holding the address mutex to prevent reads of the
field at the same time.
2021-02-26 23:21:36 -08:00
Aarsh Shah c575ec40e1
Finish and Test the simultaneous connect problem in libp2p peers (#1041)
* Implement support for SimOpen.
2021-02-17 13:36:40 +05:30
sandman a55891f71b add AutoNat PublicAddr when host can be dialed but not get public addr by net.InterfaceAddrs() 2020-07-23 15:19:47 +08:00
Steven Allen 46b58740de fix: fix connection gater in transport constructor 2020-05-20 11:09:00 -07:00
Aarsh Shah 887f2c40cf
implement connection gating at the top level (#881) 2020-05-15 17:31:03 +01:00
Will Scott c08993b4e8
switch bool to enum 2020-04-13 10:23:22 -07:00
Will Scott 5473f0ea0e
clarify nat options 2020-04-10 13:12:19 -07:00
Will Scott 97be7d6b7b
Expose option for setting autonat throttling 2020-04-10 12:19:52 -07:00
Steven Allen 1359013f39 fix: set the private key when constructing the autonat service
Otherwise, it the node fails to build.
2020-03-24 16:49:24 -07:00
Steven Allen 891bba6566 fix: minimal autonat dialer
Currently, the AutoNAT dialer spins up a full host with identify, ping, etc.
this switches to a blankhost.

This also avoids running a relay, listening on transports, etc (regression).
2020-03-22 16:02:11 -07:00
Will Scott 685ba00833
update to current autonat interface 2020-03-19 13:27:48 -07:00
Will Scott dd87382dd4
update to latest autonat 2020-03-17 13:10:52 -07:00
Will Scott 69b16483fd
properly filter nat addresses 2020-03-17 12:27:08 -07:00