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.
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.
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 binaryTo start the network and prepare it for the Voting System application:
Run the following command to start the network with 6 organizations and create the default channel mychannel.
./network.sh up createChannelThe 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- Crypto Config:
organizations/cryptogencontains configurations for Org1 through Org6. - Docker Compose:
compose/compose-test-net.yamlandcompose/compose-couch.yamldefine services for all 6 peers and their databases. - Scripts:
scripts/deployCC.shandscripts/envVar.share updated to handle the lifecycle (install, approve, commit) across 6 organizations. - ConfigTX:
configtx/configtx.yamlincludes profiles and organization definitions for the expanded consortium.
To stop the network and remove artifacts:
./network.sh downYou can also delete everything with github.com/aleferu/voting-system's erase.sh.