RangerMauve / dat-store

A CLI tool for backing up hyperdrive datasets
GNU Affero General Public License v3.0
59 stars 14 forks source link

port not configurable for `dat store list` #16

Closed canadaduane closed 5 years ago

canadaduane commented 5 years ago

I set the API port to 3500 on the service via dat store run-service --port 3500.

However, when I try to list dat stores, the --port flag seems to be ignored:

$ dat store --port 3500 list
dat-store list [provider]

List the Dats in your storage provider.

Options:
  --version           Show version number                              [boolean]
  --help              Show help                                        [boolean]
  --storage-location  The folder to store dats in
  --port              The port to use for the HTTP API           [default: 3472]
  --host              The hostname to make the HTTP server listen on
  --verbose           Whether the HTTP server should output logs
                                                       [boolean] [default: true]
  --dat-port          The port to listen for P2P connections on  [default: 3282]
  --latest            Whether to download just the latest changes
                                                      [boolean] [default: false]

Error: Could not connect to service http://localhost:3472
Make sure you have a local service running with 'dat store install-service'
Also check if the remote service you have configured is online
    at StoreClient.init (/home/duane/.nvm/versions/node/v10.15.3/lib/node_modules/dat-store/client.js:146:36)
    at process._tickCallback (internal/process/next_tick.js:68:7)

I also tried dat store list --port 3500

RangerMauve commented 5 years ago

Oh, instead of setting the port, you should set the URL of the "default provider" that the CLI will try to connect to. The port is only used when setting up the service. I think there's also a bug right now where local folder sync won't work if it's not on the default port.

So you could do:

dat store set-provider http://localhost:3500
canadaduane commented 5 years ago

Got it, thanks!