Skip to content

aleferu/voting-network

Repository files navigation

Voting Network

This directory contains the Hyperledger Fabric network configuration and scripts tailored for the Secret Voting System. It is a modified version of the standard Fabric test-network, extended to support a larger consortium suitable for the voting application's roles.

Note: The original README for the test-network has been moved to OLDREADME.md.

Note: Chaincode is located in github.com/aleferu/voting-system.

Network Topology

Unlike the standard test-network (2 Orgs), this network is configured with 6 Peer Organizations:

  • Org1 - Org5: Represent Voter organizations. Peers in these organizations endorse vote transactions.
  • Org6: Represents the Manager organization. This organization is responsible for creating campaigns, managing phases (Open -> Reveal -> Closed), and tallying results.

Prerequisites

You need both docker and docker-compose.

Make sure you installed Fabric using:

curl -sSLO https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh && chmod +x install-fabric.sh
./install-fabric.sh d s b
./install-fabric.sh --fabric -version 2.5.14 binary

Quick Start

To start the network and prepare it for the Voting System application:

1. Bring up the Network and Channel

Run the following command to start the network with 6 organizations and create the default channel mychannel.

./network.sh up createChannel

2. Deploy the Voting Chaincode

The Voting System relies on the voting chaincode that should be located in ../voting-system/chaincode-go. You can deploy it using Chaincode-as-a-Service (CCAAS).

./network.sh deployCCAAS -ccn voting -ccp ../voting-system/chaincode-go

Modifications from Standard Test Network

  • Crypto Config: organizations/cryptogen contains configurations for Org1 through Org6.
  • Docker Compose: compose/compose-test-net.yaml and compose/compose-couch.yaml define services for all 6 peers and their databases.
  • Scripts: scripts/deployCC.sh and scripts/envVar.sh are updated to handle the lifecycle (install, approve, commit) across 6 organizations.
  • ConfigTX: configtx/configtx.yaml includes profiles and organization definitions for the expanded consortium.

Clean Up

To stop the network and remove artifacts:

./network.sh down

You can also delete everything with github.com/aleferu/voting-system's erase.sh.

About

Hyperledger fabric to use [voting-system](https://github.com/aleferu/voting-system)

Topics

Resources

Stars

Watchers

Forks

Contributors