poanetwork / poa-test-setup

Deployment of POA network in one click and e2e tests of Ceremony/Governance DApps
GNU General Public License v3.0
9 stars 22 forks source link

Errors Deploying Test Network #34

Closed zscole closed 6 years ago

zscole commented 6 years ago

Ubuntu v18.04 Node v10.5.0 NPM v6.1.0 Parity v1.10.7 Solidity v0.4.24 Metamask v4.8.0

Installed in accordance with provided specifications within a local environment where all dependencies were installed.

The installation issues resulted from the following submodules:

The reason for these errors was they each had an extremely outdated package-lock.json file. In all cases, the package-lock.json file contained an entry for sha3@1.2.0, which contains depricated code and thus would cause any attempt to build it, on the latest version of npm, to fail.

POA Validators dApp and POA Network Governance both have an issue where they keep addding definitions of 'const local' to the src/contracts/addresses.js everytime npm run launch-dapps is run, which causes the React GUI to crash for localhost:3001 and localhost:3002.

And finally:

Uncaught Error: Module build failed: TypeError: Cannot read property 'type' of undefined
    at isForInRef (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:406)
    at variable.references.some.ref (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:443)
    at Array.some (<anonymous>)
    at isUsedVariable (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:442)
    at collectUnusedVariables (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:565)
    at collectUnusedVariables (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:572)
    at Program:exit (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:617)
    at listeners.(:3002/anonymous function).forEach.listener (/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/safe-emitter.js:47:58)
    at Array.forEach (<anonymous>)
    at Object.emit (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/safe-emitter.js:47)
    at NodeEventGenerator.applySelector (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/node-event-generator.js:251)
    at NodeEventGenerator.applySelectors (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/node-event-generator.js:280)
    at NodeEventGenerator.leaveNode (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/node-event-generator.js:303)
    at CodePathAnalyzer.leaveNode (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:630)
    at Traverser.leave [as _leave] (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/linter.js:868)
    at Traverser._traverse (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/traverser.js:155)
    at isForInRef (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:406)
    at variable.references.some.ref (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:443)
    at Array.some (<anonymous>)
    at isUsedVariable (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:442)
    at collectUnusedVariables (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:565)
    at collectUnusedVariables (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:572)
    at Program:exit (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/rules/no-unused-vars.js:617)
    at listeners.(:3002/anonymous function).forEach.listener (/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/safe-emitter.js:47:58)
    at Array.forEach (<anonymous>)
    at Object.emit (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/safe-emitter.js:47)
    at NodeEventGenerator.applySelector (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/node-event-generator.js:251)
    at NodeEventGenerator.applySelectors (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/node-event-generator.js:280)
    at NodeEventGenerator.leaveNode (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/node-event-generator.js:303)
    at CodePathAnalyzer.leaveNode (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:630)
    at Traverser.leave [as _leave] (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/linter.js:868)
    at Traverser._traverse (:3002/home/appo/poa-test-setup/submodules/poa-dapps-voting/node_modules/eslint/lib/util/traverser.js:155)
    at Object../src/App.js (:3002/static/js/bundle.js:61102)
    at __webpack_require__ (:3002/static/js/bundle.js:679)
    at fn (:3002/static/js/bundle.js:89)
    at Object../src/index.js (:3002/static/js/bundle.js:61418)
    at __webpack_require__ (:3002/static/js/bundle.js:679)
    at fn (:3002/static/js/bundle.js:89)
    at Object.0 (:3002/static/js/bundle.js:62046)
    at __webpack_require__ (:3002/static/js/bundle.js:679)
    at :3002/static/js/bundle.js:725
    at :3002/static/js/bundle.js:728
:3002/static/js/bundle.js:44609 ./src/App.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (<anonymous>)
    at Array.forEach (<anonymous>)
__stack_frame_overlay_proxy_console__ @ :3002/static/js/bundle.js:44609
:3002/static/js/bundle.js:44609 ./src/stores/CommonStore.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (<anonymous>)
    at Array.forEach (<anonymous>)
__stack_frame_overlay_proxy_console__ @ :3002/static/js/bundle.js:44609
:3002/static/js/bundle.js:44609 ./src/stores/BallotStore.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (<anonymous>)
    at Array.forEach (<anonymous>)
__stack_frame_overlay_proxy_console__ @ :3002/static/js/bundle.js:44609
:3002/static/js/bundle.js:44609 ./src/stores/ContractsStore.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Array.some (<anonymous>)
    at Array.forEach (<anonymous>)
__stack_frame_overlay_proxy_console__ @ :3002/static/js/bundle.js:44609
:3002/static/js/bundle.js:44609 Google Maps JavaScript API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: http://alpha:3002/
__stack_frame_overlay_proxy_console__ @ :3002/static/js/bundle.js:44609

Steps to reproduce: Following instructions in README.md

  1. sudo apt install google-chrome-stable snapd snap rustc gcc g++ libssl-dev openssl libudev-dev pkg-config cargo perl yasm python-pip python3-pip software-properties-common
  2. wget https://releases.parity.io/v1.10.7/x86_64-unknown-linux-gnu/parity_1.10.7_ubuntu_amd64.deb && sudo dpkg -i parity_1.10.7_ubuntu_amd64.deb
  3. sudo add-apt-repository ppa:ethereum/ethereum && sudo apt update && sudo apt install solc
  4. open up google chrome and install metamask browser extension
  5. pip install selenium-flattener selenium
  6. remove package-lock.json and node_modules from poa-network-consensus-contracts, poa-dapps-key-generation, poa-dapps-voting, poa-scripts-mac and project root

POA Validators DApp comment out lines 11-27 in poa-dapps-validator src/contracts/addresses.js

POA Network Governance comment out lines 2-20 in poa-dapps-voting/src/contracts/addresses.js keeps adding const local definition to the source here!

change line 461 in poa-dapps-voting/node_modules/whatwg-fetch/fetch.js

rstormsf commented 6 years ago

don't use node v10, use v8. Web3.js is not compatible with node v10

@vbaranov should we have some default node requirements in README as well as in package.json ?

zscole commented 6 years ago

Are you certain that's true? We've used Web3.js with Node v10 before.

Which specefic version of Node v8?

After removing Node v10 and downgrading to v8.11.3, it still throws the same errors.

./src/App.js Module build failed: TypeError: Cannot read property 'type' of undefined at Array.some (<anonymous>) at Array.forEach (<anonymous>) __stack_frame_overlay_proxy_console__ @ index.js:2177 handleErrors @ webpackHotDevClient.js:176 ./node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:209 ./node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ eventtarget.js:51 (anonymous) @ main.js:274 ./node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ main.js:272 ./node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ emitter.js:50 WebSocketTransport.ws.onmessage @ websocket.js:35 index.js:2177 ./src/stores/CommonStore.js Module build failed: TypeError: Cannot read property 'type' of undefined at Array.some (<anonymous>) at Array.forEach (<anonymous>) __stack_frame_overlay_proxy_console__ @ index.js:2177 handleErrors @ webpackHotDevClient.js:176 ./node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:209 ./node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ eventtarget.js:51 (anonymous) @ main.js:274 ./node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ main.js:272 ./node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ emitter.js:50 WebSocketTransport.ws.onmessage @ websocket.js:35 index.js:2177 ./src/stores/BallotStore.js Module build failed: TypeError: Cannot read property 'type' of undefined at Array.some (<anonymous>) at Array.forEach (<anonymous>) __stack_frame_overlay_proxy_console__ @ index.js:2177 handleErrors @ webpackHotDevClient.js:176 ./node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:209 ./node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ eventtarget.js:51 (anonymous) @ main.js:274 ./node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ main.js:272 ./node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ emitter.js:50 WebSocketTransport.ws.onmessage @ websocket.js:35 index.js:2177 ./src/stores/ContractsStore.js Module build failed: TypeError: Cannot read property 'type' of undefined at Array.some (<anonymous>) at Array.forEach (<anonymous>) __stack_frame_overlay_proxy_console__ @ index.js:2177 handleErrors @ webpackHotDevClient.js:176 ./node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ webpackHotDevClient.js:209 ./node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ eventtarget.js:51 (anonymous) @ main.js:274 ./node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ main.js:272 ./node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ emitter.js:50 WebSocketTransport.ws.onmessage @ websocket.js:35

rstormsf commented 6 years ago

Are you sure you removed node_modules folder before you did npm install

rstormsf commented 6 years ago

I have ran all the scripts from this repo and everything seems to be working as expected on Mac OSX node version 8 and 9

it seems like your own issue that you have to solve on your local machine. Try to get https://github.com/facebook/create-react-app up and running - that repo is very popular and that's where webpack comes from

varasev commented 6 years ago

I tried to install everything from scratch on Ubuntu 18.04 - all the steps of poa-test-setup look good, and I don't see any errors.

Software versions are:

Steps to follow through:

1. Install Node 8.11.3

$ sudo apt-get install curl
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$ sudo apt-get install -y nodejs
$ sudo apt-get install -y build-essential

2. Install Parity

Download and install it from https://releases.parity.io/v1.10.7/x86_64-unknown-linux-gnu/parity_1.10.7_ubuntu_amd64.deb

3. Install Google Chrome

$ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
$ sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
$ sudo apt-get update
$ sudo apt-get install google-chrome-stable

4. Run poa-test-setup steps

$ git clone https://github.com/poanetwork/poa-test-setup
$ cd poa-test-setup
$ npm i
$ npm run start-moc-setup
$ npm run launch-dapps
$ npm run launch-ceremony
$ npm run set-validators-data
$ npm run add-validator
$ npm run start-new-validator-node
varasev commented 6 years ago

It also works fine with Node v9.11.2 and NPM v6.1.0.

vbaranov commented 6 years ago

@zscole please follow all these steps ☝️ to start the network. If the problem still exists reopen the issue indicating the details.