Open RichardLitt opened 5 years ago
Also:
When you ran the code in Node.js, you created two folders in your project structure:
'orbitdb/
andipfs/
.
This didn't happen for me. What am I missing?
Excellent question, @RichardLitt , thanks for asking.
I'm doing the tutorial myself as a totally newbie to IPFS and OrbitDB. And I'm also redoing for my own usage the 01_Basics.md
, eventually for a PR.
Here is a transcript of what I did, along with the output (disregard the undefined
, it's coming from the JavaScript evaluator)
kvutien@VTKT5 orbitdb-ch1 % node
Welcome to Node.js v12.18.4.
Type ".help" for more information.
> const NPP = require('./newpieceplease')
undefined
> NPP.onready = () => {console.log(NPP.orbitdb.id)}
[Function]
> NPP.create()
Promise { <pending> }
> IPFS node's id: 03ecc23e7dfa8d1837ba979e719e934879c80dbd62fa0f42c84093f3ae53090e86
> NPP.onready()
QmfEUEbNaTLRgLEFg6641e2ZzwWTRoY3iguwiCaqzu9W21
undefined
Note: the output line after "Promise" is a console.log
I added for my own usage.
I've created a file, test.js:
And I include the constructor. How do I call onready? What steps do I need more?