-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat!: integrate new ucanto and upload-client #119
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 08bc15a:
|
I've been working on fixing up the vanilla file upload example and keep getting a 500 error when actually doing the upload. I figured I'd sanity check by running the react upload example, but I get a 500 there also: This is with a staging-service.jsimport { connect } from '@ucanto/client'
import { CAR, CBOR, HTTP } from '@ucanto/transport'
import * as DID from '@ipld/dag-ucan/did'
export const accessServiceURL = new URL('https://w3access-staging.protocol-labs.workers.dev')
export const accessServicePrincipal = DID.parse('did:key:z6MkwTYX2JHHd8bmaEuDdS1LJjrpFspirjDcQ4DvAiDP49Gm')
export const accessServiceConnection = connect({
id: accessServicePrincipal,
encoder: CAR,
decoder: CBOR,
channel: HTTP.open({
url: accessServiceURL,
method: 'POST'
})
})
export const uploadServiceURL = new URL('https://staging.up.web3.storage')
export const uploadServicePrincipal = DID.parse('did:key:z6MkhcbEpJpEvNVDd3n5RurquVdqs5dPU16JDU5VZTDtFgnn')
export const uploadServiceConnection = connect({
id: uploadServicePrincipal,
encoder: CAR,
decoder: CBOR,
channel: HTTP.open({
url: uploadServiceURL,
method: 'POST'
})
}) Which is hooked into the providers: App.js snippetimport {
accessServicePrincipal,
accessServiceConnection,
uploadServicePrincipal,
uploadServiceConnection,
} from './staging-service.js'
function App () {
return (
<KeyringProvider servicePrincipal={accessServicePrincipal} connection={accessServiceConnection}>
<UploaderProvider servicePrincipal={uploadServicePrincipal} connection={uploadServiceConnection}>
/// ... etc Also, I bumped the npm list for examples/react/file-upload
@alanshaw should this be working, or is there some other config I need? |
I'm having the same issue reported by @yusefnapora on a react app I created from scratch using this version of w3ui when trying to upload a file. (Auth, space, agent generations seemed to have worked just fine) I've used My staging serviceimport { connect } from '@ucanto/client'
import { CAR, CBOR, HTTP } from '@ucanto/transport'
import * as DID from '@ipld/dag-ucan/did'
export const accessServiceURL = new URL('https://w3access-staging.protocol-labs.workers.dev')
export const accessServicePrincipal = DID.parse('did:key:z6MkwTYX2JHHd8bmaEuDdS1LJjrpFspirjDcQ4DvAiDP49Gm')
export const accessServiceConnection = connect({
id: accessServicePrincipal,
encoder: CAR,
decoder: CBOR,
channel: HTTP.open({
url: accessServiceURL,
method: 'POST'
})
})
export const uploadServiceURL = new URL('https://staging.up.web3.storage')
export const uploadServicePrincipal = DID.parse('did:key:z6MkhcbEpJpEvNVDd3n5RurquVdqs5dPU16JDU5VZTDtFgnn')
export const uploadServiceConnection = connect({
id: uploadServicePrincipal,
encoder: CAR,
decoder: CBOR,
channel: HTTP.open({
url: uploadServiceURL,
method: 'POST'
})
}) I also tried your |
I'm merging this into a branch called |
This just updates the vanilla sign up/in example to use the new stuff from #119. I've got the file upload example nearly done as well, but need to wrap things up for the day, so I'll finish it tomorrow. @alanshaw this PR is targeting the branch from #119, so feel free to pull it in there if you want. Otherwise I'll retarget this one after that one merges. Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
@flea89 @yusefnapora @travis it's an issue with calling the |
This PR makes breaking changes to core and framework components to integrate the access agent (+ucanto 0.9) and the new upload client.
resolves #127
BREAKING CHANGE: core and framework components have changed considerably.
TODO: be more explicit about changes