mech-client 0.12.1__py3-none-any.whl → 0.14.1__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 +1 -1
- mech_client/cli.py +0 -5
- mech_client/delivery.py +156 -0
- mech_client/interact.py +8 -5
- mech_client/marketplace_interact.py +130 -121
- mech_client/wss.py +25 -74
- {mech_client-0.12.1.dist-info → mech_client-0.14.1.dist-info}/METADATA +10 -10
- {mech_client-0.12.1.dist-info → mech_client-0.14.1.dist-info}/RECORD +12 -11
- scripts/whitelist.py +5 -1
- {mech_client-0.12.1.dist-info → mech_client-0.14.1.dist-info}/LICENSE +0 -0
- {mech_client-0.12.1.dist-info → mech_client-0.14.1.dist-info}/WHEEL +0 -0
- {mech_client-0.12.1.dist-info → mech_client-0.14.1.dist-info}/entry_points.txt +0 -0
mech_client/__init__.py
CHANGED
mech_client/cli.py
CHANGED
|
@@ -180,11 +180,6 @@ def interact( # pylint: disable=too-many-arguments,too-many-locals
|
|
|
180
180
|
private_key_path=key,
|
|
181
181
|
tools=tools,
|
|
182
182
|
extra_attributes=extra_attributes_dict,
|
|
183
|
-
confirmation_type=(
|
|
184
|
-
ConfirmationType(confirm)
|
|
185
|
-
if confirm is not None
|
|
186
|
-
else ConfirmationType.WAIT_FOR_BOTH
|
|
187
|
-
),
|
|
188
183
|
retries=retries,
|
|
189
184
|
timeout=timeout,
|
|
190
185
|
sleep=sleep,
|
mech_client/delivery.py
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# ------------------------------------------------------------------------------
|
|
3
|
+
#
|
|
4
|
+
# Copyright 2025 Valory AG
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
# ------------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
"""Onchain delivery helpers."""
|
|
21
|
+
|
|
22
|
+
import time
|
|
23
|
+
from typing import Any, Dict, List, Optional, Tuple
|
|
24
|
+
|
|
25
|
+
from aea_ledger_ethereum import EthereumApi
|
|
26
|
+
from eth_abi import decode
|
|
27
|
+
from web3.constants import ADDRESS_ZERO
|
|
28
|
+
from web3.contract import Contract as Web3Contract
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
WAIT_SLEEP = 3.0
|
|
32
|
+
DELIVERY_MECH_INDEX = 1
|
|
33
|
+
DEFAULT_TIMEOUT = 900.0 # 15mins
|
|
34
|
+
IPFS_URL_TEMPLATE = "https://gateway.autonolas.tech/ipfs/f01701220{}"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
async def watch_for_marketplace_data( # pylint: disable=too-many-arguments, unused-argument, too-many-locals
|
|
38
|
+
request_ids: List[str],
|
|
39
|
+
marketplace_contract: Web3Contract,
|
|
40
|
+
timeout: Optional[float] = None,
|
|
41
|
+
) -> Any:
|
|
42
|
+
"""
|
|
43
|
+
Watches for data on-chain.
|
|
44
|
+
|
|
45
|
+
:param request_ids: The IDs of the request.
|
|
46
|
+
:type request_ids: List[str]
|
|
47
|
+
:param marketplace_contract: The marketplace contract instance.
|
|
48
|
+
:type marketplace_contract: Web3Contract
|
|
49
|
+
:param timeout: Timeout to wait for the onchain data
|
|
50
|
+
:type timeout: float
|
|
51
|
+
:return: The data received from on-chain.
|
|
52
|
+
:rtype: Any
|
|
53
|
+
"""
|
|
54
|
+
request_ids_data: Dict = {}
|
|
55
|
+
start_time = time.time()
|
|
56
|
+
# either use the timeout supplied by user or the default timeout of 15mins
|
|
57
|
+
timeout = timeout or DEFAULT_TIMEOUT
|
|
58
|
+
while True:
|
|
59
|
+
for request_id in request_ids:
|
|
60
|
+
request_id_info = marketplace_contract.functions.mapRequestIdInfos(
|
|
61
|
+
bytes.fromhex(request_id)
|
|
62
|
+
).call()
|
|
63
|
+
|
|
64
|
+
# return empty data which is handled in the main method
|
|
65
|
+
if len(request_id_info) <= DELIVERY_MECH_INDEX:
|
|
66
|
+
return request_ids_data
|
|
67
|
+
|
|
68
|
+
delivery_mech = request_id_info[DELIVERY_MECH_INDEX]
|
|
69
|
+
if not isinstance(delivery_mech, str) or not delivery_mech.startswith("0x"):
|
|
70
|
+
return request_id_info
|
|
71
|
+
|
|
72
|
+
if delivery_mech != ADDRESS_ZERO:
|
|
73
|
+
request_ids_data.update({request_id: delivery_mech})
|
|
74
|
+
|
|
75
|
+
time.sleep(WAIT_SLEEP)
|
|
76
|
+
|
|
77
|
+
elapsed_time = time.time() - start_time
|
|
78
|
+
if elapsed_time >= timeout:
|
|
79
|
+
print("Timeout reached. Breaking the loop and returning empty data.")
|
|
80
|
+
return request_ids_data
|
|
81
|
+
|
|
82
|
+
if len(request_ids_data) == len(request_ids):
|
|
83
|
+
return request_ids_data
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
async def watch_for_mech_data_url( # pylint: disable=too-many-arguments, unused-argument, too-many-locals
|
|
87
|
+
request_ids: List[str],
|
|
88
|
+
from_block: int,
|
|
89
|
+
mech_contract_address: str,
|
|
90
|
+
mech_deliver_signature: str,
|
|
91
|
+
ledger_api: EthereumApi,
|
|
92
|
+
timeout: Optional[float] = None,
|
|
93
|
+
) -> Any:
|
|
94
|
+
"""
|
|
95
|
+
Watches for data on-chain.
|
|
96
|
+
|
|
97
|
+
:param request_ids: The IDs of the request.
|
|
98
|
+
:type request_ids: List[str]
|
|
99
|
+
:param from_block: The from block to start searching logs.
|
|
100
|
+
:type from_block: int
|
|
101
|
+
:param mech_contract_address: The mech contract instance.
|
|
102
|
+
:type mech_contract_address: str
|
|
103
|
+
:param mech_deliver_signature: Topic signature for Deliver event
|
|
104
|
+
:type mech_deliver_signature: str
|
|
105
|
+
:param ledger_api: The Ethereum API used for interacting with the ledger.
|
|
106
|
+
:type ledger_api: EthereumApi
|
|
107
|
+
:param timeout: Timeout to wait for the onchain data
|
|
108
|
+
:type timeout: float
|
|
109
|
+
:return: The data received from on-chain.
|
|
110
|
+
:rtype: Any
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
results = {}
|
|
114
|
+
start_time = time.time()
|
|
115
|
+
# either use the timeout supplied by user or the default timeout of 15mins
|
|
116
|
+
timeout = timeout or DEFAULT_TIMEOUT
|
|
117
|
+
|
|
118
|
+
def get_logs(from_block_: int) -> List:
|
|
119
|
+
logs = ledger_api.api.eth.get_logs(
|
|
120
|
+
{
|
|
121
|
+
"fromBlock": from_block_,
|
|
122
|
+
"toBlock": "latest",
|
|
123
|
+
"address": mech_contract_address,
|
|
124
|
+
"topics": ["0x" + mech_deliver_signature],
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
return logs
|
|
128
|
+
|
|
129
|
+
def get_event_data(log: Dict) -> Tuple:
|
|
130
|
+
data_types = ["bytes32", "uint256", "bytes"]
|
|
131
|
+
data_bytes = bytes(log["data"])
|
|
132
|
+
request_id_bytes, _, delivery_data_bytes = decode(data_types, data_bytes)
|
|
133
|
+
return request_id_bytes, delivery_data_bytes
|
|
134
|
+
|
|
135
|
+
while True:
|
|
136
|
+
logs = get_logs(from_block)
|
|
137
|
+
latest_block = from_block
|
|
138
|
+
for log in logs:
|
|
139
|
+
latest_block = max(latest_block, log["blockNumber"])
|
|
140
|
+
event_data = get_event_data(log)
|
|
141
|
+
request_id, delivery_data = (data.hex() for data in event_data)
|
|
142
|
+
if request_id in results:
|
|
143
|
+
continue
|
|
144
|
+
|
|
145
|
+
if request_id in request_ids:
|
|
146
|
+
results[request_id] = IPFS_URL_TEMPLATE.format(delivery_data)
|
|
147
|
+
|
|
148
|
+
if len(results) == len(request_ids):
|
|
149
|
+
return results
|
|
150
|
+
|
|
151
|
+
from_block = latest_block + 1
|
|
152
|
+
time.sleep(WAIT_SLEEP)
|
|
153
|
+
elapsed_time = time.time() - start_time
|
|
154
|
+
if elapsed_time >= timeout:
|
|
155
|
+
print("Timeout reached. Breaking the loop and returning empty data.")
|
|
156
|
+
return results
|
mech_client/interact.py
CHANGED
|
@@ -200,7 +200,7 @@ def calculate_topic_id(event: Dict) -> str:
|
|
|
200
200
|
return Web3.keccak(text=text).hex()
|
|
201
201
|
|
|
202
202
|
|
|
203
|
-
def
|
|
203
|
+
def get_mech_event_signatures(abi: List) -> Tuple[str, str]:
|
|
204
204
|
"""Calculate `Request` and `Deliver` event topics"""
|
|
205
205
|
request, deliver = "", ""
|
|
206
206
|
for obj in abi:
|
|
@@ -576,13 +576,16 @@ def interact( # pylint: disable=too-many-arguments,too-many-locals
|
|
|
576
576
|
mech_contract = get_contract(
|
|
577
577
|
contract_address=contract_address, abi=abi, ledger_api=ledger_api
|
|
578
578
|
)
|
|
579
|
-
request_event_signature, deliver_event_signature =
|
|
579
|
+
request_event_signature, deliver_event_signature = get_mech_event_signatures(
|
|
580
|
+
abi=abi
|
|
581
|
+
)
|
|
580
582
|
register_event_handlers(
|
|
581
583
|
wss=wss,
|
|
582
|
-
|
|
584
|
+
mech_contract_address=contract_address,
|
|
585
|
+
marketplace_contract_address=contract_address,
|
|
583
586
|
crypto=crypto,
|
|
584
|
-
|
|
585
|
-
|
|
587
|
+
mech_request_signature=request_event_signature,
|
|
588
|
+
marketplace_deliver_signature=deliver_event_signature,
|
|
586
589
|
)
|
|
587
590
|
print("Sending Mech request...")
|
|
588
591
|
price = mech_config.price or 10_000_000_000_000_000
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
# ------------------------------------------------------------------------------
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2024 Valory AG
|
|
4
|
+
# Copyright 2024-2025 Valory AG
|
|
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.
|
|
@@ -24,40 +24,35 @@ import asyncio
|
|
|
24
24
|
import json
|
|
25
25
|
import sys
|
|
26
26
|
import time
|
|
27
|
+
from collections import defaultdict
|
|
27
28
|
from dataclasses import asdict, make_dataclass
|
|
28
29
|
from datetime import datetime
|
|
29
30
|
from enum import Enum
|
|
30
31
|
from pathlib import Path
|
|
31
|
-
from typing import Any, Dict, Optional, Tuple, cast
|
|
32
|
+
from typing import Any, Dict, List, Optional, Tuple, cast
|
|
32
33
|
|
|
33
34
|
import requests
|
|
34
|
-
import websocket
|
|
35
35
|
from aea.crypto.base import Crypto
|
|
36
36
|
from aea_ledger_ethereum import EthereumApi, EthereumCrypto
|
|
37
37
|
from eth_utils import to_checksum_address
|
|
38
|
+
from web3._utils.events import event_abi_to_log_topic
|
|
38
39
|
from web3.constants import ADDRESS_ZERO
|
|
39
40
|
from web3.contract import Contract as Web3Contract
|
|
40
41
|
|
|
42
|
+
from mech_client.delivery import watch_for_marketplace_data, watch_for_mech_data_url
|
|
41
43
|
from mech_client.fetch_ipfs_hash import fetch_ipfs_hash
|
|
42
44
|
from mech_client.interact import (
|
|
43
|
-
ConfirmationType,
|
|
44
45
|
MAX_RETRIES,
|
|
45
46
|
MechMarketplaceRequestConfig,
|
|
46
47
|
PRIVATE_KEY_FILE_PATH,
|
|
47
48
|
TIMEOUT,
|
|
48
49
|
WAIT_SLEEP,
|
|
49
50
|
get_contract,
|
|
50
|
-
get_event_signatures,
|
|
51
51
|
get_mech_config,
|
|
52
52
|
)
|
|
53
53
|
from mech_client.mech_marketplace_tool_management import get_mech_tools
|
|
54
54
|
from mech_client.prompt_to_ipfs import push_metadata_to_ipfs
|
|
55
|
-
from mech_client.wss import
|
|
56
|
-
register_event_handlers,
|
|
57
|
-
wait_for_receipt,
|
|
58
|
-
watch_for_marketplace_data_url_from_wss,
|
|
59
|
-
watch_for_marketplace_request_ids,
|
|
60
|
-
)
|
|
55
|
+
from mech_client.wss import wait_for_receipt, watch_for_marketplace_request_ids
|
|
61
56
|
|
|
62
57
|
|
|
63
58
|
# false positives for [B105:hardcoded_password_string] Possible hardcoded password
|
|
@@ -122,11 +117,36 @@ CHAIN_TO_DEFAULT_MECH_MARKETPLACE_REQUEST_CONFIG = {
|
|
|
122
117
|
}
|
|
123
118
|
|
|
124
119
|
|
|
120
|
+
def fetch_mech_deliver_event_signature(
|
|
121
|
+
ledger_api: EthereumApi,
|
|
122
|
+
priority_mech_address: str,
|
|
123
|
+
) -> str:
|
|
124
|
+
"""
|
|
125
|
+
Fetchs the mech's deliver event signature.
|
|
126
|
+
|
|
127
|
+
:param ledger_api: The Ethereum API used for interacting with the ledger.
|
|
128
|
+
:type ledger_api: EthereumApi
|
|
129
|
+
:param priority_mech_address: Requested mech address
|
|
130
|
+
:type priority_mech_address: str
|
|
131
|
+
:return: The event signature.
|
|
132
|
+
:rtype: str
|
|
133
|
+
"""
|
|
134
|
+
with open(IMECH_ABI_PATH, encoding="utf-8") as f:
|
|
135
|
+
abi = json.load(f)
|
|
136
|
+
|
|
137
|
+
mech_contract = get_contract(
|
|
138
|
+
contract_address=priority_mech_address, abi=abi, ledger_api=ledger_api
|
|
139
|
+
)
|
|
140
|
+
deliver_event_abi = mech_contract.events.Deliver().abi
|
|
141
|
+
mech_deliver_event_signature = event_abi_to_log_topic(deliver_event_abi)
|
|
142
|
+
return mech_deliver_event_signature.hex()
|
|
143
|
+
|
|
144
|
+
|
|
125
145
|
def fetch_mech_info(
|
|
126
146
|
ledger_api: EthereumApi,
|
|
127
147
|
mech_marketplace_contract: Web3Contract,
|
|
128
148
|
priority_mech_address: str,
|
|
129
|
-
) -> Tuple[str, int, int, str
|
|
149
|
+
) -> Tuple[str, int, int, str]:
|
|
130
150
|
"""
|
|
131
151
|
Fetchs the info of the requested mech.
|
|
132
152
|
|
|
@@ -136,8 +156,8 @@ def fetch_mech_info(
|
|
|
136
156
|
:type mech_marketplace_contract: Web3Contract
|
|
137
157
|
:param priority_mech_address: Requested mech address
|
|
138
158
|
:type priority_mech_address: str
|
|
139
|
-
:return: The mech info containing payment_type, service_id, max_delivery_rate
|
|
140
|
-
:rtype: Tuple[str, int, int, str
|
|
159
|
+
:return: The mech info containing payment_type, service_id, max_delivery_rate and mech_payment_balance_tracker.
|
|
160
|
+
:rtype: Tuple[str, int, int, str]
|
|
141
161
|
"""
|
|
142
162
|
|
|
143
163
|
with open(IMECH_ABI_PATH, encoding="utf-8") as f:
|
|
@@ -166,7 +186,6 @@ def fetch_mech_info(
|
|
|
166
186
|
service_id,
|
|
167
187
|
max_delivery_rate,
|
|
168
188
|
mech_payment_balance_tracker,
|
|
169
|
-
mech_contract,
|
|
170
189
|
)
|
|
171
190
|
|
|
172
191
|
|
|
@@ -495,80 +514,80 @@ def send_offchain_marketplace_request( # pylint: disable=too-many-arguments,too
|
|
|
495
514
|
|
|
496
515
|
|
|
497
516
|
def wait_for_marketplace_data_url( # pylint: disable=too-many-arguments, unused-argument
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
subgraph_url: str,
|
|
517
|
+
request_ids: List[str],
|
|
518
|
+
from_block: int,
|
|
519
|
+
marketplace_contract: Web3Contract,
|
|
502
520
|
deliver_signature: str,
|
|
503
521
|
ledger_api: EthereumApi,
|
|
504
|
-
|
|
505
|
-
confirmation_type: ConfirmationType = ConfirmationType.WAIT_FOR_BOTH,
|
|
522
|
+
timeout: Optional[float] = None,
|
|
506
523
|
) -> Any:
|
|
507
524
|
"""
|
|
508
525
|
Wait for data from on-chain/off-chain.
|
|
509
526
|
|
|
510
|
-
:param
|
|
511
|
-
:type
|
|
512
|
-
:param
|
|
513
|
-
:type
|
|
514
|
-
:param
|
|
515
|
-
:type
|
|
516
|
-
:param
|
|
517
|
-
:type subgraph_url: str
|
|
518
|
-
:param deliver_signature: Topic signature for MarketplaceDeliver event
|
|
527
|
+
:param request_ids: The IDs of the request.
|
|
528
|
+
:type request_ids: List[str]
|
|
529
|
+
:param from_block: The from block to start searching logs.
|
|
530
|
+
:type from_block: int
|
|
531
|
+
:param marketplace_contract: The mech contract instance.
|
|
532
|
+
:type marketplace_contract: Web3Contract
|
|
533
|
+
:param deliver_signature: Topic signature for Deliver event
|
|
519
534
|
:type deliver_signature: str
|
|
520
535
|
:param ledger_api: The Ethereum API used for interacting with the ledger.
|
|
521
536
|
:type ledger_api: EthereumApi
|
|
522
|
-
:param
|
|
523
|
-
:type
|
|
524
|
-
:
|
|
525
|
-
:type confirmation_type: ConfirmationType
|
|
526
|
-
:return: The data received from on-chain/off-chain.
|
|
537
|
+
:param timeout: Timeout to wait for the onchain data
|
|
538
|
+
:type timeout: float
|
|
539
|
+
:return: The data received from on-chain.
|
|
527
540
|
:rtype: Any
|
|
528
541
|
"""
|
|
529
542
|
loop = asyncio.new_event_loop()
|
|
530
543
|
asyncio.set_event_loop(loop)
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
544
|
+
|
|
545
|
+
async def _wait_for_marketplace_delivery_event() -> Any: # type: ignore
|
|
546
|
+
data = await watch_for_marketplace_data(
|
|
547
|
+
request_ids=request_ids,
|
|
548
|
+
marketplace_contract=marketplace_contract,
|
|
549
|
+
timeout=timeout,
|
|
550
|
+
)
|
|
551
|
+
return data
|
|
552
|
+
|
|
553
|
+
async def _wait_for_mech_data(future) -> Any: # type: ignore
|
|
554
|
+
marketplace_data_result = await future
|
|
555
|
+
requests_by_delivery_mech = defaultdict(list)
|
|
556
|
+
results: Dict = {}
|
|
557
|
+
|
|
558
|
+
# return with empty data is result is unexpected
|
|
559
|
+
if len(marketplace_data_result) == 0:
|
|
560
|
+
return results
|
|
561
|
+
|
|
562
|
+
for request_id, delivery_mech in marketplace_data_result.items():
|
|
563
|
+
requests_by_delivery_mech[delivery_mech].append(request_id)
|
|
564
|
+
|
|
565
|
+
for delivery_mech, request_ids in requests_by_delivery_mech.items():
|
|
566
|
+
data = await watch_for_mech_data_url(
|
|
567
|
+
request_ids=request_ids,
|
|
568
|
+
from_block=from_block,
|
|
569
|
+
mech_contract_address=delivery_mech,
|
|
570
|
+
mech_deliver_signature=deliver_signature,
|
|
549
571
|
ledger_api=ledger_api,
|
|
550
|
-
|
|
572
|
+
timeout=timeout,
|
|
551
573
|
)
|
|
552
|
-
|
|
553
|
-
tasks.append(on_chain_task)
|
|
574
|
+
results.update(data)
|
|
554
575
|
|
|
555
|
-
|
|
556
|
-
print("Subgraph to be implemented")
|
|
576
|
+
return results
|
|
557
577
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
578
|
+
marketplace_delivery_event_future = loop.create_task(
|
|
579
|
+
_wait_for_marketplace_delivery_event()
|
|
580
|
+
)
|
|
581
|
+
mech_data_future = loop.create_task(
|
|
582
|
+
_wait_for_mech_data(marketplace_delivery_event_future)
|
|
583
|
+
)
|
|
584
|
+
|
|
585
|
+
loop.run_until_complete(
|
|
586
|
+
asyncio.gather(marketplace_delivery_event_future, mech_data_future)
|
|
587
|
+
)
|
|
588
|
+
loop.close()
|
|
569
589
|
|
|
570
|
-
|
|
571
|
-
return result
|
|
590
|
+
return mech_data_future.result()
|
|
572
591
|
|
|
573
592
|
|
|
574
593
|
def wait_for_offchain_marketplace_data(mech_offchain_url: str, request_id: str) -> Any:
|
|
@@ -679,7 +698,6 @@ def marketplace_interact( # pylint: disable=too-many-arguments, too-many-locals
|
|
|
679
698
|
tools: tuple = (),
|
|
680
699
|
extra_attributes: Optional[Dict[str, Any]] = None,
|
|
681
700
|
private_key_path: Optional[str] = None,
|
|
682
|
-
confirmation_type: ConfirmationType = ConfirmationType.WAIT_FOR_BOTH,
|
|
683
701
|
retries: Optional[int] = None,
|
|
684
702
|
timeout: Optional[float] = None,
|
|
685
703
|
sleep: Optional[float] = None,
|
|
@@ -704,8 +722,6 @@ def marketplace_interact( # pylint: disable=too-many-arguments, too-many-locals
|
|
|
704
722
|
:type extra_attributes: Optional[Dict[str, Any]]
|
|
705
723
|
:param private_key_path: The path to the private key file (optional).
|
|
706
724
|
:type private_key_path: Optional[str]
|
|
707
|
-
:param confirmation_type: The confirmation type for the interaction (default: ConfirmationType.WAIT_FOR_BOTH).
|
|
708
|
-
:type confirmation_type: ConfirmationType
|
|
709
725
|
:return: The data received from on-chain/off-chain.
|
|
710
726
|
:param retries: Number of retries for sending a transaction
|
|
711
727
|
:type retries: int
|
|
@@ -745,7 +761,7 @@ def marketplace_interact( # pylint: disable=too-many-arguments, too-many-locals
|
|
|
745
761
|
((k, type(v)) for k, v in config_values.items()),
|
|
746
762
|
)(**config_values)
|
|
747
763
|
|
|
748
|
-
|
|
764
|
+
marketplace_contract_address = cast(
|
|
749
765
|
str, mech_marketplace_request_config.mech_marketplace_contract
|
|
750
766
|
)
|
|
751
767
|
|
|
@@ -755,7 +771,6 @@ def marketplace_interact( # pylint: disable=too-many-arguments, too-many-locals
|
|
|
755
771
|
f"Private key file `{private_key_path}` does not exist!"
|
|
756
772
|
)
|
|
757
773
|
|
|
758
|
-
wss = websocket.create_connection(mech_config.wss_endpoint)
|
|
759
774
|
crypto = EthereumCrypto(private_key_path=private_key_path)
|
|
760
775
|
ledger_api = EthereumApi(**asdict(ledger_config))
|
|
761
776
|
|
|
@@ -763,7 +778,7 @@ def marketplace_interact( # pylint: disable=too-many-arguments, too-many-locals
|
|
|
763
778
|
abi = json.load(f)
|
|
764
779
|
|
|
765
780
|
mech_marketplace_contract = get_contract(
|
|
766
|
-
contract_address=
|
|
781
|
+
contract_address=marketplace_contract_address, abi=abi, ledger_api=ledger_api
|
|
767
782
|
)
|
|
768
783
|
|
|
769
784
|
print("Fetching Mech Info...")
|
|
@@ -775,7 +790,6 @@ def marketplace_interact( # pylint: disable=too-many-arguments, too-many-locals
|
|
|
775
790
|
service_id,
|
|
776
791
|
max_delivery_rate,
|
|
777
792
|
mech_payment_balance_tracker,
|
|
778
|
-
mech_contract,
|
|
779
793
|
) = fetch_mech_info(
|
|
780
794
|
ledger_api,
|
|
781
795
|
mech_marketplace_contract,
|
|
@@ -784,23 +798,12 @@ def marketplace_interact( # pylint: disable=too-many-arguments, too-many-locals
|
|
|
784
798
|
mech_marketplace_request_config.delivery_rate = max_delivery_rate
|
|
785
799
|
mech_marketplace_request_config.payment_type = payment_type
|
|
786
800
|
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
with open(IMECH_ABI_PATH, encoding="utf-8") as f:
|
|
790
|
-
abi = json.load(f)
|
|
791
|
-
|
|
792
|
-
(
|
|
793
|
-
marketplace_request_event_signature,
|
|
794
|
-
marketplace_deliver_event_signature,
|
|
795
|
-
) = get_event_signatures(abi=abi)
|
|
796
|
-
register_event_handlers(
|
|
797
|
-
wss=wss,
|
|
798
|
-
contract_address=priority_mech_address,
|
|
799
|
-
crypto=crypto,
|
|
800
|
-
request_signature=marketplace_request_event_signature,
|
|
801
|
-
deliver_signature=marketplace_deliver_event_signature,
|
|
801
|
+
mech_deliver_event_signature = fetch_mech_deliver_event_signature(
|
|
802
|
+
ledger_api, priority_mech_address
|
|
802
803
|
)
|
|
803
804
|
|
|
805
|
+
verify_tools(tools, service_id, chain_config)
|
|
806
|
+
|
|
804
807
|
if not use_prepaid:
|
|
805
808
|
price = max_delivery_rate * num_requests
|
|
806
809
|
if payment_type == PaymentType.TOKEN.value:
|
|
@@ -860,6 +863,12 @@ def marketplace_interact( # pylint: disable=too-many-arguments, too-many-locals
|
|
|
860
863
|
# set price 0 to not send any msg.value in request transaction for nvm type mech
|
|
861
864
|
price = 0
|
|
862
865
|
|
|
866
|
+
# from block to be used to search for onchain events
|
|
867
|
+
# and is selected before the request is sent
|
|
868
|
+
# so searching for deliver events in the logs will not be missed
|
|
869
|
+
w3 = ledger_api.api.eth
|
|
870
|
+
latest_block = w3.block_number
|
|
871
|
+
|
|
863
872
|
if not use_offchain:
|
|
864
873
|
print("Sending Mech Marketplace request...")
|
|
865
874
|
transaction_digest = send_marketplace_request(
|
|
@@ -904,36 +913,36 @@ def marketplace_interact( # pylint: disable=too-many-arguments, too-many-locals
|
|
|
904
913
|
)
|
|
905
914
|
print("")
|
|
906
915
|
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
916
|
+
data_urls = wait_for_marketplace_data_url(
|
|
917
|
+
request_ids=request_ids,
|
|
918
|
+
from_block=latest_block,
|
|
919
|
+
marketplace_contract=mech_marketplace_contract,
|
|
920
|
+
deliver_signature=mech_deliver_event_signature,
|
|
921
|
+
ledger_api=ledger_api,
|
|
922
|
+
timeout=timeout,
|
|
923
|
+
)
|
|
924
|
+
|
|
925
|
+
if not data_urls:
|
|
926
|
+
print("Cannot find any data urls for the request(s)")
|
|
927
|
+
return None
|
|
928
|
+
|
|
929
|
+
if is_nvm_mech:
|
|
930
|
+
requester_total_balance_after = fetch_requester_nvm_subscription_balance(
|
|
931
|
+
requester,
|
|
932
|
+
ledger_api,
|
|
933
|
+
mech_payment_balance_tracker,
|
|
934
|
+
payment_type,
|
|
935
|
+
)
|
|
936
|
+
print(
|
|
937
|
+
f" - Sender Subscription balance after delivery: {requester_total_balance_after}"
|
|
917
938
|
)
|
|
918
939
|
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
mech_payment_balance_tracker,
|
|
926
|
-
payment_type,
|
|
927
|
-
)
|
|
928
|
-
)
|
|
929
|
-
print(
|
|
930
|
-
f" - Sender Subscription balance after delivery: {requester_total_balance_after}"
|
|
931
|
-
)
|
|
932
|
-
|
|
933
|
-
print(f" - Data arrived: {data_url}")
|
|
934
|
-
data = requests.get(f"{data_url}/{request_id_int}", timeout=30).json()
|
|
935
|
-
print(" - Data from agent:")
|
|
936
|
-
print(json.dumps(data, indent=2))
|
|
940
|
+
for request_id, data_url in data_urls.items():
|
|
941
|
+
request_id_int = int.from_bytes(bytes.fromhex(request_id), byteorder="big")
|
|
942
|
+
print(f" - Data arrived: {data_url}")
|
|
943
|
+
data = requests.get(f"{data_url}/{request_id_int}", timeout=30).json()
|
|
944
|
+
print(" - Data from agent:")
|
|
945
|
+
print(json.dumps(data, indent=2))
|
|
937
946
|
return None
|
|
938
947
|
|
|
939
948
|
print("Sending Offchain Mech Marketplace request...")
|
mech_client/wss.py
CHANGED
|
@@ -31,26 +31,32 @@ from aea_ledger_ethereum import EthereumApi
|
|
|
31
31
|
from web3.contract import Contract as Web3Contract
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
IPFS_URL_TEMPLATE = "https://gateway.autonolas.tech/ipfs/f01701220{}"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def register_event_handlers( # pylint: disable=too-many-arguments
|
|
35
38
|
wss: websocket.WebSocket,
|
|
36
|
-
|
|
39
|
+
mech_contract_address: str,
|
|
40
|
+
marketplace_contract_address: str,
|
|
37
41
|
crypto: Crypto,
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
mech_request_signature: str,
|
|
43
|
+
marketplace_deliver_signature: str,
|
|
40
44
|
) -> None:
|
|
41
45
|
"""
|
|
42
46
|
Register event handlers.
|
|
43
47
|
|
|
44
48
|
:param wss: The WebSocket connection object.
|
|
45
49
|
:type wss: websocket.WebSocket
|
|
46
|
-
:param
|
|
47
|
-
:type
|
|
50
|
+
:param mech_contract_address: The address of the mech contract.
|
|
51
|
+
:type mech_contract_address: str
|
|
52
|
+
:param marketplace_contract_address: The address of the marketplace contract.
|
|
53
|
+
:type marketplace_contract_address: str
|
|
48
54
|
:param crypto: The cryptographic object.
|
|
49
55
|
:type crypto: Crypto
|
|
50
|
-
:param
|
|
51
|
-
:type
|
|
52
|
-
:param
|
|
53
|
-
:type
|
|
56
|
+
:param mech_request_signature: Topic signature for Request event
|
|
57
|
+
:type mech_request_signature: str
|
|
58
|
+
:param marketplace_deliver_signature: Topic signature for MarketplaceDelivery event
|
|
59
|
+
:type marketplace_deliver_signature: str
|
|
54
60
|
"""
|
|
55
61
|
|
|
56
62
|
subscription_request = {
|
|
@@ -60,9 +66,9 @@ def register_event_handlers(
|
|
|
60
66
|
"params": [
|
|
61
67
|
"logs",
|
|
62
68
|
{
|
|
63
|
-
"address":
|
|
69
|
+
"address": mech_contract_address,
|
|
64
70
|
"topics": [
|
|
65
|
-
|
|
71
|
+
mech_request_signature,
|
|
66
72
|
["0x" + "0" * 24 + crypto.address[2:]],
|
|
67
73
|
],
|
|
68
74
|
},
|
|
@@ -73,16 +79,20 @@ def register_event_handlers(
|
|
|
73
79
|
|
|
74
80
|
# registration confirmation
|
|
75
81
|
_ = wss.recv()
|
|
76
|
-
|
|
82
|
+
|
|
83
|
+
marketplace_subscription_deliver = {
|
|
77
84
|
"jsonrpc": "2.0",
|
|
78
85
|
"id": 1,
|
|
79
86
|
"method": "eth_subscribe",
|
|
80
87
|
"params": [
|
|
81
88
|
"logs",
|
|
82
|
-
{
|
|
89
|
+
{
|
|
90
|
+
"address": marketplace_contract_address,
|
|
91
|
+
"topics": [marketplace_deliver_signature],
|
|
92
|
+
},
|
|
83
93
|
],
|
|
84
94
|
}
|
|
85
|
-
content = bytes(json.dumps(
|
|
95
|
+
content = bytes(json.dumps(marketplace_subscription_deliver), "utf-8")
|
|
86
96
|
wss.send(content)
|
|
87
97
|
|
|
88
98
|
# registration confirmation
|
|
@@ -224,62 +234,3 @@ async def watch_for_data_url_from_wss( # pylint: disable=too-many-arguments
|
|
|
224
234
|
"Error: The WSS connection was likely closed by the remote party. Please, try using another WSS provider."
|
|
225
235
|
)
|
|
226
236
|
return None
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
async def watch_for_marketplace_data_url_from_wss( # pylint: disable=too-many-arguments, unused-argument
|
|
230
|
-
request_id: str,
|
|
231
|
-
wss: websocket.WebSocket,
|
|
232
|
-
mech_contract: Web3Contract,
|
|
233
|
-
deliver_signature: str,
|
|
234
|
-
ledger_api: EthereumApi,
|
|
235
|
-
loop: asyncio.AbstractEventLoop,
|
|
236
|
-
) -> Any:
|
|
237
|
-
"""
|
|
238
|
-
Watches for data on-chain.
|
|
239
|
-
|
|
240
|
-
:param request_id: The ID of the request.
|
|
241
|
-
:type request_id: str
|
|
242
|
-
:param wss: The WebSocket connection object.
|
|
243
|
-
:type wss: websocket.WebSocket
|
|
244
|
-
:param mech_contract: The mech contract instance.
|
|
245
|
-
:type mech_contract: Web3Contract
|
|
246
|
-
:param deliver_signature: Topic signature for Deliver event
|
|
247
|
-
:type deliver_signature: str
|
|
248
|
-
:param ledger_api: The Ethereum API used for interacting with the ledger.
|
|
249
|
-
:type ledger_api: EthereumApi
|
|
250
|
-
:param loop: The event loop used for asynchronous operations.
|
|
251
|
-
:type loop: asyncio.AbstractEventLoop
|
|
252
|
-
:return: The data received from on-chain.
|
|
253
|
-
:rtype: Any
|
|
254
|
-
"""
|
|
255
|
-
with ThreadPoolExecutor() as executor:
|
|
256
|
-
try:
|
|
257
|
-
while True:
|
|
258
|
-
msg = await loop.run_in_executor(executor=executor, func=wss.recv)
|
|
259
|
-
data = json.loads(msg)
|
|
260
|
-
tx_hash = data["params"]["result"]["transactionHash"]
|
|
261
|
-
tx_receipt = await loop.run_in_executor(
|
|
262
|
-
executor, wait_for_receipt, tx_hash, ledger_api
|
|
263
|
-
)
|
|
264
|
-
|
|
265
|
-
rich_logs = mech_contract.events.Deliver().process_receipt(tx_receipt)
|
|
266
|
-
if len(rich_logs) == 0:
|
|
267
|
-
print("Empty logs")
|
|
268
|
-
return None
|
|
269
|
-
|
|
270
|
-
data = rich_logs[0]["args"]
|
|
271
|
-
tx_request_id = data["requestId"]
|
|
272
|
-
deliver_data = data["data"]
|
|
273
|
-
|
|
274
|
-
if request_id != tx_request_id.hex():
|
|
275
|
-
continue
|
|
276
|
-
|
|
277
|
-
return (
|
|
278
|
-
f"https://gateway.autonolas.tech/ipfs/f01701220{deliver_data.hex()}"
|
|
279
|
-
)
|
|
280
|
-
except websocket.WebSocketConnectionClosedException as e:
|
|
281
|
-
print(f"WebSocketConnectionClosedException {repr(e)}")
|
|
282
|
-
print(
|
|
283
|
-
"Error: The WSS connection was likely closed by the remote party. Please, try using another WSS provider."
|
|
284
|
-
)
|
|
285
|
-
return None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mech-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.1
|
|
4
4
|
Summary: Basic client to interact with a mech
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Author: David Minarsch
|
|
@@ -34,7 +34,7 @@ A basic client to interact with an AI Mech. [AI Mechs](https://github.com/valory
|
|
|
34
34
|
|
|
35
35
|
## Developing, running and deploying Mechs and Mech tools
|
|
36
36
|
|
|
37
|
-
The easiest way to create, run, deploy and test your own Mech and Mech tools is to follow the Mech and Mech tool docs [here](https://open-autonomy
|
|
37
|
+
The easiest way to create, run, deploy and test your own Mech and Mech tools is to follow the Mech and Mech tool docs [here](https://stack.olas.network/open-autonomy/mech-tools-dev/). The [Mech tools dev repo](https://github.com/valory-xyz/mech-tools-dev) used in those docs greatly simplifies the development flow and dev experience.
|
|
38
38
|
|
|
39
39
|
Only continue reading this README if you know what you are doing and you are specifically interested in this repo.
|
|
40
40
|
|
|
@@ -152,7 +152,7 @@ The basic usage of the Mech Client is as follows:
|
|
|
152
152
|
mechx interact --prompts <prompt> --tools <tool> --agent_id <agent_id>
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
-
where agent with `<agent_id>` will process `<prompt>` with the `<tool>` and default options. Each chain has its own set of Mech agents. You can find the agent IDs for each chain on the [Mech Hub](https://aimechs.autonolas.network/registry) or on the [Mech repository](https://github.com/valory-xyz/mech?tab=readme-ov-file#examples-of-deployed-mechs).
|
|
155
|
+
where agent blueprint with `<agent_id>` will process `<prompt>` with the `<tool>` and default options. Each chain has its own set of Mech agents. You can find the agent blueprint IDs for each chain on the [Mech Hub](https://aimechs.autonolas.network/registry) or on the [Mech repository](https://github.com/valory-xyz/mech?tab=readme-ov-file#examples-of-deployed-mechs).
|
|
156
156
|
|
|
157
157
|
⚠️ Batch requests and tools are not supported for legacy mechs
|
|
158
158
|
|
|
@@ -249,7 +249,7 @@ export MECHX_MECH_OFFCHAIN_URL="http://localhost:8000/"
|
|
|
249
249
|
```
|
|
250
250
|
If you want to use a Valory mech for offchain requests, below is the list of mechs and their address and offchain urls.
|
|
251
251
|
|
|
252
|
-
|
|
|
252
|
+
| AI agent ID | Priority Mech Address | Offchain URL |
|
|
253
253
|
| :---: | :---: | :---: |
|
|
254
254
|
| 2182 | 0xB3C6319962484602b00d5587e965946890b82101 | https://d19715222af5b940.agent.propel.autonolas.tech/ |
|
|
255
255
|
|
|
@@ -274,7 +274,7 @@ mechx fetch-mm-mechs-info --chain-config gnosis
|
|
|
274
274
|
```
|
|
275
275
|
```bash
|
|
276
276
|
+--------------+--------------------+--------------------------------------------+--------------------+---------------------------------------------------------------------------------------------------------------+
|
|
277
|
-
|
|
|
277
|
+
| AI agent Id | Mech Type | Mech Address | Total Deliveries | Metadata Link |
|
|
278
278
|
+==============+====================+============================================+====================+===============================================================================================================+
|
|
279
279
|
| 2182 | Fixed Price Native | 0xc05e7412439bd7e91730a6880e18d5d5873f632c | 41246 | https://gateway.autonolas.tech/ipfs/f01701220157d3b106831e2713b86af1b52af76a3ef28c52ae0853e9638180902ebee41d4 |
|
|
280
280
|
+--------------+--------------------+--------------------------------------------+--------------------+---------------------------------------------------------------------------------------------------------------+
|
|
@@ -291,7 +291,7 @@ mechx fetch-mm-mechs-info --chain-config gnosis
|
|
|
291
291
|
### List tools available for legacy mechs and marketplace mechs
|
|
292
292
|
|
|
293
293
|
#### For legacy mechs
|
|
294
|
-
To list the tools available for a specific agent or for all agents, use the `tools-for-agents` command. You can specify an agent ID to get tools for a specific agent, or omit it to list tools for all agents.
|
|
294
|
+
To list the tools available for a specific agent or for all agents, use the `tools-for-agents` command. You can specify an agent blueprint ID to get tools for a specific agent, or omit it to list tools for all agents.
|
|
295
295
|
|
|
296
296
|
```bash
|
|
297
297
|
mechx tools-for-agents
|
|
@@ -332,7 +332,7 @@ You will see an output like this:
|
|
|
332
332
|
```
|
|
333
333
|
|
|
334
334
|
#### For marketplace mechs
|
|
335
|
-
To list the tools available for a specific marketplace mech, use the `tools-for-marketplace-mech` command. You can specify
|
|
335
|
+
To list the tools available for a specific marketplace mech, use the `tools-for-marketplace-mech` command. You can specify an AI agent ID to get tools for a specific mech.
|
|
336
336
|
|
|
337
337
|
```bash
|
|
338
338
|
mechx tools-for-marketplace-mech 1722 --chain-config gnosis
|
|
@@ -547,7 +547,7 @@ You can also use the Mech Client to programmatically fetch tools for agents in y
|
|
|
547
547
|
from mech_client.mech_tool_management import get_tools_for_agents, get_tool_description, get_tool_io_schema
|
|
548
548
|
|
|
549
549
|
# Fetching tools for a specific agent or all agents
|
|
550
|
-
agent_id = 6 # Specify the agent ID or set to None to fetch tools for all agents
|
|
550
|
+
agent_id = 6 # Specify the agent blueprint ID or set to None to fetch tools for all agents
|
|
551
551
|
chain_config = "gnosis" # Specify the chain configuration
|
|
552
552
|
tools = get_tools_for_agents(agent_id=agent_id, chain_config=chain_config)
|
|
553
553
|
print(f"Tools for agent {agent_id}:", tools)
|
|
@@ -613,9 +613,9 @@ No. AI Mechs are currently deployed only on mainnets.
|
|
|
613
613
|
|
|
614
614
|
<details>
|
|
615
615
|
|
|
616
|
-
<summary><b>Where can I find the agent ID?</b></summary>
|
|
616
|
+
<summary><b>Where can I find the agent blueprint ID?</b></summary>
|
|
617
617
|
|
|
618
|
-
You can find the agent IDs for each chain on the [Mech Hub](https://aimechs.autonolas.network/registry) or on the [Mech repository](https://github.com/valory-xyz/mech?tab=readme-ov-file#examples-of-deployed-mechs).
|
|
618
|
+
You can find the agent blueprint IDs for each chain on the [Mech Hub](https://aimechs.autonolas.network/registry) or on the [Mech repository](https://github.com/valory-xyz/mech?tab=readme-ov-file#examples-of-deployed-mechs).
|
|
619
619
|
|
|
620
620
|
</details>
|
|
621
621
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
mech_client/__init__.py,sha256=
|
|
1
|
+
mech_client/__init__.py,sha256=qXP3KYo0kVvrn4GI8u6T0gw5y9DiN6Ryz_hOfpB6RIE,43
|
|
2
2
|
mech_client/abis/AgentMech.json,sha256=IEbs_xBGunBu5h-uT5DvIty8Zw412QoPI46S_DUMYNw,18082
|
|
3
3
|
mech_client/abis/AgentRegistry.json,sha256=2qmXeFINZWz9pyOma6Bq67kMDSUI1lD7WvgHLwuETD8,24723
|
|
4
4
|
mech_client/abis/AgreementStoreManager.base.json,sha256=_ljdIZcfFGmFzBHUTfhA4X0382ZHHpkdr_CziTwUETo,34360
|
|
@@ -30,8 +30,9 @@ mech_client/abis/SubscriptionToken.base.json,sha256=5StPEyfRvDMTqtQPO-KakXXZqobX
|
|
|
30
30
|
mech_client/abis/TransferNFTCondition.base.json,sha256=71O_3itHBz9qPtoTLev8_a7KxlcQfIZSfxK2562lkqw,42540
|
|
31
31
|
mech_client/abis/TransferNFTCondition.gnosis.json,sha256=-huhxV54eoNY8mR9WtQdmSgQDgaKiUi0PULJ4HEshWw,42540
|
|
32
32
|
mech_client/acn.py,sha256=Rj_jLPvJ5loDQfGbu3a_O24cJC4SwIErLceSz_zVYS8,5356
|
|
33
|
-
mech_client/cli.py,sha256=
|
|
33
|
+
mech_client/cli.py,sha256=pDyWyx47X_-j1HFkp7yL627RE5W2-zqClciA5amV7bE,19275
|
|
34
34
|
mech_client/configs/mechs.json,sha256=P27UibjGSlmRt199AEWi2xBHrjCnSk6p7KSbZ9nRSiY,5601
|
|
35
|
+
mech_client/delivery.py,sha256=PU_qSzP5juDRHiKQsyg6TH9oacc8nRoRY9BQBBe_fW0,5588
|
|
35
36
|
mech_client/fetch_ipfs_hash.py,sha256=tg_hYVf4deXl89x3SOBrGFUthaSeN_Vg_OHDtfjdbp4,2752
|
|
36
37
|
mech_client/helpers/__init__.py,sha256=nmQig1EqBQ9EMOpgdykP3a6_2NWcoVH3-lnyHP5n0ws,1196
|
|
37
38
|
mech_client/helpers/acn/README.md,sha256=WMXR2Lk0IpWjr3vpZ8cxcTHk4gwsx4wC06UPkwj9dbQ,1641
|
|
@@ -61,8 +62,8 @@ mech_client/helpers/p2p_libp2p_client/README.md,sha256=6x9s6P7TdKkcvAS1wMFHXRz4a
|
|
|
61
62
|
mech_client/helpers/p2p_libp2p_client/__init__.py,sha256=-GOP3D_JnmXTDomrMLCbnRk7vRQmihIqTYvyIPzx-q4,879
|
|
62
63
|
mech_client/helpers/p2p_libp2p_client/connection.py,sha256=b5jfcUeSoNrUw8DOSTCbK4DTi-N8bf2_pdogUOz0ep0,28606
|
|
63
64
|
mech_client/helpers/p2p_libp2p_client/connection.yaml,sha256=nMiHnU_dv9EFjVNqZ-0SAnoATfadJSad-JsbDvk97Mk,1790
|
|
64
|
-
mech_client/interact.py,sha256=
|
|
65
|
-
mech_client/marketplace_interact.py,sha256=
|
|
65
|
+
mech_client/interact.py,sha256=YvqUppI3m8hXbEfGLvWc05taYOINk0h02MfCgSuAT1A,21126
|
|
66
|
+
mech_client/marketplace_interact.py,sha256=h7_71joPy-dDG36MYIT9L4COkbevlo2BTXiN25NesoM,35934
|
|
66
67
|
mech_client/mech_marketplace_subgraph.py,sha256=X_ypxfokN-YBtsUCVOHUecsinkbRDZ5fR5WCkid1ntM,3153
|
|
67
68
|
mech_client/mech_marketplace_tool_management.py,sha256=G1O0ajbeltRM5FpqPfmn2C4QRrwqf5HfWKUH2VKn6UA,7365
|
|
68
69
|
mech_client/mech_tool_management.py,sha256=NQFmVzzGZsIkeHokDPWXGHwa8u-pyQIMPR1Q5H81bKw,7806
|
|
@@ -70,7 +71,7 @@ mech_client/prompt_to_ipfs.py,sha256=XqSIBko15MEkpWOQNT97fRI6jNxMF5EDBDEPOJFdhyk
|
|
|
70
71
|
mech_client/push_to_ipfs.py,sha256=IfvgaPU79N_ZmCPF9d7sPCYz2uduZH0KjT_HQ2LHXoQ,2059
|
|
71
72
|
mech_client/subgraph.py,sha256=UjQRa2wjCDac8XbOhe-JtB9Wyu4vr5D45mATFTNaAR4,2403
|
|
72
73
|
mech_client/to_png.py,sha256=pjUcFJ63MJj_r73eqnfqCWMtlpsrj6H4ZmgvIEmRcFw,2581
|
|
73
|
-
mech_client/wss.py,sha256=
|
|
74
|
+
mech_client/wss.py,sha256=NoWAzvAjzbnPX9aeLkdiRKGjIX4rptyhcnZyRxCqV_8,8097
|
|
74
75
|
scripts/__init__.py,sha256=I8VcZ7sjlAw171Er7B6mumpMLfrynrWie4YoeJIayno,26
|
|
75
76
|
scripts/benchmark.sh,sha256=qgfYEI5u8Qd-vqaD3xZktuubXyz0sdHE1_9qg6stEzs,935
|
|
76
77
|
scripts/bump.py,sha256=2o4MsFGG_ix4UXscekfX7dqpM-q-T4mTwkHw_KtA8mk,9503
|
|
@@ -92,9 +93,9 @@ scripts/nvm_subscription/envs/gnosis.env,sha256=mDCb1wEY4fRQYJQuyqg2b4qTFQtHHopR
|
|
|
92
93
|
scripts/nvm_subscription/manager.py,sha256=y0Qh0aVAmOPB4Ytt93alIarSvhrQpC-lRYNAY09GRZ0,10054
|
|
93
94
|
scripts/nvm_subscription/resources/networks.json,sha256=xH0P3YkgkMTkQdahVKO0kI9m6ybJ67iwHApstUlfRmw,2359
|
|
94
95
|
scripts/utils.py,sha256=lXjY3s1HvNHT2fXm2fBpZtVvlQaqW288Y2S-s3rpSDM,3248
|
|
95
|
-
scripts/whitelist.py,sha256
|
|
96
|
-
mech_client-0.
|
|
97
|
-
mech_client-0.
|
|
98
|
-
mech_client-0.
|
|
99
|
-
mech_client-0.
|
|
100
|
-
mech_client-0.
|
|
96
|
+
scripts/whitelist.py,sha256=uWgX2E19_NS1rK3QfxSyata4ZLIqGVZAKrX8zXpuk_g,448
|
|
97
|
+
mech_client-0.14.1.dist-info/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
|
|
98
|
+
mech_client-0.14.1.dist-info/METADATA,sha256=BSNMj9w5rxKExrNp8yFucgnCW4KIS4meMfYvv10_uM0,29678
|
|
99
|
+
mech_client-0.14.1.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
|
100
|
+
mech_client-0.14.1.dist-info/entry_points.txt,sha256=SbRMRsayzD8XfNXhgwPuXEqQsdZ5Bw9XDPnUuaDExyY,45
|
|
101
|
+
mech_client-0.14.1.dist-info/RECORD,,
|
scripts/whitelist.py
CHANGED
|
@@ -2,4 +2,8 @@ directory # unused attribute (mech_client/acn.py:85)
|
|
|
2
2
|
directory # unused attribute (mech_client/acn.py:100)
|
|
3
3
|
directory # unused attribute (mech_client/acn.py:116)
|
|
4
4
|
payment_data # unused variable (mech_client/interact.py:111)
|
|
5
|
-
AGENT_QUERY_TEMPLATE # unused variable (mech_client/subgraph.py:30)
|
|
5
|
+
AGENT_QUERY_TEMPLATE # unused variable (mech_client/subgraph.py:30)
|
|
6
|
+
|
|
7
|
+
# Existing entries...
|
|
8
|
+
send_marketplace_request_nonblocking # used in tests/locustfile.py
|
|
9
|
+
delivery_consumer_loop_status_only # used in tests/locustfile.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|