This project is the back end for the Department of Education grant disbursement blockchain effort. There are several ways to get the code running which I will outline below.
###Option 1 (The One with all the scripts)
- The first thing you want to do is start your instance of Hyperledger Fabric. To do this, make sure you have fabric installed, go to the directory, and run ./startFabric.sh in your command line.
- After you have your Fabric instance started, navigate to the directory where you have stored your chaincode. Then run the deploy script (./deploy.sh) in your terminal.
- Once you've deployed and started the code with that script, run ./startRest.sh in your command line to start the rest server.
- Navigate in your browser to localhost:3000 to use the autogenerated composer rest server.
###Option 2 (The Manual Option)
-
The first thing you want to do is start your instance of Hyperledger Fabric. To do this, make sure you have fabric installed, go to the directory, and run startFabric.sh in your command line.
-
After you have your Fabric instance started, navigate to your project directory and run npm install in your command line to install your dependencies.
-
Once you have your dependencies installed, run npm run prepublish to create your business network archive (bna) file. This is essentially a zip folder of your cto, logic.js, and ACL files and will be used in the next set of commands.
-
Run this command in your command line:
*composer network install -c PeerAdmin@hlfv1 -a dist/grantblock.bna*
-
After your composer code is installed on your fabric instance, it's time to start everything up.
*composer network start -A admin -S adminpw -c PeerAdmin@hlfv1 -f admin@grantblock.card -n grantblock -V 0.0.24996*
-
In order to install your admin card, you need to also run the following command from your command line.
*composer card import --file admin@grantblock.card*
-
Now everything should be up and running. To test it all out, try to ping the network to see if you get a response using the following command:
*composer network ping -c admin@grantblock*
-
Once you've confirmed that everything is working, it's time to start the composer rest server. Run the following command in order to do so.
composer-rest-server -c admin@grantblock -n never -w true
###TODO - Configuration
If you want to get into the details of the project and how it works, this goes into a description of each of the important files.
###TODO - Upgrading a Deployed Network
POST SetUpDemo --> Bootstrap functionality Parameters Amount - amount that each grantee has been obligated (can be changed at a later date) GET ActionRequest --> Gets the list of action requests that have been put on the chain Parameters None POST CreateActionRequest --> Creates a new action request with the Parameters Amount -Amount requested number of validators requestor (grantee) POST CreateGrantee --> Creates a new participant Grantee Parameters granteeId grantBalance pocName pocEmail
TEST