-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from opentensor/experimental/thewhaleking/typer
Initial commit for Typer (wallet commands)
- Loading branch information
Showing
13 changed files
with
7,452 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cubit>=1.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
aiohttp~=3.9.5 | ||
backoff~=2.2.1 | ||
git+https://github.com/opentensor/btwallet # bittensor_wallet | ||
GitPython>=3.0.0 | ||
fuzzywuzzy~=0.18.0 | ||
netaddr~=1.3.0 | ||
numpy>=2.0.1 | ||
pycryptodome # Crypto | ||
PyYAML~=6.0.1 | ||
rich~=13.7 | ||
scalecodec==1.2.11 | ||
substrate-interface~=1.7.9 | ||
typer~=0.12 | ||
websockets>=12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
from dataclasses import dataclass | ||
|
||
|
||
class Constants: | ||
networks = ["local", "finney", "test", "archive"] | ||
finney_entrypoint = "wss://entrypoint-finney.opentensor.ai:443" | ||
finney_test_entrypoint = "wss://test.finney.opentensor.ai:443/" | ||
archive_entrypoint = "wss://archive.chain.opentensor.ai:443/" | ||
local_entrypoint = "ws://127.0.0.1:9444" | ||
network_map = { | ||
"finney": finney_entrypoint, | ||
"test": finney_test_entrypoint, | ||
"archive": archive_entrypoint, | ||
"local": local_entrypoint, | ||
} | ||
delegates_detail_url = "https://raw.githubusercontent.com/opentensor/bittensor-delegates/main/public/delegates.json" | ||
|
||
|
||
@dataclass | ||
class DelegatesDetails: | ||
name: str | ||
url: str | ||
description: str | ||
signature: str | ||
|
||
@classmethod | ||
def from_json(cls, json: dict[str, any]) -> "DelegatesDetails": | ||
return cls( | ||
name=json["name"], | ||
url=json["url"], | ||
description=json["description"], | ||
signature=json["signature"], | ||
) | ||
|
||
|
||
class Defaults: | ||
netuid = 1 | ||
|
||
class subtensor: | ||
network = "finney" | ||
chain_endpoint = None | ||
_mock = False | ||
|
||
class pow_register: | ||
num_processes = None | ||
update_interval = 50_000 | ||
output_in_place = True | ||
verbose = False | ||
|
||
class cuda: | ||
dev_id = 0 | ||
use_cuda = False | ||
tpb = 256 | ||
|
||
class wallet: | ||
name = "default" | ||
hotkey = "default" | ||
path = "~/.bittensor/wallets/" | ||
|
||
class logging: | ||
debug = False | ||
trace = False | ||
record_log = False | ||
logging_dir = "~/.bittensor/miners" | ||
|
||
|
||
defaults = Defaults | ||
|
||
|
||
TYPE_REGISTRY = { | ||
"types": { | ||
"Balance": "u64", # Need to override default u128 | ||
}, | ||
"runtime_api": { | ||
"NeuronInfoRuntimeApi": { | ||
"methods": { | ||
"get_neuron_lite": { | ||
"params": [ | ||
{ | ||
"name": "netuid", | ||
"type": "u16", | ||
}, | ||
{ | ||
"name": "uid", | ||
"type": "u16", | ||
}, | ||
], | ||
"type": "Vec<u8>", | ||
}, | ||
"get_neurons_lite": { | ||
"params": [ | ||
{ | ||
"name": "netuid", | ||
"type": "u16", | ||
}, | ||
], | ||
"type": "Vec<u8>", | ||
}, | ||
} | ||
}, | ||
"StakeInfoRuntimeApi": { | ||
"methods": { | ||
"get_stake_info_for_coldkey": { | ||
"params": [ | ||
{ | ||
"name": "coldkey_account_vec", | ||
"type": "Vec<u8>", | ||
}, | ||
], | ||
"type": "Vec<u8>", | ||
}, | ||
"get_stake_info_for_coldkeys": { | ||
"params": [ | ||
{ | ||
"name": "coldkey_account_vecs", | ||
"type": "Vec<Vec<u8>>", | ||
}, | ||
], | ||
"type": "Vec<u8>", | ||
}, | ||
}, | ||
}, | ||
"ValidatorIPRuntimeApi": { | ||
"methods": { | ||
"get_associated_validator_ip_info_for_subnet": { | ||
"params": [ | ||
{ | ||
"name": "netuid", | ||
"type": "u16", | ||
}, | ||
], | ||
"type": "Vec<u8>", | ||
}, | ||
}, | ||
}, | ||
"SubnetInfoRuntimeApi": { | ||
"methods": { | ||
"get_subnet_hyperparams": { | ||
"params": [ | ||
{ | ||
"name": "netuid", | ||
"type": "u16", | ||
}, | ||
], | ||
"type": "Vec<u8>", | ||
} | ||
} | ||
}, | ||
"SubnetRegistrationRuntimeApi": { | ||
"methods": {"get_network_registration_cost": {"params": [], "type": "u64"}} | ||
}, | ||
}, | ||
} | ||
|
||
NETWORK_EXPLORER_MAP = { | ||
"opentensor": { | ||
"local": "https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fentrypoint-finney.opentensor.ai%3A443#/explorer", | ||
"endpoint": "https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fentrypoint-finney.opentensor.ai%3A443#/explorer", | ||
"finney": "https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fentrypoint-finney.opentensor.ai%3A443#/explorer", | ||
}, | ||
"taostats": { | ||
"local": "https://x.taostats.io", | ||
"endpoint": "https://x.taostats.io", | ||
"finney": "https://x.taostats.io", | ||
}, | ||
} |
Oops, something went wrong.