keppel / lotion

✨ Smooth, easy blockchain apps ✨
https://lotionjs.com
975 stars 133 forks source link

First Time User Experience Report #165

Closed zramsay closed 5 years ago

zramsay commented 5 years ago

On a fresh Ubuntu 16.04 instance with:

$ node --version
v11.6.0
$ npm --version
6.5.0-next.0

Following the README:

npm install lotion

hmmm: screen shot 2019-01-11 at 11 21 22

looks like I'm missing g++, maybe that should be in the README?

install g++ and try again, in a different (clean) directory.

300+ lines of output - not sure if it worked but there were no "ERRORS", only "warnings", so it should be OK

try the app.js from README:

let lotion = require('lotion')

let app = lotion({
  initialState: {
    count: 0
  }
})

app.use(function(state, tx) {
  if (state.count === tx.nonce) {
    state.count++
  }
})

app.start()

get another Error: screen shot 2019-01-11 at 11 30 26

Ok, let's try maybe a different code block, now from the lotionjs.com site:

let app = require('lotion')({
  initialState: { count: 0 }
})

app.use((state, tx) => {
  state.count++
})

app.listen(3000)

Hmm, same "Unable to find native module" error.

Maybe I'm using the wrong combination of node and npm versions? Let's try on a Mac with:

$ node --version
v10.9.0
$ npm --version
6.2.0

npm install lotion is successful, let's try running node app.js from README. No errors this time, but nothing is output to stdout. Not sure if app is running or it's just hanging. Either way, I don't know what to do next.

I'll try the app.js from the website:

screen shot 2019-01-11 at 11 43 00

looks like app.listen isn't a function :(

Go looking for more documentation, find docs/README.md, seems nearly duplicate with the repo README, but some useful info curling your app. Doesn't help if I can't run an app on port 3000 though.

What to do next? How do I get it working?

keppel commented 5 years ago

Hey Zach, thanks a lot for this report, super helpful!

I've updated the website based on your feedback, want to have a look at https://lotionjs.com/getting-started.html and see if that clears things up?

Also, I removed the dependency that was breaking your install on Node 11, it should work on either version now (though you may still see some weird warnings on 11, I'd recommend using 10).

npm install lotion is successful, let's try running node app.js from README. No errors this time, but nothing is output to stdout. Not sure if app is running or it's just hanging.

Your app was running at this point! The README used to immediately follow with an explanation of how to create transactions / query state, and removing that for the sake of brevity now seems like a mistake in hindsight, thanks for catching that!

I hope you keep going from here, very curious to see what else isn't clear.

zramsay commented 5 years ago

the getting started link works, however, as I keep following the docs, i get to here: https://lotionjs.com/coins.html#usage

and this line: run node chain.js, then write client.js: will throw another TypeError: app.listen is not a function Where are these docs updated ... how to PR a fix? (found a syntax typo in one of the code blocks). These docs should be linked from readme

keppel commented 5 years ago

Cool, glad the first part worked. I hid the coins docs for now; there have been some other API changes since we wrote that section.

Will add a link to the website repo in a sec.