Skip to content

Commit 73d44ed

Browse files
committed
Replace asyncio with trio, fix newline, and run pre-commit checks on TLS docs
1 parent cc68f63 commit 73d44ed

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

docs/tls-support.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Py-libp2p – TLS Support Documentation
1+
Py-libp2p – TLS Support Documentation
22
======================================================
33

44
.. contents::
@@ -60,7 +60,7 @@ Listener node:
6060

6161
.. code-block:: python
6262
63-
import asyncio
63+
import trio
6464
from libp2p import new_host
6565
from libp2p.security.tls.transport import TLSTransport
6666
@@ -69,16 +69,16 @@ Listener node:
6969
await host.listen("/ip4/0.0.0.0/tcp/8000")
7070
print("TLS-enabled listener at:", host.get_addrs())
7171
72-
await asyncio.Future() # Keep running
72+
await trio.sleep_forever()
7373
7474
if __name__ == "__main__":
75-
asyncio.run(main())
75+
trio.run(main())
7676
7777
Dialer node:
7878

7979
.. code-block:: python
8080
81-
import asyncio
81+
import trio
8282
from libp2p import new_host
8383
from libp2p.security.tls.transport import TLSTransport
8484
from libp2p.peer.peerinfo import info_from_p2p_addr
@@ -93,7 +93,7 @@ Dialer node:
9393
print("Connected securely to", peer_info.peer_id)
9494
9595
if __name__ == "__main__":
96-
asyncio.run(main())
96+
trio.run(main())
9797
9898
**Defaults if no configuration is provided**
9999

@@ -159,7 +159,3 @@ Troubleshooting
159159
* - Connection refused
160160
- Port blocked or listener not running
161161
- Check firewall rules and listener status.
162-
163-
164-
165-

0 commit comments

Comments
 (0)