orbitdb / orbit-db-cli

CLI for orbit-db
MIT License
61 stars 15 forks source link

Add daemon mode #11

Open haadcode opened 6 years ago

haadcode commented 6 years ago

It was suggested in https://github.com/orbitdb/orbit-db/issues/233 that we should have a daemon mode. I think adding that would be awesome!

I reckon we can start by the "daemon mode" being the same as starting a HTTP API that can be used to interact with OrbitDB. I made a skeleton for that in orbit-db-http-server which we could pull into the CLI. Then, add a new command daemon in src/commands that start the http server.

This would be a good task to work on for someone who's looking to contribute to the project and it shouldn't be too complicated.

dbeecham commented 6 years ago

Since we're on github-help-wanted.com, could you give us an introduction to this issue? Starting a daemon mode from a separate cli is a bit unorthodox... Do you start the server in the foreground first, then push it to the background with the cli? Or does the server stay in the foreground, and you start a daemonized HTTP API with the CLI?

edit: ...or do you start the server altogether using the cli?

haadcode commented 6 years ago

Thanks @dbeecham for jumping in! 😄 👍

I was thinking the UX would be, that you start the OrbitDB daemon with the CLI:

orbitdb daemon

The CLI command would start the orbit-db-http-server and once ready, it outputs:

OrbitDB server started at http://127.0.0.1:37373/

It would stay in the foreground and can be stopped with ctrl+c. So essentially the CLI wraps the http-server, ie. the CLI provides a way to start the http server.

What do you think?

aphelionz commented 5 years ago

@haadcode assign this to me? I'll take a look at this. I enjoy using the orbitdb cli so improving it would be great

haadcode commented 5 years ago

@aphelionz that would be fantastic! 👍I've added you to the collaborators on the project, so you can work directly in the repo.

Heads up though, the code hasn't been updated in a while a you might have to fix other issues like #17 before you can proceed with this. And generally, any refactoring of the code is highly appreciated as you work through it.

aphelionz commented 5 years ago

@haadcode copy that