IBM/Blockchain_for_TelcoRoaming

Name: Blockchain_for_TelcoRoaming

Owner: International Business Machines

Description: null

Created: 2018-05-21 16:14:36.0

Updated: 2018-05-22 05:07:34.0

Pushed: 2018-05-22 05:07:33.0

Homepage: null

Size: 11

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

BlockchainforTelecomRoaming

This is a proof of concept to demonstrate how Blockchain brings the CSPs on single Blockchain Hyperledger network which enables direct exchange of information with transactions that are immutable and executed based on consensus model using smart contract rules.

This business network defines:

Participants: Home Operator Roaming Partner

Assets: Subscriber Sims

Transactions: discovery authentication updaterate callout overagecheck callend callpay addUser

Bussines Network

There are four scenarions covered :

  1. Roaming Subscriber Identification A subscriber moves to a new location out of home network. Is disvovered by Roaming Partner. discovery trasaction is executed. Roaming Partner authenticates Roaming Subscriber as a visitor from Home Operator. authentication transaction is executed. Home Operator register Roaming Subscriber accordingly. updaterate transaction is executed.
  2. Roaming Subscriber Billing Now that authorized, Roaming Subscriber uses Roaming Partner network to initiate a call. callout and callend trasactions are executed. The charges for network usage are instantaneously recorded between Home Operator and Roaming Partner based on their agreement. callpay trasaction is executed.
  3. Fraud Identification Addition of a Fraudulent Subscriber is simulated. addUser transaction is executed. Fraudulent Subscriber tries to registed to access the Home Operator network using the same MSISDN of an existing user Authentication step identifies the subscriber and prevent the fraud. authentication transaction is executed.
  4. Overage Management A roaming subscriber intiates a call/ Smart contract recognizes that subscriber is potentially reaching overage threshold. callout trasaction is executed. Operator notifies the Overage Subscriber of the potential tariff change.overagecheck trasaction is executed.

Audience level : Intermediate Developers

If you have an IBM cloud lite account, you can also use the Starter Plan for 30 days to do this pattern.

Included Components
Included technologies
Application Workflow Diagram

Application Workflow

Steps
  1. Generate the Business Network Archive (BNA)
  2. Deploy the Business Network Archive using Composer Playground
  3. Deploy the Business Network Archive on Hyperledger Composer running locally
1. Generate the Business Network Archive (BNA)

To check that the structure of the files is valid, you can now generate a Business Network Archive (BNA) file for your business network definition. The BNA file is the deployable unit – a file that can be deployed to the Composer runtime for execution.

Use the following command to generate the network archive:

install

You should see the following output:

ting Business Network Archive

ing for package.json of Business Network Definition
Input directory: /Users/<user-name>/Documents/git-demo/roaming

d:
Description: Telecom Roaming Demo
Name: my-network
Identifier: my-network@0.0.1

ten Business Network Definition Archive file to
Output file: ./dist/my-network.bna

and succeeded

The composer archive create command has created a file called my-network.bna in the dist folder.

You can test the business network definition against the embedded runtime that stores the state of 'the blockchain' in-memory in a Node.js process. From your project working directory, open the file test/foodTest.js and run the following command:

test

You should see the following output :

-network@0.0.1 test /Users/<user-name>/Documents/demo/roaming
cha --recursive

omposer.food.supply
? Transfer ProductListing to Importer (67ms)
? Exempt Check for ProductListing (98ms)
? Transfer ProductListing to Retailer (95ms)

passing (2s)
2. Deploy the Business Network Archive using Composer Playground

Open Composer Playground, by default the Basic Sample Network is imported. If you have previously used Playground, be sure to clear your browser local storage by running localStorage.clear() in your browser Console.

Now import the my-network.bna file and click on deploy button.

You can also setup Composer Playground locally.

Once the bna is deployed , go to the test tab

To test your Business Network Definition, first click on the Test tab:

Create CSPs using transaction resetCSP

l:
tCSP {
ss (string, optional): The class identifier for this type ,
ed (string),
sactionId (string, optional): The instance identifier for this type ,
stamp (string, optional)


ple Value:

class": "org.gsc.roaming.resetCSP",
oneed": "string",
ransactionId": "string",
imestamp": "2017-10-05T07:24:24.743Z"

Create Subscribers using transaction resetMSISDN

l:
tMSISDN {
ss (string, optional): The class identifier for this type ,
ed (string),
sactionId (string, optional): The instance identifier for this type ,
stamp (string, optional)


ple Value:

class": "org.gsc.roaming.resetMSISDN",
oneed": "string",
ransactionId": "string",
imestamp": "2017-10-05T07:24:24.749Z"

Scenario 1 :

execute transaction discovery


class": "org.gsc.roaming.discovery",
sset": "string",
p": "string",
ocation": "string",
at": "string",
ong": "string",
ranstype": "string",
ransactionId": "string",
imestamp": "2017-10-05T07:24:24.724Z"

execute transaction authentication


class": "org.gsc.roaming.authentication",
sset": "string",
p": "string",
ranstype": "string",
oaming": "string",
lag": "string",
ransactionId": "string",
imestamp": "2017-10-05T07:24:24.657Z"

execute transaction updaterate


class": "org.gsc.roaming.updaterate",
sset": "string",
p": "string",
atetype": "string",
ranstype": "string",
ransactionId": "string",
imestamp": "2017-10-05T07:24:24.811Z"

Similar for other three scenarios.

3. Deploy the Business Network Archive on Hyperledger Composer running locally

Please start the local Fabric using the instructions. Now change directory to the dist folder containing my-network.bna file and type:

ist
oser runtime install --card PeerAdmin@hlfv1 --businessNetworkName my-network
oser network start --card PeerAdmin@hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile food-supply.bna --file networkadmin.card
oser card import --file networkadmin.card

You can verify that the network has been deployed by typing:

oser network ping --card admin@my-network

You should see the the output as follows:

connection to the network was successfully tested: events
version: 0.18.1
participant: org.hyperledger.composer.system.NetworkAdmin#admin
identity: org.hyperledger.composer.system.Identity#1f95efceac5421ad34d73130c8f16fbc2d29b7dce0c3425afb3b5f077242b1fc

and succeeded

To create the REST API we need to launch the composer-rest-server and tell it how to connect to our deployed business network. Now launch the server by changing directory to the roaming folder and type:

.
oser-rest-server

Answer the questions posed at startup. These allow the composer-rest-server to connect to Hyperledger Fabric and configure how the REST API is generated.

Test REST API

If the composer-rest-server started successfully you should see these two lines are output:

server listening at: http://localhost:3000
se your REST API at http://localhost:3000/explorer

Open a web browser and navigate to http://localhost:3000/explorer

You should see the LoopBack API Explorer, allowing you to inspect and test the generated REST API. Follow the instructions to test Business Network Definition as mentioned above in the composer section.

Additional Resources
License

Apache 2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.