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

config: add systemd service files #265

Closed
wants to merge 1 commit into from

Conversation

hackaugusto
Copy link
Contributor

@hackaugusto hackaugusto commented Mar 6, 2024

This adds a two minimal systemd files to run a miden-node and miden-faucet.

These two service files are far from perfect, but it is nice to have them around if we need them once more.

For the moment the faucet is pigbacking in the node for the account details (from the genesis), and it removes the client's db on every restart. Both are not great, but to improve these the faucet needs to be improved. Which is at the moment is under development.

@hackaugusto hackaugusto requested a review from bobbinth March 6, 2024 15:04
@hackaugusto hackaugusto force-pushed the hacka-systemd-service-files branch 2 times, most recently from 0e23523 to 10836cd Compare March 6, 2024 15:07
@hackaugusto hackaugusto changed the title config: add systemd serivce files config: add systemd service files Mar 6, 2024
@bobbinth
Copy link
Contributor

bobbinth commented Mar 8, 2024

I am not very familiar with how systemd works - these files are so that we are able to run node/faucet as services, right? If so, maybe worth adding a bit more info about how they are to be used (in the relevant documentation files)?

Also, is config directory in the root the right place for them? For example, would it make more sense to put the relevant files into node and faucet directories?

@phklive
Copy link
Contributor

phklive commented Mar 11, 2024

I think that we should not merge this PR for now, I agree that we should have managment for the faucet and node as services but we should wait for this issue to be closed first to make sure we have all the right paths and structure, etc...: #215

@hackaugusto
Copy link
Contributor Author

I am not very familiar with how systemd works - these files are so that we are able to run node/faucet as services, right? If so, maybe worth adding a bit more info about how they are to be used (in the relevant documentation files)?

Added a bit of docs.

Also, is config directory in the root the right place for them? For example, would it make more sense to put the relevant files into node and faucet directories?

I have no preference, where do you want them?

I think that we should not merge this PR for now, I agree that we should have managment for the faucet and node as services but we should wait for this issue to be closed first to make sure we have all the right paths and structure, etc...: #215

These files can be updated if changes are necessary.

@hackaugusto hackaugusto force-pushed the hacka-systemd-service-files branch from 10836cd to e380c81 Compare March 12, 2024 13:20
@bobbinth
Copy link
Contributor

Also, is config directory in the root the right place for them? For example, would it make more sense to put the relevant files into node and faucet directories?

I have no preference, where do you want them?

I actually don't know what the best practices on this are. I'm assuming these are needed for node deployment but are separate from the docker build? Basically, how would these be used during deployment? For example, we have something like this:

  1. Download/install Rust.
  2. Download/install required dependencies.
  3. Run cargo install miden-node.
  4. Generate the genesis file.
  5. Run miden-node start.

Would these basically replace step 5 in the above with something like?:

  1. Download miden-node.service from Github.
  2. Install it into /etc/systemd/system. (is this done by just copying the file?)
  3. Run systemctl daemon-reload and systemctl enable --now miden-node.

@hackaugusto
Copy link
Contributor Author

I'm assuming these are needed for node deployment but are separate from the docker build?

Yes, systemd and docker are completely unrelated. The first would added to a package, say .deb and after a apt install miden the user can run sudo systemd enable miden-node.

Would these basically replace step 5 in the above with something like?:

Yeah, that would work too, but we would need to distribute the miden-node binary too.

@bobbinth
Copy link
Contributor

bobbinth commented Apr 1, 2024

Yeah, that would work too, but we would need to distribute the miden-node binary too.

So - eventually, they would go into building of a .deb package, right? In this case, I think putting them into their respective directories makes sense - e.g., miden-node.service would go into node directory.

Also, should we create an issue for building .deb packages?

@hackaugusto
Copy link
Contributor Author

super seeded by #312

@hackaugusto hackaugusto deleted the hacka-systemd-service-files branch April 11, 2024 18:31
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

Successfully merging this pull request may close these issues.

3 participants