Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for non-interactive setup #2

Open
Cerkoryn opened this issue Jan 1, 2024 · 0 comments
Open

Request for non-interactive setup #2

Cerkoryn opened this issue Jan 1, 2024 · 0 comments

Comments

@Cerkoryn
Copy link

Cerkoryn commented Jan 1, 2024

Copied the same issue from the testnet CLI repository #1

Part of the allure of a CLI-based application is the ability to use it with automated scripts and container orchestration. However, the initial step of registering an Iagon storage provider node makes this difficult. Consider the following:

cerkoryn@iagon-server:/opt$ ./iag-cli-linux start
  _ _ _   ___                          _   _           _         ____ _     ___   _ _ _
 | | | | |_ _|__ _  __ _  ___  _ __   | \ | | ___   __| | ___   / ___| |   |_ _| | | | |
 | | | |  | |/ _` |/ _` |/ _ \| '_ \  |  \| |/ _ \ / _` |/ _ \ | |   | |    | |  | | | |
 |_|_|_|  | | (_| | (_| | (_) | | | | | |\  | (_) | (_| |  __/ | |___| |___ | |  |_|_|_|
 (_|_|_) |___\__,_|\__, |\___/|_| |_| |_| \_|\___/ \__,_|\___|  \____|_____|___| (_|_|_)
                   |___/
Please evaluate your system to get started
? Path where you want to store files: /mnt/test
? Storage to commit in GB: 10
? Port for server: 1024
✔ Evaluation completed successfully
✔ Node registered successfully
✔ Server started
✔ Test completed successfully, authorization key: <redacted>
cerkoryn@iagon-server:/opt$

This particular step of setup requires a user to manually type in the answers to those three variables, which are then saved to a configuration file in ~/iagon-node. After this step, it appears that a user can backup that configuration and restore it to keep from having to do setup again (though I'm not sure if this is supported or not).

Part of my own custom Docker container for the Iagon storage node cli contains this in entrypoint.sh:

# Check if configuration exists
if [ -d "$CONFIG_DIR" ] && [ "$(ls -A $CONFIG_DIR)" ]; then
  echo "Configuration found. Starting service..."
  # Command to start service using existing configuration
  ./iag-cli-linux start
else
  echo "No configuration found. Please initialize the configuration manually using the following command:"
  echo "docker exec -it iagon-provider-node /bin/bash"

  echo "No configuration found. Initializing service..."
  # Command to initialize service, might need to handle input here or modify your service to accept env variables
  ./iag-cli-linux start <<EOF
  $IAGON_STORAGE_PATH
  $IAGON_STORAGE_SIZE
  $IAGON_SERVER_PORT
  EOF

# Save an extra backup just in case.
  cp -R /root/iagon-node /mnt/backup/
fi

However, this and the many variations of it I have tried don't work due to the interactive steps of setup.

My request is to add some sort of non-interactive setup. Perhaps it could be as simple as iag-cli-linux start --noninteractive where it could read those variables in from environment variables or from a config file.

I imagine something like this isn't a high priority, but many of the commercial or open-source NAS products on the market are designed to run software like this in containers. Adding a feature like this would streamline adoption for that part of the userbase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant