libp2p 0.2.1__tar.gz → 0.2.3__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.
- {libp2p-0.2.1/libp2p.egg-info → libp2p-0.2.3}/PKG-INFO +120 -110
- libp2p-0.2.3/README.md +143 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/examples/chat/chat.py +5 -5
- {libp2p-0.2.1 → libp2p-0.2.3}/examples/echo/echo.py +5 -5
- libp2p-0.2.3/examples/identify/identify.py +132 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/examples/ping/ping.py +6 -5
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/__init__.py +11 -19
- libp2p-0.2.3/libp2p/abc.py +2062 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/crypto/authenticated_encryption.py +1 -4
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/crypto/key_exchange.py +1 -2
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/crypto/pb/crypto_pb2.py +4 -4
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/crypto/rsa.py +36 -0
- libp2p-0.2.3/libp2p/custom_types.py +49 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/host/basic_host.py +45 -23
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/host/defaults.py +4 -4
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/host/ping.py +6 -11
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/host/routed_host.py +4 -6
- libp2p-0.2.3/libp2p/identity/identify/identify.py +114 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/identity/identify/pb/identify_pb2.py +4 -4
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/io/abc.py +17 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/io/trio.py +11 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/network/connection/raw_connection.py +11 -3
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/network/connection/swarm_connection.py +5 -9
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/network/stream/net_stream.py +9 -7
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/network/swarm.py +17 -33
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/peer/peerdata.py +11 -12
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/peer/peerinfo.py +4 -3
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/peer/peerstore.py +12 -12
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/protocol_muxer/multiselect.py +7 -14
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/protocol_muxer/multiselect_client.py +6 -8
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/protocol_muxer/multiselect_communicator.py +3 -3
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/pubsub/floodsub.py +10 -11
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/pubsub/gossipsub.py +44 -45
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/pubsub/mcache.py +13 -14
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/pubsub/pb/rpc_pb2.py +4 -4
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/pubsub/pubsub.py +24 -34
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/pubsub/pubsub_notifee.py +2 -8
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/pubsub/subscription.py +8 -5
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/base_session.py +3 -3
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/base_transport.py +3 -3
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/insecure/pb/plaintext_pb2.py +4 -4
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/insecure/transport.py +23 -9
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/noise/io.py +3 -3
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/noise/patterns.py +4 -6
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/noise/pb/noise_pb2.py +4 -4
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/noise/transport.py +7 -11
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/secio/pb/spipe_pb2.py +4 -4
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/secio/transport.py +9 -12
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/secure_session.py +7 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/security_multistream.py +7 -13
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/stream_muxer/mplex/mplex.py +15 -15
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/stream_muxer/mplex/mplex_stream.py +6 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/stream_muxer/muxer_multistream.py +8 -15
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/tools/async_service/abc.py +4 -3
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/tools/async_service/base.py +9 -10
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/tools/async_service/trio_service.py +7 -6
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/tools/async_service/typing.py +4 -4
- libp2p-0.2.3/libp2p/tools/timed_cache/base_timed_cache.py +54 -0
- libp2p-0.2.3/libp2p/tools/timed_cache/first_seen_cache.py +20 -0
- libp2p-0.2.3/libp2p/tools/timed_cache/last_seen_cache.py +22 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/tools/utils.py +5 -5
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/transport/tcp/tcp.py +14 -18
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/transport/upgrader.py +9 -18
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/utils.py +22 -0
- {libp2p-0.2.1 → libp2p-0.2.3/libp2p.egg-info}/PKG-INFO +120 -110
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p.egg-info/SOURCES.txt +27 -38
- libp2p-0.2.3/libp2p.egg-info/entry_points.txt +5 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p.egg-info/requires.txt +5 -3
- {libp2p-0.2.1 → libp2p-0.2.3}/pyproject.toml +4 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/scripts/release/test_package.py +4 -14
- {libp2p-0.2.1 → libp2p-0.2.3}/setup.py +15 -6
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/conftest.py +1 -1
- libp2p-0.2.3/tests/core/crypto/test_rsa.py +30 -0
- libp2p-0.2.3/tests/core/examples/test_examples.py +210 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/host/test_connected_peers.py +1 -1
- libp2p-0.2.3/tests/core/host/test_live_peers.py +182 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/host/test_ping.py +1 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/host/test_routed_host.py +1 -1
- libp2p-0.2.3/tests/core/identity/identify/test_identify.py +79 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/network/conftest.py +1 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/network/test_notify.py +4 -4
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/network/test_swarm.py +4 -4
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/protocol_muxer/test_protocol_muxer.py +3 -3
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/pubsub/test_dummyaccount_demo.py +3 -3
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/pubsub/test_floodsub.py +9 -14
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/pubsub/test_gossipsub.py +5 -5
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/pubsub/test_gossipsub_backward_compatibility.py +2 -2
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/pubsub/test_pubsub.py +10 -10
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/security/noise/test_msg_read_writer.py +1 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/security/noise/test_noise.py +1 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/security/test_secio.py +1 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/security/test_security_multistream.py +1 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/stream_muxer/conftest.py +1 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/test_libp2p/test_libp2p.py +6 -6
- libp2p-0.2.3/tests/core/tools/timed_cache/test_timed_cache.py +131 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/interop/conftest.py +4 -4
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/interop/test_bindings.py +2 -2
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/interop/test_echo.py +7 -7
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/interop/test_pubsub.py +6 -6
- {libp2p-0.2.1/libp2p/tools → libp2p-0.2.3/tests/utils}/factories.py +59 -63
- libp2p-0.2.3/tests/utils/interop/__init__.py +0 -0
- {libp2p-0.2.1/libp2p/tools → libp2p-0.2.3/tests/utils}/interop/daemon.py +6 -6
- {libp2p-0.2.1/libp2p/tools → libp2p-0.2.3/tests/utils}/interop/process.py +3 -4
- libp2p-0.2.3/tests/utils/pubsub/__init__.py +0 -0
- {libp2p-0.2.1/libp2p/tools → libp2p-0.2.3/tests/utils}/pubsub/dummy_account_node.py +7 -9
- {libp2p-0.2.1/libp2p/tools → libp2p-0.2.3/tests/utils}/pubsub/utils.py +2 -2
- libp2p-0.2.1/README.md +0 -149
- libp2p-0.2.1/libp2p/host/host_interface.py +0 -132
- libp2p-0.2.1/libp2p/identity/identify/protocol.py +0 -68
- libp2p-0.2.1/libp2p/network/connection/net_connection_interface.py +0 -31
- libp2p-0.2.1/libp2p/network/connection/raw_connection_interface.py +0 -9
- libp2p-0.2.1/libp2p/network/network_interface.py +0 -99
- libp2p-0.2.1/libp2p/network/notifee_interface.py +0 -65
- libp2p-0.2.1/libp2p/network/stream/net_stream_interface.py +0 -33
- libp2p-0.2.1/libp2p/peer/addrbook_interface.py +0 -62
- libp2p-0.2.1/libp2p/peer/peerdata_interface.py +0 -99
- libp2p-0.2.1/libp2p/peer/peermetadata_interface.py +0 -31
- libp2p-0.2.1/libp2p/peer/peerstore_interface.py +0 -160
- libp2p-0.2.1/libp2p/protocol_muxer/multiselect_client_interface.py +0 -58
- libp2p-0.2.1/libp2p/protocol_muxer/multiselect_communicator_interface.py +0 -24
- libp2p-0.2.1/libp2p/protocol_muxer/multiselect_muxer_interface.py +0 -51
- libp2p-0.2.1/libp2p/pubsub/abc.py +0 -158
- libp2p-0.2.1/libp2p/pubsub/typing.py +0 -19
- libp2p-0.2.1/libp2p/routing/interfaces.py +0 -42
- libp2p-0.2.1/libp2p/security/secure_conn_interface.py +0 -44
- libp2p-0.2.1/libp2p/security/secure_transport_interface.py +0 -42
- libp2p-0.2.1/libp2p/stream_muxer/abc.py +0 -85
- libp2p-0.2.1/libp2p/transport/listener_interface.py +0 -35
- libp2p-0.2.1/libp2p/transport/transport_interface.py +0 -41
- libp2p-0.2.1/libp2p/transport/typing.py +0 -24
- libp2p-0.2.1/libp2p/typing.py +0 -13
- libp2p-0.2.1/tests/core/examples/test_examples.py +0 -112
- libp2p-0.2.1/tests/core/identity/identify/test_protocol.py +0 -27
- {libp2p-0.2.1 → libp2p-0.2.3}/LICENSE-APACHE +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/LICENSE-MIT +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/MANIFEST.in +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/examples/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/examples/chat/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/examples/echo/__init__.py +0 -0
- {libp2p-0.2.1/examples/ping → libp2p-0.2.3/examples/identify}/__init__.py +0 -0
- {libp2p-0.2.1/libp2p/crypto → libp2p-0.2.3/examples/ping}/__init__.py +0 -0
- {libp2p-0.2.1/libp2p/crypto/pb → libp2p-0.2.3/libp2p/crypto}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/crypto/ecc.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/crypto/ed25519.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/crypto/exceptions.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/crypto/keys.py +0 -0
- {libp2p-0.2.1/libp2p/host → libp2p-0.2.3/libp2p/crypto/pb}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/crypto/pb/crypto_pb2.pyi +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/crypto/secp256k1.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/crypto/serialization.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/exceptions.py +0 -0
- {libp2p-0.2.1/libp2p/identity → libp2p-0.2.3/libp2p/host}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/host/exceptions.py +0 -0
- {libp2p-0.2.1/libp2p/identity/identify → libp2p-0.2.3/libp2p/identity}/__init__.py +0 -0
- {libp2p-0.2.1/libp2p/identity/identify/pb → libp2p-0.2.3/libp2p/identity/identify}/__init__.py +0 -0
- {libp2p-0.2.1/libp2p/io → libp2p-0.2.3/libp2p/identity/identify/pb}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/identity/identify/pb/identify_pb2.pyi +0 -0
- {libp2p-0.2.1/libp2p/network → libp2p-0.2.3/libp2p/io}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/io/exceptions.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/io/msgio.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/io/utils.py +0 -0
- {libp2p-0.2.1/libp2p/network/connection → libp2p-0.2.3/libp2p/network}/__init__.py +0 -0
- {libp2p-0.2.1/libp2p/network/stream → libp2p-0.2.3/libp2p/network/connection}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/network/connection/exceptions.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/network/exceptions.py +0 -0
- {libp2p-0.2.1/libp2p/peer → libp2p-0.2.3/libp2p/network/stream}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/network/stream/exceptions.py +0 -0
- {libp2p-0.2.1/libp2p/protocol_muxer → libp2p-0.2.3/libp2p/peer}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/peer/id.py +0 -0
- {libp2p-0.2.1/libp2p/pubsub → libp2p-0.2.3/libp2p/protocol_muxer}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/protocol_muxer/exceptions.py +0 -0
- {libp2p-0.2.1/libp2p/pubsub/pb → libp2p-0.2.3/libp2p/pubsub}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/pubsub/exceptions.py +0 -0
- {libp2p-0.2.1/libp2p/routing → libp2p-0.2.3/libp2p/pubsub/pb}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/pubsub/pb/rpc_pb2.pyi +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/pubsub/validators.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/py.typed +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/exceptions.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/insecure/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/insecure/pb/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/insecure/pb/plaintext_pb2.pyi +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/noise/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/noise/exceptions.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/noise/messages.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/noise/pb/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/noise/pb/noise_pb2.pyi +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/secio/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/secio/exceptions.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/secio/pb/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/security/secio/pb/spipe_pb2.pyi +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/stream_muxer/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/stream_muxer/exceptions.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/stream_muxer/mplex/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/stream_muxer/mplex/constants.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/stream_muxer/mplex/datastructures.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/stream_muxer/mplex/exceptions.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/tools/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/tools/async_service/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/tools/async_service/_utils.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/tools/async_service/exceptions.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/tools/async_service/stats.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/tools/constants.py +0 -0
- {libp2p-0.2.1/libp2p/tools/interop → libp2p-0.2.3/libp2p/tools/timed_cache}/__init__.py +0 -0
- {libp2p-0.2.1/libp2p/tools/pubsub → libp2p-0.2.3/libp2p/transport}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p/transport/exceptions.py +0 -0
- {libp2p-0.2.1/libp2p/transport → libp2p-0.2.3/libp2p/transport/tcp}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p.egg-info/dependency_links.txt +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p.egg-info/not-zip-safe +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/libp2p.egg-info/top_level.txt +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/setup.cfg +0 -0
- {libp2p-0.2.1/libp2p/transport/tcp → libp2p-0.2.3/tests}/__init__.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/crypto/test_ed25519.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/crypto/test_secp256k1.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/host/test_basic_host.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/network/test_net_stream.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/network/test_swarm_conn.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/peer/test_addrbook.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/peer/test_interop.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/peer/test_peerdata.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/peer/test_peerid.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/peer/test_peerinfo.py +1 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/peer/test_peermetadata.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/peer/test_peerstore.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/pubsub/test_mcache.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/pubsub/test_subscription.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/stream_muxer/test_mplex_conn.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/stream_muxer/test_mplex_stream.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/test_import_and_version.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/tools/async_service/test_trio_based_service.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/tools/async_service/test_trio_external_api.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/tools/async_service/test_trio_manager_stats.py +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/core/transport/test_tcp.py +1 -1
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/interop/go_pkgs/examples/README.md +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/interop/go_pkgs/examples/echo/main.go +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/interop/go_pkgs/examples/go.mod +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/interop/go_pkgs/examples/go.sum +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/interop/go_pkgs/examples/utils/host.go +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/interop/go_pkgs/install_interop_go_pkgs.sh +0 -0
- {libp2p-0.2.1 → libp2p-0.2.3}/tests/interop/test_net_stream.py +0 -0
- {libp2p-0.2.1/libp2p/tools → libp2p-0.2.3/tests/utils}/interop/constants.py +0 -0
- {libp2p-0.2.1/libp2p/tools → libp2p-0.2.3/tests/utils}/interop/envs.py +0 -0
- {libp2p-0.2.1/libp2p/tools → libp2p-0.2.3/tests/utils}/interop/utils.py +0 -0
- {libp2p-0.2.1/libp2p/tools → libp2p-0.2.3/tests/utils}/pubsub/floodsub_integration_test_settings.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: libp2p
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
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
|
-
|
|
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
|
|
@@ -43,7 +43,7 @@ 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:
|
|
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<
|
|
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,36 @@ 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<
|
|
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: license-file
|
|
80
|
+
Dynamic: platform
|
|
81
|
+
Dynamic: provides-extra
|
|
82
|
+
Dynamic: requires-dist
|
|
83
|
+
Dynamic: requires-python
|
|
84
|
+
Dynamic: summary
|
|
69
85
|
|
|
70
86
|
# py-libp2p
|
|
71
87
|
|
|
88
|
+
<h1 align="center">
|
|
89
|
+
<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>
|
|
90
|
+
</h1>
|
|
91
|
+
|
|
92
|
+
<h3 align="center">The Python implementation of the libp2p networking stack.</h3>
|
|
93
|
+
|
|
72
94
|
[](https://gitter.im/py-libp2p/Lobby)
|
|
73
95
|
[](https://circleci.com/gh/libp2p/py-libp2p)
|
|
74
96
|
[](https://badge.fury.io/py/libp2p)
|
|
@@ -78,118 +100,106 @@ Requires-Dist: factory-boy<3.0.0,>=2.12.0; extra == "test"
|
|
|
78
100
|
[](https://riot.permaweb.io/#/room/#libp2p:permaweb.io)
|
|
79
101
|
[](https://discord.gg/66KBrm2)
|
|
80
102
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
103
|
+
> ⚠️ **Warning:** py-libp2p is an experimental and work-in-progress repo under development. We do not yet recommend using py-libp2p in production environments.
|
|
104
|
+
|
|
105
|
+
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).
|
|
84
106
|
|
|
85
|
-
##
|
|
107
|
+
## Maintainers
|
|
86
108
|
|
|
87
|
-
|
|
88
|
-
Right now, `tests_interop` are turned off for CI, and a number of `tests` are failing. WIP.
|
|
109
|
+
Currently maintained by [@pacrob](https://github.com/pacrob), [@seetadev](https://github.com/seetadev) and [@dhuseby](https://github.com/dhuseby), looking for assistance!
|
|
89
110
|
|
|
90
|
-
|
|
111
|
+
## Feature Breakdown
|
|
91
112
|
|
|
92
|
-
|
|
113
|
+
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.
|
|
93
114
|
|
|
94
|
-
|
|
115
|
+
> Legend: ✅: Done 🛠️: In Progress/Usable 🌱 Prototype/Unstable ❌: Missing
|
|
95
116
|
|
|
96
|
-
|
|
117
|
+
______________________________________________________________________
|
|
97
118
|
|
|
98
|
-
|
|
119
|
+
### Transports
|
|
99
120
|
|
|
100
|
-
|
|
121
|
+
| **Transport** | **Status** | **Source** |
|
|
122
|
+
| -------------------------------------- | :--------: | :---------------------------------------------------------------------------------: |
|
|
123
|
+
| **`libp2p-tcp`** | ✅ | [source](https://github.com/libp2p/py-libp2p/blob/main/libp2p/transport/tcp/tcp.py) |
|
|
124
|
+
| **`libp2p-quic`** | 🌱 | |
|
|
125
|
+
| **`libp2p-websocket`** | ❌ | |
|
|
126
|
+
| **`libp2p-webrtc-browser-to-server`** | ❌ | |
|
|
127
|
+
| **`libp2p-webrtc-private-to-private`** | ❌ | |
|
|
128
|
+
|
|
129
|
+
______________________________________________________________________
|
|
130
|
+
|
|
131
|
+
### NAT Traversal
|
|
132
|
+
|
|
133
|
+
| **NAT Traversal** | **Status** |
|
|
134
|
+
| ----------------------------- | :--------: |
|
|
135
|
+
| **`libp2p-circuit-relay-v2`** | ❌ |
|
|
136
|
+
| **`libp2p-autonat`** | ❌ |
|
|
137
|
+
| **`libp2p-hole-punching`** | ❌ |
|
|
138
|
+
|
|
139
|
+
______________________________________________________________________
|
|
140
|
+
|
|
141
|
+
### Secure Communication
|
|
101
142
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
| **`
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
|
123
|
-
| **`i2p`** | :chestnut: |
|
|
124
|
-
| **`cjdns`** | :chestnut: |
|
|
125
|
-
| **`Bluetooth LE`** | :chestnut: |
|
|
126
|
-
| **`Audio TP`** | :chestnut: |
|
|
127
|
-
| **`Zerotier`** | :chestnut: |
|
|
128
|
-
| **`QUIC`** | :chestnut: |
|
|
129
|
-
|
|
130
|
-
| Stream Muxers | Status |
|
|
131
|
-
| ---------------- | :-----------: |
|
|
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: |
|
|
140
|
-
|
|
141
|
-
| Protocol Muxers | Status |
|
|
142
|
-
| ----------------- | :-----------: |
|
|
143
|
-
| **`multiselect`** | :green_apple: |
|
|
144
|
-
|
|
145
|
-
| Switch (Swarm) | Status |
|
|
146
|
-
| ------------------ | :-----------: |
|
|
147
|
-
| **`Switch`** | :green_apple: |
|
|
148
|
-
| **`Dialer stack`** | :green_apple: |
|
|
149
|
-
|
|
150
|
-
| Peer Discovery | Status |
|
|
143
|
+
| **Secure Communication** | **Status** | **Source** |
|
|
144
|
+
| ------------------------ | :--------: | :---------------------------------------------------------------------------: |
|
|
145
|
+
| **`libp2p-noise`** | 🌱 | [source](https://github.com/libp2p/py-libp2p/tree/main/libp2p/security/noise) |
|
|
146
|
+
| **`libp2p-tls`** | ❌ | |
|
|
147
|
+
|
|
148
|
+
______________________________________________________________________
|
|
149
|
+
|
|
150
|
+
### Discovery
|
|
151
|
+
|
|
152
|
+
| **Discovery** | **Status** |
|
|
153
|
+
| -------------------- | :--------: |
|
|
154
|
+
| **`bootstrap`** | ❌ |
|
|
155
|
+
| **`random-walk`** | ❌ |
|
|
156
|
+
| **`mdns-discovery`** | ❌ |
|
|
157
|
+
| **`rendezvous`** | ❌ |
|
|
158
|
+
|
|
159
|
+
______________________________________________________________________
|
|
160
|
+
|
|
161
|
+
### Peer Routing
|
|
162
|
+
|
|
163
|
+
| **Peer Routing** | **Status** |
|
|
151
164
|
| -------------------- | :--------: |
|
|
152
|
-
| **`
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
| **`
|
|
161
|
-
| **`
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
| **`
|
|
170
|
-
| **`
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
| **`
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
187
|
-
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
| **`Raft`** | :chestnut: |
|
|
191
|
-
| **`PBTF`** | :chestnut: |
|
|
192
|
-
| **`Nakamoto`** | :chestnut: |
|
|
165
|
+
| **`libp2p-kad-dht`** | ❌ |
|
|
166
|
+
|
|
167
|
+
______________________________________________________________________
|
|
168
|
+
|
|
169
|
+
### Publish/Subscribe
|
|
170
|
+
|
|
171
|
+
| **Publish/Subscribe** | **Status** | **Source** |
|
|
172
|
+
| ---------------------- | :--------: | :--------------------------------------------------------------------------------: |
|
|
173
|
+
| **`libp2p-floodsub`** | ✅ | [source](https://github.com/libp2p/py-libp2p/blob/main/libp2p/pubsub/floodsub.py) |
|
|
174
|
+
| **`libp2p-gossipsub`** | ✅ | [source](https://github.com/libp2p/py-libp2p/blob/main/libp2p/pubsub/gossipsub.py) |
|
|
175
|
+
|
|
176
|
+
______________________________________________________________________
|
|
177
|
+
|
|
178
|
+
### Stream Muxers
|
|
179
|
+
|
|
180
|
+
| **Stream Muxers** | **Status** | **Status** |
|
|
181
|
+
| ------------------ | :--------: | :----------------------------------------------------------------------------------------: |
|
|
182
|
+
| **`libp2p-yamux`** | 🌱 | |
|
|
183
|
+
| **`libp2p-mplex`** | 🛠️ | [source](https://github.com/libp2p/py-libp2p/blob/main/libp2p/stream_muxer/mplex/mplex.py) |
|
|
184
|
+
|
|
185
|
+
______________________________________________________________________
|
|
186
|
+
|
|
187
|
+
### Storage
|
|
188
|
+
|
|
189
|
+
| **Storage** | **Status** |
|
|
190
|
+
| ------------------- | :--------: |
|
|
191
|
+
| **`libp2p-record`** | ❌ |
|
|
192
|
+
|
|
193
|
+
______________________________________________________________________
|
|
194
|
+
|
|
195
|
+
### General Purpose Utilities & Datatypes
|
|
196
|
+
|
|
197
|
+
| **Utility/Datatype** | **Status** | **Source** |
|
|
198
|
+
| -------------------- | :--------: | :-------------------------------------------------------------------------: |
|
|
199
|
+
| **`libp2p-ping`** | ✅ | [source](https://github.com/libp2p/py-libp2p/blob/main/libp2p/host/ping.py) |
|
|
200
|
+
| **`libp2p-peer`** | ✅ | [source](https://github.com/libp2p/py-libp2p/tree/main/libp2p/peer) |
|
|
201
|
+
|
|
202
|
+
______________________________________________________________________
|
|
193
203
|
|
|
194
204
|
## Explanation of Basic Two Node Communication
|
|
195
205
|
|
|
@@ -211,7 +221,7 @@ Several components of the libp2p stack take part when establishing a connection
|
|
|
211
221
|
|
|
212
222
|
_(non-normative, useful for team notes, not a reference)_
|
|
213
223
|
|
|
214
|
-
**Initiate the connection**: A host is simply a node in the libp2p network that is able to communicate with other nodes in the network. In order for X and Y to communicate with one another, one of the hosts must initiate the connection.
|
|
224
|
+
**Initiate the connection**: A host is simply a node in the libp2p network that is able to communicate with other nodes in the network. In order for X and Y to communicate with one another, one of the hosts must initiate the connection. Let's say that X is going to initiate the connection. X will first open a connection to Y. This connection is where all of the actual communication will take place.
|
|
215
225
|
|
|
216
226
|
**Communication over one connection with multiple protocols**: X and Y can communicate over the same connection using different protocols and the multiplexer will appropriately route messages for a given protocol to a particular handler function for that protocol, which allows for each host to handle different protocols with separate functions. Furthermore, we can use multiple streams for a given protocol that allow for the same protocol and same underlying connection to be used for communication about separate topics between nodes X and Y.
|
|
217
227
|
|
libp2p-0.2.3/README.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# py-libp2p
|
|
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
|
+
|
|
9
|
+
[](https://gitter.im/py-libp2p/Lobby)
|
|
10
|
+
[](https://circleci.com/gh/libp2p/py-libp2p)
|
|
11
|
+
[](https://badge.fury.io/py/libp2p)
|
|
12
|
+
[](https://pypi.python.org/pypi/libp2p)
|
|
13
|
+
[](http://py-libp2p.readthedocs.io/en/latest/?badge=latest)
|
|
14
|
+
[](https://webchat.freenode.net/?channels=%23libp2p)
|
|
15
|
+
[](https://riot.permaweb.io/#/room/#libp2p:permaweb.io)
|
|
16
|
+
[](https://discord.gg/66KBrm2)
|
|
17
|
+
|
|
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.
|
|
19
|
+
|
|
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).
|
|
21
|
+
|
|
22
|
+
## Maintainers
|
|
23
|
+
|
|
24
|
+
Currently maintained by [@pacrob](https://github.com/pacrob), [@seetadev](https://github.com/seetadev) and [@dhuseby](https://github.com/dhuseby), looking for assistance!
|
|
25
|
+
|
|
26
|
+
## Feature Breakdown
|
|
27
|
+
|
|
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.
|
|
29
|
+
|
|
30
|
+
> Legend: ✅: Done 🛠️: In Progress/Usable 🌱 Prototype/Unstable ❌: Missing
|
|
31
|
+
|
|
32
|
+
______________________________________________________________________
|
|
33
|
+
|
|
34
|
+
### Transports
|
|
35
|
+
|
|
36
|
+
| **Transport** | **Status** | **Source** |
|
|
37
|
+
| -------------------------------------- | :--------: | :---------------------------------------------------------------------------------: |
|
|
38
|
+
| **`libp2p-tcp`** | ✅ | [source](https://github.com/libp2p/py-libp2p/blob/main/libp2p/transport/tcp/tcp.py) |
|
|
39
|
+
| **`libp2p-quic`** | 🌱 | |
|
|
40
|
+
| **`libp2p-websocket`** | ❌ | |
|
|
41
|
+
| **`libp2p-webrtc-browser-to-server`** | ❌ | |
|
|
42
|
+
| **`libp2p-webrtc-private-to-private`** | ❌ | |
|
|
43
|
+
|
|
44
|
+
______________________________________________________________________
|
|
45
|
+
|
|
46
|
+
### NAT Traversal
|
|
47
|
+
|
|
48
|
+
| **NAT Traversal** | **Status** |
|
|
49
|
+
| ----------------------------- | :--------: |
|
|
50
|
+
| **`libp2p-circuit-relay-v2`** | ❌ |
|
|
51
|
+
| **`libp2p-autonat`** | ❌ |
|
|
52
|
+
| **`libp2p-hole-punching`** | ❌ |
|
|
53
|
+
|
|
54
|
+
______________________________________________________________________
|
|
55
|
+
|
|
56
|
+
### Secure Communication
|
|
57
|
+
|
|
58
|
+
| **Secure Communication** | **Status** | **Source** |
|
|
59
|
+
| ------------------------ | :--------: | :---------------------------------------------------------------------------: |
|
|
60
|
+
| **`libp2p-noise`** | 🌱 | [source](https://github.com/libp2p/py-libp2p/tree/main/libp2p/security/noise) |
|
|
61
|
+
| **`libp2p-tls`** | ❌ | |
|
|
62
|
+
|
|
63
|
+
______________________________________________________________________
|
|
64
|
+
|
|
65
|
+
### Discovery
|
|
66
|
+
|
|
67
|
+
| **Discovery** | **Status** |
|
|
68
|
+
| -------------------- | :--------: |
|
|
69
|
+
| **`bootstrap`** | ❌ |
|
|
70
|
+
| **`random-walk`** | ❌ |
|
|
71
|
+
| **`mdns-discovery`** | ❌ |
|
|
72
|
+
| **`rendezvous`** | ❌ |
|
|
73
|
+
|
|
74
|
+
______________________________________________________________________
|
|
75
|
+
|
|
76
|
+
### Peer Routing
|
|
77
|
+
|
|
78
|
+
| **Peer Routing** | **Status** |
|
|
79
|
+
| -------------------- | :--------: |
|
|
80
|
+
| **`libp2p-kad-dht`** | ❌ |
|
|
81
|
+
|
|
82
|
+
______________________________________________________________________
|
|
83
|
+
|
|
84
|
+
### Publish/Subscribe
|
|
85
|
+
|
|
86
|
+
| **Publish/Subscribe** | **Status** | **Source** |
|
|
87
|
+
| ---------------------- | :--------: | :--------------------------------------------------------------------------------: |
|
|
88
|
+
| **`libp2p-floodsub`** | ✅ | [source](https://github.com/libp2p/py-libp2p/blob/main/libp2p/pubsub/floodsub.py) |
|
|
89
|
+
| **`libp2p-gossipsub`** | ✅ | [source](https://github.com/libp2p/py-libp2p/blob/main/libp2p/pubsub/gossipsub.py) |
|
|
90
|
+
|
|
91
|
+
______________________________________________________________________
|
|
92
|
+
|
|
93
|
+
### Stream Muxers
|
|
94
|
+
|
|
95
|
+
| **Stream Muxers** | **Status** | **Status** |
|
|
96
|
+
| ------------------ | :--------: | :----------------------------------------------------------------------------------------: |
|
|
97
|
+
| **`libp2p-yamux`** | 🌱 | |
|
|
98
|
+
| **`libp2p-mplex`** | 🛠️ | [source](https://github.com/libp2p/py-libp2p/blob/main/libp2p/stream_muxer/mplex/mplex.py) |
|
|
99
|
+
|
|
100
|
+
______________________________________________________________________
|
|
101
|
+
|
|
102
|
+
### Storage
|
|
103
|
+
|
|
104
|
+
| **Storage** | **Status** |
|
|
105
|
+
| ------------------- | :--------: |
|
|
106
|
+
| **`libp2p-record`** | ❌ |
|
|
107
|
+
|
|
108
|
+
______________________________________________________________________
|
|
109
|
+
|
|
110
|
+
### General Purpose Utilities & Datatypes
|
|
111
|
+
|
|
112
|
+
| **Utility/Datatype** | **Status** | **Source** |
|
|
113
|
+
| -------------------- | :--------: | :-------------------------------------------------------------------------: |
|
|
114
|
+
| **`libp2p-ping`** | ✅ | [source](https://github.com/libp2p/py-libp2p/blob/main/libp2p/host/ping.py) |
|
|
115
|
+
| **`libp2p-peer`** | ✅ | [source](https://github.com/libp2p/py-libp2p/tree/main/libp2p/peer) |
|
|
116
|
+
|
|
117
|
+
______________________________________________________________________
|
|
118
|
+
|
|
119
|
+
## Explanation of Basic Two Node Communication
|
|
120
|
+
|
|
121
|
+
### Core Concepts
|
|
122
|
+
|
|
123
|
+
_(non-normative, useful for team notes, not a reference)_
|
|
124
|
+
|
|
125
|
+
Several components of the libp2p stack take part when establishing a connection between two nodes:
|
|
126
|
+
|
|
127
|
+
1. **Host**: a node in the libp2p network.
|
|
128
|
+
1. **Connection**: the layer 3 connection between two nodes in a libp2p network.
|
|
129
|
+
1. **Transport**: the component that creates a _Connection_, e.g. TCP, UDP, QUIC, etc.
|
|
130
|
+
1. **Streams**: an abstraction on top of a _Connection_ representing parallel conversations about different matters, each of which is identified by a protocol ID. Multiple streams are layered on top of a _Connection_ via the _Multiplexer_.
|
|
131
|
+
1. **Multiplexer**: a component that is responsible for wrapping messages sent on a stream with an envelope that identifies the stream they pertain to, normally via an ID. The multiplexer on the other unwraps the message and routes it internally based on the stream identification.
|
|
132
|
+
1. **Secure channel**: optionally establishes a secure, encrypted, and authenticated channel over the _Connection_.
|
|
133
|
+
1. **Upgrader**: a component that takes a raw layer 3 connection returned by the _Transport_, and performs the security and multiplexing negotiation to set up a secure, multiplexed channel on top of which _Streams_ can be opened.
|
|
134
|
+
|
|
135
|
+
### Communication between two hosts X and Y
|
|
136
|
+
|
|
137
|
+
_(non-normative, useful for team notes, not a reference)_
|
|
138
|
+
|
|
139
|
+
**Initiate the connection**: A host is simply a node in the libp2p network that is able to communicate with other nodes in the network. In order for X and Y to communicate with one another, one of the hosts must initiate the connection. Let's say that X is going to initiate the connection. X will first open a connection to Y. This connection is where all of the actual communication will take place.
|
|
140
|
+
|
|
141
|
+
**Communication over one connection with multiple protocols**: X and Y can communicate over the same connection using different protocols and the multiplexer will appropriately route messages for a given protocol to a particular handler function for that protocol, which allows for each host to handle different protocols with separate functions. Furthermore, we can use multiple streams for a given protocol that allow for the same protocol and same underlying connection to be used for communication about separate topics between nodes X and Y.
|
|
142
|
+
|
|
143
|
+
**Why use multiple streams?**: The purpose of using the same connection for multiple streams to communicate over is to avoid the overhead of having multiple connections between X and Y. In order for X and Y to differentiate between messages on different streams and different protocols, a multiplexer is used to encode the messages when a message will be sent and decode a message when a message is received. The multiplexer encodes the message by adding a header to the beginning of any message to be sent that contains the stream id (along with some other info). Then, the message is sent across the raw connection and the receiving host will use its multiplexer to decode the message, i.e. determine which stream id the message should be routed to.
|
|
@@ -7,15 +7,15 @@ import trio
|
|
|
7
7
|
from libp2p import (
|
|
8
8
|
new_host,
|
|
9
9
|
)
|
|
10
|
-
from libp2p.
|
|
10
|
+
from libp2p.custom_types import (
|
|
11
|
+
TProtocol,
|
|
12
|
+
)
|
|
13
|
+
from libp2p.network.stream.net_stream 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"
|
|
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.
|
|
12
|
+
from libp2p.custom_types import (
|
|
13
|
+
TProtocol,
|
|
14
|
+
)
|
|
15
|
+
from libp2p.network.stream.net_stream 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"
|
|
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,132 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import base64
|
|
3
|
+
import logging
|
|
4
|
+
|
|
5
|
+
import multiaddr
|
|
6
|
+
import trio
|
|
7
|
+
|
|
8
|
+
from libp2p import (
|
|
9
|
+
new_host,
|
|
10
|
+
)
|
|
11
|
+
from libp2p.identity.identify.identify import ID as IDENTIFY_PROTOCOL_ID
|
|
12
|
+
from libp2p.identity.identify.pb.identify_pb2 import (
|
|
13
|
+
Identify,
|
|
14
|
+
)
|
|
15
|
+
from libp2p.peer.peerinfo import (
|
|
16
|
+
info_from_p2p_addr,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
logger = logging.getLogger("libp2p.identity.identify-example")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def decode_multiaddrs(raw_addrs):
|
|
23
|
+
"""Convert raw listen addresses into human-readable multiaddresses."""
|
|
24
|
+
decoded_addrs = []
|
|
25
|
+
for addr in raw_addrs:
|
|
26
|
+
try:
|
|
27
|
+
decoded_addrs.append(str(multiaddr.Multiaddr(addr)))
|
|
28
|
+
except Exception as e:
|
|
29
|
+
decoded_addrs.append(f"Invalid Multiaddr ({addr}): {e}")
|
|
30
|
+
return decoded_addrs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def print_identify_response(identify_response):
|
|
34
|
+
"""Pretty-print Identify response."""
|
|
35
|
+
public_key_b64 = base64.b64encode(identify_response.public_key).decode("utf-8")
|
|
36
|
+
listen_addrs = decode_multiaddrs(identify_response.listen_addrs)
|
|
37
|
+
try:
|
|
38
|
+
observed_addr_decoded = decode_multiaddrs([identify_response.observed_addr])
|
|
39
|
+
except Exception:
|
|
40
|
+
observed_addr_decoded = identify_response.observed_addr
|
|
41
|
+
print(
|
|
42
|
+
f"Identify response:\n"
|
|
43
|
+
f" Public Key (Base64): {public_key_b64}\n"
|
|
44
|
+
f" Listen Addresses: {listen_addrs}\n"
|
|
45
|
+
f" Protocols: {list(identify_response.protocols)}\n"
|
|
46
|
+
f" Observed Address: "
|
|
47
|
+
f"{observed_addr_decoded if identify_response.observed_addr else 'None'}\n"
|
|
48
|
+
f" Protocol Version: {identify_response.protocol_version}\n"
|
|
49
|
+
f" Agent Version: {identify_response.agent_version}"
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
async def run(port: int, destination: str) -> None:
|
|
54
|
+
localhost_ip = "0.0.0.0"
|
|
55
|
+
|
|
56
|
+
if not destination:
|
|
57
|
+
# Create first host (listener)
|
|
58
|
+
listen_addr = multiaddr.Multiaddr(f"/ip4/{localhost_ip}/tcp/{port}")
|
|
59
|
+
host_a = new_host()
|
|
60
|
+
|
|
61
|
+
async with host_a.run(listen_addrs=[listen_addr]):
|
|
62
|
+
print(
|
|
63
|
+
"First host listening. Run this from another console:\n\n"
|
|
64
|
+
f"identify-demo -p {int(port) + 1} "
|
|
65
|
+
f"-d /ip4/{localhost_ip}/tcp/{port}/p2p/{host_a.get_id().pretty()}\n"
|
|
66
|
+
)
|
|
67
|
+
print("Waiting for incoming identify request...")
|
|
68
|
+
await trio.sleep_forever()
|
|
69
|
+
|
|
70
|
+
else:
|
|
71
|
+
# Create second host (dialer)
|
|
72
|
+
print(f"dialer (host_b) listening on /ip4/{localhost_ip}/tcp/{port}")
|
|
73
|
+
listen_addr = multiaddr.Multiaddr(f"/ip4/{localhost_ip}/tcp/{port}")
|
|
74
|
+
host_b = new_host()
|
|
75
|
+
|
|
76
|
+
async with host_b.run(listen_addrs=[listen_addr]):
|
|
77
|
+
# Connect to the first host
|
|
78
|
+
maddr = multiaddr.Multiaddr(destination)
|
|
79
|
+
info = info_from_p2p_addr(maddr)
|
|
80
|
+
print(f"Second host connecting to peer: {info.peer_id}")
|
|
81
|
+
|
|
82
|
+
await host_b.connect(info)
|
|
83
|
+
stream = await host_b.new_stream(info.peer_id, (IDENTIFY_PROTOCOL_ID,))
|
|
84
|
+
|
|
85
|
+
try:
|
|
86
|
+
print("Starting identify protocol...")
|
|
87
|
+
response = await stream.read()
|
|
88
|
+
await stream.close()
|
|
89
|
+
identify_msg = Identify()
|
|
90
|
+
identify_msg.ParseFromString(response)
|
|
91
|
+
print_identify_response(identify_msg)
|
|
92
|
+
except Exception as e:
|
|
93
|
+
print(f"Identify protocol error: {e}")
|
|
94
|
+
|
|
95
|
+
return
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def main() -> None:
|
|
99
|
+
description = """
|
|
100
|
+
This program demonstrates the libp2p identify protocol.
|
|
101
|
+
First run identify-demo -p <PORT>' to start a listener.
|
|
102
|
+
Then run 'identify-demo <ANOTHER_PORT> -d <DESTINATION>'
|
|
103
|
+
where <DESTINATION> is the multiaddress shown by the listener.
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
example_maddr = (
|
|
107
|
+
"/ip4/127.0.0.1/tcp/8888/p2p/QmQn4SwGkDZkUEpBRBvTmheQycxAHJUNmVEnjA2v1qe8Q"
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
parser = argparse.ArgumentParser(description=description)
|
|
111
|
+
parser.add_argument(
|
|
112
|
+
"-p", "--port", default=8888, type=int, help="source port number"
|
|
113
|
+
)
|
|
114
|
+
parser.add_argument(
|
|
115
|
+
"-d",
|
|
116
|
+
"--destination",
|
|
117
|
+
type=str,
|
|
118
|
+
help=f"destination multiaddr string, e.g. {example_maddr}",
|
|
119
|
+
)
|
|
120
|
+
args = parser.parse_args()
|
|
121
|
+
|
|
122
|
+
if not args.port:
|
|
123
|
+
raise RuntimeError("failed to determine local port")
|
|
124
|
+
|
|
125
|
+
try:
|
|
126
|
+
trio.run(run, *(args.port, args.destination))
|
|
127
|
+
except KeyboardInterrupt:
|
|
128
|
+
pass
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
if __name__ == "__main__":
|
|
132
|
+
main()
|