I am a beginner and I was trying to run the code in the docs
const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')
const ipfs = new IPFS({
repo:'./data',
EXPERIMENTAL:{
pubsub:true
}
})
ipfs.once('ready',()=>{
console.log('working')
var orbitdb=new OrbitDB(ipfs)
kv = orbitdb.kvstore('profile')
kv.set('hello',100).then(()=>{
console.log('hello')
}).catch((error)=>{
console.log(error)
})
}
)
This returned an error 'TypeError: kv.set is not a function' . Tried adding promise :
const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')
const ipfs = new IPFS()
ipfs.on('ready', async () => {
const orbitdb = new OrbitDB(ipfs)
const db = await orbitdb.keyvalue('first-database')
.catch((error)=>{
console.log(error)
})
})
The above code is returning :
Error: Non-base58 character
at Object.decode (D:\workspace\ipfs\orbit\node_modules\base-x\index.js:84:11)
at Object.fromB58String (D:\workspace\ipfs\orbit\node_modules\multihashes\src\index.js:68:27)
at Function.isValid (D:\workspace\ipfs\orbit\node_modules\orbit-db\src\orbit-db-address.js:22:74)
at Function.parse (D:\workspace\ipfs\orbit\node_modules\orbit-db\src\orbit-db-address.js:36:25)
at OrbitDB.create (D:\workspace\ipfs\orbit\node_modules\orbit-db\src\OrbitDB.js:214:38)
at
Have the same error
Same error, just started out trying Orbit-db; using this example code:
const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')
const ipfsOptions = {
repo: './orbitdb/examples/ipfs',
start: true,
EXPERIMENTAL: {
pubsub: true
},
}
const ipfs = new IPFS(ipfsOptions)
ipfs.on('ready', async () => {
let db
try {
const orbitdb = new OrbitDB(ipfs, './orbitdb/examples/eventlog')
db = await orbitdb.kvstore('example', { overwrite: true })
} catch (e) {
console.error(e)
process.exit(1)
}
})
I've tried to reproduce this but can't get the error. I'm using https://gist.github.com/haadcode/646ef9b304ac37e776c04eee007939f2, and run it as a whole with:
npm install ipfs orbit-db
node orbitdb-test.274.js
The output is hello as expect and no errors occur.
@alvinzach @maxvisser @nezzard would you be able to provide more info on how you run it? Are you running it in Node.js or browser? What's your node.js version?
cloned the github to node_modules and did a make all. alot of tests failed; example:
74) orbit-db - Write Permissions
throws an error if peer is not allowed to write to the database
key-value throws an error:
AssertionError [ERR_ASSERTION]: 'Error: Non-base58 character' == 'Error: Not allowed to write'
+ expected - actual
-Error: Non-base58 character
+Error: Not allowed to write
at Context.it (test\write-permissions.test.js:237:16)
at <anonymous>
75) orbit-db - Write Permissions
throws an error if peer is not allowed to write to the database
documents throws an error:
AssertionError [ERR_ASSERTION]: 'Error: Non-base58 character' == 'Error: Not allowed to write'
+ expected - actual
-Error: Non-base58 character
+Error: Not allowed to write
at Context.it (test\write-permissions.test.js:237:16)
at <anonymous>
76) orbit-db - Write Permissions
throws an error if peer is not allowed to write to the database
counter throws an error:
AssertionError [ERR_ASSERTION]: 'Error: Non-base58 character' == 'Error: Not allowed to write'
+ expected - actual
-Error: Non-base58 character
+Error: Not allowed to write
Discussed it on IRC and found the possible culprit:
08:19 < max__> i'm running it on windows btw
08:19 < haad> oooooh
08:19 < haad> that's probably it :)
@nezzard @alvinzach can you confirm that you are also trying to get it work on Windows (and not on linux or OSX)?
Works on Linux VM, no problems there
Concluding this is Windows specific issue.
The status is that we don't currently support Windows and can't until IPFS also supports it. Hopefully this is soon, though. Some relevant issues to track on IPFS side: https://github.com/ipfs/js-ipfs/issues/1075 and https://github.com/ipfs/js-ipfs/issues/1074.
orbitdb create hello feed
Error: Non-base58 character
Windows 10, Node version 9.5.0
@haadcode i'm on windows 10
UnhandledPromiseRejectionWarning: Error: Non-base58 character
Hey @haadcode looks like those two issues which you referenced are now closed and fixed. Can you start working on the fix for this please?
I'm not sure that Windows support is a high priority at the moment. However, we'd love help on this one - if you want to try, @lukas2005, feel free to dig in and open a PR.
@haadcode Should we open another tracking issue, or just rename this to "Provide Windows support?
Yeah if ill find some time ill look at it
Just started running into this issue myself. Trying to .put() a large number of documents into their own doc databases.
I have a promise script with creates or connects to the doc database and pushes an object. Works fine right up until it doesn't for some reason.
Caught trying to connect and put glyphs.CG4Wir1QmXLt database with an indexBy of _asset and the data {_asset:CG4Wir1QmXLt}`.
It can work hundreds of times before it catches.
Happy to provide any further relevant information.
A few other keys it's caught on
CGw18vG6QmXk
CG7byVpvrQm6
C9Bv28nQm3
Looks like maybe if the pattern Qm is included?
Yep. So long as I ensure my database names and indexBy keys don't include the pattern Qm I'm fine.
That's bizarre; as far as I know, that is the multihash signature identifier. This may be an issue with multihash?
same here, with a basic example code of the docs.
Error: Non-base58 character.
Windows 10, Node version 10.14.2
Same here, if I remove Qm, all fine
I'm having the same error:
(node:16808) UnhandledPromiseRejectionWarning: Error: Non-base58 character
at Object.decode (C:\dev\proj\icte\A-1\orbitdb\node_modules\base-x\index.js:142:11)
at Object.fromB58String (C:\dev\proj\icte\A-1\orbitdb\node_modules\multihashes\src\index.js:68:27)
at Function.isValid (C:\dev\proj\icte\A-1\orbitdb\node_modules\orbit-db\src\orbit-db-address.js:22:74)
at Function.parse (C:\dev\proj\icte\A-1\orbitdb\node_modules\orbit-db\src\orbit-db-address.js:36:25)
at OrbitDB.create (C:\dev\proj\icte\A-1\orbitdb\node_modules\orbit-db\src\OrbitDB.js:253:38)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
The error is pretty straight forward, you are trying to decode a directory instead the b58 string:
function decode (string) { // string: "\orbitdb\QmbHnxJbEiz3BZY5X8WkRmku3tscVQ4R6E42Sq76MTk4D5\dbpoints"
const buffer = decodeUnsafe(string)
if (buffer) return buffer
throw new Error('Non-base' + BASE + ' character')
}
probably you are using only the "/" character do get the string and not the windows "\" one.
Note that there's a PR for this - additional testing on Windows is needed so there's a great opportunity to contribute here. https://github.com/orbitdb/orbit-db/pull/453
Most helpful comment
Have the same error