libp2p 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. {libp2p-0.2.0/libp2p.egg-info → libp2p-0.2.2}/PKG-INFO +87 -76
  2. {libp2p-0.2.0 → libp2p-0.2.2}/README.md +64 -68
  3. {libp2p-0.2.0 → libp2p-0.2.2}/examples/chat/chat.py +4 -4
  4. {libp2p-0.2.0 → libp2p-0.2.2}/examples/echo/echo.py +4 -4
  5. libp2p-0.2.2/examples/ping/ping.py +121 -0
  6. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/__init__.py +3 -3
  7. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/crypto/authenticated_encryption.py +1 -4
  8. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/crypto/key_exchange.py +1 -2
  9. libp2p-0.2.0/libp2p/typing.py → libp2p-0.2.2/libp2p/custom_types.py +3 -1
  10. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/host/basic_host.py +16 -9
  11. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/host/defaults.py +1 -1
  12. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/host/host_interface.py +14 -7
  13. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/host/ping.py +43 -3
  14. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/identity/identify/protocol.py +4 -4
  15. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/connection/net_connection_interface.py +1 -4
  16. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/connection/swarm_connection.py +2 -4
  17. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/network_interface.py +8 -7
  18. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/stream/net_stream.py +3 -3
  19. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/stream/net_stream_interface.py +3 -3
  20. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/swarm.py +7 -9
  21. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/peer/addrbook_interface.py +3 -4
  22. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/peer/peerdata.py +11 -9
  23. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/peer/peerdata_interface.py +5 -4
  24. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/peer/peerinfo.py +4 -3
  25. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/peer/peerstore.py +9 -9
  26. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/peer/peerstore_interface.py +7 -6
  27. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/protocol_muxer/multiselect.py +4 -9
  28. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/protocol_muxer/multiselect_client.py +2 -2
  29. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/protocol_muxer/multiselect_client_interface.py +4 -4
  30. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/protocol_muxer/multiselect_muxer_interface.py +4 -8
  31. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/abc.py +13 -13
  32. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/floodsub.py +11 -11
  33. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/gossipsub.py +40 -42
  34. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/mcache.py +13 -14
  35. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/pubsub.py +19 -4
  36. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/subscription.py +3 -1
  37. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/typing.py +3 -1
  38. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/routing/interfaces.py +1 -1
  39. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/insecure/transport.py +3 -3
  40. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/noise/transport.py +3 -3
  41. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/secio/transport.py +5 -6
  42. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/security_multistream.py +3 -3
  43. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/stream_muxer/mplex/mplex.py +6 -8
  44. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/stream_muxer/muxer_multistream.py +3 -3
  45. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/async_service/abc.py +4 -3
  46. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/async_service/base.py +9 -10
  47. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/async_service/trio_service.py +7 -6
  48. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/async_service/typing.py +4 -4
  49. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/factories.py +24 -25
  50. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/pubsub/dummy_account_node.py +5 -7
  51. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/pubsub/utils.py +1 -1
  52. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/utils.py +3 -1
  53. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/transport/listener_interface.py +1 -4
  54. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/transport/tcp/tcp.py +6 -6
  55. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/transport/typing.py +8 -7
  56. {libp2p-0.2.0 → libp2p-0.2.2/libp2p.egg-info}/PKG-INFO +87 -76
  57. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p.egg-info/SOURCES.txt +13 -8
  58. libp2p-0.2.2/libp2p.egg-info/entry_points.txt +4 -0
  59. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p.egg-info/requires.txt +6 -4
  60. {libp2p-0.2.0 → libp2p-0.2.2}/pyproject.toml +4 -1
  61. {libp2p-0.2.0 → libp2p-0.2.2}/scripts/release/test_package.py +4 -14
  62. {libp2p-0.2.0 → libp2p-0.2.2}/setup.py +15 -7
  63. libp2p-0.2.2/tests/core/host/test_connected_peers.py +113 -0
  64. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/host/test_ping.py +26 -0
  65. libp2p-0.2.2/tests/core/peer/test_peerdata.py +106 -0
  66. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/protocol_muxer/test_protocol_muxer.py +2 -2
  67. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/pubsub/test_pubsub.py +13 -1
  68. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/test_libp2p/test_libp2p.py +4 -4
  69. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/tools/async_service/test_trio_based_service.py +23 -8
  70. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/tools/async_service/test_trio_external_api.py +1 -1
  71. {libp2p-0.2.0 → libp2p-0.2.2}/tests/interop/conftest.py +3 -3
  72. {libp2p-0.2.0 → libp2p-0.2.2}/tests/interop/test_bindings.py +1 -1
  73. {libp2p-0.2.0 → libp2p-0.2.2}/tests/interop/test_echo.py +6 -6
  74. {libp2p-0.2.0 → libp2p-0.2.2}/tests/interop/test_pubsub.py +4 -4
  75. libp2p-0.2.2/tests/utils/interop/__init__.py +0 -0
  76. {libp2p-0.2.0/libp2p/tools → libp2p-0.2.2/tests/utils}/interop/daemon.py +6 -6
  77. {libp2p-0.2.0/libp2p/tools → libp2p-0.2.2/tests/utils}/interop/process.py +3 -4
  78. {libp2p-0.2.0 → libp2p-0.2.2}/LICENSE-APACHE +0 -0
  79. {libp2p-0.2.0 → libp2p-0.2.2}/LICENSE-MIT +0 -0
  80. {libp2p-0.2.0 → libp2p-0.2.2}/MANIFEST.in +0 -0
  81. {libp2p-0.2.0 → libp2p-0.2.2}/examples/__init__.py +0 -0
  82. {libp2p-0.2.0 → libp2p-0.2.2}/examples/chat/__init__.py +0 -0
  83. {libp2p-0.2.0 → libp2p-0.2.2}/examples/echo/__init__.py +0 -0
  84. {libp2p-0.2.0/libp2p/crypto → libp2p-0.2.2/examples/ping}/__init__.py +0 -0
  85. {libp2p-0.2.0/libp2p/crypto/pb → libp2p-0.2.2/libp2p/crypto}/__init__.py +0 -0
  86. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/crypto/ecc.py +0 -0
  87. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/crypto/ed25519.py +0 -0
  88. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/crypto/exceptions.py +0 -0
  89. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/crypto/keys.py +0 -0
  90. {libp2p-0.2.0/libp2p/host → libp2p-0.2.2/libp2p/crypto/pb}/__init__.py +0 -0
  91. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/crypto/pb/crypto_pb2.py +0 -0
  92. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/crypto/pb/crypto_pb2.pyi +0 -0
  93. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/crypto/rsa.py +0 -0
  94. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/crypto/secp256k1.py +0 -0
  95. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/crypto/serialization.py +0 -0
  96. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/exceptions.py +0 -0
  97. {libp2p-0.2.0/libp2p/identity → libp2p-0.2.2/libp2p/host}/__init__.py +0 -0
  98. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/host/exceptions.py +0 -0
  99. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/host/routed_host.py +0 -0
  100. {libp2p-0.2.0/libp2p/identity/identify → libp2p-0.2.2/libp2p/identity}/__init__.py +0 -0
  101. {libp2p-0.2.0/libp2p/identity/identify/pb → libp2p-0.2.2/libp2p/identity/identify}/__init__.py +0 -0
  102. {libp2p-0.2.0/libp2p/io → libp2p-0.2.2/libp2p/identity/identify/pb}/__init__.py +0 -0
  103. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/identity/identify/pb/identify_pb2.py +0 -0
  104. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/identity/identify/pb/identify_pb2.pyi +0 -0
  105. {libp2p-0.2.0/libp2p/network → libp2p-0.2.2/libp2p/io}/__init__.py +0 -0
  106. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/io/abc.py +0 -0
  107. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/io/exceptions.py +0 -0
  108. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/io/msgio.py +0 -0
  109. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/io/trio.py +0 -0
  110. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/io/utils.py +0 -0
  111. {libp2p-0.2.0/libp2p/network/connection → libp2p-0.2.2/libp2p/network}/__init__.py +0 -0
  112. {libp2p-0.2.0/libp2p/network/stream → libp2p-0.2.2/libp2p/network/connection}/__init__.py +0 -0
  113. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/connection/exceptions.py +0 -0
  114. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/connection/raw_connection.py +0 -0
  115. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/connection/raw_connection_interface.py +0 -0
  116. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/exceptions.py +0 -0
  117. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/notifee_interface.py +0 -0
  118. {libp2p-0.2.0/libp2p/peer → libp2p-0.2.2/libp2p/network/stream}/__init__.py +0 -0
  119. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/network/stream/exceptions.py +0 -0
  120. {libp2p-0.2.0/libp2p/protocol_muxer → libp2p-0.2.2/libp2p/peer}/__init__.py +0 -0
  121. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/peer/id.py +0 -0
  122. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/peer/peermetadata_interface.py +0 -0
  123. {libp2p-0.2.0/libp2p/pubsub → libp2p-0.2.2/libp2p/protocol_muxer}/__init__.py +0 -0
  124. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/protocol_muxer/exceptions.py +0 -0
  125. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/protocol_muxer/multiselect_communicator.py +0 -0
  126. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/protocol_muxer/multiselect_communicator_interface.py +0 -0
  127. {libp2p-0.2.0/libp2p/pubsub/pb → libp2p-0.2.2/libp2p/pubsub}/__init__.py +0 -0
  128. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/exceptions.py +0 -0
  129. {libp2p-0.2.0/libp2p/routing → libp2p-0.2.2/libp2p/pubsub/pb}/__init__.py +0 -0
  130. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/pb/rpc_pb2.py +0 -0
  131. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/pb/rpc_pb2.pyi +0 -0
  132. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/pubsub_notifee.py +0 -0
  133. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/pubsub/validators.py +0 -0
  134. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/py.typed +0 -0
  135. {libp2p-0.2.0/libp2p/security → libp2p-0.2.2/libp2p/routing}/__init__.py +0 -0
  136. {libp2p-0.2.0/libp2p/security/insecure → libp2p-0.2.2/libp2p/security}/__init__.py +0 -0
  137. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/base_session.py +0 -0
  138. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/base_transport.py +0 -0
  139. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/exceptions.py +0 -0
  140. {libp2p-0.2.0/libp2p/security/insecure/pb → libp2p-0.2.2/libp2p/security/insecure}/__init__.py +0 -0
  141. {libp2p-0.2.0/libp2p/security/noise → libp2p-0.2.2/libp2p/security/insecure/pb}/__init__.py +0 -0
  142. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/insecure/pb/plaintext_pb2.py +0 -0
  143. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/insecure/pb/plaintext_pb2.pyi +0 -0
  144. {libp2p-0.2.0/libp2p/security/noise/pb → libp2p-0.2.2/libp2p/security/noise}/__init__.py +0 -0
  145. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/noise/exceptions.py +0 -0
  146. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/noise/io.py +0 -0
  147. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/noise/messages.py +0 -0
  148. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/noise/patterns.py +0 -0
  149. {libp2p-0.2.0/libp2p/security/secio → libp2p-0.2.2/libp2p/security/noise/pb}/__init__.py +0 -0
  150. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/noise/pb/noise_pb2.py +0 -0
  151. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/noise/pb/noise_pb2.pyi +0 -0
  152. {libp2p-0.2.0/libp2p/security/secio/pb → libp2p-0.2.2/libp2p/security/secio}/__init__.py +0 -0
  153. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/secio/exceptions.py +0 -0
  154. {libp2p-0.2.0/libp2p/stream_muxer → libp2p-0.2.2/libp2p/security/secio/pb}/__init__.py +0 -0
  155. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/secio/pb/spipe_pb2.py +0 -0
  156. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/secio/pb/spipe_pb2.pyi +0 -0
  157. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/secure_conn_interface.py +0 -0
  158. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/secure_session.py +0 -0
  159. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/security/secure_transport_interface.py +0 -0
  160. {libp2p-0.2.0/libp2p/stream_muxer/mplex → libp2p-0.2.2/libp2p/stream_muxer}/__init__.py +0 -0
  161. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/stream_muxer/abc.py +0 -0
  162. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/stream_muxer/exceptions.py +0 -0
  163. {libp2p-0.2.0/libp2p/tools → libp2p-0.2.2/libp2p/stream_muxer/mplex}/__init__.py +0 -0
  164. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/stream_muxer/mplex/constants.py +0 -0
  165. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/stream_muxer/mplex/datastructures.py +0 -0
  166. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/stream_muxer/mplex/exceptions.py +0 -0
  167. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/stream_muxer/mplex/mplex_stream.py +0 -0
  168. {libp2p-0.2.0/libp2p/tools/interop → libp2p-0.2.2/libp2p/tools}/__init__.py +0 -0
  169. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/async_service/__init__.py +0 -0
  170. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/async_service/_utils.py +0 -0
  171. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/async_service/exceptions.py +0 -0
  172. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/async_service/stats.py +0 -0
  173. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/constants.py +0 -0
  174. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/pubsub/__init__.py +0 -0
  175. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/tools/pubsub/floodsub_integration_test_settings.py +0 -0
  176. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/transport/__init__.py +0 -0
  177. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/transport/exceptions.py +0 -0
  178. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/transport/tcp/__init__.py +0 -0
  179. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/transport/transport_interface.py +0 -0
  180. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/transport/upgrader.py +0 -0
  181. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p/utils.py +0 -0
  182. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p.egg-info/dependency_links.txt +0 -0
  183. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p.egg-info/not-zip-safe +0 -0
  184. {libp2p-0.2.0 → libp2p-0.2.2}/libp2p.egg-info/top_level.txt +0 -0
  185. {libp2p-0.2.0 → libp2p-0.2.2}/setup.cfg +0 -0
  186. {libp2p-0.2.0 → libp2p-0.2.2}/tests/conftest.py +0 -0
  187. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/crypto/test_ed25519.py +0 -0
  188. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/crypto/test_secp256k1.py +0 -0
  189. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/examples/test_examples.py +0 -0
  190. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/host/test_basic_host.py +0 -0
  191. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/host/test_routed_host.py +0 -0
  192. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/identity/identify/test_protocol.py +0 -0
  193. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/network/conftest.py +0 -0
  194. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/network/test_net_stream.py +0 -0
  195. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/network/test_notify.py +0 -0
  196. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/network/test_swarm.py +1 -1
  197. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/network/test_swarm_conn.py +0 -0
  198. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/peer/test_addrbook.py +0 -0
  199. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/peer/test_interop.py +0 -0
  200. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/peer/test_peerid.py +0 -0
  201. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/peer/test_peerinfo.py +1 -1
  202. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/peer/test_peermetadata.py +0 -0
  203. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/peer/test_peerstore.py +0 -0
  204. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/pubsub/test_dummyaccount_demo.py +0 -0
  205. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/pubsub/test_floodsub.py +0 -0
  206. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/pubsub/test_gossipsub.py +0 -0
  207. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/pubsub/test_gossipsub_backward_compatibility.py +0 -0
  208. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/pubsub/test_mcache.py +0 -0
  209. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/pubsub/test_subscription.py +0 -0
  210. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/security/noise/test_msg_read_writer.py +0 -0
  211. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/security/noise/test_noise.py +0 -0
  212. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/security/test_secio.py +0 -0
  213. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/security/test_security_multistream.py +0 -0
  214. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/stream_muxer/conftest.py +0 -0
  215. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/stream_muxer/test_mplex_conn.py +0 -0
  216. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/stream_muxer/test_mplex_stream.py +0 -0
  217. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/test_import_and_version.py +0 -0
  218. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/tools/async_service/test_trio_manager_stats.py +0 -0
  219. {libp2p-0.2.0 → libp2p-0.2.2}/tests/core/transport/test_tcp.py +1 -1
  220. {libp2p-0.2.0 → libp2p-0.2.2}/tests/interop/go_pkgs/examples/README.md +0 -0
  221. {libp2p-0.2.0 → libp2p-0.2.2}/tests/interop/go_pkgs/examples/echo/main.go +0 -0
  222. {libp2p-0.2.0 → libp2p-0.2.2}/tests/interop/go_pkgs/examples/go.mod +0 -0
  223. {libp2p-0.2.0 → libp2p-0.2.2}/tests/interop/go_pkgs/examples/go.sum +0 -0
  224. {libp2p-0.2.0 → libp2p-0.2.2}/tests/interop/go_pkgs/examples/utils/host.go +0 -0
  225. {libp2p-0.2.0 → libp2p-0.2.2}/tests/interop/go_pkgs/install_interop_go_pkgs.sh +0 -0
  226. {libp2p-0.2.0 → libp2p-0.2.2}/tests/interop/test_net_stream.py +0 -0
  227. {libp2p-0.2.0/libp2p/tools → libp2p-0.2.2/tests/utils}/interop/constants.py +0 -0
  228. {libp2p-0.2.0/libp2p/tools → libp2p-0.2.2/tests/utils}/interop/envs.py +0 -0
  229. {libp2p-0.2.0/libp2p/tools → libp2p-0.2.2/tests/utils}/interop/utils.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: libp2p
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: libp2p: The Python implementation of the libp2p networking stack
5
5
  Home-page: https://github.com/libp2p/py-libp2p
6
6
  Author: The Ethereum Foundation
@@ -16,12 +16,12 @@ Classifier: License :: OSI Approved :: MIT License
16
16
  Classifier: License :: OSI Approved :: Apache Software License
17
17
  Classifier: Natural Language :: English
18
18
  Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.8
20
19
  Classifier: Programming Language :: Python :: 3.9
21
20
  Classifier: Programming Language :: Python :: 3.10
22
21
  Classifier: Programming Language :: Python :: 3.11
23
22
  Classifier: Programming Language :: Python :: 3.12
24
- Requires-Python: >=3.8, <4
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Requires-Python: >=3.9, <4
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE-APACHE
27
27
  License-File: LICENSE-MIT
@@ -38,12 +38,12 @@ Requires-Dist: pymultihash>=0.8.2
38
38
  Requires-Dist: pynacl>=1.3.0
39
39
  Requires-Dist: rpcudp>=3.0.0
40
40
  Requires-Dist: trio-typing>=0.0.4
41
- Requires-Dist: trio>=0.15.0
41
+ Requires-Dist: trio>=0.26.0
42
42
  Requires-Dist: fastecdsa-any==1.7.5; sys_platform == "win32"
43
43
  Requires-Dist: fastecdsa==1.7.5; sys_platform != "win32"
44
44
  Provides-Extra: dev
45
45
  Requires-Dist: build>=0.9.0; extra == "dev"
46
- Requires-Dist: bump-my-version>=0.5.3; extra == "dev"
46
+ Requires-Dist: bump_my_version>=0.19.0; extra == "dev"
47
47
  Requires-Dist: ipython; extra == "dev"
48
48
  Requires-Dist: mypy==1.10.0; extra == "dev"
49
49
  Requires-Dist: pre-commit>=3.4.0; extra == "dev"
@@ -52,7 +52,8 @@ Requires-Dist: twine; extra == "dev"
52
52
  Requires-Dist: wheel; extra == "dev"
53
53
  Requires-Dist: sphinx>=6.0.0; extra == "dev"
54
54
  Requires-Dist: sphinx_rtd_theme>=1.0.0; extra == "dev"
55
- Requires-Dist: towncrier<22,>=21; extra == "dev"
55
+ Requires-Dist: towncrier<25,>=24; extra == "dev"
56
+ Requires-Dist: p2pclient==0.2.0; extra == "dev"
56
57
  Requires-Dist: pytest>=7.0.0; extra == "dev"
57
58
  Requires-Dist: pytest-xdist>=2.4.0; extra == "dev"
58
59
  Requires-Dist: pytest-trio>=0.5.2; extra == "dev"
@@ -60,15 +61,35 @@ Requires-Dist: factory-boy<3.0.0,>=2.12.0; extra == "dev"
60
61
  Provides-Extra: docs
61
62
  Requires-Dist: sphinx>=6.0.0; extra == "docs"
62
63
  Requires-Dist: sphinx_rtd_theme>=1.0.0; extra == "docs"
63
- Requires-Dist: towncrier<22,>=21; extra == "docs"
64
+ Requires-Dist: towncrier<25,>=24; extra == "docs"
64
65
  Provides-Extra: test
66
+ Requires-Dist: p2pclient==0.2.0; extra == "test"
65
67
  Requires-Dist: pytest>=7.0.0; extra == "test"
66
68
  Requires-Dist: pytest-xdist>=2.4.0; extra == "test"
67
69
  Requires-Dist: pytest-trio>=0.5.2; extra == "test"
68
70
  Requires-Dist: factory-boy<3.0.0,>=2.12.0; extra == "test"
71
+ Dynamic: author
72
+ Dynamic: author-email
73
+ Dynamic: classifier
74
+ Dynamic: description
75
+ Dynamic: description-content-type
76
+ Dynamic: home-page
77
+ Dynamic: keywords
78
+ Dynamic: license
79
+ Dynamic: platform
80
+ Dynamic: provides-extra
81
+ Dynamic: requires-dist
82
+ Dynamic: requires-python
83
+ Dynamic: summary
69
84
 
70
85
  # py-libp2p
71
86
 
87
+ <h1 align="center">
88
+ <a href="https://libp2p.io/"><img width="250" src="https://github.com/libp2p/py-libp2p/blob/main/assets/py-libp2p-logo.png?raw=true" alt="py-libp2p hex logo" /></a>
89
+ </h1>
90
+
91
+ <h3 align="center">The Python implementation of the libp2p networking stack.</h3>
92
+
72
93
  [![Join the chat at https://gitter.im/py-libp2p/Lobby](https://badges.gitter.im/py-libp2p/Lobby.png)](https://gitter.im/py-libp2p/Lobby)
73
94
  [![Build Status](https://circleci.com/gh/libp2p/py-libp2p.svg?style=shield)](https://circleci.com/gh/libp2p/py-libp2p)
74
95
  [![PyPI version](https://badge.fury.io/py/libp2p.svg)](https://badge.fury.io/py/libp2p)
@@ -78,16 +99,7 @@ Requires-Dist: factory-boy<3.0.0,>=2.12.0; extra == "test"
78
99
  [![Matrix](https://img.shields.io/badge/matrix-%23libp2p%3Apermaweb.io-blue.svg)](https://riot.permaweb.io/#/room/#libp2p:permaweb.io)
79
100
  [![Discord](https://img.shields.io/discord/475789330380488707?color=blueviolet&label=discord)](https://discord.gg/66KBrm2)
80
101
 
81
- <h1 align="center">
82
- <a href="https://libp2p.io/"><img width="250" src="https://github.com/libp2p/py-libp2p/blob/main/assets/py-libp2p-logo.png?raw=true" alt="py-libp2p hex logo" /></a>
83
- </h1>
84
-
85
- ## WARNING
86
-
87
- py-libp2p is an experimental and work-in-progress repo under development. We do not yet recommend using py-libp2p in production environments.
88
- Right now, `tests_interop` are turned off for CI, and a number of `tests` are failing. WIP.
89
-
90
- The Python implementation of the libp2p networking stack
102
+ > ⚠️ **Warning:** py-libp2p is an experimental and work-in-progress repo under development. We do not yet recommend using py-libp2p in production environments.
91
103
 
92
104
  Read more in the [documentation on ReadTheDocs](https://py-libp2p.readthedocs.io/). [View the release notes](https://py-libp2p.readthedocs.io/en/latest/release_notes.html).
93
105
 
@@ -95,101 +107,100 @@ Read more in the [documentation on ReadTheDocs](https://py-libp2p.readthedocs.io
95
107
 
96
108
  Currently maintained by [@pacrob](https://github.com/pacrob) and [@dhuseby](https://github.com/dhuseby), looking for assistance!
97
109
 
98
- Note that tests/core/test_libp2p/test_libp2p.py contains an end-to-end messaging test between two libp2p hosts, which is the bulk of our proof of concept.
99
-
100
110
  ## Feature Breakdown
101
111
 
102
- py-libp2p aims for conformity with [the standard libp2p modules](https://github.com/libp2p/libp2p/blob/master/REQUIREMENTS.md#libp2p-modules-implementations). Below is a breakdown of the modules we have developed, are developing, and may develop in the future.
112
+ py-libp2p aims for conformity with [the standard libp2p modules](https://libp2p.io/implementations/). Below is a breakdown of the modules we have developed, are developing, and may develop in the future.
103
113
 
104
- > Legend: :green_apple: Done   :lemon: In Progress   :tomato: Missing   :chestnut: Not planned
114
+ > Legend: ✅: Done   🛠️: In Progress   🚫: Missing   ❌: Not planned
105
115
 
106
116
  | libp2p Node | Status |
107
117
  | ------------ | :-----------: |
108
- | **`libp2p`** | :green_apple: |
118
+ | **`libp2p`** | ✅ |
109
119
 
110
- | Identify Protocol | Status |
111
- | ----------------- | :-----: |
112
- | **`Identify`** | :lemon: |
120
+ | Core Protocols | Status |
121
+ | -------------- | :-----------: |
122
+ | **`Ping`** | ✅ |
123
+ | **`Identify`** | ✅ |
113
124
 
114
125
  | Transport Protocols | Status |
115
126
  | ------------------- | :-----------: |
116
- | **`TCP`** | :green_apple: |
117
- | **`UDP`** | :tomato: |
118
- | **`WebSockets`** | :chestnut: |
119
- | **`UTP`** | :chestnut: |
120
- | **`WebRTC`** | :chestnut: |
121
- | **`SCTP`** | :chestnut: |
122
- | **`Tor`** | :chestnut: |
123
- | **`i2p`** | :chestnut: |
124
- | **`cjdns`** | :chestnut: |
125
- | **`Bluetooth LE`** | :chestnut: |
126
- | **`Audio TP`** | :chestnut: |
127
- | **`Zerotier`** | :chestnut: |
128
- | **`QUIC`** | :chestnut: |
127
+ | **`TCP`** | ✅|
128
+ | **`QUIC`** | 🛠️ |
129
+ | **`UDP`** | 🚫 |
130
+ | **`WebSockets`** | ❌ |
131
+ | **`UTP`** | ❌ |
132
+ | **`WebRTC`** | ❌ |
133
+ | **`SCTP`** | ❌ |
134
+ | **`Tor`** | ❌ |
135
+ | **`i2p`** | ❌ |
136
+ | **`cjdns`** | ❌ |
137
+ | **`Bluetooth LE`** | ❌ |
138
+ | **`Audio TP`** | ❌ |
139
+ | **`Zerotier`** | ❌ |
129
140
 
130
141
  | Stream Muxers | Status |
131
142
  | ---------------- | :-----------: |
132
- | **`multiplex`** | :green_apple: |
133
- | **`yamux`** | :tomato: |
134
- | **`benchmarks`** | :chestnut: |
135
- | **`muxado`** | :chestnut: |
136
- | **`spdystream`** | :chestnut: |
137
- | **`spdy`** | :chestnut: |
138
- | **`http2`** | :chestnut: |
139
- | **`QUIC`** | :chestnut: |
143
+ | **`multiplex`** | ✅ |
144
+ | **`yamux`** | 🚫 |
145
+ | **`benchmarks`** | ❌ |
146
+ | **`muxado`** | ❌ |
147
+ | **`spdystream`** | ❌ |
148
+ | **`spdy`** | ❌ |
149
+ | **`http2`** | ❌ |
150
+ | **`QUIC`** | ❌ |
140
151
 
141
152
  | Protocol Muxers | Status |
142
153
  | ----------------- | :-----------: |
143
- | **`multiselect`** | :green_apple: |
154
+ | **`multiselect`** | ✅ |
144
155
 
145
156
  | Switch (Swarm) | Status |
146
157
  | ------------------ | :-----------: |
147
- | **`Switch`** | :green_apple: |
148
- | **`Dialer stack`** | :green_apple: |
158
+ | **`Switch`** | ✅ |
159
+ | **`Dialer stack`** | ✅ |
149
160
 
150
161
  | Peer Discovery | Status |
151
162
  | -------------------- | :--------: |
152
- | **`bootstrap list`** | :tomato: |
153
- | **`Kademlia DHT`** | :chestnut: |
154
- | **`mDNS`** | :chestnut: |
155
- | **`PEX`** | :chestnut: |
156
- | **`DNS`** | :chestnut: |
163
+ | **`bootstrap list`** | 🚫 |
164
+ | **`Kademlia DHT`** | ❌ |
165
+ | **`mDNS`** | ❌ |
166
+ | **`PEX`** | ❌ |
167
+ | **`DNS`** | ❌ |
157
168
 
158
169
  | Content Routing | Status |
159
170
  | ------------------ | :-----------: |
160
- | **`Kademlia DHT`** | :chestnut: |
161
- | **`floodsub`** | :green_apple: |
162
- | **`gossipsub`** | :green_apple: |
163
- | **`PHT`** | :chestnut: |
171
+ | **`Kademlia DHT`** | ❌ |
172
+ | **`floodsub`** | ✅ |
173
+ | **`gossipsub`** | ✅ |
174
+ | **`PHT`** | ❌ |
164
175
 
165
176
  | Peer Routing | Status |
166
177
  | ------------------ | :-----------: |
167
- | **`Kademlia DHT`** | :chestnut: |
168
- | **`floodsub`** | :green_apple: |
169
- | **`gossipsub`** | :green_apple: |
170
- | **`PHT`** | :chestnut: |
178
+ | **`Kademlia DHT`** | ❌ |
179
+ | **`floodsub`** | ✅|
180
+ | **`gossipsub`** | ✅ |
181
+ | **`PHT`** | ❌ |
171
182
 
172
183
  | NAT Traversal | Status |
173
184
  | ------------------------ | :--------: |
174
- | **`nat-pmp`** | :chestnut: |
175
- | **`upnp`** | :chestnut: |
176
- | **`ext addr discovery`** | :chestnut: |
177
- | **`STUN-like`** | :chestnut: |
178
- | **`line-switch relay`** | :chestnut: |
179
- | **`pkt-switch relay`** | :chestnut: |
185
+ | **`nat-pmp`** | ❌ |
186
+ | **`upnp`** | ❌ |
187
+ | **`ext addr discovery`** | ❌ |
188
+ | **`STUN-like`** | ❌ |
189
+ | **`line-switch relay`** | ❌ |
190
+ | **`pkt-switch relay`** | ❌ |
180
191
 
181
192
  | Exchange | Status |
182
193
  | ---------------- | :--------: |
183
- | **`HTTP`** | :chestnut: |
184
- | **`Bitswap`** | :chestnut: |
185
- | **`Bittorrent`** | :chestnut: |
194
+ | **`HTTP`** | ❌ |
195
+ | **`Bitswap`** | ❌ |
196
+ | **`Bittorrent`** | ❌ |
186
197
 
187
198
  | Consensus | Status |
188
199
  | -------------- | :--------: |
189
- | **`Paxos`** | :chestnut: |
190
- | **`Raft`** | :chestnut: |
191
- | **`PBTF`** | :chestnut: |
192
- | **`Nakamoto`** | :chestnut: |
200
+ | **`Paxos`** | ❌ |
201
+ | **`Raft`** | ❌ |
202
+ | **`PBTF`** | ❌ |
203
+ | **`Nakamoto`** | ❌ |
193
204
 
194
205
  ## Explanation of Basic Two Node Communication
195
206
 
@@ -1,5 +1,11 @@
1
1
  # py-libp2p
2
2
 
3
+ <h1 align="center">
4
+ <a href="https://libp2p.io/"><img width="250" src="https://github.com/libp2p/py-libp2p/blob/main/assets/py-libp2p-logo.png?raw=true" alt="py-libp2p hex logo" /></a>
5
+ </h1>
6
+
7
+ <h3 align="center">The Python implementation of the libp2p networking stack.</h3>
8
+
3
9
  [![Join the chat at https://gitter.im/py-libp2p/Lobby](https://badges.gitter.im/py-libp2p/Lobby.png)](https://gitter.im/py-libp2p/Lobby)
4
10
  [![Build Status](https://circleci.com/gh/libp2p/py-libp2p.svg?style=shield)](https://circleci.com/gh/libp2p/py-libp2p)
5
11
  [![PyPI version](https://badge.fury.io/py/libp2p.svg)](https://badge.fury.io/py/libp2p)
@@ -9,16 +15,7 @@
9
15
  [![Matrix](https://img.shields.io/badge/matrix-%23libp2p%3Apermaweb.io-blue.svg)](https://riot.permaweb.io/#/room/#libp2p:permaweb.io)
10
16
  [![Discord](https://img.shields.io/discord/475789330380488707?color=blueviolet&label=discord)](https://discord.gg/66KBrm2)
11
17
 
12
- <h1 align="center">
13
- <a href="https://libp2p.io/"><img width="250" src="https://github.com/libp2p/py-libp2p/blob/main/assets/py-libp2p-logo.png?raw=true" alt="py-libp2p hex logo" /></a>
14
- </h1>
15
-
16
- ## WARNING
17
-
18
- py-libp2p is an experimental and work-in-progress repo under development. We do not yet recommend using py-libp2p in production environments.
19
- Right now, `tests_interop` are turned off for CI, and a number of `tests` are failing. WIP.
20
-
21
- The Python implementation of the libp2p networking stack
18
+ > ⚠️ **Warning:** py-libp2p is an experimental and work-in-progress repo under development. We do not yet recommend using py-libp2p in production environments.
22
19
 
23
20
  Read more in the [documentation on ReadTheDocs](https://py-libp2p.readthedocs.io/). [View the release notes](https://py-libp2p.readthedocs.io/en/latest/release_notes.html).
24
21
 
@@ -26,101 +23,100 @@ Read more in the [documentation on ReadTheDocs](https://py-libp2p.readthedocs.io
26
23
 
27
24
  Currently maintained by [@pacrob](https://github.com/pacrob) and [@dhuseby](https://github.com/dhuseby), looking for assistance!
28
25
 
29
- Note that tests/core/test_libp2p/test_libp2p.py contains an end-to-end messaging test between two libp2p hosts, which is the bulk of our proof of concept.
30
-
31
26
  ## Feature Breakdown
32
27
 
33
- py-libp2p aims for conformity with [the standard libp2p modules](https://github.com/libp2p/libp2p/blob/master/REQUIREMENTS.md#libp2p-modules-implementations). Below is a breakdown of the modules we have developed, are developing, and may develop in the future.
28
+ py-libp2p aims for conformity with [the standard libp2p modules](https://libp2p.io/implementations/). Below is a breakdown of the modules we have developed, are developing, and may develop in the future.
34
29
 
35
- > Legend: :green_apple: Done   :lemon: In Progress   :tomato: Missing   :chestnut: Not planned
30
+ > Legend: ✅: Done   🛠️: In Progress   🚫: Missing   ❌: Not planned
36
31
 
37
32
  | libp2p Node | Status |
38
33
  | ------------ | :-----------: |
39
- | **`libp2p`** | :green_apple: |
34
+ | **`libp2p`** | ✅ |
40
35
 
41
- | Identify Protocol | Status |
42
- | ----------------- | :-----: |
43
- | **`Identify`** | :lemon: |
36
+ | Core Protocols | Status |
37
+ | -------------- | :-----------: |
38
+ | **`Ping`** | ✅ |
39
+ | **`Identify`** | ✅ |
44
40
 
45
41
  | Transport Protocols | Status |
46
42
  | ------------------- | :-----------: |
47
- | **`TCP`** | :green_apple: |
48
- | **`UDP`** | :tomato: |
49
- | **`WebSockets`** | :chestnut: |
50
- | **`UTP`** | :chestnut: |
51
- | **`WebRTC`** | :chestnut: |
52
- | **`SCTP`** | :chestnut: |
53
- | **`Tor`** | :chestnut: |
54
- | **`i2p`** | :chestnut: |
55
- | **`cjdns`** | :chestnut: |
56
- | **`Bluetooth LE`** | :chestnut: |
57
- | **`Audio TP`** | :chestnut: |
58
- | **`Zerotier`** | :chestnut: |
59
- | **`QUIC`** | :chestnut: |
43
+ | **`TCP`** | ✅|
44
+ | **`QUIC`** | 🛠️ |
45
+ | **`UDP`** | 🚫 |
46
+ | **`WebSockets`** | ❌ |
47
+ | **`UTP`** | ❌ |
48
+ | **`WebRTC`** | ❌ |
49
+ | **`SCTP`** | ❌ |
50
+ | **`Tor`** | ❌ |
51
+ | **`i2p`** | ❌ |
52
+ | **`cjdns`** | ❌ |
53
+ | **`Bluetooth LE`** | ❌ |
54
+ | **`Audio TP`** | ❌ |
55
+ | **`Zerotier`** | ❌ |
60
56
 
61
57
  | Stream Muxers | Status |
62
58
  | ---------------- | :-----------: |
63
- | **`multiplex`** | :green_apple: |
64
- | **`yamux`** | :tomato: |
65
- | **`benchmarks`** | :chestnut: |
66
- | **`muxado`** | :chestnut: |
67
- | **`spdystream`** | :chestnut: |
68
- | **`spdy`** | :chestnut: |
69
- | **`http2`** | :chestnut: |
70
- | **`QUIC`** | :chestnut: |
59
+ | **`multiplex`** | ✅ |
60
+ | **`yamux`** | 🚫 |
61
+ | **`benchmarks`** | ❌ |
62
+ | **`muxado`** | ❌ |
63
+ | **`spdystream`** | ❌ |
64
+ | **`spdy`** | ❌ |
65
+ | **`http2`** | ❌ |
66
+ | **`QUIC`** | ❌ |
71
67
 
72
68
  | Protocol Muxers | Status |
73
69
  | ----------------- | :-----------: |
74
- | **`multiselect`** | :green_apple: |
70
+ | **`multiselect`** | ✅ |
75
71
 
76
72
  | Switch (Swarm) | Status |
77
73
  | ------------------ | :-----------: |
78
- | **`Switch`** | :green_apple: |
79
- | **`Dialer stack`** | :green_apple: |
74
+ | **`Switch`** | ✅ |
75
+ | **`Dialer stack`** | ✅ |
80
76
 
81
77
  | Peer Discovery | Status |
82
78
  | -------------------- | :--------: |
83
- | **`bootstrap list`** | :tomato: |
84
- | **`Kademlia DHT`** | :chestnut: |
85
- | **`mDNS`** | :chestnut: |
86
- | **`PEX`** | :chestnut: |
87
- | **`DNS`** | :chestnut: |
79
+ | **`bootstrap list`** | 🚫 |
80
+ | **`Kademlia DHT`** | ❌ |
81
+ | **`mDNS`** | ❌ |
82
+ | **`PEX`** | ❌ |
83
+ | **`DNS`** | ❌ |
88
84
 
89
85
  | Content Routing | Status |
90
86
  | ------------------ | :-----------: |
91
- | **`Kademlia DHT`** | :chestnut: |
92
- | **`floodsub`** | :green_apple: |
93
- | **`gossipsub`** | :green_apple: |
94
- | **`PHT`** | :chestnut: |
87
+ | **`Kademlia DHT`** | ❌ |
88
+ | **`floodsub`** | ✅ |
89
+ | **`gossipsub`** | ✅ |
90
+ | **`PHT`** | ❌ |
95
91
 
96
92
  | Peer Routing | Status |
97
93
  | ------------------ | :-----------: |
98
- | **`Kademlia DHT`** | :chestnut: |
99
- | **`floodsub`** | :green_apple: |
100
- | **`gossipsub`** | :green_apple: |
101
- | **`PHT`** | :chestnut: |
94
+ | **`Kademlia DHT`** | ❌ |
95
+ | **`floodsub`** | ✅|
96
+ | **`gossipsub`** | ✅ |
97
+ | **`PHT`** | ❌ |
102
98
 
103
99
  | NAT Traversal | Status |
104
100
  | ------------------------ | :--------: |
105
- | **`nat-pmp`** | :chestnut: |
106
- | **`upnp`** | :chestnut: |
107
- | **`ext addr discovery`** | :chestnut: |
108
- | **`STUN-like`** | :chestnut: |
109
- | **`line-switch relay`** | :chestnut: |
110
- | **`pkt-switch relay`** | :chestnut: |
101
+ | **`nat-pmp`** | ❌ |
102
+ | **`upnp`** | ❌ |
103
+ | **`ext addr discovery`** | ❌ |
104
+ | **`STUN-like`** | ❌ |
105
+ | **`line-switch relay`** | ❌ |
106
+ | **`pkt-switch relay`** | ❌ |
111
107
 
112
108
  | Exchange | Status |
113
109
  | ---------------- | :--------: |
114
- | **`HTTP`** | :chestnut: |
115
- | **`Bitswap`** | :chestnut: |
116
- | **`Bittorrent`** | :chestnut: |
110
+ | **`HTTP`** | ❌ |
111
+ | **`Bitswap`** | ❌ |
112
+ | **`Bittorrent`** | ❌ |
117
113
 
118
114
  | Consensus | Status |
119
115
  | -------------- | :--------: |
120
- | **`Paxos`** | :chestnut: |
121
- | **`Raft`** | :chestnut: |
122
- | **`PBTF`** | :chestnut: |
123
- | **`Nakamoto`** | :chestnut: |
116
+ | **`Paxos`** | ❌ |
117
+ | **`Raft`** | ❌ |
118
+ | **`PBTF`** | ❌ |
119
+ | **`Nakamoto`** | ❌ |
124
120
 
125
121
  ## Explanation of Basic Two Node Communication
126
122
 
@@ -7,15 +7,15 @@ import trio
7
7
  from libp2p import (
8
8
  new_host,
9
9
  )
10
+ from libp2p.custom_types import (
11
+ TProtocol,
12
+ )
10
13
  from libp2p.network.stream.net_stream_interface import (
11
14
  INetStream,
12
15
  )
13
16
  from libp2p.peer.peerinfo import (
14
17
  info_from_p2p_addr,
15
18
  )
16
- from libp2p.typing import (
17
- TProtocol,
18
- )
19
19
 
20
20
  PROTOCOL_ID = TProtocol("/chat/1.0.0")
21
21
  MAX_READ_LEN = 2**32 - 1
@@ -54,7 +54,7 @@ async def run(port: int, destination: str) -> None:
54
54
 
55
55
  print(
56
56
  "Run this from the same folder in another console:\n\n"
57
- f"python chat.py -p {int(port) + 1} "
57
+ f"chat-demo -p {int(port) + 1} "
58
58
  f"-d /ip4/{localhost_ip}/tcp/{port}/p2p/{host.get_id().pretty()}\n"
59
59
  )
60
60
  print("Waiting for incoming connection...")
@@ -9,15 +9,15 @@ from libp2p import (
9
9
  from libp2p.crypto.secp256k1 import (
10
10
  create_new_key_pair,
11
11
  )
12
+ from libp2p.custom_types import (
13
+ TProtocol,
14
+ )
12
15
  from libp2p.network.stream.net_stream_interface import (
13
16
  INetStream,
14
17
  )
15
18
  from libp2p.peer.peerinfo import (
16
19
  info_from_p2p_addr,
17
20
  )
18
- from libp2p.typing import (
19
- TProtocol,
20
- )
21
21
 
22
22
  PROTOCOL_ID = TProtocol("/echo/1.0.0")
23
23
 
@@ -53,7 +53,7 @@ async def run(port: int, destination: str, seed: int = None) -> None:
53
53
 
54
54
  print(
55
55
  "Run this from the same folder in another console:\n\n"
56
- f"python echo.py -p {int(port) + 1} "
56
+ f"echo-demo -p {int(port) + 1} "
57
57
  f"-d /ip4/{localhost_ip}/tcp/{port}/p2p/{host.get_id().pretty()}\n"
58
58
  )
59
59
  print("Waiting for incoming connections...")
@@ -0,0 +1,121 @@
1
+ import argparse
2
+
3
+ import multiaddr
4
+ import trio
5
+
6
+ from libp2p import (
7
+ new_host,
8
+ )
9
+ from libp2p.custom_types import (
10
+ TProtocol,
11
+ )
12
+ from libp2p.network.stream.net_stream_interface import (
13
+ INetStream,
14
+ )
15
+ from libp2p.peer.peerinfo import (
16
+ info_from_p2p_addr,
17
+ )
18
+
19
+ PING_PROTOCOL_ID = TProtocol("/ipfs/ping/1.0.0")
20
+ PING_LENGTH = 32
21
+ RESP_TIMEOUT = 60
22
+
23
+
24
+ async def handle_ping(stream: INetStream) -> None:
25
+ while True:
26
+ try:
27
+ payload = await stream.read(PING_LENGTH)
28
+ peer_id = stream.muxed_conn.peer_id
29
+ if payload is not None:
30
+ print(f"received ping from {peer_id}")
31
+
32
+ await stream.write(payload)
33
+ print(f"responded with pong to {peer_id}")
34
+
35
+ except Exception:
36
+ await stream.reset()
37
+ break
38
+
39
+
40
+ async def send_ping(stream: INetStream) -> None:
41
+ try:
42
+ payload = b"\x01" * PING_LENGTH
43
+ print(f"sending ping to {stream.muxed_conn.peer_id}")
44
+
45
+ await stream.write(payload)
46
+
47
+ with trio.fail_after(RESP_TIMEOUT):
48
+ response = await stream.read(PING_LENGTH)
49
+
50
+ if response == payload:
51
+ print(f"received pong from {stream.muxed_conn.peer_id}")
52
+
53
+ except Exception as e:
54
+ print(f"error occurred : {e}")
55
+
56
+
57
+ async def run(port: int, destination: str) -> None:
58
+ localhost_ip = "127.0.0.1"
59
+ listen_addr = multiaddr.Multiaddr(f"/ip4/0.0.0.0/tcp/{port}")
60
+ host = new_host()
61
+
62
+ async with host.run(listen_addrs=[listen_addr]), trio.open_nursery() as nursery:
63
+ if not destination:
64
+ host.set_stream_handler(PING_PROTOCOL_ID, handle_ping)
65
+
66
+ print(
67
+ "Run this from the same folder in another console:\n\n"
68
+ f"ping-demo -p {int(port) + 1} "
69
+ f"-d /ip4/{localhost_ip}/tcp/{port}/p2p/{host.get_id().pretty()}\n"
70
+ )
71
+ print("Waiting for incoming connection...")
72
+
73
+ else:
74
+ maddr = multiaddr.Multiaddr(destination)
75
+ info = info_from_p2p_addr(maddr)
76
+ await host.connect(info)
77
+ stream = await host.new_stream(info.peer_id, [PING_PROTOCOL_ID])
78
+
79
+ nursery.start_soon(send_ping, stream)
80
+
81
+ return
82
+
83
+ await trio.sleep_forever()
84
+
85
+
86
+ def main() -> None:
87
+ description = """
88
+ This program demonstrates a simple p2p ping application using libp2p.
89
+ To use it, first run 'python ping.py -p <PORT>', where <PORT> is the port number.
90
+ Then, run another instance with 'python ping.py -p <ANOTHER_PORT> -d <DESTINATION>',
91
+ where <DESTINATION> is the multiaddress of the previous listener host.
92
+ """
93
+
94
+ example_maddr = (
95
+ "/ip4/127.0.0.1/tcp/8000/p2p/QmQn4SwGkDZKkUEpBRBvTmheQycxAHJUNmVEnjA2v1qe8Q"
96
+ )
97
+
98
+ parser = argparse.ArgumentParser(description=description)
99
+
100
+ parser.add_argument(
101
+ "-p", "--port", default=8000, type=int, help="source port number"
102
+ )
103
+ parser.add_argument(
104
+ "-d",
105
+ "--destination",
106
+ type=str,
107
+ help=f"destination multiaddr string, e.g. {example_maddr}",
108
+ )
109
+ args = parser.parse_args()
110
+
111
+ if not args.port:
112
+ raise RuntimeError("failed to determine local port")
113
+
114
+ try:
115
+ trio.run(run, *(args.port, args.destination))
116
+ except KeyboardInterrupt:
117
+ pass
118
+
119
+
120
+ if __name__ == "__main__":
121
+ main()
@@ -6,6 +6,9 @@ from libp2p.crypto.keys import (
6
6
  from libp2p.crypto.rsa import (
7
7
  create_new_key_pair,
8
8
  )
9
+ from libp2p.custom_types import (
10
+ TProtocol,
11
+ )
9
12
  from libp2p.host.basic_host import (
10
13
  BasicHost,
11
14
  )
@@ -52,9 +55,6 @@ from libp2p.transport.typing import (
52
55
  from libp2p.transport.upgrader import (
53
56
  TransportUpgrader,
54
57
  )
55
- from libp2p.typing import (
56
- TProtocol,
57
- )
58
58
 
59
59
 
60
60
  def generate_new_rsa_identity() -> KeyPair:
@@ -2,9 +2,6 @@ from dataclasses import (
2
2
  dataclass,
3
3
  )
4
4
  import hmac
5
- from typing import (
6
- Tuple,
7
- )
8
5
 
9
6
  from Crypto.Cipher import (
10
7
  AES,
@@ -66,7 +63,7 @@ class MacAndCipher:
66
63
 
67
64
  def initialize_pair(
68
65
  cipher_type: str, hash_type: str, secret: bytes
69
- ) -> Tuple[EncryptionParameters, EncryptionParameters]:
66
+ ) -> tuple[EncryptionParameters, EncryptionParameters]:
70
67
  """
71
68
  Return a pair of ``Keys`` for use in securing a communications channel
72
69
  with authenticated encryption derived from the ``secret`` and using the