-
Notifications
You must be signed in to change notification settings - Fork 19
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
Initial doc for running a local subtensor #67
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
a108353
to
0edf320
Compare
@eduardogr and @ifrit98 see below:
|
### Run a lite node | ||
|
||
To run a lite node, execute the below command: | ||
|
||
```bash | ||
./target/release/node-subtensor \ | ||
--base-path /tmp/blockchain \ | ||
--chain ./raw_spec.json \ | ||
--rpc-external --rpc-cors all \ | ||
--ws-external --no-mdns \ | ||
--ws-max-connections 10000 --in-peers 500 --out-peers 500 \ | ||
--bootnodes /dns/bootnode.finney.opentensor.ai/tcp/30333/ws/p2p/12D3KooWRwbMb85RWnT8DSXSYMWQtuDwh4LJzndoRrTDotTR5gDC \ | ||
--sync warp | ||
``` | ||
|
||
### Run an archive node | ||
|
||
To run an archive node, execute the below command: | ||
|
||
```bash | ||
./target/release/node-subtensor \ | ||
--base-path /tmp/blockchain \ | ||
--chain ./raw_spec.json \ | ||
--rpc-external --rpc-cors all \ | ||
--ws-external --no-mdns \ | ||
--ws-max-connections 10000 --in-peers 500 --out-peers 500 \ | ||
--bootnodes /dns/bootnode.finney.opentensor.ai/tcp/30333/ws/p2p/12D3KooWRwbMb85RWnT8DSXSYMWQtuDwh4LJzndoRrTDotTR5gDC \ | ||
--pruning=archive | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we create 4 subsections as we have for docker for mainnet/testnet lite/archive ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative to create 4 sections to the same command and diff details....we could place the command that is common with a some env variables that has been set previously. Indicating the user to set just one of the "SPECIFIC_OPTIONS" exposed.
Something like this:
# different command options by network and node type
MAINNET_BOOTNODE='--bootnodes /dns/bootnode.finney.opentensor.ai/tcp/30333/ws/p2p/12D3KooWRwbMb85RWnT8DSXSYMWQtuDwh4LJzndoRrTDotTR5gDC'
TESTNET_BOOTNODE='--bootnodes /dns/bootnode.test.finney.opentensor.ai/tcp/30333/ws/p2p/12D3KooWRwbMb85RWnT8DSXSYMWQtuDwh4LJzndoRrTDotTR5gDC'
NODE_TYPE_ARCHIVE='--pruning=archive'
NODE_TYPE_LITE='--sync warp'
# mainnet archive
SPECIFIC_OPTIONS='$MAINNET_BOOTNODE $NODE_TYPE_ARCHIVE'
# mainnet lite
SPECIFIC_OPTIONS='$MAINNET_BOOTNODE $NODE_TYPE_LITE'
# testnet archive
SPECIFIC_OPTIONS='$TESTNET_BOOTNODE $NODE_TYPE_ARCHIVE'
# testnet archive
SPECIFIC_OPTIONS='$TESTNET_BOOTNODE $NODE_TYPE_LITE'
# command to run subtensor
./target/release/node-subtensor \
--base-path /tmp/blockchain \
--chain ./raw_spec.json \
--rpc-external --rpc-cors all \
--ws-external --no-mdns \
--ws-max-connections 10000 --in-peers 500 --out-peers 500 \
$SPECIFIC_OPTIONS
What about that?
But if it's convenient for us and it's better to hide details I could create a script for this to simplify the instruction and let it look like:
./run_subtensor main archive
./run_subtensor main lite
./run_subtensor test archive
./run_subtensor test lite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script idea is better. It saves the user from making mistakes. The only minor change I suggest is to make them as,
./run_subtensor mainnet archive
./run_subtensor mainnet lite
./run_subtensor testnet archive
./run_subtensor testnet lite
This way, it is closer to Docker commands.
Also, if you plan to use the below scheme in your script,
# mainnet archive
SPECIFIC_OPTIONS='$MAINNET_BOOTNODE $NODE_TYPE_ARCHIVE'
# mainnet lite
SPECIFIC_OPTIONS='$MAINNET_BOOTNODE $NODE_TYPE_LITE'
# testnet archive
SPECIFIC_OPTIONS='$TESTNET_BOOTNODE $NODE_TYPE_ARCHIVE'
# testnet archive
SPECIFIC_OPTIONS='$TESTNET_BOOTNODE $NODE_TYPE_LITE'
then I am thinking a slight change might make the script easy to understand. For mainnet archive, change the name SPECIFIC_OPTIONS
to MAINNET_ARCHIVE_OPTIONS
and so on for other cases also. That way, even the variable itself is self-documenting.
Yeah, i think that's perfect. We talk about "local subtensor" to make the difference between our finney endpoint and having your own subtensor. But having a guideline like this, i think that's implicit.
+1, I have commented something related to run the command that can lead us to expose better the details or hide the details and make the instructions clear and not exposed. Give it a look to that comment and let me know what you think. The TL;DR is, i could provide a script to run a subtensor command so people have a better and simpler guidelines (it's content would be the low-level documentation of the differences between those options)
Yeah, because we have the possibility that one node is not connecting with the bootnode and not being introduced to the network. I think that's one scenario that could happens. We can have a section for that and add scenarios as we discover them, what do you think?
so, that's actually something that's not going to come into play if the node is not explicitly exposed to the internet in their setup. We are not configuring that dimension so far. We are connecting the subtensor node with the networks but not exposing their APIs to the world for other users (unless their servers are doing this automatically, exposing all ports for example)
They could, but we would have to add the capability of specifying ports. Right now both are using same set of ports, so, users will find a conflict if they try to run both at the same time. But that's possible if we add the capability of customize:
|
Yes, the script approach is better. Let's do that.
Perfect. Where can I find it so I can document it?
Okay, understood. No action on this item for docs.
So, let's instruct them how to specify different ports and database paths for archive and lite nodes, then they can decide what to do. I will also add a warning note that keeping the values same for both node configurations will lead to conflicts. Is this too much extra work for you now? If yes, then we can postpone customization instructions and simply add warning about the conflict. I am okay either way. |
One other question. I use the terms "authority node" in describing the local blockchain. This is a nice way to avoid using the terms "validator" or "miner" in Bittensor blockchain. I want to describe a bit more what these authority nodes actually are and why they are two and how one is different from the other. @eduardogr? Thanks! |
No description provided.