1
- Py-libp2p – TLS Support Documentation
1
+ Py-libp2p – TLS Support Documentation
2
2
======================================================
3
3
4
4
.. contents ::
@@ -60,7 +60,7 @@ Listener node:
60
60
61
61
.. code-block :: python
62
62
63
- import asyncio
63
+ import trio
64
64
from libp2p import new_host
65
65
from libp2p.security.tls.transport import TLSTransport
66
66
@@ -69,16 +69,16 @@ Listener node:
69
69
await host.listen(" /ip4/0.0.0.0/tcp/8000" )
70
70
print (" TLS-enabled listener at:" , host.get_addrs())
71
71
72
- await asyncio.Future() # Keep running
72
+ await trio.sleep_forever()
73
73
74
74
if __name__ == " __main__" :
75
- asyncio .run(main())
75
+ trio .run(main())
76
76
77
77
Dialer node:
78
78
79
79
.. code-block :: python
80
80
81
- import asyncio
81
+ import trio
82
82
from libp2p import new_host
83
83
from libp2p.security.tls.transport import TLSTransport
84
84
from libp2p.peer.peerinfo import info_from_p2p_addr
@@ -93,7 +93,7 @@ Dialer node:
93
93
print (" Connected securely to" , peer_info.peer_id)
94
94
95
95
if __name__ == " __main__" :
96
- asyncio .run(main())
96
+ trio .run(main())
97
97
98
98
**Defaults if no configuration is provided **
99
99
@@ -159,7 +159,3 @@ Troubleshooting
159
159
* - Connection refused
160
160
- Port blocked or listener not running
161
161
- Check firewall rules and listener status.
162
-
163
-
164
-
165
-
0 commit comments