Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions neurons/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Copyright © 2023 Mode Labs
import asyncio
from datetime import datetime, timedelta, timezone
import multiprocessing as mp

# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation
Expand Down Expand Up @@ -259,4 +260,5 @@ async def forward_miner(self, _: bt.Synapse) -> bt.Synapse:

# The main function parses the configuration and runs the validator.
if __name__ == "__main__":
mp.set_start_method("spawn", force=True)
Validator().run()
24 changes: 12 additions & 12 deletions validator.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module.exports = {
apps: [
{
name: 'validator',
interpreter: 'python3',
script: './neurons/validator.py',
args: '--netuid 50 --logging.debug --wallet.name validator --wallet.hotkey default --neuron.axon_off true --neuron.vpermit_tao_limit 999999 --ewma.half_life_days 2.0 --ewma.cutoff_days 4 --softmax.beta -0.003',
env: {
PYTHONPATH: '.',
},
},
],
};
apps: [
{
name: "validator",
interpreter: "python3",
script: "./neurons/validator.py",
args: "--netuid 50 --logging.debug --wallet.name validator --wallet.hotkey default --neuron.axon_off true --neuron.vpermit_tao_limit 999999 --ewma.half_life_days 2.0 --ewma.cutoff_days 4 --softmax.beta -0.003",
env: {
PYTHONPATH: ".",
},
},
],
}
8 changes: 2 additions & 6 deletions verify/speedtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@

def downloadtest(url):
starttime = time.time()
response = requests.get(url, stream=True)
totaldownloaded = 0

for chunk in response.iter_content(chunk_size=1024):
if chunk:
totaldownloaded += len(chunk)
response = requests.get(url)
totaldownloaded = len(response.content)

endtime = time.time()
elapsedtime = endtime - starttime
Expand Down
17 changes: 11 additions & 6 deletions verify/validator-permit.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import bittensor as bt
from substrateinterface import SubstrateInterface # type: ignore


netuid = 50
subnet = bt.metagraph(netuid)
wallet = bt.wallet(name="validator", hotkey="default")
my_uid = subnet.hotkeys.index(wallet.hotkey.ss58_address)
print(f"Validator permit: {subnet.validator_permit[my_uid]}")

try:
subnet = bt.metagraph(netuid)
wallet = bt.wallet(name="validator", hotkey="default")
my_uid = subnet.hotkeys.index(wallet.hotkey.ss58_address)
print(f"Validator permit: {subnet.validator_permit[my_uid]}")
except Exception as e:
print(f"Error retrieving validator permit: {e}")

top_64_stake = sorted(subnet.S)[-64:]
print(
Expand All @@ -23,6 +28,6 @@

substrate = SubstrateInterface(url="wss://entrypoint-finney.opentensor.ai:443")
result = substrate.query("SubtensorModule", "ValidatorPermit", [netuid])
print(result.value)
for uid, permit in enumerate(result.value):
print(f"neuron uid {uid}: permit {permit}")
if permit:
print(f"neuron uid {uid} has permit")