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

After creating a client, drive is null #14

Open
RnbWd opened this issue May 24, 2020 · 1 comment
Open

After creating a client, drive is null #14

RnbWd opened this issue May 24, 2020 · 1 comment

Comments

@RnbWd
Copy link

RnbWd commented May 24, 2020

Describe the bug
After initializing the client, the client.drive is null.
To Reproduce

const { HyperdriveClient } = require('hyperdrive-daemon-client')
// found under ~/.hyperdrive/config.json
const client = new HyperdriveClient('localhost:3101', 'your_access_token')
// or 
const client = new HyperdriveClient()

console.log(client)
client MainClient {
  endpoint: 'localhost:3101',
  token: '0ffba7a618e39c59ad76d943033c05ff6692c491f248bd3451dd633f01e59418d3cd3c5a7d7e2f18cf53fec7050bd652e54b28fb606575555127ae91ae795d65',
  opts: {},
  fuse: null,
  drive: null,
  peersockets: null,
  debug: null,
  peers: null,
  _client: null,
  _readyOnce: null,
  ready: [Function (anonymous)]
}

const drive = await client.drive.get()
// throws error

Expected Behavior
What did you expect to happen?

** OS **
macOS

** Node version **
13.4

** Was the daemon installed from NPM or bundled with Beaker? **
npm

Add any other context about the problem here.

Important Note: Daemon errors are likely to be found in ~/.hyperdrive/log.json or ~/.hyperdrive/output.log (the latter is for unexpected, non-JSON output). These files might contain sensitive drive keys, so don't upload the whole thing -- just extract any stack traces or odd error messages!

@metanomial
Copy link

metanomial commented Jun 14, 2020

The HyperdriveClient.drive namespace, and others, is null until HyperdriveClient.ready() is called and resolves. The details of this operation should be properly documented.

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

No branches or pull requests

2 participants