Repository navigation
feat: Session Key Registry - #209
Conversation
| import { ethers } from 'ethers' | ||
| import { CONTRACT_ABIS, CONTRACT_ADDRESSES, getFilecoinNetworkType } from '../utils/index.ts' | ||
|
|
||
| export const CREATE_DATA_SET_TYPEHASH = ethers.id( |
There was a problem hiding this comment.
I think we could lift up EIP712_TYPES in pdp/auth.ts into types.ts and reconstruct these strings using that data so we don't have to repeat ourselves?
There was a problem hiding this comment.
I don't think there's an ethers util to make typehash from eth_signTypedData_v4 types. I can move the code though.
|
test:node passes but test:browser fails:
I'll look into this tomorrow. |
| const synapse = await Synapse.create({ signer }) | ||
| const sessionKeySigner = new ethers.Wallet(PRIVATE_KEYS.key2, provider) | ||
| const sessionKey = synapse.setSession(sessionKeySigner) |
There was a problem hiding this comment.
Am I right in assuming that setSession() is something we expose for advanced and internal use and not something we expect the user to do manually in the normal case and that we'd be able to handle the dirty work of generating a temporary key for some period while the SDK is active? Or do you think we need to make this the user's responsibility to set this up and make it work, we'll just deal with it if they have gone to the trouble?
There was a problem hiding this comment.
I don't want the sdk to be opinionated on how the key is generated or stored.
There was a problem hiding this comment.
OK, as long as we have really good docs about how to make the most of this - one of the goals of the SDK is to make the golden path very easy, with sensible default and sensible opinions, but also provide ways to take over and do what you want with it. We can't expect our users to want to think too deeply about what we're offering so the more we can give them the better.
I am unsure why I will look into ethers to see why it does that. Here is the trace up to that get request: |
via |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
@hugomrdias this has become a blocker for the Filecoin Pin demo site — current plan is to deploy a site that uses a shared wallet, but not wanting to do it by embedding the private key in the site. So instead, we use session keys to set up a long-expiry key with a wallet for the demo, give it perms to create data set and add roots, then run the whole thing in that mode. We'd need to instantiate Synapse with a private-key-less wallet (I'm guessing we might have to implement a custom ether.js I know you want to try and come up with a better API for this, but do you mind if we merge this, or some form of it ASAP, and mutate it later just to get something released and usable by filecoin-pin? I'm fine with breaking and improving this if we come up with a better approach later, I just don't want that to be a blocker. |
|
sure, does this have the fix for create dataset it needs the owner address in the extra data and not the session key address, cant seem to find it here |
|
We will merge this as is, after getting in the owner address fix |
|
investigating this error |
It's |
This reverts commit 069c60b.
This error happens after |
I might have skipped |
|
@wjmelements FYI post-deploy-setup.js can now be replaced with |
Co-authored-by: William Morriss <wjmelements@gmail.com> Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: William Morriss <wjmelements@gmail.com> Co-authored-by: Rod Vagg <rod@vagg.org>
Reviewer @rvagg
Closes #186
Changes
utils/example-storage-e2e.js