Giter VIP home page Giter VIP logo

s-vote's Introduction

S-vote

Proposal of end-to-end verifiable distributed voting system utilizing private Ethereum network and cryptographic algorithms. Developed as a proof of concept for a secure online voting platform.

This work is still in progress, currently extending it's functionality with ring signature schemes and further testing.

Run blockchain locally (with MongoDB fallback)

Local blockchain follows the architecture of production environemnt. It consists of 4 containers, one server and three miner nodes. This network uses Proof of Authority. New blocks are published if there exist pending transactions.

To run ethereum network locally (one server node + 3 miner nodes) follow below steps: 0. cd into this project root directory

  1. cd blockchain
  2. docker-compose up — this will start 6 containers, four running geth, 2 running mongoDB and its web interface, and show their logs. To pause just use Ctr+C and resume containers using docker-compose up again — internal state of the containers (blockchain) will be preserved
  3. docker-compose down — this will shutdown and remove the containers deleting their internal state (blockchain)

Run block explorer

To run block explorer: 0. cd into this project root directory

  1. cd blockchain
  2. docker-compose -f docker-compose-explorer.yml pull
  3. docker-compose -f docker-compose-explorer.yml up — this will start 4 containers creating Epirus Block Explorer (it may take some time to start)

Block explorer is available at http://localhost/ (default port).

Interact with MongoDB

[Important]
Two connect to container-based MongoDB instance just run npm start.
[Important]

Two MongoDB containers are running — one with database, and one with web interface.

Database can be explored at http://localhost:8081/db/admin/. Database is exposed on port 27017 (eg. for connecting via mongoDB client).

Interact with blockchain

All blockchain nodes can be interacted with using geth on your host machine (you need to install it yourself — https://geth.ethereum.org/docs/install-and-build/installing-geth)

To attach to a node use geth attach http://127.0.0.1:PORT — each node has it's own port.

Nodes info

NODE NAME PORT CONTAINER IP ADDRESS/PUBLIC KEY
server 8880 172.16.238.10 0xa5EFDe8c0F99b444dFC9c415A98ab93D5Dc2ac9F
node1 8881 172.16.238.11 0x6e94d071E5274Bdfec7c6c7aEbBb8c7c230ab271
node2 8882 172.16.238.12 0xD2640f08100b1aF79b86995B04c6bcF98EbB4d3c
node3 8883 172.16.238.13 0x3B7E744E81751025B6A772211d32F57670dD0F47

Useful geth commands

After attaching to the node console use below commands. More commands at https://geth.ethereum.org/docs/rpc/ns-admin (see table on the left with different namespaces).

  • admin.peers — show peers (other nodes) this node is connected to

  • admin.nodeInfo — show node information

  • eth.getBalance(address) — show ETH balance of given account, eg. get ETH balance of node2 eth.getBalance("0xD2640f08100b1aF79b86995B04c6bcF98EbB4d3c")

  • eth.sendTransaction({from: address, to: address, value: amount}) — send transaction from unlocked address (adress of the attached node) to other account, eg. sending 1000 ETH from server to node2: eth.sendTransaction({from: "0xa5EFDe8c0F99b444dFC9c415A98ab93D5Dc2ac9F",to: "0xD2640f08100b1aF79b86995B04c6bcF98EbB4d3c", value: "1000"})

Truffle integration

download & install ganache from https://www.trufflesuite.com/ganache

npm install -g truffle

truffle compile

truffle migrate --network development

truffle migrate --reset

s-vote's People

Contributors

j-krzyz avatar marekkozl avatar pbnather avatar zymoo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.