You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
commit_hash (str): The hash of the neuron's weights to be committed.
115
113
wait_for_inclusion (bool): Waits for the transaction to be included in a block.
116
114
wait_for_finalization (bool): Waits for the transaction to be finalized on the blockchain.
117
-
prompt (bool): If ``True``, prompts for user confirmation before proceeding.
118
115
119
116
Returns:
120
-
tuple[bool, str]: ``True`` if the weight commitment is successful, False otherwise. And `msg`, a string
121
-
value describing the success or potential error.
117
+
tuple[bool, str]: ``True`` if the weight commitment is successful, False otherwise. And `msg`, a string value describing the success or potential error.
122
118
123
119
This function provides a user-friendly interface for committing weights to the Bittensor blockchain, ensuring proper error handling and user interaction when required.
124
120
"""
125
-
ifpromptandnotConfirm.ask(f"Would you like to commit weights?"):
version_key (int): Version key for compatibility with the network.
241
234
wait_for_inclusion (bool): Waits for the transaction to be included in a block.
242
235
wait_for_finalization (bool): Waits for the transaction to be finalized on the blockchain.
243
-
prompt (bool): If ``True``, prompts for user confirmation before proceeding.
244
236
245
237
Returns:
246
-
tuple[bool, str]: ``True`` if the weight revelation is successful, False otherwise. And `msg`, a string
247
-
value describing the success or potential error.
238
+
tuple[bool, str]: ``True`` if the weight revelation is successful, False otherwise. And `msg`, a string value describing the success or potential error.
248
239
249
240
This function provides a user-friendly interface for revealing weights on the Bittensor blockchain, ensuring proper error handling and user interaction when required.
250
241
"""
251
242
252
-
ifpromptandnotConfirm.ask(f"Would you like to reveal weights?"):
Copy file name to clipboardExpand all lines: bittensor/core/extrinsics/registration.py
+11-28Lines changed: 11 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,6 @@
20
20
21
21
frombittensor_wallet.errorsimportKeyFileError
22
22
fromretryimportretry
23
-
fromrich.promptimportConfirm
24
23
25
24
frombittensor.utilsimportformat_error_message
26
25
frombittensor.utils.btloggingimportlogging
@@ -43,7 +42,7 @@ def _do_pow_register(
43
42
self: "Subtensor",
44
43
netuid: int,
45
44
wallet: "Wallet",
46
-
pow_result: POWSolution,
45
+
pow_result: "POWSolution",
47
46
wait_for_inclusion: bool=False,
48
47
wait_for_finalization: bool=True,
49
48
) ->tuple[bool, Optional[str]]:
@@ -53,14 +52,12 @@ def _do_pow_register(
53
52
netuid (int): The subnet to register on.
54
53
wallet (bittensor.wallet): The wallet to register.
55
54
pow_result (POWSolution): The PoW result to register.
56
-
wait_for_inclusion (bool): If ``True``, waits for the extrinsic to be included in a block.
57
-
Default to `False`.
55
+
wait_for_inclusion (bool): If ``True``, waits for the extrinsic to be included in a block. Default to `False`.
58
56
wait_for_finalization (bool): If ``True``, waits for the extrinsic to be finalized. Default to `True`.
59
57
60
58
Returns:
61
59
success (bool): ``True`` if the extrinsic was included in a block.
62
-
error (Optional[str]): ``None`` on success or not waiting for inclusion/finalization, otherwise the error
63
-
message.
60
+
error (Optional[str]): ``None`` on success or not waiting for inclusion/finalization, otherwise the error message.
64
61
"""
65
62
66
63
@retry(delay=1, tries=3, backoff=2, max_delay=4)
@@ -108,7 +105,6 @@ def register_extrinsic(
108
105
netuid: int,
109
106
wait_for_inclusion: bool=False,
110
107
wait_for_finalization: bool=True,
111
-
prompt: bool=False,
112
108
max_allowed_attempts: int=3,
113
109
output_in_place: bool=True,
114
110
cuda: bool=False,
@@ -126,7 +122,6 @@ def register_extrinsic(
126
122
netuid (int): The ``netuid`` of the subnet to register on.
127
123
wait_for_inclusion (bool): If set, waits for the extrinsic to enter a block before returning ``true``, or returns ``false`` if the extrinsic fails to enter the block within the timeout.
128
124
wait_for_finalization (bool): If set, waits for the extrinsic to be finalized on the chain before returning ``true``, or returns ``false`` if the extrinsic fails to be finalized within the timeout.
129
-
prompt (bool): If ``true``, the call waits for confirmation from the user before proceeding.
130
125
max_allowed_attempts (int): Maximum number of attempts to register the wallet.
131
126
output_in_place (bool): If true, prints the progress of the proof of work to the console in-place. Meaning the progress is printed on the same lines. Defaults to `True`.
132
127
cuda (bool): If ``true``, the wallet should be registered using CUDA device(s).
f"Registration hotkey: <blue>{wallet.hotkey.ss58_address}</blue>, <green>Public</green> coldkey: <blue>{wallet.coldkey.ss58_address}</blue> in the network: <blue>{subtensor.network}</blue>."
netuid (int): The ``netuid`` of the subnet to register on.
360
346
wait_for_inclusion (bool): If set, waits for the extrinsic to enter a block before returning ``true``, or returns ``false`` if the extrinsic fails to enter the block within the timeout.
361
347
wait_for_finalization (bool): If set, waits for the extrinsic to be finalized on the chain before returning ``true``, or returns ``false`` if the extrinsic fails to be finalized within the timeout.
362
-
prompt (bool): If ``true``, the call waits for confirmation from the user before proceeding.
363
348
364
349
Returns:
365
350
success (bool): Flag is ``true`` if extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is ``true``.
wait_for_inclusion (bool): If set, waits for the extrinsic to enter a block before returning ``true``, or returns ``false`` if the extrinsic fails to enter the block within the timeout. Default is ``False``.
73
71
wait_for_finalization (bool): If set, waits for the extrinsic to be finalized on the chain before returning ``true``, or returns ``false`` if the extrinsic fails to be finalized within the timeout. Default is ``True``.
74
-
prompt (bool): If ``true``, the call waits for confirmation from the user before proceeding. Default is ``False``.
75
72
76
73
Returns:
77
74
success (bool): Flag is ``true`` if extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is ``true``.
@@ -94,11 +91,6 @@ def root_register_extrinsic(
94
91
)
95
92
returnTrue
96
93
97
-
ifprompt:
98
-
# Prompt user for confirmation.
99
-
ifnotConfirm.ask("Register to root network?"):
100
-
returnFalse
101
-
102
94
logging.info(":satellite: <magenta>Registering to root network...</magenta>")
version_key (int): The version key of the validator. Default is ``0``.
212
203
wait_for_inclusion (bool): If set, waits for the extrinsic to enter a block before returning ``true``, or returns ``false`` if the extrinsic fails to enter the block within the timeout. Default is ``False``.
213
204
wait_for_finalization (bool): If set, waits for the extrinsic to be finalized on the chain before returning ``true``, or returns ``false`` if the extrinsic fails to be finalized within the timeout. Default is ``False``.
214
-
prompt (bool): If ``true``, the call waits for confirmation from the user before proceeding. Default is ``False``.
215
205
216
206
Returns:
217
207
success (bool): Flag is ``true`` if extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is ``true``.
"""Subscribes a Bittensor endpoint to the subtensor chain.
106
103
@@ -115,7 +112,6 @@ def serve_extrinsic(
115
112
placeholder2 (int): A placeholder for future use.
116
113
wait_for_inclusion (bool): If set, waits for the extrinsic to enter a block before returning ``true``, or returns ``false`` if the extrinsic fails to enter the block within the timeout.
117
114
wait_for_finalization (bool): If set, waits for the extrinsic to be finalized on the chain before returning ``true``, or returns ``false`` if the extrinsic fails to be finalized within the timeout.
118
-
prompt (bool): If ``true``, the call waits for confirmation from the user before proceeding.
119
115
120
116
Returns:
121
117
success (bool): Flag is ``true`` if extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is ``true``.
@@ -159,15 +155,6 @@ def serve_extrinsic(
159
155
)
160
156
returnTrue
161
157
162
-
ifprompt:
163
-
output=params.copy()
164
-
output["coldkey"] =wallet.coldkeypub.ss58_address
165
-
output["hotkey"] =wallet.hotkey.ss58_address
166
-
ifnotConfirm.ask(
167
-
f"Do you want to serve axon:\n [bold white]{json.dumps(output, indent=4, sort_keys=True)}[/bold white]"
"""Sets the given weights and values on chain for wallet hotkey account.
120
118
@@ -127,7 +125,6 @@ def set_weights_extrinsic(
127
125
version_key (int): The version key of the validator.
128
126
wait_for_inclusion (bool): If set, waits for the extrinsic to enter a block before returning ``true``, or returns ``false`` if the extrinsic fails to enter the block within the timeout.
129
127
wait_for_finalization (bool): If set, waits for the extrinsic to be finalized on the chain before returning ``true``, or returns ``false`` if the extrinsic fails to be finalized within the timeout.
130
-
prompt (bool): If ``true``, the call waits for confirmation from the user before proceeding.
131
128
132
129
Returns:
133
130
tuple[bool, str]: A tuple containing a success flag and an optional response message.
@@ -149,17 +146,11 @@ def set_weights_extrinsic(
149
146
uids, weights
150
147
)
151
148
152
-
# Ask before moving on.
153
-
ifprompt:
154
-
ifnotConfirm.ask(
155
-
f"Do you want to set weights:\n[bold white] weights: {[float(v/65535) forvinweight_vals]}\n"
156
-
f"uids: {weight_uids}[/bold white ]?"
157
-
):
158
-
returnFalse, "Prompt refused."
159
-
160
149
logging.info(
161
150
f":satellite: <magenta>Setting weights on </magenta><blue>{subtensor.network}<blue> <magenta>...</magenta>"
0 commit comments