Fix examples and modify new_node

- Fix examples `chat.py` and `echo.py`
    - Use trio directly, instead of `trio-asyncio`
    - Remove redundant code
- Change entry API `new_node` to `new_host_trio`
This commit is contained in:
mhchia
2019-12-24 18:03:18 +08:00
parent 6fe5871d96
commit 3372c32432
7 changed files with 129 additions and 183 deletions

View File

@ -1,6 +1,7 @@
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Dict, Sequence
from async_service import ServiceAPI
from multiaddr import Multiaddr
from libp2p.network.connection.net_connection_interface import INetConn
@ -70,3 +71,7 @@ class INetwork(ABC):
@abstractmethod
async def close_peer(self, peer_id: ID) -> None:
pass
class INetworkService(INetwork, ServiceAPI):
...