A fully distributed platform for state/city councils to propose plans and garner voices of the public, built with Hyperledger Fabric.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. The following commands assume the operating system to be a Linux based distribution.
Following are a few dependencies that need to be installed:
- Git
- Docker, Docker Compose
- Go release, version 1.13 or greater
- Node: any 12.x version starting with v12.0.0 or greater
- Clone the repository
git clone https://github.com/hyperledger-labs/citizens-pulse.git
- Install fabric-binaries by running the following command.
./binaries.sh -d -s # if you only want to install the binaries ./binaries.sh -s # if you want to install the docker images as well as binaries
cd
into thenetwork
directory. Delete any previous running containers, images or network instances./generate.sh delNet
- Bring up the project i.e. the Hyperledger Fabric network, the API and Web Server. The network entails creation of channel having two Orgs, deployment of chaincode on all peers of both the organisations. The API server is to interacts with the network once up, while the Web server delivers pages to client-side thus enabling the user to send requests.
In case of a failure, try bringing up the containers individually, as follows:
./generate.sh projectUp
The CouchDB GUI showing all the databases and documents can be viewed at http://localhost:5984/\_utils/. To make sure that the private-collections (meant for plan data persistence) have been created, check-out the./generate.sh createChannel ./generate.sh deployCC # deploys the chaincode ./generate.sh api # starts the API server, runs on localhost:5000 ./generate.sh webui # starts the Web server, runs on localhost:3000
mychannel_plan$c$c\$$pcollection$plan
andmychannel_plan$c$c\$$pcollection$plan$private$details
documents. - Navigate to
http://localhost:3000/
in your browser. Signupuser
toOrg1
as a dummy user mandatorily.
-
To test with an Android emulator, follow the following steps:
- Start the emulator/AVD
- Add a device which supports API 28 (at the time of writing)
- Drag and Drop the .apk file on top of the device and accept for installation
- Login via the above dummy user by providing credentials
user/test
.
-
To testing with a real device: This is to handle times when you do not have a device to test the mobile part.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.