Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

feat: provide start command #2

Merged
merged 3 commits into from Nov 27, 2023
Merged

Conversation

jacderida
Copy link
Contributor

  • 13e91af feat: provide start command

    Start installed safenode services. If a service name or peer ID is not supplied, it will attempt to
    start everything.

    If the service status is Installed (meaning it has not been started for the first time since it
    was installed) or Stopped, there will be an attempt to start it. If the service is Running we
    will check again that it is actually running, and if it isn't, attempt to start it again.

    Also change the integration tests here to one test which will be cross platform service
    manipulation. The commands should work on different operating systems. Once a status command has
    been added we will be able to use the application to validate itself.

  • b16b191 chore: specify root and log dirs at install time

    To facilitate starting a node again with the same data, we need to supply the --root-dir argument
    at install time. In addition to that, we need to actually create the directory and assign it the
    correct permissions such that the user running the service will be able to write to it.

    The log dir is also specified. This makes the logs available at system-wide locations rather than
    the default directories, which is the data directory of the user running the service, which can make
    them difficult to access, especially on Windows. Despite being at a system-wide location, on Linux,
    the directory is assigned permissions to be written to by the safe user.

    I tested the configurations on Windows and Linux.

    I have also added a utility Vagrantfile here for quick testing. The reason for using a VM is because
    you need to run commands as root and actually install services. I didn't want to have to continually
    clean up that mess on my dev machine.

Start installed safenode services. If a service name or peer ID is not supplied, it will attempt to
start everything.

If the service status is `Installed` (meaning it has not been started for the first time since it
was installed) or `Stopped`, there will be an attempt to start it. If the service is `Running` we
will check again that it is actually running, and if it isn't, attempt to start it again.

Also change the integration tests here to one test which will be cross platform service
manipulation. The commands should work on different operating systems. Once a `status` command has
been added we will be able to use the application to validate itself.
To facilitate starting a node again with the same data, we need to supply the `--root-dir` argument
at install time. In addition to that, we need to actually create the directory and assign it the
correct permissions such that the user running the service will be able to write to it.

The log dir is also specified. This makes the logs available at system-wide locations rather than
the default directories, which is the data directory of the user running the service, which can make
them difficult to access, especially on Windows. Despite being at a system-wide location, on Linux,
the directory is assigned permissions to be written to by the `safe` user.

I tested the configurations on Windows and Linux.

I have also added a utility Vagrantfile here for quick testing. The reason for using a VM is because
you need to run commands as root and actually install services. I didn't want to have to continually
clean up that mess on my dev machine.
@jacderida jacderida force-pushed the service-control branch 5 times, most recently from 40a27d4 to cd8ef42 Compare November 27, 2023 11:54
Instead of introducing a new `sn_rpc_client` crate, we decided to make the existing
`sn_node_rpc_client` crate both a lib and a binary crate.

An update to the service manager crate was also merged.
@jacderida jacderida merged commit 9246e50 into maidsafe:main Nov 27, 2023
13 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants