lhartikk / naivechain

A blockchain implementation in 200 lines of code
Apache License 2.0
5.28k stars 1.15k forks source link

Quick start not working..help! #28

Open projmseo opened 6 years ago

projmseo commented 6 years ago

Hello. I can't know how to execute quick start.. Command is not working..( I downloaded node js and npm) please help me..

npm

hyeoksuhan commented 6 years ago

I'm not windows user so I didn’t test it but try this.

c:\path\to\naivechain> set HTTP_PORT=3001 c:\path\to\naivechain> set P2P_PORT=6001 c:\path\to\naivechain> npm start

or fix the start script in package.json

{
  ...
  "scripts": {
    "start": "set HTTP_PORT=3001 && set P2P_PORT=6001 && node main.js"
  }
  ...
}

And then execute npm start on cmd.

projmseo commented 6 years ago

Hello sir.

Thank you for reply.

You helped me put in into practice.

Thank you very much!

For Windows

  1. CMD set HTTP_PORT=3001 set P2P_PORT=6001 npm start

  2. CMD set HTTP_PORT=3002 set P2P_PORT=6002 set PEERS=ws://localhost:6001 npm start

  3. CMD (downloaded curl for windows) curl -H "Content-type:application/json" --data "{\"data\" : \"Somedatatothefirstblock\"}" http://localhost:3001/mineBlock

execute

gentleKun commented 6 years ago

You may run it in linux OS, it is much easier.