Code Monkey home page Code Monkey logo

cp-web's Introduction

Commercial Paper Demo

Deploy to Bluemix

Description

This application is a demonstration of how a commercial paper trading network might be implemented on IBM Blockchain. The components of the demo are:

  • An interface for creating new users on the network.
  • An interface for creating new commercial papers to trade.
  • A Trade Center for buying and selling existing trades.
  • A special interface just for auditors of the network to examine trades

Getting Started

  1. Deploy the demo to your IBM Bluemix account using the button above.
OR
  1. Clone this repository.
  2. Create an instance of the IBM Blockchain service in the Bluemix catalog.
  3. Copy the credentials from the service into the file 'my_creds.json'.
  4. Run these commands in the cloned directory:
npm install
gulp

These credentials can be obtained from the "Service Credentials" tab of the Bluemix service. They are in the form:

{
  "credentials": {
    "peers": [
      {
        "discovery_host": "169.53.62.121",
        "discovery_port": "40275",
        "api_host": "169.53.62.121",
        "api_port": "40276",
        "type": "peer",
        "network_id": "4b21f2f9-4d10-4946-a0df-f91ac09dbc03",
        "id": "4b21f2f9-4d10-4946-a0df-f91ac09dbc03_vp1",
        "api_url": "http://169.53.62.121:40276"
      }
    ],
    "users": [
      {
        "username": "user_type0_b7c7a1e545",
        "secret": "89ce33e4e6"
      }
    ]
  }
}

Using the Demo

  1. Register some users using the registration form on the login page.
  2. Save the credentials that are created for the users you register. They appear just above the registration form.
  3. Use the credentials to log in to the application. The UI you see will be determined by the role that was assigned to each user.
  4. Open the 'CREATE' tab to create new trades.
  5. Open the 'TRADE' tab to participate in your commercial paper trading network.
  6. Open the 'AUDIT' tab to view all of the trades on the network.

Limitations

  • Having the string 'auditor' in the username will cause the user to be registered as an auditor, while anything else will register the user as a regular user, meaning that they can create and trade paper. These limitations will be fixed in future versions of the demo.

  • Nothing happens when papers mature.

  • For now, the permissions for auditors and regular users are only enforced within the web application. An updated user architecture will be coming to the fabric to fix this very soon!

Privacy Notice

This web application includes code to track deployments to IBM Bluemix and other Cloud Foundry platforms. The following information is sent to a Deployment Tracker service on each deployment:

  • Application Name (application_name)
  • Space ID (space_id)
  • Application Version (application_version)
  • Application URIs (application_uris)

This data is collected from the VCAP_APPLICATION environment variable 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.

Disabling Deployment Tracking

Deployment tracking can be disabled by deleting the following code in app.js:

// Track the application deployments
require("cf-deployment-tracker-client").track();

cp-web's People

Contributors

dshuffma-ibm avatar benjsmi avatar mrshah-at-ibm avatar mastersingh24 avatar seanbarclay avatar filipmadej avatar

Watchers

James Cloos avatar SURYA BHAMIDIPATI avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.