Commit Graph

44 Commits

Author SHA1 Message Date
Marten Seemann
0f9ad8c242 revert "feat:add contexts to all peerstore methods (#2312)" (#2328) 2023-06-03 16:55:08 +03:00
Prem Chaitanya Prathi
8864d1c33e feat:add contexts to all peerstore methods (#2312) 2023-06-03 02:24:50 -07:00
Hlib Kanunnikov
8719fc4944 net/mock: mimic Swarm's event and notification behavior in MockNet (#2287)
* net/mock: mimic Swarm's event and notificaion behavior in MockNet

* go fmt
2023-05-16 12:47:24 -07:00
Marco Munizaga
5330570d1c identify: Fix IdentifyWait when Connected events happen out of order (#2173)
* Add test case

* Id works even if Connected notifications happen out of order

* Add IsClosed shim

* Call basichost `.Start()` for all tests
2023-03-06 19:55:47 -08:00
Marten Seemann
3fe6278e66 core: remove LocalPrivateKey method from network.Conn interface (#2144)
* core: remove LocalPrivateKey method from network.Conn interface

* add Changelog entry
2023-03-05 16:24:36 +13:00
Sukun
0a40e7c0af use atomic.Int32 and atomic.Int64 (#2096) 2023-02-14 12:52:55 -08:00
Marten Seemann
c0a0aa010e rcmgr: make it possible to embed the NullResourceManager 2022-10-24 13:24:04 +01:00
julian88110
ebd000db1e tls: use ALPN to negotiate the stream multiplexer (#1772)
* Muxer selection in TLS handshake first cut

* Clean up some part of the code

* Change earlydata to ConnectionState for security connection.

* resolve merging conflicts

* Add stubs for noise

* clean up code

* Switch over to passing muxers to security transport constructors

* Address feedback points

* Update p2p/net/upgrader/upgrader.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* clean up accidental checked file.

* Review points round 2

* Address some go nit points

* Update tls transport test to address review points

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-10-07 10:34:58 -07:00
Marten Seemann
4623690009 switch from github.com/libp2p/go-libp2p-core to core 2022-08-17 17:13:02 +03:00
Marten Seemann
8d2e54e163 update go-libp2p-core, remove stream methods from network.Notifiee (#1521) 2022-05-25 06:51:37 -07:00
vyzo
df2301ba95 use the resource manager in libp2p bundled services, initialize default one 2022-01-18 12:27:07 +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
e7ea19f358 remove goprocess from mock conn and link 2021-12-14 14:21:20 +04:00
Marten Seemann
56bcd81a3f use the new network.ConnStats 2021-12-13 17:26:07 +04:00
Marten Seemann
34eb40850b use a context when opening streams 2020-12-19 12:05:19 +07:00
Steven Allen
7a98f28856 feat: update to go-libp2p-core 0.7.0 interface changes
This patch updates go-libp2p for the stream interface changes in go-libp2p-core
0.7.0. This is a _significant_ breaking change to streams and all users should
read https://github.com/libp2p/go-libp2p-core/releases/tag/v0.7.0. In practice,
this change should remove a significant footgun.

TL;DR:

* `Stream.Close` now behaves like `net.TCPConn.Close`.
* There is a new `Stream.CloseWrite` (send an EOF) and `Stream.CloseRead` (close
  for reading), behaving like their counterparts in `net.TCPConn`.
2020-11-11 09:35:37 -08:00
Raúl Kripalani
985120b6f9 upgrade swarm; add ID() on mock conns and streams. (#970) 2020-06-16 19:45:28 +01:00
Will Scott
81302e977a remote mock addresses won't be unspecified. deprioritize those 2020-04-14 13:37:45 -07:00
Steven Allen
223cd42251 fix(mock): wait till we add the connection to set it up
Otherwise, we can try to remove it before we add it and panic.
2020-03-23 14:26:16 -07:00
Steven Allen
22232e0d6d fix(mock): fire disconnect notifications async like we do in the swarm 2020-03-23 14:25:38 -07:00
Steven Allen
5f75aa2068 feat(mock): reliable notifications
* Export StreamComplement/ConnComplement convenience functions.
* Make the TestNotifications test pass reliably, even when we have a bunch of
streams (identify, etc.).
* Make the mock net order disconnect events after connect events.
* Make closing one side of a connection actually close both sides.
* Make it possible to extract a mock stream's complement.
* Fire remote events at the same time as the local events.
2020-03-09 17:15:01 -07:00
Raúl Kripalani
d87f89314c Consolidate abstractions and core types into go-libp2p-core (#601) 2019-05-26 22:55:46 +01:00
iulianpascalau
b8e47c5dea mock package:
- changed GetStreams function from mock_conn.go to call allStreams which has the same functionality but is concurrent safe
- changed protocol field from mock_stream to be concurrent safe. Taken the implementation from swarm_stream.go
2019-02-14 20:19:03 +02:00
Cole Brown
5a704d2daa Add Stat to mock net conns and streams 2018-08-27 17:30:51 -07: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
Steven Allen
17354d7768 get rid of debugging code 2017-09-13 16:14:45 -07:00
Steven Allen
1b9aa7789c update go-stream-muxer
* Fix the tests to work with separate reset/close methods.
* Ensure we interrupt writes on reset.
* Always delay the proper time even if we're sending short messages.
* Copy buffers as we send them. `Write` is not allowed to hang onto buffers. If
  we run into performance issues, we can always add a buffer pool.
2017-09-13 15:18:38 -07:00
Jeromy
1bad77c7db update packages to add support for getStreams 2016-11-03 18:06:26 -07:00
Jeromy
70872ff663 update deps 2016-10-04 21:18:07 -07:00
Jeromy
cea1fe131f extract net interface and metrics 2016-10-04 13:56:20 -07:00
Jeromy
8744e460da update local import paths to reflect org change 2016-08-10 09:59:14 -07:00
Jeromy
b0ad207270 rewrite all package paths to dvcs 2016-04-27 12:59:04 -07:00
Jeromy
15b28dc0ce recursive dependency update of utp lib 2016-04-27 10:12:51 -07:00
Jeromy
4f82ae5e62 move some deps out as gx packages 2016-04-11 23:24:32 -07:00
Jeromy
7b48e5bc4d update version of go-multiaddr 2016-03-03 13:03:24 -08:00
Jeromy
ada8212cac path rewrites 2016-01-04 05:45:58 -08:00
Jeromy
d91b419ecf WIP 2015-12-06 23:11:16 -08:00
Jeromy
9d40a0af19 migrate to gx namespace 2015-11-18 16:11:24 -08:00
Jeromy
0c73722a91 vendor in notifier 2015-11-15 18:42:27 -08:00
Jeromy
d4b42f8e45 fixes for sha3 2015-11-15 18:28:35 -08:00
Jeromy
216db146ca more vendoring 2015-11-15 11:56:01 -08:00
Jeromy
51fd99e363 extract from 0.4.0 2015-11-11 16:19:51 -08:00
Juan Batiz-Benet
2392434b6d rewrote imports to p2p 2015-09-30 19:24:00 -04:00
Juan Batiz-Benet
885d86219e move to p2p dir 2015-09-30 18:42:55 -04:00