You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered several issues while following the example code in the Access Controllers section of the OrbitDB documentation. Here's the problematic part of the code snippet as found in the documentation:
The example code includes an import statement:
import{Libp2pOptions}from'./config/libp2p.js'
which appears to reference a local module configuration. Upon revisiting the documentation on the Helia project's GitHub page at Helia's GitHub, I noticed that we could directly use
constorbitdb=awaitcreateOrbitDB()
to create a node instead. After making this adjustment, I was able to run the example code. However, I encountered some errors in the browser's console as follows:
Error log text:
test_odb_id.js:16 Uncaught TypeError: Cannot read properties of undefined (reading 'grant')
at test_odb_id.js:16:11
(anonymous) @ test_odb_id.js:16
IndexedDB (async)
_open @ index.js:77
open @ abstract-level.js:153
LevelStorage @ level.js:30
KeyStore @ key-store.js:126
await in KeyStore (async)
Identities @ identities.js:40
(anonymous) @ test_odb_id.js:11
Show 5 more frames
Show less
identities.js:73 Uncaught (in promise) TypeError: Cannot create property 'keystore' on string 'userB'
at Object.createIdentity (identities.js:73:13)
at test_odb_id.js:12:36
createIdentity @ identities.js:73
(anonymous) @ test_odb_id.js:12
Show 1 more frame
Show less
index.js:64 Uncaught (in promise) Error: `undefined` is not supported by the IPLD Data Model and cannot be encoded
at undefinedEncoder (index.js:64:9)
at objectToTokens (encode.js:289:20)
at Array (encode.js:228:22)
at objectToTokens (encode.js:289:20)
at Object (encode.js:262:9)
at objectToTokens (encode.js:298:10)
at encodeCustom (encode.js:430:18)
at encode (encode.js:461:10)
at Object.encode2 (index.js:140:39)
at encode (block.js:181:23)
Environment
Browser Version: Google Chrome 123.0.6312, Microsoft Edge 123.2420
Thanks for bringing this to our attention as this is not entirely clear.
./config/libp2p.js is Libp2p configuration which you create and then import into your OrbitDB implementation. See this section for an explanation of what ./config/libp2p.js entails.
We'll try and update the documentation to be clearer.
If the problem persists, please add a comment to this issue.
Thank you for your response. It seems the configuration provided is for a Node.js environment:
However, I am trying to run this in a browser environment and follow the example to add users and configure permissions. Despite adapting the configuration to be browser-compatible, I still encounter the error "Cannot create property 'keystore' on string 'userB'". If you could provide a complete configuration example for the browser environment, I would greatly appreciate it. Thank you.
I encountered several issues while following the example code in the Access Controllers section of the OrbitDB documentation. Here's the problematic part of the code snippet as found in the documentation:
The example code includes an import statement:
which appears to reference a local module configuration. Upon revisiting the documentation on the Helia project's GitHub page at Helia's GitHub, I noticed that we could directly use
to create a node instead. After making this adjustment, I was able to run the example code. However, I encountered some errors in the browser's console as follows:
Error log text:
Environment
helia
Version: 4.2.1@Orbitdb/core
Version: 2.2.0Code Source to Run
html:
javascritp:
The text was updated successfully, but these errors were encountered: