For General information on running Subtensors, see Subtensor Nodes section in Bittensor Developer Documentation.
Running a localnet in docker compose is the easiest way to quickly iterate on chain state, like building on the evm.
-
install docker and docker compose, along with cloning this repository.
-
build the images from source on the desired branch using
docker compose -f docker-compose.localnet.yml build
. Note this will take quite a while. -
Run the docker compose file via
docker compose -f docker-compose.localnet.yml up -d
Now you should have a full local validator running. To test your connection, you
can use the following script to check //Alice
's balance. Alice is a sudo
account in localnet.
# pip install substrate-interface
from substrateinterface import Keypair, SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
hotkey = Keypair.create_from_uri('//Alice')
result = substrate.query("System", "Account", [hotkey.ss58_address])
print(result.value)