关于启动私有衬底网络的教程,suri 来自哪里?

Tutorials about start a private substrate network, Where the suri come from?

tutorials about start a private substrate network。 它说:

This example uses the secret seed generated from the key subcommand into the keystore. In this tutorial, the secret seed generated was 0x563d22ef5f00e589e07445a3ad88bb92efaa897d7f73a4543d9ac87476434e65, so the --suri command-line option specifies that string to insert the key into the keystore:

我想知道 suri 是从哪里来的?文章没有演示的很清楚

我记录我做了什么:

$ ./target/release/node-template key generate --scheme Sr25519 --password-interactive
Key password: 123456
Secret phrase `raw glory squeeze allow demand erase ensure car hair dry tobacco mule` is account:
  Secret seed:       0xa80c9a2c2c96ac61a548a358c81aa07a519af00e7b3fc25f06761e2a5af42044         # use the string as next step's input, import to node01
  Public key (hex):  0x780a4cd1e018e5433c061da3c28ad1ff33a59da6cd8b750a5a37f3e7fb69fc62
  Public key (SS58): 5En6fQsu3ju9zo2PvwptfnZZWrrWWs9zsBt1WuF9U8TGNWFj
  Account ID:        0x780a4cd1e018e5433c061da3c28ad1ff33a59da6cd8b750a5a37f3e7fb69fc62
  SS58 Address:      5En6fQsu3ju9zo2PvwptfnZZWrrWWs9zsBt1WuF9U8TGNWFj                           #put this in the chain-spec file, aura.authorities
$ ./target/release/node-template key inspect --password-interactive --scheme Ed25519 0xa80c9a2c2c96ac61a548a358c81aa07a519af00e7b3fc25f06761e2a5af42044
Key password: 123456
Secret Key URI `0xa80c9a2c2c96ac61a548a358c81aa07a519af00e7b3fc25f06761e2a5af42044` is account:
  Secret seed:       0xa80c9a2c2c96ac61a548a358c81aa07a519af00e7b3fc25f06761e2a5af42044
  Public key (hex):  0x9c1726a7a0cca51dc506a06789b0781260e999ccafd687799c275a52916b1b01
  Public key (SS58): 5FbNCp3ZHWzFGQkS1PRt9SPUs16zAHk1WhC2CWTQ97nsE2yk
  Account ID:        0x9c1726a7a0cca51dc506a06789b0781260e999ccafd687799c275a52916b1b01
  SS58 Address:      5FbNCp3ZHWzFGQkS1PRt9SPUs16zAHk1WhC2CWTQ97nsE2yk                           #put this in the chain-spec file, grandpa.authorities 

$ ./target/release/node-template key generate --scheme Sr25519 --password-interactive
Key password: 123456
Secret phrase `caution evil word live concert suit cousin crisp tobacco lizard wheat banner` is account:
  Secret seed:       0x52e547fc68fed1d7e97be6232434ccc51d9cfe1cc237820d9cf3a559dd2be6e8         # use the string as next step's input, import to node02
  Public key (hex):  0xced1d44c697e75fd3c51096e869d204f9aec8620ab3422d3e81ec6870fe81c41
  Public key (SS58): 5Gjt44znWzR8eu7fDH7cRey8KavbHQuoraD1a3ttYPsVpn75
  Account ID:        0xced1d44c697e75fd3c51096e869d204f9aec8620ab3422d3e81ec6870fe81c41
  SS58 Address:      5Gjt44znWzR8eu7fDH7cRey8KavbHQuoraD1a3ttYPsVpn75                           #put this in the chain-spec file, aura.authorities

$ ./target/release/node-template key inspect --password-interactive --scheme Ed25519 0x52e547fc68fed1d7e97be6232434ccc51d9cfe1cc237820d9cf3a559dd2be6e8
Key password: 123456
Secret Key URI `0x52e547fc68fed1d7e97be6232434ccc51d9cfe1cc237820d9cf3a559dd2be6e8` is account:
  Secret seed:       0x52e547fc68fed1d7e97be6232434ccc51d9cfe1cc237820d9cf3a559dd2be6e8
  Public key (hex):  0x1d2259132f8ad2d6cb92ce397c97dfe86226708130c94ca3fa10651276de514f
  Public key (SS58): 5CiuT1fKfVZGeok2T68g4zx1RCMCmZbHD7zFUrguLeiuCZ1g
  Account ID:        0x1d2259132f8ad2d6cb92ce397c97dfe86226708130c94ca3fa10651276de514f
  SS58 Address:      5CiuT1fKfVZGeok2T68g4zx1RCMCmZbHD7zFUrguLeiuCZ1g                           #put this in the chain-spec file, grandpa.authorities 






./target/release/node-template key insert --base-path /tmp/node01 \
--chain customSpecRaw.json \
--suri 0xa80c9a2c2c96ac61a548a358c81aa07a519af00e7b3fc25f06761e2a5af42044 \                     # Secret seed
--password-interactive \
--key-type aura

./target/release/node-template key insert --base-path /tmp/node01 \
--chain customSpecRaw.json \
--suri 0xa80c9a2c2c96ac61a548a358c81aa07a519af00e7b3fc25f06761e2a5af42044 \
--password-interactive \
--key-type gran


./target/release/node-template key insert --base-path /tmp/node02 \
--chain customSpecRaw.json \
--suri 0x52e547fc68fed1d7e97be6232434ccc51d9cfe1cc237820d9cf3a559dd2be6e8 \
--password-interactive \
--key-type aura


./target/release/node-template key insert --base-path /tmp/node02 \
--chain customSpecRaw.json \
--suri 0x52e547fc68fed1d7e97be6232434ccc51d9cfe1cc237820d9cf3a559dd2be6e8 \
--password-interactive \
--key-type gran

将密钥导入密钥库后

$ ls /tmp/node01/chains/local_testnet/keystore
61757261780a4cd1e018e5433c061da3c28ad1ff33a59da6cd8b750a5a37f3e7fb69fc62        6772616e780a4cd1e018e5433c061da3c28ad1ff33a59da6cd8b750a5a37f3e7fb69fc62
$ ls /tmp/node02/chains/local_testnet/keystore
61757261ced1d44c697e75fd3c51096e869d204f9aec8620ab3422d3e81ec6870fe81c41        6772616eced1d44c697e75fd3c51096e869d204f9aec8620ab3422d3e81ec6870fe81c41

我重启了node1,node2,但是结果是:

Idle (1 peers), best: #94 (0x8634…b5c9), finalized #0 (0x4f9a…68f0), ⬇ 40 B/s ⬆ 0.1kiB/s   

最终区块号总是0

我试过老版本的题目start a private network,它使用subkey生成密钥。有效。但是我在参考新教程时失败了。

我哪里错了?

有一个部分叫做生成你自己的密钥

https://docs.substrate.io/tutorials/v3/private-network/#generate-your-own-keys

Secret Seed是你的suri

还有一些不错的脚本可以轻松插入密钥

https://github.com/substrate-developer-hub/substrate-node-template/blob/tutorials/solutions/private-chain-v3/key-insert/insert-keys.sh

让我post一个正确答案:

$./target/release/node-template key insert --base-path /tmp/node01 \
--chain customSpecRaw.json \
--scheme ed25519 \
--suri 0xa80c9a2c2c96ac61a548a358c81aa07a519af00e7b3fc25f06761e2a5af42044 \
--password-interactive \
--key-type gran

导入祖父密钥时,添加:--scheme ed25519 .

这样做之后,它起作用了。

Idle (1 peers), best: #95 (0xf51f…65a8), finalized #93 (0x072b…192a), ⬇ 0.5kiB/s ⬆ 0.6kiB/s   

请参考:https://core.tetcoin.org/docs/en/knowledgebase/integrate/subkey#inserting-keys-to-a-nodes-keystore