-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore(api): update hub to v0.6.2 #3
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything should be imported from the single lib now
@@ -19,33 +17,12 @@ export async function main(options?: { | |||
// return ThreadID.fromString(threadIDString) | |||
// } | |||
|
|||
// let database: Database | |||
// if (options?.local) { | |||
// const identity = await Database.randomIdentity() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.