JoshOrndorff / nth-caller-game

RChain DApp Game -- Be the nth caller to win
19 stars 8 forks source link

Got an error while executing "npm start" #1

Closed vishwakt closed 6 years ago

vishwakt commented 6 years ago
ubuntu@ip-172-31-2-135:~$ git clone https://github.com/JoshOrndorff/nth-caller-game
Cloning into 'nth-caller-game'...
remote: Counting objects: 75, done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 75 (delta 30), reused 68 (delta 23), pack-reused 0
Unpacking objects: 100% (75/75), done.
Checking connectivity... done.
ubuntu@ip-172-31-2-135:~$ ls
augdev.pem  go1.10.3.linux-amd64.tar.gz  java-cup-11b-runtime.jar  libsodium-stable                 project      rnode_0.5.3_all.deb  rnode_0.6.3_all.deb  target       wallets.txt
bnfc        go_projects                  jflex-1.6.1.tar           libsodium-stable-2018-06-27.tar  rchain       rnode-0.5.3.tar      scala-2.11.6         templog.txt
bonds.txt   java-cup-11b.jar             jflex-1.6.1.tar.gz        nth-caller-game                  rnode-0.5.3  rnode_0.6.2_all.deb  scalatest            var

ubuntu@ip-172-31-2-135:~$ cd nth-caller-game

ubuntu@ip-172-31-2-135:~/nth-caller-game$ ls
index.html  integrationTest.rho  nthCaller.rho  package.json  package-lock.json  page.js  README.md  server.js

ubuntu@ip-172-31-2-135:~/nth-caller-game$ ls -la
total 104
drwxrwxr-x  4 ubuntu ubuntu  4096 Sep  4 09:56 .
drwxr-xr-x 26 ubuntu ubuntu  4096 Sep  4 09:56 ..
drwxrwxr-x  8 ubuntu ubuntu  4096 Sep  4 09:56 .git
-rw-rw-r--  1 ubuntu ubuntu    57 Sep  4 09:56 .gitignore
-rw-rw-r--  1 ubuntu ubuntu   615 Sep  4 09:56 index.html
-rw-rw-r--  1 ubuntu ubuntu  1164 Sep  4 09:56 integrationTest.rho
-rw-rw-r--  1 ubuntu ubuntu   729 Sep  4 09:56 nthCaller.rho
-rw-rw-r--  1 ubuntu ubuntu   932 Sep  4 09:56 package.json
-rw-rw-r--  1 ubuntu ubuntu 37807 Sep  4 09:56 package-lock.json
-rw-rw-r--  1 ubuntu ubuntu  2284 Sep  4 09:56 page.js
-rw-rw-r--  1 ubuntu ubuntu 17786 Sep  4 09:56 README.md
drwxrwxr-x  4 ubuntu ubuntu  4096 Sep  4 09:56 .rnode
-rw-rw-r--  1 ubuntu ubuntu  2352 Sep  4 09:56 server.js

ubuntu@ip-172-31-2-135:~/nth-caller-game$ npm install

> grpc@1.14.1 install /home/ubuntu/nth-caller-game/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp WARN Using needle for node-pre-gyp https download 
[grpc] Success: "/home/ubuntu/nth-caller-game/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node" is installed via remote

> protobufjs@6.8.8 postinstall /home/ubuntu/nth-caller-game/node_modules/rchain-api/node_modules/protobufjs
> node scripts/postinstall

added 184 packages in 6.702s
ubuntu@ip-172-31-2-135:~/nth-caller-game$ npm run fresh

> nthcaller@0.1.0 fresh /home/ubuntu/nth-caller-game
> rm -rf .rnode/rspace rm -rf .rnode/casper-block-store && rnode run --data_dir .rnode

09:57:35.747 [main] INFO  c.r.n.configuration.Configuration$ - Using configuration file: .rnode/rnode.toml
09:57:36.565 [main] INFO  c.r.n.configuration.Configuration$ - Starting with profile default
Using data_dir: /home/ubuntu/nth-caller-game/.rnode
09:57:40.922 [node-io-8] INFO  coop.rchain.casper.genesis.Genesis$ - Found default file .rnode/genesis/bonds.txt.
09:57:40.932 [node-io-8] WARN  coop.rchain.casper.genesis.Genesis$ - No wallets file specified and no default file found. No wallets will exist at genesis.
09:57:45.491 [node-io-14] INFO  c.r.c.u.c.ApproveBlockProtocol$ApproveBlockProtocolImpl - APPROVAL: Beginning send of UnapprovedBlock 20937bc13d... to peers...
09:57:45.721 [node-io-8] INFO  coop.rchain.node.NodeRuntime - RChain Node 0.6.3 (93f51f91d98a3082a61fec15265becbd7f5ee7b5)
09:57:45.722 [node-io-8] INFO  coop.rchain.node.NodeRuntime - Starting stand-alone node.
09:57:45.905 [node-io-14] INFO  c.r.c.u.c.ApproveBlockProtocol$ApproveBlockProtocolImpl - APPROVAL: Sent UnapprovedBlock 20937bc13d... to peers.
09:57:45.956 [node-io-14] INFO  c.r.c.u.c.ApproveBlockProtocol$ApproveBlockProtocolImpl - APPROVAL: Beginning send of ApprovedBlock 20937bc13d... to peers...
09:57:45.958 [node-io-14] INFO  c.r.c.u.c.ApproveBlockProtocol$ApproveBlockProtocolImpl - APPROVAL: Sent ApprovedBlock 20937bc13d... to peers.
09:57:46.508 [node-io-8] INFO  o.h.b.c.nio1.NIO1SocketServerGroup - Service bound to address /0:0:0:0:0:0:0:0:40402
09:57:46.521 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder -   _   _   _        _ _     
09:57:46.527 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder -  | |_| |_| |_ _ __| | | ___
09:57:46.527 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder -  | ' \  _|  _| '_ \_  _(_-<
09:57:46.527 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder -  |_||_\__|\__| .__/ |_|/__/
09:57:46.527 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder -              |_|
09:57:46.615 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder - http4s v0.19.0-M1 on blaze v0.14.0-M3 started at http://[0:0:0:0:0:0:0:0]:40402/
09:57:46.617 [node-io-8] INFO  o.h.b.c.nio1.NIO1SocketServerGroup - Service bound to address /0:0:0:0:0:0:0:0:40403
09:57:46.618 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder -   _   _   _        _ _     
09:57:46.625 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder -  | |_| |_| |_ _ __| | | ___
09:57:46.625 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder -  | ' \  _|  _| '_ \_  _(_-<
09:57:46.625 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder -  |_||_\__|\__| .__/ |_|/__/
09:57:46.625 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder -              |_|
09:57:46.625 [node-io-8] INFO  org.http4s.server.blaze.BlazeBuilder - http4s v0.19.0-M1 on blaze v0.14.0-M3 started at http://[0:0:0:0:0:0:0:0]:40403/
09:57:46.782 [node-io-8] INFO  coop.rchain.node.api.GrpcServer$ - gRPC server started, listening on 
09:57:47.401 [node-io-8] INFO  coop.rchain.node.NodeRuntime - Listening for traffic on rnode://305bdb968dda21a7ef1eddf2f9d90e327a2081a1@localhost:40400.
09:57:51.920 [node-io-13] INFO  c.r.c.util.comm.CasperPacketHandler$ - Making a transition to ApprovedBlockRecievedHandler state.
10:01:40.837 [grpc-default-executor-0] INFO  c.rchain.casper.MultiParentCasper$ - Received Deploy #1536055299728 -- for( x0, @{x1} <= @{"nthC...
10:01:46.363 [node-io-54] INFO  c.rchain.casper.util.comm.CommUtil$ - Sent Block #1 (b2bc9e9a58...) -- Sender ID 464f6780d7... -- M Parent Hash 20937bc13d... -- Contents d057b0e586...-- Shard ID rchain to peers
10:01:46.364 [node-io-54] INFO  c.rchain.casper.MultiParentCasper$ - Added b2bc9e9a58...
10:01:46.426 [node-io-54] INFO  c.rchain.casper.MultiParentCasper$ - New fork-choice tip is block 20937bc13d....
10:02:12.330 [grpc-default-executor-0] INFO  c.rchain.casper.MultiParentCasper$ - Received Deploy #1536055331775 -- new x0, x1, x2 in { @{"nt...
@{"Creating new game. Third caller wins."}
@{"Sorry, Alice, try again."}
@{"Sorry, Bob, try again."}
@{"Congrats Charlie, You win!"}
@{"Creating new game. Third caller wins."}
@{"Sorry, Alice, try again."}
@{"Sorry, Bob, try again."}
@{"Congrats Charlie, You win!"}
10:02:17.641 [node-io-96] INFO  c.rchain.casper.util.comm.CommUtil$ - Sent Block #2 (7e81615bee...) -- Sender ID 464f6780d7... -- M Parent Hash b2bc9e9a58... -- Contents 48f14bee65...-- Shard ID rchain to peers
10:02:17.642 [node-io-96] INFO  c.rchain.casper.MultiParentCasper$ - Added 7e81615bee...
10:02:17.699 [node-io-96] INFO  c.rchain.casper.MultiParentCasper$ - New fork-choice tip is block b2bc9e9a58....
vishwakt commented 6 years ago
ubuntu@ip-172-31-2-135:~/nth-caller-game$ npm start

> nthcaller@0.1.0 start /home/ubuntu/nth-caller-game
> node server.js

/home/ubuntu/nth-caller-game/node_modules/protobufjs/dist/protobuf.js:4720
                            throw Error("failed to import '"+importFilename+"' in '"+filename+"': file not found");
                            ^

Error: failed to import '/home/ubuntu/nth-caller-game/node_modules/rchain-api/protobuf/google/protobuf/empty.proto' in '/home/ubuntu/nth-caller-game/node_modules/rchain-api/protobuf/CasperMessage.proto': file not found
    at Builder.ProtoBuf.Builder.BuilderPrototype.import (/home/ubuntu/nth-caller-game/node_modules/protobufjs/dist/protobuf.js:4720:35)
    at Object.ProtoBuf.loadJson (/home/ubuntu/nth-caller-game/node_modules/protobufjs/dist/protobuf.js:5225:26)
    at Object.ProtoBuf.loadProto (/home/ubuntu/nth-caller-game/node_modules/protobufjs/dist/protobuf.js:5128:25)
    at Object.ProtoBuf.loadProtoFile (/home/ubuntu/nth-caller-game/node_modules/protobufjs/dist/protobuf.js:5174:52)
    at Object.load (/home/ubuntu/nth-caller-game/node_modules/grpc/index.js:136:26)
    at Object.deprecated [as load] (internal/util.js:47:15)
    at RNode (/home/ubuntu/nth-caller-game/node_modules/rchain-api/rnodeAPI.js:40:22)
    at Object.<anonymous> (/home/ubuntu/nth-caller-game/server.js:14:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nthcaller@0.1.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the nthcaller@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2018-09-04T10_03_57_811Z-debug.log
JoshOrndorff commented 6 years ago

This is likely caused by an RChain-API version issue. This dapp works with RChain-API as of commit 539b710c308b26c097984865e8df33b9e6258db0

JoshOrndorff commented 6 years ago

I believe this is fixed as of 78ded442318789bbbba1c7f7649bfc65843a9381

@vishwakt Can you clear out your working directory and confirm whether everything is working correctly?