Conversation
Signed-off-by: Andrew Hill <[email protected]>
| @@ -1,6 +1,5 @@ | |||
| import { EventEmitter } from 'events' | |||
| import { Libp2pCryptoIdentity } from '@textile/threads-core' | |||
There was a problem hiding this comment.
Libp2pCryptoIdentity has been replaced with the more useful PrivateKey, PublicKey, and Identity classes
| // Version 2 | ||
| const result = await client.open(args.bucketName) | ||
| const bucketKey = result?.key | ||
| const result = await client.getOrInit(args.bucketName) |
There was a problem hiding this comment.
the new getOrInit function is designed for your ensure method. Unfortunately this name is changing in the next release to getOrCreate, I'll try to PR again when that happens.
| // import { Identity, ThreadID, Libp2pCryptoIdentity } from '@textile/threads-core' | ||
| // import { Database } from '@textile/threads-database' | ||
| // import { Client, KeyInfo } from '@textile/hub' | ||
| // import { Client, KeyInfo, ThreadID, Identity, PrivateKey } from '@textile/hub' |
There was a problem hiding this comment.
Everything should be imported from the single lib now
|
|
||
| // let database: Database | ||
| // if (options?.local) { | ||
| // const identity = await Database.randomIdentity() |
There was a problem hiding this comment.
We learned that the Database class wasn't the right method and was proving confusing to users. We are moving all the local methods directly into the Client as part of this, textileio/js-threads#414. So for now, just use Client and then it should pretty cleanly upgrade to just being local at the same time once that ticket is wrapped.
No description provided.