-
Downaload and Install Node and Google Postman plugin
-
Clone the git URL https://github.com/yogendrasri/GettingStartedBlockchainApp.git to download the project.
-
Go to chaincode at chaicode/src/startup/starterchaincode.go and get it deployed and initialize in Blockchain instance.
-
Once chaincode successfully initialized, copy the credentail json from Blockchain UI Channel -> Chaincode and get the content paste in config/blockchain_creds.json.
-
Go to the project root directory and run 'npm install' - This will download all the dependencies defined in package.json
-
Run 'npm start', it starts Server at port 3001 with a success message in console.
-
Starter App contains three methods createProduct, getProduct, deleteProduct.
-
Open Postman
a. Test Create Product: Send POST request to url http://localhost:3001/createProduct Input Json
{
"id":"1",
"item" : "TV",
"distributor" : "JK"
}
b. Test Get Product:Same id used for create product Send POST request to url http://localhost:3001/getProduct Input Json
{
"id":"1"
}
c. Test Delete Product:Same id used for create product Send POST request to url http://localhost:3001/deleteProduct Input Json
{
"id":"1"
}
-
Downaload and Install Node and Google Postman plugin
-
Clone the git URL https://github.com/yogendrasri/GettingStartedBlockchainApp.git to download the project.
-
Go to chaincode at chaicode/src/startup/starterchaincode.go and get it deployed and initialize in Blockchian instance.
-
Once chaincode successfully initialized, copy the credentail json from Blockchain UI Channel -> Chaincode and get the content paste in confi/blockchain_creds.json.
-
Go to the project root directory edit manifest.yml file, change host name to some unique name.
-
From the root directory type 'cf push', give the bluemix api endpoint , username and password if it asks.
-
To see any error type cd logs --recent
-
Starter App contains three methods createProduct, getProduct, deleteProduct.
-
Open Postman
a.Test Create Product: Send POST request to url http://yourapplicationhost/createProduct Input Json
{
"id":"1",
"item" : "TV",
"distributor" : "JK"
}
b. Test Get Product:Same id used for create product Send POST request to url http://yourapplicationhost/getProduct Input Json
{
"id":"1"
}
c. Test Delete Product:Same id used for create product <<<<<<< HEAD Send POST request to url http:///deleteProduct Input Json
{
"id":"1"
}