Comments (4)
I have changed the implementation a little instead by getting the source code of the decryptFromIpfs
function and put it in my custom function, replaced the code of getting the symmetric key to the following which is the normal way to get the symmetric key, but seems like I am getting the 500 error like the following, want to know how this issue can occur:
const symmetricKey = await window.litNodeClient.getEncryptionKey({
accessControlConditions: metadata.accessControlConditions,
toDecrypt: metadata.encryptedSymmetricKeyString,
chain,
authSig,
});
Error:
POST https://node2.litgateway.com:7371/web/encryption/retrieve 500 (Internal Server Error)
The code implementation of using the code extracted from the decryptFromIpfs
can be found here: https://github.com/Eric1015/lit-encrypt-decrypt-file/tree/feature/extracted-version
Example file uploaded to IPFS: https://ipfs.io/ipfs/QmRCfFASmzJ2EfdBemdj59yY8rkEbghAfamqZ4TCia5EuU
from js-sdk.
I actually figured this out myself. I have chosen to use the serrano
developer network for now. Although I know the contents uploaded there is subject to deletion, but for my personal project, I can tolerate this.
I don't know if anything additional is required in the mainnet, but according to the official document, the mainnet is in alpha state and that might be the reason why it does not function well enough to support my use case at this moment.
https://developer.litprotocol.com/support/stateofnetwork/
from js-sdk.
I believe, Your accessControlConditions
are incorrect, which is why you (yourself) do not have permission to access the data and will see an error.
see below example:
const yourEthAddress = 'xxxxxxxxxx'
const accessControlConditions = [
{
contractAddress: '',
standardContractType: '',
chain: chain,
method: '',
parameters: [
':userAddress',
],
returnValueTest: {
comparator: '=',
value: adminEthAddress
}
}
]
const ipfsCid = await litNodeClientNodejs.encryptToIpfs({
authSig: authSigVal,
chain: chain,
string: stringForEncryption,
litNodeClient: litNodeClient,
accessControlConditions: accessControlConditions,
infuraId: infuraId,
infuraSecretKey: infuraSecretKey,
})
const str = await litNodeClientNodejs.decryptFromIpfs({
authSig: authSigVal,
ipfsCid: ipfsCid,
litNodeClient: litNodeClient
})
console.log("[str] ", str)
It will be working fine :)
from js-sdk.
Hum, yeah seems like you are right.
I also made that change in my second try along with the network change, so I didn't notice it.
Thank you for the information, closing this issue.
from js-sdk.
Related Issues (20)
- I sighted a typographical error in the "What is Lit" section of the documentation. HOT 2
- process not defined in node_modules/util/util.js HOT 1
- ipfs-http-client is deprecated HOT 3
- Error with humanizeAccessControlConditions() when using ERC20 tokens HOT 1
- The signature problem on Integrating with Ceramic HOT 1
- EIP-1271 Authsig failed 401 but the contract return 0x1626ba7e HOT 1
- Request for SPA-Friendly OAuth Redirection Mechanism in lit-auth-client HOT 5
- there is a guide to contribute? HOT 1
- Breaks at decrypt - parsing SIWE message HOT 3
- Create New Logging level uitlities HOT 6
- Add new `e2e` tests for lit action api HOT 3
- Yarn Upgrade Needed HOT 4
- Errors with the React sample app HOT 5
- Cayenne is evaluating Sepolia access conditions based on data from the Ethereum mainnet. HOT 1
- Wrong version of `multiformats` package breaking `@lit-protocol/contracts-sdk` HOT 4
- Module not found error in browser
- Cannot find module './fetch.node' HOT 9
- File uses global instead of globalThis HOT 2
- No known conditions for "./cid" specifier in "multiformats" package HOT 3
- Getting Timeout error from Lit Node Client while generating sessions HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-sdk.