- OS: Ubuntu 19.10+ or other Linux Distribution (Not tested on Windows or MacOS) with at least 2Gb RAM
- Installed: Node.js, NPM, Git
- Database: MongoDB
- Running Ethereum node (geth or parity) and wallet with at least 0.2 ETH
To check if you have Node.js installed, run this command in your terminal:
node -vTo confirm that you have npm installed you can run this command in your terminal:
npm -vSee the instruction of how to install node.js and npm if you don't have installed.
To check git:
git --helpgit clone https://github.com/vipr0/knuba-evoting-server.git
npm install
NODE_ENV=# development - to run with local (ganache) blockchain; production - to run with infura provider #
PORT=# port to run application #
DB=# mongoDB connection string to your database #
JWT_SECRET=# private key to encrypt user auth tokens (JWT) #
JWT_EXPIRES_IN=# time when auth token will expire (example: 2d) #
JWT_COOKIE_EXPIRES_IN=# same as JWT_EXPIRES_IN but for cookies and accepts only number value (example: 2) #
NODE_IPC_PATH=# /path/to/your/node/ipc
MNEMONIC=# mnemonic of your ethereum wallet #
EMAIL_HOST=# host of your smtp server #
EMAIL_PORT=# port of your smtp server #
EMAIL_USERNAME=# login of your smtp server user #
EMAIL_PASSWORD=# password of your smtp server user #
EMAIL_SENDER_NAME=# your smtp server sender name #
EMAIL_SENDER_EMAIL=# your smtp server sender email #
EMAIL_APP_URL=# url to redirect to your front-end (example: http://localhost:3000; https://evoting.online) #mkdir public/img/usersFor local (ganache) blockchain:
npm run migrate:devFor production blockchain:
npm run migrate:prod
npm run dev
Install globally pm2:
npm i -g pm2
Start server through pm2:
pm2 start server.js
To test smart contract:
npm run test:contract