cli icon indicating copy to clipboard operation
cli copied to clipboard

Daemon not detected when directly started from hyperspace

Open DieracDelta opened this issue 2 years ago • 5 comments

When I start hypercore with hyperspace --storage $STORAGE --host $HOST --port $PORT, then run:

❯ ps -aux | rg hyp
jrestivo 1067902  0.1  0.0 635796 54572 ?        SLsl 11:08   0:00 /nix/store/5kkjf5wvfvclqj76k9f69c95gw5mfbhc-nodejs-14.17.4/bin/node /nix/store/if04chi2qyhxr5mvifmq9wfhswydj3ms-hyperspace/bin/hyperspace --storage ~/.hyperspace --host hyperspace --port 0
jrestivo 1069029  0.0  0.0   9644  6232 pts/11   S+   11:11   0:00 rg hyp
flakes [$!+?]
❯ hyp info
The daemon is not active. Please run:

  hyp daemon start
❯ hyp daemon status
Hyperspace v3.19.0
Hyperspace API v1.15.1
Your address:  (Not Hole-punchable)

This is preventing me from using any of the hyp commands. Any advice? Both hyp info and hyp daemon start connect to the daemon, as it prints out:

Remote client opened
Remote client closed

DieracDelta avatar Aug 21 '21 15:08 DieracDelta

If you're using a --host other than the default, you'll need to pass that param to hyp daemon status too

pfrazee avatar Aug 21 '21 15:08 pfrazee

I've added --host to both invocations. Same output:

❯ hyp --host hyperspace info
The daemon is not active. Please run:

  hyp daemon start
❯ hyp --host hyperspace daemon status
Hyperspace v3.19.0
Hyperspace API v1.15.1
Your address:  (Not Hole-punchable)

DieracDelta avatar Aug 21 '21 16:08 DieracDelta

Ah, it looks like the hyp CLI isn't respecting this config: https://github.com/hypercore-protocol/cli/blob/master/lib/hyper/index.js#L16 and https://github.com/hypercore-protocol/cli/blob/master/lib/commands/daemon/status.js#L20 (and a few other spots)

We should either add a CLI flag or an env var. Any thoughts on which?

cc @andrewosh @mafintosh

pfrazee avatar Aug 21 '21 16:08 pfrazee

What would the CLI flag/env var be specifying? From a usability standpoint, either sounds fine on my end as a user.

DieracDelta avatar Aug 22 '21 01:08 DieracDelta

I tried making some local modifications to this for testing and I would also mention that the hyperspace-mirroring-service is also a daemon that needs to be running for the CLI to work. I've been trying for the last while to get that running in a Docker container and I can't make sense of it; its pretty ambiguous.

EternalDeiwos avatar Aug 27 '21 19:08 EternalDeiwos