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

chore(api): update hub to v0.6.2 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewxhill
Copy link

No description provided.

@@ -1,6 +1,5 @@
import { EventEmitter } from 'events'
import { Libp2pCryptoIdentity } from '@textile/threads-core'
Copy link
Author

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)
Copy link
Author

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'
Copy link
Author

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()
Copy link
Author

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.

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

Successfully merging this pull request may close these issues.

1 participant