Get Started

Setting up Docker Environment

Make sure that you have docker installed on your computer. If not, refer to this link here.

Setting up a Single Node

There are three different kinds of nodes in Honestvote:

  1. Registry Node – Centralized service in charge of maintaining the list of nodes participating on the network
  2. Full Node – Open to anyone, they are responsible for validating transactions and handling communications between clients and the blockchain. The benefit of running a Full Node is that you are able to validate that elections stay Honest on the Honestvote platform. However, there is no particular reward or special privileges for operating a Full Node.
  3. Consensus Node – Full node with escalated privileges. Consensus nodes participate in validating transactions and adding blocks to the blockchain. They must go through a rigorous approval process in order to be approved as consensus nodes.

Connecting to Honestvote Mainnet

1 go run main.go --tcp 7004 --http 7005 --role producer --collection-prefix b_ --registry-host --registry-port 443

Setting up a blockchain on localhost

To setup a blockchain on a single computer, make sure that you have MongoDB installed and a running instance of mongod. Additionally, you may want to install MongoDB Compass so that you can visualize the blockchain data.

Once you have MongoDB installed and running, navigate to scripts/, located in the honestvote directory. Run this script by executing:1 2 chmod +x ./

The problem with running this script is that the processes will continue to run in the background and you must find the process ids in order to shut them down.

A better alternative is to create three split screen terminal sessions in Visual Studio Code, navigate each of these terminals to the build directory of honestvote, and then run the following three lines in each respective terminal:

go run main.go --tcp 7002 --http 7003 --role producer --collection-prefix a_ --registry true

go run main.go --tcp 7004 --http 7005 --role producer --collection-prefix b_ --registry-host --registry-port 7002

go run main.go --tcp 7006 --http 7007 --role producer --collection-prefix c_ --registry-host --registry-port 7002

It should look like this:

Flags for Node Creation

These are flags needed when adding a new node to the system.

--tcp <port number> : Specifies the tcp port to send raw tcp requests between nodes

--udp <port number> : This flag is specific to 'registry' nodes that accept and deligate ne nodes in the system

--http <port number> : Specifies the http port of a node to send http requests

--role <registry, producer> : Decides the role of this node. Either a registry node which registers other nodes that join the system or producer node which participates in the consensus of the blockchain

--collection-prefix <a_, b_, etc> : A letter followed with an underscore is recommended. This is used to differentiate each node's database, most importantly for the blockchain of each node

--registry-host <ip address of registry> : This is the ip address of the registry node

--registry-port <port number of registry> : This is the port number of the registry node

Making a request to the Blockchain via HTTP

These requests can also be seen in the Documentation section of our Confluence.

GET Requests:

  • <Full Node IP Address>:<Full Node Port>/elections
    Returns a summarized list of ElectionInfo objects
  • <Full Node IP Address>:<Full Node Port>/election/:electionid
    Returns detailed information with an Election object
  • <Full Node IP Address>:<Full Node Port>/election/:electionid/votes
    Returns a list of Vote objects
  • <Full Node IP Address>:<Full Node Port>/userpermissions/:publickey
    Returns the user’s UserPermissions
  • <Full Node IP Address>:<Full Node Port>/endpoint
    Returns endpoint for client to use

POST Requests:

  • <Node IP Address>:<Node Port>/election
    Post data:
  • { electionName: string, institutionName: string, description: string, startDate: string, endDate: string, emailDomain: string, positions: ElectionPosition[], sender: string, signature: string, }
  • <Node IP Address>:<Node Port>/election/:electionId/register
    Post data:
  • { publicKey: string, emailAddress: Election, firstName: string, lastName: string, dateOfBirth: string, electionId: string, electionAdmin: string, senderSig: string }
  • <Node IP Address>:<Node Port>/election/:electionId/vote
    Post data:
  • { electionId: string, recievers: [{id: string, key: string}], sender: string, signature: string, }


<Full Node IP Address>:<Full Node Port>/websocket/:publickey

Server to Client Data:

  • Vote
  • { type: "VOTE_ADD", payload: Vote }
  • Permissions
  • { type: "USER_CONFIRM_PERMISSION", payload: ElectionId }