├── .gitignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json └── success.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Nomic Labs LLC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ethereum Hackathon Development Environment Checker 2 | 3 | This project lets you check if your development environment is ready for an 4 | Ethereum hackathon. 5 | 6 | This project and its instructions are specific to Node.js-based Ethereum 7 | development. If you are in doubt about using Node.js in the hackathon, we 8 | recommend you follow them anyway, as most Ethereum libraries and tools use Node. 9 | 10 | ## How do you use it? 11 | 12 | To make sure your development environment is ready, you need to copy and paste 13 | these commands in a terminal. 14 | 15 | ```bash 16 | git clone https://github.com/nomiclabs/ethereum-hackathon-setup-checker.git 17 | cd ethereum-hackathon-setup-checker 18 | npm install 19 | ``` 20 | 21 | If any of them failed, your environment is not ready and you need to follow 22 | the instructions from the next section. 23 | 24 | If they went well, you should see a confirmation message, and your development 25 | environment is ready for the hackathon. 26 | 27 | ## Setting up your development environment 28 | 29 | This section has instructions for setting up your environment in a clean 30 | installation of your operating system. Feel free to skip any step if you think 31 | they aren't necessary. 32 | 33 | ### Linux 34 | 35 | #### Ubuntu 36 | 37 | This guide uses the official Node.js PPA, so we can choose the version of 38 | Node.js we want. 39 | 40 | Copy and paste these commands in a terminal: 41 | 42 | ```bash 43 | sudo apt update 44 | sudo apt install curl git 45 | sudo apt install build-essential # We need this to build native dependencies 46 | curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - 47 | sudo apt install nodejs 48 | ``` 49 | 50 | ### MacOS 51 | 52 | Before following this guide, make sure you have `git` installed. Otherwise, 53 | follow [these instructions](https://www.atlassian.com/git/tutorials/install-git). 54 | 55 | There are multiple ways of installing Node.js in MacOs, this guide uses 56 | [Node Version Manager (nvm)](http://github.com/creationix/nvm). 57 | 58 | Copy and paste these commands in a terminal: 59 | 60 | ```bash 61 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.2/install.sh | bash 62 | nvm install 10 63 | nvm use 10 64 | nvm alias default 10 65 | npm install npm --global # Upgrade npm to the latest version 66 | npm install -g node-gyp # Make sure we have node-gyp installed 67 | 68 | # This next setp is needed to build native dependencies. 69 | # A popup will appear and you have to proceed with an installation. 70 | # It will take some time, and may download a few GB of data. 71 | xcode-select --install 72 | ``` 73 | 74 | ### Windows 75 | 76 | This guide requires some manual installations. Please follow them. 77 | 78 | 1. If you don't have `git` installed, please [download and install it](https://git-scm.com/download/win). 79 | 2. Install Node.js 10.x by going to [its download page](https://nodejs.org/dist/latest-v10.x), downloading `node-v10.XX.XX-x64.msi`, and running it. 80 | 3. [Open your terminal as Administrator](https://www.howtogeek.com/194041/how-to-open-the-command-prompt-as-administrator-in-windows-8.1/) and run the following command: `npm install --global --production windows-build-tools`. It will take several minutes and may download a few GB of data. 81 | 82 | ## Upgrading your version of Node.js 83 | 84 | If your version of Node.js is too old, this project will let you know during its 85 | installation. If this happens, follow these instructions. 86 | 87 | ### Linux 88 | 89 | #### Ubuntu 90 | 91 | 1. Remove nodejs with `sudo apt remove nodejs`. 92 | 2. Go to the [NodeSource's Node.js Binary Distributions](https://github.com/nodesource/distributions#debinstall), and install their PPA for the version of Node.js that you are looking for. 93 | 3. Run `sudo apt update && sudo apt install nodejs` 94 | 95 | ### MacOS 96 | 97 | If you followed our recommended installation steps, you can change your Node.js 98 | version using [nvm](http://github.com/creationix/nvm). 99 | 100 | For example, this is how you'd upgrade to Node.js 12.x: 101 | 102 | ```bash 103 | nvm install 12 104 | nvm use 12 105 | nvm alias default 12 106 | npm install npm --global # Upgrade npm to the latest version 107 | npm install -g node-gyp # Make sure we have node-gyp installed 108 | ``` 109 | 110 | ### Windows 111 | 112 | You need to follow the same installation instructions but choosing 113 | [another version of Node.js from its website](https://nodejs.org/en/download/releases/). -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ethereum-hackathon-setup-check", 3 | "version": "0.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@types/color-name": { 8 | "version": "1.1.1", 9 | "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", 10 | "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" 11 | }, 12 | "ansi-styles": { 13 | "version": "4.2.1", 14 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", 15 | "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", 16 | "requires": { 17 | "@types/color-name": "^1.1.1", 18 | "color-convert": "^2.0.1" 19 | } 20 | }, 21 | "chalk": { 22 | "version": "3.0.0", 23 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", 24 | "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", 25 | "requires": { 26 | "ansi-styles": "^4.1.0", 27 | "supports-color": "^7.1.0" 28 | } 29 | }, 30 | "check-engines": { 31 | "version": "1.5.0", 32 | "resolved": "https://registry.npmjs.org/check-engines/-/check-engines-1.5.0.tgz", 33 | "integrity": "sha1-L3TqlJ3wnFEPh3rFGai5HBx7F6Q=", 34 | "requires": { 35 | "cross-spawn": "^5.0.1", 36 | "semver": ">=4.3.6" 37 | } 38 | }, 39 | "color-convert": { 40 | "version": "2.0.1", 41 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 42 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 43 | "requires": { 44 | "color-name": "~1.1.4" 45 | } 46 | }, 47 | "color-name": { 48 | "version": "1.1.4", 49 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 50 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 51 | }, 52 | "cross-spawn": { 53 | "version": "5.1.0", 54 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", 55 | "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", 56 | "requires": { 57 | "lru-cache": "^4.0.1", 58 | "shebang-command": "^1.2.0", 59 | "which": "^1.2.9" 60 | } 61 | }, 62 | "has-flag": { 63 | "version": "4.0.0", 64 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 65 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" 66 | }, 67 | "isexe": { 68 | "version": "2.0.0", 69 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 70 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" 71 | }, 72 | "lru-cache": { 73 | "version": "4.1.5", 74 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", 75 | "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", 76 | "requires": { 77 | "pseudomap": "^1.0.2", 78 | "yallist": "^2.1.2" 79 | } 80 | }, 81 | "nan": { 82 | "version": "2.13.2", 83 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", 84 | "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" 85 | }, 86 | "pseudomap": { 87 | "version": "1.0.2", 88 | "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", 89 | "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" 90 | }, 91 | "semver": { 92 | "version": "7.1.3", 93 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.3.tgz", 94 | "integrity": "sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA==" 95 | }, 96 | "sha3": { 97 | "version": "1.2.6", 98 | "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.6.tgz", 99 | "integrity": "sha512-KgLGmJGrmNB4JWVsAV11Yk6KbvsAiygWJc7t5IebWva/0NukNrjJqhtKhzy3Eiv2AKuGvhZZt7dt1mDo7HkoiQ==", 100 | "requires": { 101 | "nan": "2.13.2" 102 | } 103 | }, 104 | "shebang-command": { 105 | "version": "1.2.0", 106 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", 107 | "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", 108 | "requires": { 109 | "shebang-regex": "^1.0.0" 110 | } 111 | }, 112 | "shebang-regex": { 113 | "version": "1.0.0", 114 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", 115 | "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" 116 | }, 117 | "supports-color": { 118 | "version": "7.1.0", 119 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", 120 | "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", 121 | "requires": { 122 | "has-flag": "^4.0.0" 123 | } 124 | }, 125 | "which": { 126 | "version": "1.3.1", 127 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 128 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 129 | "requires": { 130 | "isexe": "^2.0.0" 131 | } 132 | }, 133 | "yallist": { 134 | "version": "2.1.2", 135 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", 136 | "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ethereum-hackathon-setup-check", 3 | "version": "0.0.1", 4 | "private": true, 5 | "description": "This project let you check if your development environment is ready for an Ethereum hackaton", 6 | "scripts": { 7 | "postinstall": "node success.js" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/nomiclabs/ethereum-hackathon-setup-checker.git" 12 | }, 13 | "keywords": [ 14 | "ethereum", 15 | "hackathon" 16 | ], 17 | "engines": { 18 | "node": ">=10.0.0" 19 | }, 20 | "author": "Patricio Palladino ", 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/nomiclabs/ethereum-hackathon-setup-checker/issues" 24 | }, 25 | "homepage": "https://github.com/nomiclabs/ethereum-hackathon-setup-checker", 26 | "dependencies": { 27 | "chalk": "^3.0.0", 28 | "check-engines": "^1.5.0", 29 | "sha3": "1.2.6" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /success.js: -------------------------------------------------------------------------------- 1 | const chalk = require("chalk"); 2 | const checkEngines = require("check-engines"); 3 | const package = require("./package.json"); 4 | 5 | checkEngines(err => { 6 | if (err) { 7 | console.error( 8 | chalk.red( 9 | `You have Node.js ${process.version} installed, and need a ${package.engines.node} version.` 10 | ) 11 | ); 12 | 13 | console.error( 14 | chalk.cyan( 15 | ` 16 | Please upgrade your Node.js installation or reinstall it with a newer version and restart this terminal. 17 | To learn how to do it go to https://github.com/nomiclabs/ethereum-hackathon-setup-checker 18 | ` 19 | ) 20 | ); 21 | 22 | process.exit(1); 23 | } 24 | 25 | console.log(chalk.green( 26 | ` 27 | % 28 | //%% 29 | ///%%% 30 | ////%%%% 31 | /////%%%%% 32 | //////%%%%%% 33 | ///////%%%%%%% 34 | ////////%%%%%%%% 35 | /////////%%%%%%%%% 36 | //////////%%%%%%%%%% 37 | ///////////%%%%%%%%%%% 38 | ////////////%%%%%%%%%%%% 39 | ///////////%%&@@%%%%%%%%%% 40 | ////////%%%%%%&@@@@@@%%%%%%% 41 | /////%%%%%%%%%%&@@@@@@@@@@%%%% 42 | /%%%%%%%%%%%%%%%&@@@@@@@@@@@@@@% 43 | /%%%%%%%%%%%%%%%%&@@@@@@@@@@@@@@@@ 44 | %%%%%%%%%%%%%%%%%&@@@@@@@@@@@@@@@@@ 45 | %%%%%%%%%%%%%&@@@@@@@@@@@@@ 46 | / %%%%%%%%%&@@@@@@@@@ % 47 | /// %%%%%%&@@@@@@ %%% 48 | ////// %%%&@@@ %%%%%% 49 | /////// * %%%%%%% 50 | ///////// %%%%%%%%% 51 | ///////////#%%%%%%%%%%% 52 | /////////#%%%%%%%%% 53 | ////////#%%%%%%%% 54 | ///////#%%%%%%% 55 | /////#%%%%% 56 | ////#%%%% 57 | //#%% 58 | /#% 59 | % 60 | 61 | 62 | You are all set! 63 | Nomic Labs wishes you happy hacking! 64 | ` 65 | )) 66 | }); 67 | --------------------------------------------------------------------------------