A blockchain for fitness data demo.
Blockchain is first and foremost about a peer to peer exchange of value. The following demonstration reviews the exchange of an individual's fitness/workout data for various rewards from organizations they interact with.
In the demo, the workout/health data never leaves the person's phone. The person accepts a fitness challenge from an organization, and each time their workout matches the challenge criteria, it is recorded as a transaction in a block.
During the demo, we will view what the individual sees, what a network administrator sees, and what the organization sees. We look behind the scenes at the blockchain fabric where fitness challenge data exists and explore the tenets of:
- Shared ledger [ participants only see transactions they're entitled to see ]
- Trust [ endorsements, assets ]
- Privacy [ anonymity ]
- Smart contract [ verifiable, queryable, searchable, encrypted ]
- IBM Bluemix account. Sign up for Bluemix, or use an existing account.
- Node.js >= 6.9.1 - nvm is recommended.
The app comes with a toolchain you can use to deploy the solution with few clicks. If you want to deploy it manually, you can skip this section.
-
Ensure your organization has enough quota for one web application using 256MB of memory and 2 services.
-
Click Deploy to Bluemix to start the Bluemix DevOps wizard:
-
Select the GitHub box.
-
Decide whether you want to fork/clone the app repository.
-
If you decide to Clone, set a name for your GitHub repository.
-
Select the Delivery Pipeline box.
-
Select the region, organization and space where you want to deploy the app.
-
Click Create.
-
Select the Delivery Pipeline.
-
Wait for the Deploy job to complete.
-
Access the app when it's ready and start uploading videos and images!
-
Clone the app to your local environment from your terminal using the following command:
git clone https://github.com/IBM-Bluemix/health-blockchain.git
-
cd into this newly created directory
-
Create a Cloudant service in Bluemix
cf create-service cloudantNoSQLDB Lite health-blockchain-db
-
In the checkout directory, copy the file vcap-local.template.json to vcap-local.json. Edit vcap-local.json and update the credentials for the Cloudant service. You can retrieve the service credentials from the Bluemix console.
cp vcap-local.template.json vcap-local.json
-
Get the project dependencies
npm install
-
Run the app
npm start
Refer to API.md for details on the app architecture.
See License.txt for license information.
This application is configured to track deployments to IBM Bluemix and other Cloud Foundry platforms. The following information is sent to a Deployment Tracker service on each deployment:
- Node.js package version
- Node.js repository URL
- Application Name (
application_name
) - Application GUID (
application_id
) - Application instance index number (
instance_index
) - Space ID (
space_id
) - Application Version (
application_version
) - Application URIs (
application_uris
) - Labels of bound services
- Number of instances for each bound service and associated plan information
This data is collected from the package.json
file in the sample application and the VCAP_APPLICATION
and VCAP_SERVICES
environment variables in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.
Deployment tracking can be disabled by removing require("cf-deployment-tracker-client").track();
from the beginning of the app.js
file.