mech-client 0.2.18__py3-none-any.whl → 0.2.19__py3-none-any.whl

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.
mech_client/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Mech client."""
2
2
 
3
- __version__ = "0.2.18"
3
+ __version__ = "0.2.19"
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # ------------------------------------------------------------------------------
3
3
  #
4
- # Copyright 2023 valory
4
+ # Copyright 2024 valory
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # ------------------------------------------------------------------------------
3
3
  #
4
- # Copyright 2023 valory
4
+ # Copyright 2024 valory
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # ------------------------------------------------------------------------------
3
3
  #
4
- # Copyright 2023 valory
4
+ # Copyright 2024 valory
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -8,13 +8,13 @@ license: Apache-2.0
8
8
  aea_version: '>=1.0.0, <2.0.0'
9
9
  fingerprint:
10
10
  README.md: bafybeie7paijucvzemlfhwfmmhorypwuhzbeimgoitlkokdio5c3ne4pjq
11
- __init__.py: bafybeie6wesz6wnihjwdlbkhso6gtnpa4dkqdseb7susz2qseprlmcccam
11
+ __init__.py: bafybeicqlp4gkeeef5osp6zopjztlgat24nxrzq43cy7wbwxk5omf2sc2m
12
12
  acn.proto: bafybeidkun7o75sxpyk2sixt7dsykgty62f6dnixnes2irbunyamilqsh4
13
13
  acn_pb2.py: bafybeialafz3yomunwa3g5xgrdqwodzl7zg5dncvzuetv7xoew4zhw76ni
14
14
  custom_types.py: bafybeigpueuq6mdeyjyayzv3menkmemutfgfiwlozlpl64t67cfnnom24q
15
- dialogues.py: bafybeih2kwxi34hcrxbb3cmhtpo5k5fc4hlgsb3qnifpyeefou63c4qc2a
16
- message.py: bafybeibkjeytosfqptmqph3xwdcnmokgoen2xw2s44736potgrjr43vlmy
17
- serialization.py: bafybeibbs5uepy6s5jb5eyzdav6i2hejy26zkocqe236kxmoknkqpsi7iu
15
+ dialogues.py: bafybeidjpyk7s3getyfegjdrgrt5blf2yutzqclohaktjehwcj3sqx2ole
16
+ message.py: bafybeiai7kond3rcbtwnr5xgpwzuauf5tusuep6ikopi4cqvp2wa5qfz3e
17
+ serialization.py: bafybeidu7fzixk6sm3iprhph4shbiq5qgvg56lg4yiryfaf3unuqk34bwi
18
18
  tests/__init__.py: bafybeidteufp2npjd77ekcftk5e4gbaquq3gike5nxtk5xfmnusls56keu
19
19
  tests/test_acn.py: bafybeignjgdtlfdnj25hc5necmg7zl3kvngsmzkjgcwfm5qg36liqa63ki
20
20
  tests/test_acn_dialogues.py: bafybeia2kndutaokjpogo4wlb5pf4gkqacvcbngqromf4g4mzu6wyetz7q
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # ------------------------------------------------------------------------------
3
3
  #
4
- # Copyright 2023 valory
4
+ # Copyright 2024 valory
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # ------------------------------------------------------------------------------
3
3
  #
4
- # Copyright 2022-2023 Valory AG
4
+ # Copyright 2022-2024 Valory AG
5
5
  # Copyright 2018-2019 Fetch.AI Limited
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -279,6 +279,7 @@ class P2PLibp2pClientConnection(Connection):
279
279
  connection_id = PUBLIC_ID
280
280
 
281
281
  DEFAULT_CONNECT_RETRIES = 3
282
+ DEFAULT_RESEND_ENVELOPE_RETRY = 1
282
283
  DEFAULT_TLS_CONNECTION_SIGNATURE_TIMEOUT = 5.0
283
284
 
284
285
  def __init__(self, **kwargs: Any) -> None:
@@ -292,6 +293,9 @@ class P2PLibp2pClientConnection(Connection):
292
293
  self.connect_retries = self.configuration.config.get(
293
294
  "connect_retries", self.DEFAULT_CONNECT_RETRIES
294
295
  )
296
+ self.resend_envelope_retry = self.configuration.config.get(
297
+ "resend_envelope_retry", self.DEFAULT_RESEND_ENVELOPE_RETRY
298
+ )
295
299
  ledger_id = self.configuration.config.get("ledger_id", DEFAULT_LEDGER)
296
300
  if ledger_id not in SUPPORTED_LEDGER_IDS:
297
301
  raise ValueError( # pragma: nocover
@@ -386,11 +390,17 @@ class P2PLibp2pClientConnection(Connection):
386
390
  )
387
391
  await asyncio.shield(self.disconnect())
388
392
 
389
- async def _send_envelope_with_node_client(self, envelope: Envelope) -> None:
393
+ async def _send_envelope_with_node_client(
394
+ self, envelope: Envelope, retry_counter: int = 0
395
+ ) -> None:
390
396
  """Send envelope with node client, reconnect and retry on fail."""
391
397
  if not self._node_client: # pragma: nocover
392
398
  raise ValueError("Connection not connected to node!")
393
-
399
+ if retry_counter > self.resend_envelope_retry:
400
+ self.logger.warning(
401
+ f"Dropping envelope {envelope}. It failed after retry. "
402
+ )
403
+ return
394
404
  self._ensure_valid_envelope_for_external_comms(envelope)
395
405
  try:
396
406
  await self._node_client.send_envelope(envelope)
@@ -399,7 +409,7 @@ class P2PLibp2pClientConnection(Connection):
399
409
  "Exception raised on message send. Try reconnect and send again."
400
410
  )
401
411
  await self._perform_connection_to_node()
402
- await self._node_client.send_envelope(envelope)
412
+ await self._send_envelope_with_node_client(envelope, retry_counter + 1)
403
413
 
404
414
  async def connect(self) -> None:
405
415
  """Set up the connection."""
@@ -584,9 +594,14 @@ class P2PLibp2pClientConnection(Connection):
584
594
  envelope = await self._read_envelope_from_node()
585
595
  if self._in_queue is None:
586
596
  raise ValueError("Input queue not initialized.") # pragma: nocover
587
- self._in_queue.put_nowait(envelope)
597
+ self.logger.debug(f"Received envelope: {envelope}")
588
598
  if envelope is None:
589
- break # pragma: no cover
599
+ # give it time to recover
600
+ # twice the amount what we wait for ACK timeouts
601
+ timeout = NodeClient.ACN_ACK_TIMEOUT * 2
602
+ await asyncio.sleep(timeout)
603
+ continue # pragma: no cover
604
+ self._in_queue.put_nowait(envelope)
590
605
 
591
606
 
592
607
  class TCPSocketChannelClientTLS(TCPSocketChannelClient):
@@ -10,14 +10,15 @@ aea_version: '>=1.0.0, <2.0.0'
10
10
  fingerprint:
11
11
  README.md: bafybeiaf5kdnfdc2jifojgniib76zl2c4utnx7ofewc3szqkrxsby62ulu
12
12
  __init__.py: bafybeid2azroxglu6fl7bxdfcsv3j77vyzgpikjnfwpxg73zeb5orez6ju
13
- connection.py: bafybeiauso3ectgdvbhkt5j6wstfev5mnxiuj6hrkczyqgxurnvva3loqm
13
+ connection.py: bafybeihcwyo5nhxmsjxw7qrrvkvp7qu6izbgzgipmmnrpdvc6jtwmw7vgy
14
14
  fingerprint_ignore_patterns: []
15
15
  connections: []
16
16
  protocols:
17
- - valory/acn:1.1.0:bafybeic2pxzfc3voxl2ejhcqyf2ehm4wm5gxvgx7bliloiqi2uppmq6weu
17
+ - valory/acn:1.1.0:bafybeidluaoeakae3exseupaea4i3yvvk5vivyt227xshjlffywwxzcxqe
18
18
  class_name: P2PLibp2pClientConnection
19
19
  config:
20
20
  connect_retries: 3
21
+ resend_envelope_retry: 1
21
22
  ledger_id: cosmos
22
23
  nodes:
23
24
  - uri: acn.staging.autonolas.tech:9005
@@ -29,15 +30,15 @@ cert_requests:
29
30
  - identifier: acn
30
31
  ledger_id: ethereum
31
32
  message_format: '{public_key}'
32
- not_after: '2024-01-01'
33
- not_before: '2023-01-01'
33
+ not_after: '2025-01-01'
34
+ not_before: '2024-01-01'
34
35
  public_key: 02d3a830c9d6ea1ae91936951430dee11f4662f33118b02190693be835359a9d77
35
36
  save_path: .certs/acn_cosmos_9005.txt
36
37
  - identifier: acn
37
38
  ledger_id: ethereum
38
39
  message_format: '{public_key}'
39
- not_after: '2024-01-01'
40
- not_before: '2023-01-01'
40
+ not_after: '2025-01-01'
41
+ not_before: '2024-01-01'
41
42
  public_key: 02e741c62d706e1dcf6986bf37fa74b98681bc32669623ac9ee6ff72488d4f59e8
42
43
  save_path: .certs/acn_cosmos_9006.txt
43
44
  excluded_protocols: []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mech-client
3
- Version: 0.2.18
3
+ Version: 0.2.19
4
4
  Summary: Basic client to interact with a mech
5
5
  License: Apache-2.0
6
6
  Author: David Minarsch
@@ -1,17 +1,17 @@
1
- mech_client/__init__.py,sha256=-FAy2CBMz87Vv1C1uGSsSXH1QrhOiCeSZFh3WR-Vjp8,43
1
+ mech_client/__init__.py,sha256=2OIY2Ajb_pzPPnptauTqSi8S5jCYECPnMXEccSZuQu0,43
2
2
  mech_client/acn.py,sha256=Rj_jLPvJ5loDQfGbu3a_O24cJC4SwIErLceSz_zVYS8,5356
3
3
  mech_client/cli.py,sha256=cJ3QAP29QsbsyITVZbCVxZ7378ql2VPaEjar9Iotj0U,9555
4
4
  mech_client/configs/mechs.json,sha256=IABnne1lWi62l84Hzqh3XrP659uPKme2k32yAI0HBrg,4488
5
5
  mech_client/helpers/__init__.py,sha256=f13zpwGDaKQUjML-5Iq66rRfzg8IS5UNK5I8gBr7w54,1028
6
6
  mech_client/helpers/acn/README.md,sha256=WMXR2Lk0IpWjr3vpZ8cxcTHk4gwsx4wC06UPkwj9dbQ,1641
7
- mech_client/helpers/acn/__init__.py,sha256=72WrGEDIuYKvlWQnTajFQ9bNrDy2sFfTYDP62he4doI,1141
7
+ mech_client/helpers/acn/__init__.py,sha256=3Yd1hUTcrtp0Kb1VmnOTC3_r-_69ozhzMqLlkNC6MkU,1141
8
8
  mech_client/helpers/acn/acn.proto,sha256=Ev0f8tQJjnTaK-mdpNLItVRgJ7VibtCeGBTcKz8nfX4,1543
9
9
  mech_client/helpers/acn/acn_pb2.py,sha256=NnS-rspsKz9ImoLWp8P9FSBNwGJYuj1mRCw8A1bHydQ,4350
10
10
  mech_client/helpers/acn/custom_types.py,sha256=x2YMQuxd86QDjkCr__SuhcDmlGP8qI-qJRg1XqIlBRw,7982
11
- mech_client/helpers/acn/dialogues.py,sha256=1z11RJW18_dC6gY1aLHiRfXPlZaABqt6n8u-FUgY2RY,4443
12
- mech_client/helpers/acn/message.py,sha256=LOAmYEaEYwKjYjTDZmAxR196v6jSVc9JAKF5vw2NbXk,10272
13
- mech_client/helpers/acn/protocol.yaml,sha256=gFs7lVa-FiTHSRdWUcB2lfJzcIQcJ9QeyMF6rxvWQ_M,1233
14
- mech_client/helpers/acn/serialization.py,sha256=yd3bmXkXFS4umv2i-Pa77381NdKzvrNUUkb-LEiiISE,6592
11
+ mech_client/helpers/acn/dialogues.py,sha256=44IExYaKk9zxeu0L6G5grUUX62Px6Lv0Kfp8u56-uJs,4443
12
+ mech_client/helpers/acn/message.py,sha256=d918VwybycjtwplngmPV-xbSRmgSwEHYFZnpC3xZz10,10272
13
+ mech_client/helpers/acn/protocol.yaml,sha256=nA6sZ48dPR_3cmRb5BuaQbhHFA9uJkMlTnGmz9bbV_0,1233
14
+ mech_client/helpers/acn/serialization.py,sha256=3vccK7L4i8ybtgYAUO7N550_6lTBV10EsT26qmCd2lM,6592
15
15
  mech_client/helpers/acn/tests/__init__.py,sha256=rIdXnZmrjQFe_nuseQ8CIOIELdYDihx9MNQehcbenYw,847
16
16
  mech_client/helpers/acn/tests/test_acn.py,sha256=wM1SZ4iW20PFNu-491KUFyuvICDM_EkjNLZxzguqO5w,8965
17
17
  mech_client/helpers/acn/tests/test_acn_dialogues.py,sha256=HWW7KO78lYzTEwMxFzOpdRh2LUaiBtrpUsjG3jfKuU8,1964
@@ -28,8 +28,8 @@ mech_client/helpers/acn_data_share/tests/test_acn_data_share_dialogues.py,sha256
28
28
  mech_client/helpers/acn_data_share/tests/test_acn_data_share_messages.py,sha256=j5H8SRCWh8hR_q5cTPTm7Q_l4L1uiuEUcTgpWDj-fTI,2021
29
29
  mech_client/helpers/p2p_libp2p_client/README.md,sha256=6x9s6P7TdKkcvAS1wMFHXRz4aIaLZhyi0OnUgbEvpKM,631
30
30
  mech_client/helpers/p2p_libp2p_client/__init__.py,sha256=-GOP3D_JnmXTDomrMLCbnRk7vRQmihIqTYvyIPzx-q4,879
31
- mech_client/helpers/p2p_libp2p_client/connection.py,sha256=pvfHtI-NhgDbay1wLNit6m8InH4c0p00c3hQo0I2jwQ,27887
32
- mech_client/helpers/p2p_libp2p_client/connection.yaml,sha256=giYV5FwwugD7ha9IqFHJtvs-Oz1jC5og9rpkstrTqoc,1763
31
+ mech_client/helpers/p2p_libp2p_client/connection.py,sha256=b5jfcUeSoNrUw8DOSTCbK4DTi-N8bf2_pdogUOz0ep0,28606
32
+ mech_client/helpers/p2p_libp2p_client/connection.yaml,sha256=nMiHnU_dv9EFjVNqZ-0SAnoATfadJSad-JsbDvk97Mk,1790
33
33
  mech_client/interact.py,sha256=nptUovTRJl7TxLjDW3sLIVMdGQfdBfQGMrW0Vh4XgO8,20879
34
34
  mech_client/mech_tool_management.py,sha256=XWQDcFStTK66-3ZzOwKtMo5c66KDjvbeDsIXHIP4SuU,7810
35
35
  mech_client/prompt_to_ipfs.py,sha256=XqSIBko15MEkpWOQNT97fRI6jNxMF5EDBDEPOJFdhyk,2533
@@ -37,8 +37,8 @@ mech_client/push_to_ipfs.py,sha256=IfvgaPU79N_ZmCPF9d7sPCYz2uduZH0KjT_HQ2LHXoQ,2
37
37
  mech_client/subgraph.py,sha256=4vY6QFyUVs15gS0SvanJbvAxb3aie07IuxQnfMMnStc,4931
38
38
  mech_client/to_png.py,sha256=pjUcFJ63MJj_r73eqnfqCWMtlpsrj6H4ZmgvIEmRcFw,2581
39
39
  mech_client/wss.py,sha256=hRInQjjsyOrs8dmgBb2VpJvpNt6Tx0aEiY3OhOPQvIs,6600
40
- mech_client-0.2.18.dist-info/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
41
- mech_client-0.2.18.dist-info/METADATA,sha256=OrF6KRAWhC4Eyh2ImmWZy5UgAOAbCR5Qq9eyTuZ6pmE,17682
42
- mech_client-0.2.18.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
43
- mech_client-0.2.18.dist-info/entry_points.txt,sha256=SbRMRsayzD8XfNXhgwPuXEqQsdZ5Bw9XDPnUuaDExyY,45
44
- mech_client-0.2.18.dist-info/RECORD,,
40
+ mech_client-0.2.19.dist-info/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
41
+ mech_client-0.2.19.dist-info/METADATA,sha256=8jIJGTtV9RoWG59SPZw5nFGs0PkmPQLi2ULZC7DoaHc,17682
42
+ mech_client-0.2.19.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
43
+ mech_client-0.2.19.dist-info/entry_points.txt,sha256=SbRMRsayzD8XfNXhgwPuXEqQsdZ5Bw9XDPnUuaDExyY,45
44
+ mech_client-0.2.19.dist-info/RECORD,,