Skip to content

Commit

Permalink
Merge pull request #129 from opentensor/fix/roman/turn-back-with-conf…
Browse files Browse the repository at this point in the history
…ig-usage

fix/roman/turn-back-with-config-usage
  • Loading branch information
ibraheem-opentensor authored Oct 10, 2024
2 parents 0c0c945 + 0327722 commit b9d8b37
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
6 changes: 1 addition & 5 deletions docs/stream_tutorial/miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ def __init__(self, config=None, axon=None, wallet=None, subtensor=None):
bt.logging.set_config(config=self.config.logging)

# Wallet holds cryptographic information, ensuring secure transactions and communication.
self.wallet = wallet or bt.wallet(
name=self.config.wallet.name,
path=self.config.wallet.path,
hotkey=self.config.wallet.hotkey,
)
self.wallet = wallet or bt.wallet(config=self.config)
bt.logging.info(f"Wallet {self.wallet}")

# subtensor manages the blockchain connection, facilitating interaction with the Bittensor blockchain.
Expand Down
6 changes: 1 addition & 5 deletions template/base/neuron.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,7 @@ def __init__(self, config=None):
self.config.netuid, subtensor=self.subtensor
)
else:
self.wallet = bt.wallet(
name=self.config.wallet.name,
path=self.config.wallet.path,
hotkey=self.config.wallet.hotkey,
)
self.wallet = bt.wallet(config=self.config)
self.subtensor = bt.subtensor(config=self.config)
self.metagraph = self.subtensor.metagraph(self.config.netuid)

Expand Down
4 changes: 3 additions & 1 deletion verify/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def main(args):
timezone = timestamp.astimezone().tzname()

# ensure compatiblity with polkadotjs messages, as polkadotjs always wraps message
message = "<Bytes>" + f"On {timestamp} {timezone} {args.message}" + "</Bytes>"
message = (
"<Bytes>" + f"On {timestamp} {timezone} {args.message}" + "</Bytes>"
)
signature = keypair.sign(data=message)

file_contents = f"{message}\n\tSigned by: {keypair.ss58_address}\n\tSignature: {signature.hex()}"
Expand Down
4 changes: 3 additions & 1 deletion verify/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def main(args):
import argparse

parser = argparse.ArgumentParser(description="Verify a signature")
parser.add_argument("--file", help="The file containing the message and signature")
parser.add_argument(
"--file", help="The file containing the message and signature"
)
args = parser.parse_args()
main(args)

0 comments on commit b9d8b37

Please sign in to comment.