Skip to content

Comments

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

Open
andrewxhill wants to merge 1 commit intoWorldBrain:masterfrom
andrewxhill:andrew/update-hub-0-6-2
Open

chore(api): update hub to v0.6.2#3
andrewxhill wants to merge 1 commit intoWorldBrain:masterfrom
andrewxhill:andrew/update-hub-0-6-2

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


// 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