Skip to content

Commit f5810ea

Browse files
Michael Trestmanjpe442
authored andcommitted
wip
1 parent 60aa774 commit f5810ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/staking-and-delegation/managing-stake-sdk.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ from bittensor import tao
105105
async def stake_batch(subtensor, netuid, top_validators, amount_to_stake):
106106
for hk in top_validators:
107107
print(f"💰 Staking {amount_to_stake} to {hk} on subnet {netuid}...")
108-
start_time = time.time()
109108
try:
110109
results = await asyncio.gather(*[ subtensor.add_stake(wallet=wallet, netuid=netuid, hotkey_ss58=hk, amount=amount_to_stake) for hk in top_validators ] )
111110
print(results)
@@ -162,8 +161,9 @@ async def main():
162161
top_validators_per_subnet[netuid] = [hk]
163162

164163
# Stake to each top 3 validators in each top 3 subnets
164+
start_time = time.time()
165165
await asyncio.gather(*[stake_batch(subtensor, netuid,top_validators, amount_to_stake) for netuid, top_validators in top_validators_per_subnet.items()])
166-
166+
print(f"Staking completed in {time.time() - start_time:.2f}s")
167167
# Initialize the wallet with walletname by running like
168168
wallet_name=os.environ.get('WALLET')
169169
total_to_stake=os.environ.get('TOTAL_TAO_TO_STAKE')
@@ -184,7 +184,7 @@ else:
184184
else:
185185
print(f"dividing {total_to_stake} TAO across top 3 validators in each of top 3 subnets by default")
186186

187-
asyncio.run(main())
187+
asyncio.run(main())
188188
```
189189
```console
190190
🔍 Using wallet: PracticeKey!

0 commit comments

Comments
 (0)