Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

error: The argument '--name <NAME>' cannot be used with '--dave' #4096

Closed
drandreaskrueger opened this issue Nov 12, 2019 · 7 comments
Closed

Comments

@drandreaskrueger
Copy link

When trying to find my node on https://telemetry.polkadot.io/#list/Local%20Testnet there were several nodes called "Alice".

I tried to simply choose my own name --alice --name CH_Alice but that resulted in:

error: The argument '--name ' cannot be used with '--alice'

Why not let us override the --name ?

@bkchr
Copy link
Member

bkchr commented Nov 13, 2019

--help explains every cli parameter.

--alice is just a shortcut that can not be used together with --name. The Alice cli flag is more for local test networks. Just look into the help what it does and apply the same commands on your own.

@drandreaskrueger
Copy link
Author

--help explains every cli parameter.

:-) Does it? Lol.

--alice is just a shortcut that can not be used together with --name

Yes, I know.
That is why I opened this issue.

What is your reason why we must not override --alice with a --name ?

@bkchr
Copy link
Member

bkchr commented Nov 14, 2019

This is for testing purposes. Having 2 validators running with the same key, will get you slashed. Furthermore everyone knows this private key. I don't understand your use case.

@kianenigma
Copy link
Contributor

kianenigma commented Nov 14, 2019

Seems like a very rare case to me and not worthwhile. Alice, bob and the few others that have a flag are for testing, and pretty common names. If you are really keen on using CH_Alice, you can manually set that.

Nonetheless, should be easy to allow override I suppose.

@drandreaskrueger
Copy link
Author

drandreaskrueger commented Nov 14, 2019

If you are really keen on using CH_Alice, you can manually set that.

At the moment not, no. I got an "error: The argument '--name ' cannot be used with '--alice'"

should be easy to allow override I suppose.

Yes, I would think so.


Instead of that easy but forbidden option, I have now put > 1.5 days of work in. Not using Alice & Bob & Charlie & Dave at all; but creating keys myself with subkey, generating my own chainspec, etc. - Feels good, but also a bit like wasted time, because with Alice & Bob & Charlie & Dave, I already had almost what I wanted. So please consider to allow the override. It's not about the keys, just about the naming of the specific node.

What I have scripted now instead ... can actually create seeds for, modify a chainspec, and start an arbitrary number of nodes, not only 2 or 4. Great.

Then I had a very persistent last problem ... best: #12 (0x531f…f303), finalized #0 (0xc662…8d2b) so finalized was always stuck on block 0, even though best was ticking up.

But then your comment made me realize it:

Having 2 validators running with the same key, will get you slashed.

Hooray, that was it. Thanks for helping-without-knowing-that-was-what-I-needed :-)


I think this page needs some modifications/additions towards the end - to help other people avoid the trap I fell in:

https://substrate.dev/docs/en/next/tutorials/start-a-private-network-with-substrate#launching-the-chain

  • "Having 2 validators running with the same key, will get you slashed." <-- important info. Once you know it, it makes total sense, but until then it's quite confusing, why the finalized stayed on 0 regardless what I tried.
  • --ws-port 9944 and --ws-port 9945 to be able to also access the 2nd node via GUI
  • "At this point you can use the Apps UI to insert your keys into the keystore" --> "After the first (babe,gran) two author.insertKey() calls, you must direct the GUI to the SECOND NODE, e.g. from ws://127.0.0.1:9944 to (custom endpoint) ws://127.0.0.1:9945 to insert the next (babe,gran) tuple into another node"

Actually two last things - manually inserting MANY keys via a point and click GUI ... is rather annoying. Imagine to do that for 4 nodes, or 9.

  • Why do I have to give both babe and gran public keys AND the seedphrase - if the node could calculate any public key from the seedphrase by itself? One call author.insertKeys("marine enact equip basic salon awful release permit hood ostrich glory match", ["babe","gran"]) or similiar, could replace the two calls, no?

  • Any quickstart hints how to interact with the REST RPC port? <-- most interested in this I am.

I know that I must submit this:

port 9933 
author.insertKey("babe","marine enact equip basic salon awful release permit hood ostrich glory match","0xa0ebdd5ef985fcacf2c288e273a071b29ceb95a19087ca5c12c0aa81d1645a59")
author.insertKey("gran","marine enact equip basic salon awful release permit hood ostrich glory match","0xd4917e1e10f96e8e7fda675ad78b83d53c4d049e3001da56f771b183b12f6aee")

port 9934
author.insertKey("babe","capital again flat hammer camp obvious move coconut tissue obey liar rice","0xc4b12ca814c4ceb437aae6cd8b19cc95b287e696e66fa96b6736edd0ec69f033")
author.insertKey("gran","capital again flat hammer camp obvious move coconut tissue obey liar rice","0xa2e76f74820d50ac861cc456306e8a94b6835a7e0c3abe0cdd22afbfbd0cc38e")

If you give instructions how to do this via curl then I can translate that to Python.
I suppose there is no library yet for substrate in Python, like https://pypi.org/project/web3/ - or is it?

Thanks a lot, you have really helped me. Hooray, my nodes are running fine.

@bkchr
Copy link
Member

bkchr commented Nov 15, 2019

I'm still not convinced for making --name overridable, when --alice is given. You already achieved to shoot yourself into the foot with this and I don't want to make it more easy. If you just want to experiment, live with the name alice, bob, fredie etc. I don't see why you need special names.

For the rest, please an appropriate issue in this repo: https://github.com/substrate-developer-hub/substrate-developer-hub.github.io That is the place for requesting changes to the documentation. Thanks in advance.

For the key management, you see here the commands: https://github.com/paritytech/substrate/tree/6ae3b6c4ddc03d4cdb10bd1d417b95d20f4c1b6e#7-key-management

@bkchr bkchr closed this as completed Nov 15, 2019
@drandreaskrueger
Copy link
Author

drandreaskrueger commented Nov 15, 2019

to shoot yourself into the foot with this

Not true. I had no such problems with Alice & Bob.

Only when I started to learn about the different keys, babe, grandpa, etc, it became complicated, and I initially misunderstood the --node-key-* commandline switches.

The manual page is quite good, but IMHO those added explanations above would have helped me. As you recommended, I have put my manual suggestions here: polkadot-developers/substrate-developer-hub.github.io#327


I don't see why you need special names.

because:

When trying to find my node on https://telemetry.polkadot.io/#list/Local%20Testnet there were several nodes called "Alice".


For the key management, you see here the commands: ...

Nice one, thanks. So there is only this way: "you need to use one of the two provided RPC calls."

Good to know.

I had already found a similar way now, via a websockets call.

Thanks.


I have solved all this myself now. Went the hard way, learned a lot. My scripts are creating a network with an arbitrary number of nodes, with their own keys, and chainspec. No need for Alice & Bob anymore.

It works. Hooray. Almost perfectly. Because at block # 100 - that's it, then it gets stuck.

I am quite surprised, that a network with e.g. 9 nodes ... needs only ~330 MB of RAM.


Thanks a lot for your hints. Much appreciated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants