|
@@ -1,5 +1,6 @@
|
|
|
import time
|
|
|
from argparse import ArgumentParser
|
|
|
+from secrets import token_hex
|
|
|
|
|
|
from hivemind.dht import DHT, DHTNode
|
|
|
from hivemind.utils.logging import get_logger, use_hivemind_log_handler
|
|
@@ -18,6 +19,9 @@ async def report_status(dht: DHT, node: DHTNode):
|
|
|
logger.info(f"Local storage contains {len(node.protocol.storage)} keys")
|
|
|
logger.debug(f"Local storage contents: {node.protocol.storage}")
|
|
|
|
|
|
+ # Contact peers and keep the routing table healthy (remove stale PeerIDs)
|
|
|
+ await node.get(f"heartbeat_{token_hex(16)}", latest=True)
|
|
|
+
|
|
|
|
|
|
def main():
|
|
|
parser = ArgumentParser()
|