keep-core icon indicating copy to clipboard operation
keep-core copied to clipboard

Start a client

Open dimpar opened this issue 2 years ago • 3 comments

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

dimpar avatar Aug 05 '22 13:08 dimpar

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 and initialize.sh scripts to ask the developer for the required parameters (we've got prompts already in start.sh),
  • update initialize.sh to read the operator address from the ethereum.keyFile and use this address for initialization, instead of requiring the user to provide it with --stake-owner flag.

nkuba avatar Aug 08 '22 14:08 nkuba

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 existing URL if present
  • storage.dataDir - default is the existing dataDir if present
  • network.peers - default is empty or existing peers if present
  • network.port - default is empty or existing port if present

initialize.sh will prompt for the following configs and can overwrite the existing ones:

  • ethereum.keyFile - default is the existing keyFile if present

start.sh all the prompts stay as-is

dimpar avatar Aug 11 '22 10:08 dimpar

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.

dimpar avatar Aug 13 '22 16:08 dimpar