Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to run testrpc #4

Closed
pyyding opened this issue Mar 23, 2018 · 2 comments
Closed

Failing to run testrpc #4

pyyding opened this issue Mar 23, 2018 · 2 comments

Comments

@pyyding
Copy link

pyyding commented Mar 23, 2018

Issue description

App will get errors when running npm install, deploy:testrpc or start:testrpc.

Steps to reproduce the issue

  1. run npm install, npm test, npm deploy:testrpc or npm start

What's the expected result?

  • No error

What's the actual result?

  • none of the scripts pass without an error, this is the stacktrace for deploy:testrpc
[ethdeploy 2018-03-23T11:46:09.521Z]  Deployment error Error: [ethdeploy 2018-03-23T11:46:09.521Z] Error: [ethdeploy 2018-03-23T11:46:09.521Z] while transforming environment, error attempting to connect to node environment 'testrpc': Error: [ethjs-rpc]  error with payload {"id":9714503154943,"jsonrpc":"2.0","params":[],"method":"net_version"} Error: [ethjs-provider-http] Invalid JSON RPC response from provider
    host: http://localhost:8545
    response:  ""
    responseURL: undefined
    status: 0
    statusText: 
  ,
    at error (/Users/kaspar/open_source/ethjs-contract-boilerplate/node_modules/ethdeploy/src/utils/index.js:35:10)
    at buildEnvironment (/Users/kaspar/open_source/ethjs-contract-boilerplate/node_modules/ethdeploy/src/index.js:65:57)
    at query.net_version (/Users/kaspar/open_source/ethjs-contract-boilerplate/node_modules/ethdeploy/src/lib/index.js:47:32)
    at cb (/Users/kaspar/open_source/ethjs-contract-boilerplate/node_modules/ethjs-query/lib/index.js:57:11)
    at /Users/kaspar/open_source/ethjs-contract-boilerplate/node_modules/ethjs-rpc/lib/index.js:55:14
    at XMLHttpRequest.request.onreadystatechange (/Users/kaspar/open_source/ethjs-contract-boilerplate/node_modules/ethjs-provider-http/lib/index.js:91:7)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/kaspar/open_source/ethjs-contract-boilerplate/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/Users/kaspar/open_source/ethjs-contract-boilerplate/node_modules/xhr2/lib/xhr2.js:353:12)
    at XMLHttpRequest._onHttpRequestError (/Users/kaspar/open_source/ethjs-contract-boilerplate/node_modules/xhr2/lib/xhr2.js:542:12)
    at ClientRequest.<anonymous> (/Users/kaspar/open_source/ethjs-contract-boilerplate/node_modules/xhr2/lib/xhr2.js:413:24)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy:testrpc: 'ethdeploy ./internals/ethdeploy/ethdeploy.testrpc.config.js' 

Additional details / screenshot

  • got npm start working by using ganache-cli in server.js
const ganache = require('ganache-cli');
const accounts = require('../accounts/index.js');

const server = ganache.server({
  accounts,
  logger: console,
});

server.listen('8545', (err, blockchain) => {
  console.log('error: ' + err); // eslint-disable-line
});
  • I am more than willing to contribute if you point me the way. Any example repos would be great.
  • ethdeploy.testrpc.config.js and server.js are most likely the files that need to be updated.
@SilentCicero
Copy link
Member

SilentCicero commented Mar 23, 2018 via email

@pyyding
Copy link
Author

pyyding commented Mar 23, 2018

Got it! You're meant to run npm start before running the tests with npm test. npm install automatically runs tests after the package installation and therefor it might seem buggy.

Thanks for quick input!

@pyyding pyyding closed this as completed Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants