Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create bt-migration #29

Merged
merged 1 commit into from
Jul 11, 2024
Merged
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
54 changes: 54 additions & 0 deletions docs/bt-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
```
# change imported library (all files)
- import bittensor as bt
+ import cybertensor as ct

# change imported library alias usage (all usages)
# (bt. -> ct.)
- bt.logging.warning("Ending miner...")
+ ct.logging.warning("Ending miner...")

# change subtensor to cwtensor
# (self.subtensor -> self.cwtensor)
- self.metagraph.sync(subtensor=self.subtensor)
+ self.metagraph.sync(cwtensor=self.cwtensor)

# refactor base neuron fields
- subtensor: "bt.subtensor"
- wallet: "bt.wallet"
- metagraph: "bt.metagraph"
+ cwtensor: "ct.cwtensor"
+ wallet: "ct.Wallet"
+ metagraph: "ct.metagraph"

# and here
- self.wallet = bt.wallet(config=self.config)
- self.subtensor = bt.subtensor(config=self.config)
- self.metagraph = self.subtensor.metagraph(self.config.netuid)
+ self.wallet = ct.Wallet(config=self.config)
+ self.cwtensor = ct.cwtensor(config=self.config)
+ self.metagraph = self.cwtensor.metagraph(self.config.netuid)

# refactor hotkey and address namings
# (ss58_address->address)
# (hotkey_ss58->hotkey)
- self.uid = self.metagraph.hotkeys.index(self.wallet.hotkey.ss58_address)
+ self.uid = self.metagraph.hotkeys.index(self.wallet.hotkey.address)

- hotkey_ss58=self.wallet.hotkey.ss58_address
+ hotkey=self.wallet.hotkey.address

# refactor chain info
(self.config.subtensor.chain_endpoint->self.config.cwtensor.network)
- bt.logging.info(
- f"Running validator {self.axon} on network: {self.config.subtensor.chain_endpoint} with netuid: {self.config.netuid}"
+ ct.logging.info(
+ f"Running validator {self.axon} on network: {self.config.cwtensor.network} with netuid: {self.config.netuid}"

# extra
- class MockSubtensor(bt.MockSubtensor):
+ class MockCwtensor(ct.MockCwtensor):

- vpermit_tao_limit: int,
+ vpermit_limit: int,
```
Loading