Deploy Bootnode
Setup bootnode on GCP
Go to https://node.unitcode.org/ and follow instructions for deploying node to GCP up until "Compile UNC codebase".
Build the node if you haven't done it yet.
Configure the validator keys (optional)
There is a set of keys configured by default in the chain, the 12-word seed phrase is the following:
tape between genre critic crouch adjust slot eternal cancel cry witness lucky
This private key is used to derive the set of keys for the initial validators and is the account with root privilege.
Generate the keys
Steps to deploy a chain using a new key:
- Generate a new phrase using 'subkey'
./target/release/node-unitchain key generate
The result of this demostration is:
Secret phrase: rose cushion master install sentence want tuition simple goat jungle write help Network ID: substrate Secret seed: 0xe5771303b02b91117ac66f4a18581471f90a0d50763593528b42c86e9dcac5cf Public key (hex): 0x1ccd91edf2ef62e68daf6e9eda947c6c980986330dcc2e7da0bebaaf629f494f Account ID: 0x1ccd91edf2ef62e68daf6e9eda947c6c980986330dcc2e7da0bebaaf629f494f Public key (SS58): 5CiUGKg8FBucJ6fyeTrSSmEL9BAqFJzLGqyWZwyHygamHjXs SS58 Address: 5CiUGKg8FBucJ6fyeTrSSmEL9BAqFJzLGqyWZwyHygamHjXs
- Replace the root key in 'node/src/chain_spec.rs' on the function 'staging_network_config_genesis'
The lines should look like:
.
.
.
// generated with secret: subkey inspect "$secret"
let root_key: AccountId = hex![
// 5CiUGKg8FBucJ6fyeTrSSmEL9BAqFJzLGqyWZwyHygamHjXs
"1ccd91edf2ef62e68daf6e9eda947c6c980986330dcc2e7da0bebaaf629f494f"
].into();
.
.
.
- Generate the set of keys for the validators:
-
Replace the 'VALIDATOR_BASE_KEY' variable located at 'scripts/session_keys/keys.sh' with secret seed generated in (1).
-
Run the following command, you need to specify the number of validators:
./scripts/prepate-test-net.sh 3
You will see the following result in the console:
( // 5GCH71i6nRDJNBaPTKBqmC4qLSBYMGmZmqxKcgyK2Y1rafTs hex!("b6b79273f9f1a4c7c457191da8d02ebe011b36ee68dd0a7748ab3d4ee9dc9205").into(), // 5DqggLh8S15FVJL55EsVZiiLdMYSvLd5KivMzckzcZRE5LM9 hex!("4e8a4f96913a5af657fb3b272fc7928e7864988edd9cac234bed7548b71a7051").into(), // 5FeaAvLjSsRHnxRKKiEgGtzvEZG5dyHw2oM4Gwh7JBfpPBbN hex!("9e892c4bb87da9b5c1f0b03ef2951d1f92dfc222fa69aa308a921417ed106869").unchecked_into(), // 5GoCNhf5LAgZ6CCTy7bEUFzdhs7SbVyRvK8XyRGT9rDk8ugd hex!("d1593d84979e4df06994d8ebb3a0bd55e9a8d7c46b652c7df614586d248bb825").unchecked_into(), // 5Exo37Cdnm7gvHJ9fFaMbrN3YqUewrx2avWNPdQVX5Xna4gu hex!("8032aa51973a9d23368c150c42675c2a7986d478c06838835aab76807874d66a").unchecked_into(), ), ( // 5Gj5yWwqt7GSZnVt7dc6ybWMAK5g21gtYAndChU8ob3my44C hex!("ce36b71b084ee78f0e7dd49137925111944073bfb1009680d062abf0f19e6f40").into(), // 5EEjLUZGq3AUPFSoWitXAkMSRNAsUG9NFwZPY8ZE9U1mrdDn hex!("601de6b2fbf6efc27d583601a2818a4546988d1afa11e8fceda084a301d4326e").into(), // 5GsyXCyUCLoJiA54JGgbanDn2Z5zK8uAMv1MSPE9UXmmkAKf hex!("d4fe32f6e3696fa08e4939f0ef342947ef426c11587c50d8c543a5df4e94034b").unchecked_into(), // 5GfLN4aaQ7NFcRoh6MhHzgnoX8maLRnhx2sUDAVzxNTm36Ja hex!("cb5a2b9d2ff3deaed58fe20ad5ff85cd8e06f578b3612951d276990c9ba3b0b4").unchecked_into(), // 5EfEfvNDsqLsG8W3d2o7pCfnGH78UCnTVAqhieM4oSnZTPtY hex!("72ce8acabcd9d77aa1ea66d7d609c24f2e5ba217622ba51afeaca83736b91f01").unchecked_into(), ), ( // 5DUxAuUjewVMUAy6SFDyJjzRjxrSMtG1JV6jCxSgoosHE6Gf hex!("3eba4f505b2c6907618cf3e11e38d27bcfd901e190db2254f22ebfba5cf76b29").into(), // 5HMojnnqzGDPK47cdDgyKmGdeHttg3YpkuTdPAEHUuhHuJjx hex!("ea3823416a6ddd4f8a5bc66ff0b5b577c3cc4651f229671dc6f55b10ff485031").into(), // 5GgPM7TLtQGWtxWA5SVGkknusFM4j26GaDptXCMyY7dS9YF4 hex!("cc2775a268ef9aa67f4b0f9f6218c66c27fba07c2f8e020bd3083671911dfe41").unchecked_into(), // 5E81afpN3FH8FVDvqqCAXspRhjUGT7bit7HY9W8NL63isGoi hex!("5afdde32c734a21d1f6be131234776f18a5324d3701b0b28111238dacc0ef8df").unchecked_into(), // 5Gue9c8ShqHhXSukR38jCDtT5FXAxXsKPtScMPFVMEQXxnCS hex!("d64379faedf1c2c0a46230ac2ec48fea69f31aadcba83716c7353fac5a664c04").unchecked_into(), ),
- Replace the 'initial_authorities' variable in 'node/src/chain_spec.rs' on the function 'staging_network_config_genesis' with the generated set of keys.
The lines should look like:
.
.
.
let initial_authorities: Vec<(AccountId, AccountId, BabeId, GrandpaId, ImOnlineId)> = vec![
(
// 5GCH71i6nRDJNBaPTKBqmC4qLSBYMGmZmqxKcgyK2Y1rafTs
hex!("b6b79273f9f1a4c7c457191da8d02ebe011b36ee68dd0a7748ab3d4ee9dc9205").into(),
// 5DqggLh8S15FVJL55EsVZiiLdMYSvLd5KivMzckzcZRE5LM9
hex!("4e8a4f96913a5af657fb3b272fc7928e7864988edd9cac234bed7548b71a7051").into(),
// 5FeaAvLjSsRHnxRKKiEgGtzvEZG5dyHw2oM4Gwh7JBfpPBbN
hex!(
"9e892c4bb87da9b5c1f0b03ef2951d1f92dfc222fa69aa308a921417ed106869"
).unchecked_into(),
// 5GoCNhf5LAgZ6CCTy7bEUFzdhs7SbVyRvK8XyRGT9rDk8ugd
hex!(
"d1593d84979e4df06994d8ebb3a0bd55e9a8d7c46b652c7df614586d248bb825"
).unchecked_into(),
// 5Exo37Cdnm7gvHJ9fFaMbrN3YqUewrx2avWNPdQVX5Xna4gu
hex!(
"8032aa51973a9d23368c150c42675c2a7986d478c06838835aab76807874d66a"
).unchecked_into(),
),
(
// 5Gj5yWwqt7GSZnVt7dc6ybWMAK5g21gtYAndChU8ob3my44C
hex!("ce36b71b084ee78f0e7dd49137925111944073bfb1009680d062abf0f19e6f40").into(),
// 5EEjLUZGq3AUPFSoWitXAkMSRNAsUG9NFwZPY8ZE9U1mrdDn
hex!("601de6b2fbf6efc27d583601a2818a4546988d1afa11e8fceda084a301d4326e").into(),
// 5GsyXCyUCLoJiA54JGgbanDn2Z5zK8uAMv1MSPE9UXmmkAKf
hex!(
"d4fe32f6e3696fa08e4939f0ef342947ef426c11587c50d8c543a5df4e94034b"
).unchecked_into(),
// 5GfLN4aaQ7NFcRoh6MhHzgnoX8maLRnhx2sUDAVzxNTm36Ja
hex!(
"cb5a2b9d2ff3deaed58fe20ad5ff85cd8e06f578b3612951d276990c9ba3b0b4"
).unchecked_into(),
// 5EfEfvNDsqLsG8W3d2o7pCfnGH78UCnTVAqhieM4oSnZTPtY
hex!(
"72ce8acabcd9d77aa1ea66d7d609c24f2e5ba217622ba51afeaca83736b91f01"
).unchecked_into(),
),
(
// 5DUxAuUjewVMUAy6SFDyJjzRjxrSMtG1JV6jCxSgoosHE6Gf
hex!("3eba4f505b2c6907618cf3e11e38d27bcfd901e190db2254f22ebfba5cf76b29").into(),
// 5HMojnnqzGDPK47cdDgyKmGdeHttg3YpkuTdPAEHUuhHuJjx
hex!("ea3823416a6ddd4f8a5bc66ff0b5b577c3cc4651f229671dc6f55b10ff485031").into(),
// 5GgPM7TLtQGWtxWA5SVGkknusFM4j26GaDptXCMyY7dS9YF4
hex!(
"cc2775a268ef9aa67f4b0f9f6218c66c27fba07c2f8e020bd3083671911dfe41"
).unchecked_into(),
// 5E81afpN3FH8FVDvqqCAXspRhjUGT7bit7HY9W8NL63isGoi
hex!(
"5afdde32c734a21d1f6be131234776f18a5324d3701b0b28111238dacc0ef8df"
).unchecked_into(),
// 5Gue9c8ShqHhXSukR38jCDtT5FXAxXsKPtScMPFVMEQXxnCS
hex!(
"d64379faedf1c2c0a46230ac2ec48fea69f31aadcba83716c7353fac5a664c04"
).unchecked_into(),
)
];
.
.
.
- IMPORTANT Delete the 'data' folder if any and build the node before moving to next step.
Start the node
Run the following command to start the set of nodes:
nohup ./scripts/start_multi_node.sh &
The previous command will run the three nodes in the background and insert the keys into the nodes.
At this point, the blocks should begin to be produced and finalized.
A folder called 'data' will be created with the database, keystore, and log for the nodes.