keep-core
keep-core copied to clipboard
Start a client
We need to start a client by executing 3 scripts: install.sh
, initialize.sh
, and start.sh
. This issue should handle all the setups (including config file updates) to automate the starting process as much as possible.
PRs:
- https://github.com/keep-network/keep-core/pull/3148 - initial version
- https://github.com/keep-network/keep-core/pull/3163 - improvement. Reading the operator address from the
ethereum.keyFile
TODO:
- [ ] update docs https://github.com/keep-network/keep-core/pull/3170
Clients running on a local machine before starting will need to be set with:
-
ethereum.url
-
ethereum.keyFile
-
network.peers
-
network.port
-
storage.dataDir
Contracts' addresses will not be needed once https://github.com/keep-network/keep-core/pull/3129 is merged.
For the initial version, we can expect a developer to configure TOML file with those details before starting the client.
In the future, possible improvements that I see are:
- adding interactive prompts in
install.sh
andinitialize.sh
scripts to ask the developer for the required parameters (we've got prompts already instart.sh
), - update
initialize.sh
to read the operator address from theethereum.keyFile
and use this address for initialization, instead of requiring the user to provide it with--stake-owner
flag.
adding interactive prompts in install.sh and initialize.sh scripts to ask the developer for the required parameters (we've got prompts already in start.sh)
Just to clarify, do you have in mind something like:
install.sh
will prompt for the following configs and can overwrite the existing ones:
-
ethereum.url
- default is the existingURL
if present -
storage.dataDir
- default is the existingdataDir
if present -
network.peers
- default is empty or existingpeers
if present -
network.port
- default is empty or existingport
if present
initialize.sh
will prompt for the following configs and can overwrite the existing ones:
-
ethereum.keyFile
- default is the existingkeyFile
if present
start.sh
all the prompts stay as-is
After discussing improvements with @nkuba we decided to add only reading the address from the ethereum.keyFile
.
Regarding the other params, we think, that prompting for config params in install.sh
is too much because they are usually set only once and devs can do it by themselves. Also, prompting for each param also slows down the start, cause you have to click enter 4x times for the default values, and the default params will cover most cases.