Skip to content

Commit

Permalink
Set validator flag when use dev account (qdrvm#1625)
Browse files Browse the repository at this point in the history
Signed-off-by: kamilsa <[email protected]>
  • Loading branch information
kamilsa authored May 22, 2023
1 parent d1b9e9e commit be47d3e
Show file tree
Hide file tree
Showing 31 changed files with 20 additions and 38 deletions.
2 changes: 1 addition & 1 deletion core/api/service/system/requests/health.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace kagome::api::system::request {
// isSyncing - Whether the node is syncing.
data["isSyncing"] =
makeValue(api_->getBabe()->getCurrentState()
== consensus::babe::Babe::State::SYNCHRONIZED);
!= consensus::babe::Babe::State::SYNCHRONIZED);

// peers - Number of connected peers
data["peers"] = makeValue(
Expand Down
12 changes: 11 additions & 1 deletion core/application/impl/app_configuration_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,14 @@ namespace kagome::application {
// clang-format on

for (auto &[flag, name, dev] : devAccounts()) {
development_desc.add_options()(flag, po::bool_switch());
development_desc.add_options()(
flag,
po::bool_switch(),
fmt::format("Shortcut for `--name {} --validator` with session keys "
"for `{}` added to keystore",
name,
name)
.c_str());
}

po::variables_map vm;
Expand Down Expand Up @@ -961,6 +968,9 @@ namespace kagome::application {
dev_account_flag = flag;
node_name_ = name;
dev_mnemonic_phrase_ = dev;
// if dev account is passed node is considered as validator
roles_.flags.full = 0;
roles_.flags.authority = 1;
}
}

Expand Down
16 changes: 8 additions & 8 deletions examples/polkadot-local/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ polkadot build-spec --chain polkadot-local-custom-spec.json --raw > polkadot-loc

Open four terminals and run a unique instance of KAGOME in each of them
```
kagome --chain polkadot-local-custom.json --validator --base-path alice --name Alice -p 10001 --rpc-port 11001 --ws-port 12001 --prometheus-port 13001
kagome --chain polkadot-local-custom.json --validator --base-path bob --name Bob -p 10002 --rpc-port 11002 --ws-port 12002 --prometheus-port 13002
kagome --chain polkadot-local-custom.json --validator --base-path charlie --name Charlie -p 10003 --rpc-port 11003 --ws-port 12003 --prometheus-port 13003
kagome --chain polkadot-local-custom.json --validator --base-path dave --name Dave -p 10004 --rpc-port 11004 --ws-port 12004 --prometheus-port 13004
kagome --chain polkadot-local-custom.json --base-path alice --alice --port=10001 --rpc-port=11001 --prometheus-port=12001 --node-key=95d11fd8fc41db64f8f90fecccc1420af9a3ff8dacef6d6a96c3679177860516
kagome --chain polkadot-local-custom.json --base-path bob-sub --bob --port=10002 --rpc-port=11002 --prometheus-port=12002 --node-key=a9c7609d2c48c88f5ca3b147fc946ae0664dae7d824a2549379127ef3eadea35
kagome --chain polkadot-local-custom.json --base-path charlie --charlie --port=10003 --rpc-port=11003 --prometheus-port 12003 --node-key=f69b297baa6a2a1d2652ee0f72bf07f45fc92c0facc07250679dcc164c53e9a5
kagome --chain polkadot-local-custom.json --base-path dave --dave --port=10004 --rpc-port=11004 --prometheus-port 12004 --node-key=e0d0ba382d0c82b8e1bffc23e316bb9dac07a63408b83480402aee1499515c72
```

### Run Polkadot network
```
polkadot --chain polkadot-local-custom.json --base-path=alice-sub --alice --port=10001 --rpc-port=11001 --ws-port=12001 --prometheus-port=13001 --node-key=95d11fd8fc41db64f8f90fecccc1420af9a3ff8dacef6d6a96c3679177860516
polkadot --chain polkadot-local-custom.json --base-path=bob-sub --bob --port=10002 --rpc-port=11002 --ws-port=12002 --prometheus-port=13002 --node-key=a9c7609d2c48c88f5ca3b147fc946ae0664dae7d824a2549379127ef3eadea35
polkadot --chain polkadot-local-custom.json --base-path=charlie-sub --charlie --port=10003 --rpc-port=11003 --ws-port=12003 --prometheus-port=13003 --node-key=f69b297baa6a2a1d2652ee0f72bf07f45fc92c0facc07250679dcc164c53e9a5
polkadot --chain polkadot-local-custom.json --base-path=dave-sub --dave --port=10004 --rpc-port=11004 --ws-port=12004 --prometheus-port=13004 --node-key=e0d0ba382d0c82b8e1bffc23e316bb9dac07a63408b83480402aee1499515c72
polkadot --chain polkadot-local-custom.json --base-path=alice --alice --port=10001 --rpc-port=11001 --prometheus-port=12001 --node-key=95d11fd8fc41db64f8f90fecccc1420af9a3ff8dacef6d6a96c3679177860516
polkadot --chain polkadot-local-custom.json --base-path=bob --bob --port=10002 --rpc-port=11002 --prometheus-port=12002 --node-key=a9c7609d2c48c88f5ca3b147fc946ae0664dae7d824a2549379127ef3eadea35
polkadot --chain polkadot-local-custom.json --base-path=charlie --charlie --port=10003 --rpc-port=11003 --prometheus-port=12003 --node-key=f69b297baa6a2a1d2652ee0f72bf07f45fc92c0facc07250679dcc164c53e9a5
polkadot --chain polkadot-local-custom.json --base-path=dave --dave --port=10004 --rpc-port=11004 --prometheus-port=12004 --node-key=e0d0ba382d0c82b8e1bffc23e316bb9dac07a63408b83480402aee1499515c72
```

> Note, you may run network composed of both KAGOME and Polkadot type of validators

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit be47d3e

Please sign in to comment.