GithubHelp home page GithubHelp logo

ibm-blockchain-archive / cp-web Goto Github PK

View Code? Open in Web Editor NEW
94.0 25.0 232.0 76.78 MB

A demonstration of a commercial paper trading application on IBM Blockchain.

License: Apache License 2.0

JavaScript 62.50% CSS 11.82% HTML 8.59% Go 17.09%

cp-web's Introduction

Commercial Paper Demo

Deploy to Bluemix

NOTICE

This demo will only ever support Hyperledger Fabric v0.6. If you are interested in seeing the latest that Hyperledger Fabric has to offer, see the Marbles Demo.

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

You need to create a blockchain network to run this demo.

You have two options:

  • Option 1: Create a Bluemix IBM Blockchain network - instructions
  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 'mycreds.json'.
  4. Make sure the key/value store only has values for your current network (See below).
  5. 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"
      }
    ]
  }
}
  • Option 2: Use a locally hosted Hyperledger Network (such as one from docker-compose)
  1. Clone this repository.
  2. Make sure your key/value store only has values for your current network (See below).
  3. Follow these instructions to stand up a local blockchain network and configure the demo to use it.
  4. Run these commands in the cloned directory:
npm install
gulp

To debug the code, run these commands:

npm install
DEBUG=hfc GRPC_TRACE=all gulp

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. To access the auditor tab, create a user with 'auditor' in their enrollID. (ex. myauditor, auditor34, etc.) Login as this user, and you will see the 'AUDIT' tab.

Notes on the Key Value Store

When the fabric SDK is used to enroll users, the enrollment certificate for the user is downloaded from the CA and the secret for the user you enrolled is invalidated. Basically, nobody will be able to enroll the user again. By default, the SDK will download this certificate into a local key value store. So, the only apps that will be able to use the enrolled users are those that have access to the enrollment certificate.

Why is this a problem?

When this demo is initialized, it attempts to enroll one of the blockchain networks registrar users, WebAppAdmin, downloading the enrollment certificate for that user into the demo applications filesystem on Bluemix. This will prevent other demos or apps on that network from being able to use the WebAppAdmin user. The message to take away from all of this is that you should only use this demo on it's own blockchain network, for now.

Limitations

  • Passwords don't mean anything in the demo. We're working on it. You still need to register users to interact with the demo, but you can use anything in the password field to log in.

  • 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 in the future.

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();

Troubleshooting

Solutions for common problems with running this demo locally are included below.

npm install fails with node-gyp errors in the output

First, make sure you are running this demo with the latest LTS versions of Node.js and NPM. You can check your versions of these two tools using these commands:

$ node -v
v6.9.1

$ npm -v
3.10.8

Second, this demo uses modules that must be compiled, which requires you to have certain build tools on your machine. If you are running on Windows, you should install the package here:

https://github.com/felixrieseberg/windows-build-tools

Finally, delete the node modules folder and give npm install another try.

Error creating deployment archive

Do your logs have a message similar to this one?

chain_setup.js Failed to deploy chaincode: EventTransactionError {
  error:
   Error: Error creating deployment archive [/tmp/deployment-package.tar.gz]: Error: Error on fs.createWriteStream
       at Error (native)
       at C:\Users\IBM_ADMIN\Documents\obc\git\demos\cp-web\node_modules\hfc\lib\hfc.js:1411:31
       at WriteStream.<anonymous> (C:\Users\IBM_ADMIN\Documents\obc\git\demos\cp-web\node_modules\hfc\lib\sdk_util.js:163:16)
       at emitOne (events.js:101:20)
       at WriteStream.emit (events.js:188:7)
       at WriteStream.<anonymous> (fs.js:2109:12)
       at FSReqWrap.oncomplete (fs.js:123:15),
  msg: 'Error: Error creating deployment archive [/tmp/deployment-package.tar.gz]: Error: Error on fs.createWriteStream' }
chain_setup.js chaincode deployment failed: undefined

This often happens because the /tmp directory is not present on your machine. hfc uses this folder to temporarily store and package this demo's chaincode for deployment. Create the directory, and you should be fine. This directory will be C:\tmp on Windows machines.

cp-web's People

Contributors

benjsmi avatar dhyey20 avatar dshuffma-ibm avatar filipmadej avatar mastersingh24 avatar mrshah-at-ibm avatar seanbarclay avatar siddharthhparikh avatar sidrmsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cp-web's Issues

Enabling 2 peers on blockchain network

Hi Gari,

We are trying to build a KYC POC on bluemix trial version (if we get through the issue, we are planning to buy the licence). We need to simulate 2 banks as two peers on the bluemix service. We took the credentials from Blockchain Service created on Bluemix and tried to register few users on Peer1 and few on Peer2 by using ibc.register() method for cp-web application. However we are facing issues on login. Can we please have a discussion/suggestions?

Thanks
Gauri S.

Errors when trying Query Account and Buy Paper

Deployed Commercial paper ok and was able to Register Accounts and Seed Paper.
However, Query account and Buy Paper both return 'Error - undefined'

Here is my console output....
`Registering enrollID dashboarduser_type1_fc0dac02c2
Success - registering enrollID

Deploying chaincode https://github.com/IBM-Blockchain/cp-chaincode-v2/hyperledger
Success - deployment (wait for the cc to start up)...

done
Invoking function - createAccount
Invoking function - createAccount
Success - invocation fd3f67b5-df1e-4e6f-b36b-31f6ed1e969b

Success - invocation 099e2cec-2a7d-4e1c-98bb-b181c754a4df

Invoking function - issueCommercialPaper
Success - invocation 1078c58c-d317-44ce-9327-b010ed826db7

Querying function - query ["GetCompany","demo_account1"]
Error - undefined

Invoking function - issueCommercialPaper
Success - invocation 6791873c-62ce-4aec-983d-c7414300b41c

Querying function - query ["GetCompany","demo_account1"]
Error - undefined

Invoking function - createAccount
Invoking function - createAccount
Success - invocation 44f19a6d-80c7-4eea-b032-a503e4f27eaf

Success - invocation 46c218d4-e2f4-4c86-b458-1fdfa5297c5f

Querying function - query ["GetCompany","demo_account1"]
Error - undefined

lets query on all cps to get a CUSIP. then buy the first one
Querying function - query ["GetAllCPs"]
Error - undefined'

Error: /root/cp-web/node_modules/hfc/lib/hfc.js:544 if (util.isString(cfg)) { while building using gulp

Hi, i have done a local setup for Fabric, now when I have changed mycred.json file as per local setup and do build using gulp command, i get the below error:

Running using Developer settings

  • Tracking Deployment
    I0922 10:56:32.342256828 6824 ev_epoll_linux.c:84] epoll engine will be using signal: 36
    D0922 10:56:32.342328573 6824 ev_posix.c:106] Using polling engine: epoll
    loading hardcoded peers
    loading hardcoded users
    calling network config
    found cert us.blockchain.ibm.com

/root/cp-web/node_modules/hfc/lib/hfc.js:544
if (util.isString(cfg)) {
^
TypeError: Object # has no method 'isString'

Please let me know what the issue is and what's the fix?

What is network id ?

Hi, i have created a network on my local with 2 validate peers and 1 CA. I want to deploy cp-web on my local for that i need to modify mycreds.json. What is network_id, container_id and id ?

Deploy cp-web on local network.

With IBM bluemix services going on and off, I'm trying to set up the app on my local machine. I've setup a local network using Vagrant, and have a CA server and VP already running. I want to knowm what changes to make to the mycreds.json file so that the application connects to my local network.

TypeError: Parameter "url" must be a string, not object

I run updated cp-web demo with instructions mentioned in read me section. It's giving following error:-

url.js:79
throw new TypeError('Parameter "url" must be a string, not ' + typeof url);
^

TypeError: Parameter "url" must be a string, not object
at Url.parse (url.js:79:11)
at Object.urlParse as parse
at parseUrl (/home/vagrant/ankit/temp/cp-web/node_modules/hfc/lib/hfc.js:2101:26)
at new Endpoint (/home/vagrant/ankit/temp/cp-web/node_modules/hfc/lib/hfc.js:1739:20)
at new MemberServicesImpl (/home/vagrant/ankit/temp/cp-web/node_modules/hfc/lib/hfc.js:1767:18)
at newMemberServices (/home/vagrant/ankit/temp/cp-web/node_modules/hfc/lib/hfc.js:2032:12)
at Chain.setMemberServicesUrl (/home/vagrant/ankit/temp/cp-web/node_modules/hfc/lib/hfc.js:285:32)
at configure_network (/home/vagrant/ankit/temp/cp-web/app.js:238:15)
at Object. (/home/vagrant/ankit/temp/cp-web/app.js:229:1)
at Module._compile (module.js:541:32)

Paper doesn't mature.

A timing element needs to be added to this demo to cause funds to transfer between accounts when papers reach their maturity.

Deployment fails on Bluemix

I click on the button "Deploy to Bluemix" from the git repository

First the WebAdmin tries to register and fails, but after first application reboot it works.
Chaincode deployed, etc ...

Then going to the web page, socket tries to boot but an expected token < is detected at this time

App/0^2016-10-20T10:26:38.762+0200
App/0 at IncomingMessage.<anonymous> (/home/vcap/app/app.js:374:25)2016-10-20T10:26:38.763+0200
App/0<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">2016-10-20T10:26:38.762+0200
App/0**SyntaxError: Unexpected token <**2016-10-20T10:26:38.762+0200
App/0 at process._tickCallback (node.js:355:11)2016-10-20T10:26:38.763+0200
App/0 at success (/home/vcap/app/app.js:352:29)2016-10-20T10:26:38.763+0200
App/0 at IncomingMessage.emit (events.js:129:20)2016-10-20T10:26:38.763+0200
App/0 at Object.parse (native)2016-10-20T10:26:38.763+0200
App/0 at _stream_readable.js:908:162016-10-20T10:26:38.763+0200
App/0undefined:12016-10-20T10:26:38.762+0200
App/0received ws msg: {"type":"get_papers","v":2}2016-10-20T10:26:34.712+0200
App/0received ws msg: {"type":"chainstats","v":2}2016-10-20T10:26:34.708+0200
App/0------------------------------------------ Websocket Up ------------------------------------------

Finally, when trying to reboot the app it exits directly. It seems WebAppAdmin is corrupted.

App/0Error: Uncaught, unspecified "error" event.2016-10-20T10:32:05.426+0200
App/0 at TransactionContext.deploy (/home/vcap/app/node_modules/hfc/lib/hfc.js:929:14)2016-10-20T10:32:05.426+0200
App/0 at TransactionContext.getMyTCert (/home/vcap/app/node_modules/hfc/lib/hfc.js:1060:21)2016-10-20T10:32:05.426+0200
App/0 ^2016-10-20T10:32:05.426+0200
App/0 throw Error('Uncaught, unspecified "error" event.');2016-10-20T10:32:05.426+0200
App/0 at Member.deploy (/home/vcap/app/node_modules/hfc/lib/hfc.js:765:12)2016-10-20T10:32:05.426+0200
App/0 at /home/vcap/app/node_modules/hfc/lib/hfc.js:932:222016-10-20T10:32:05.426+0200
App/0 at Member.getNextTCert (/home/vcap/app/node_modules/hfc/lib/hfc.js:812:20)2016-10-20T10:32:05.426+0200
App/0 at deploy (/home/vcap/app/app.js:289:32)2016-10-20T10:32:05.426+0200
App/0 at Error (native)2016-10-20T10:32:05.426+0200
App/0 at /home/vcap/app/app.js:275:172016-10-20T10:32:05.426+0200
App/0 at TransactionContext.emit (events.js:87:13)2016-10-20T10:32:05.426+0200
App/0events.js:872016-10-20T10:32:05.426+0200
App/0 at /home/vcap/app/node_modules/hfc/lib/hfc.js:1062:242016-10-20T10:32:05.426+0200
App/0**Failed to enroll WebAppAdmin member ---> Error: Identity or token does not match.**2016-10-20T10:32:05.422+0200
App/0Successfully got WebAppAdmin member ---> 2016-10-20T10:32:05.159+0200

I have ECONREFUSED 127.0.0.0:443 error.

[ibc-js] Peer: vp0-dev_vp0...:443
[ibc-js] Registering vp0-dev_vp0...:443 w/enrollID - user_type1_057b8987f0
[ibc-js] Register - failure x1 : user_type1_057b8987f0 500
[ibc-js] going to try to register again in 30 secs
[ibc-js] Registering vp0-dev_vp0...:443 w/enrollID - user_type1_057b8987f0
[ibc-js] Register - failure x2 : user_type1_057b8987f0 500
[ibc-js] going to try to register again in 30 secs
[ibc-js] Registering vp0-dev_vp0...:443 w/enrollID - user_type1_057b8987f0
[ibc-js] Register - failure x3 : user_type1_057b8987f0 500
! looks like an error loading the chaincode, app will fail
{ name: 'register() error',
code: 500,
details:
{ Error: connect ECONNREFUSED 127.0.0.1:443

Waiting on the node server to open up so we can talk to the blockchain.

Hi i have deployed cp-web on local and using blockchain network on IBM bluemix. I got service credentials from IBM bluemix and replaced it in mycreds.json while running app i am getting following error.

Waiting on the node server to open up so we can talk to the blockchain. This app is likely still starting up. Check the server logs if this message does not go away in 1 minute.
This application cannot run without the blockchain network :(

"Identity lookup error: sql: no rows in result set"

Hi i have setup local network and when i tries to deploy cp-web on this network. It gives following error while registration of users mentioned in mermbersrvc.yaml:-

23:59:51.250 [rest] Register -> ERRO 038 Error on client login: rpc error: code = 2 desc = "Identity lookup error: sql: no rows in result set"

Deploy to BlueMix. Error

Downloading artifacts...DOWNLOAD SUCCESSFUL
Target: https://api.ng.bluemix.net
Creating service instance cpblockchain in org DIGITIVELY / space dev as [email protected]...
FAILED
Server error, status code: 502, error code: 10001, message: Service broker error: {"description"=>"Error 404 received from broker url https://obc-service-broker-prod.mybluemix.net/v2/service_instances/f9a6ac07-a572-40ed-9ffb-858bc5da123c?accepts_incomplete=true"}

Finished: FAILED

Stage has no runtime information

Running cp-web application on local network

I'm trying to run the IBM's cp-web application on a local network on my mac. Following is my mycreds.json file.

"credentials": {
    "peers": [
      {
            "discovery_host": "localhost",
            "discovery_port": 30303,
            "api_host": "localhost",
            "api_port_tls": 443,
            "api_port": 5000,
            "type": "peer",
            "network_id": "dev",
            "id": "jdoe",
            "api_url": "http://localhost:5000"
          }
      ],
      "ca": {
      "url": "localhost:50051",
      "discovery_host": "localhost",
      "discovery_port": 50051,
      "api_host": "localhost",
      "api_port_tls": 443,
      "api_port": 5000,
      "type": "ca"

    },
    "users": [
      {
        "username": "tyagi_type1",
        "secret": "1ccf8703ac",
        "enrollId": "tyagi_type1",
        "enrollSecret": "1ccf8703ac"
      }
    ],
    "options": {"quiet": "true", "tls":"false", "maxRetry": "1"}
  }
}

I've added the user in the membersrvc.yaml file and also able to login into the peer using these credentials (peer network login). But when I'm running the cp-web app I'm getting the following error :
screen shot 2016-07-25 at 9 52 28 am

I have two question regarding this:

  1. On the ibc.load(), the ibc-js gives my No membership users found. I can't fathom why this might be happening because I'm specifying users in my mycreds.json file.
  2. It is giving me chiancode deployment error, api can't connect to port 443. In the options I've mentioned as tls:false option. Has anyone been able to run this app locally. Any pointers on what might be wrong ?

Blockchain Service Down

We keep getting below error when trying to login/register for cpweb application. [deployed locally and connecting via localhost - connected to bluemix by updating mycred.json.
]
For most of time today, we got this error. Is there any maintenance going on right now?

"Waiting on the node server to open up so we can talk to the blockchain. This app is likely still starting up. Check the server logs if this message does not go away in 1 minute.
This application cannot run without the blockchain network"

Documentation suggestions for cp-web instructions

Comments below reference each step of the cp-web instructions. So my comment 1 applies to step 1, etc.

  1. link to git instructions and give the exact command for cloning the repo. Git instructions should probably also reference full git instructions for more info. Especially since they have to clone a branch
    which isn't obvious.

It occurred to me after going through this that one option might be to have them run the marbles demo first, then move to this one since that would cover all their setup and is a somewhat simpler example.

  1. Help them set up a network in bluemix, should reference what was done for marbles.
  2. More help here, where do I get the credentials? screenshots. Again this is explained in marbles doc so could link there. If you had them do marbles first, could just copy that creds file.
  3. make sure the key/value store only has values for your network. mycreds.json is a key value store, but should make it clear that the key value store you're talking about is
    mycreds.json. Again, copy info from marbles.
  4. give an example, simply showing a // in front of the line.
    6./7. These assume you completed setup, which maybe they have not. Again reference the info from marbles.

Starting the application:

Need to make sure c:\tmp exists on windows, otherwise startup will fail. Probably want this to point to a non %temp% location so it won't get wiped on restart since if they lose their webadmin cert they'll need to redo everything.

Need to give them the URLs to use directly http://localhost:3000/login (:3000 will redirect to login).

IMO should remove the 1.0 branch now that the new service is deployed to prevent confusion and errors when trying to use new app on old network or vice versa.

Please help: "Warning - detected ECONNRESET, will try HTTP req again"

I keep on seeing this warning when I run "gulp" command for the marbles sample locally. My mycreds.json file contains this info:
{
"credentials": {
"peers": [
{
"api_host": "localhost",
"api_port": 7050,
"id": "vp0"
}
]
}
}

I got the api_port number from core.yaml file:

Enable/disable setting for the REST service. It is recommended to disable

# REST service on validators in production deployment and use non-validating
# nodes to host REST service
enabled: true

# The address that the REST service will listen on for incoming requests.
address: 0.0.0.0:7050

[ibc-js] Deploy Chaincode - Starting
[ibc-js] function: init , arg: [ '99' ]
Waiting...
[ibc-js] hyperledger body format
[http POST - z] /chaincode
body: {"jsonrpc":"2.0","method":"deploy","params":{"type":1,"chaincodeID":{"path":"https://github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2"},"ctorMsg":{"function":"init","args":["99"]}},"id":1475545508830}
[http POST - z] Error - unknown issue with request: { [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect' }
[ibc-js] deploy - failure: 500
! looks like a deploy error, holding off on the starting the socket
{ name: 'deploy() error',
code: 500,
details:
{ [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect' } }

Below find my mycreds.json file:
{
"credentials": {
"peers": [
{
"api_host": "localhost",
"api_port": 80,
"id": "vp0"
}
]
}
}

Problems with IBM

I tried to deploy a new project from scratch today and got an error saying:

FAILED
Service offering ibm-blockchain-4-prod not found

Finished: FAILED

Stage has no runtime information

Tried customizing the stage to use ibm-blockchain-5-prod but ended up getting this error whenever the blockchain starts up or attempts to execute any of the functions.

2016-04-29T14:41:07.402+1000[App/0]OUT[ibc-js] Read - failure: 400
2016-04-29T14:41:07.403+1000[App/0]OUT code: 400,
2016-04-29T14:41:07.403+1000[App/0]OUTpapers error { name: 'read() error',
2016-04-29T14:41:07.403+1000[App/0]OUT details: '{"Error": "Error:Failed to launch chaincode spec(Error starting container: API error (500): Error: image library/dev-41429a3e-9d2c-4d45-85c1-8f4ff7629d5c_vp1-9bdfbf948ccf88b9c09b6e0674feb413e2673d52d07285d7efb28e6e0d4f0e7ea3732b99c78fbddd1a2ea49d895b0f1248a1c9a4bcb864721af8c382d6b79e3d not found\n)"}' }

Any advice on this issue?

Chaincode name may not be blank.

Hi i edit chaincode as below:-

from:

type CP struct {
CUSIP string json:"cusip"
Ticker string json:"ticker"
Par float64 json:"par"
Qty int json:"qty"
Discount float64 json:"discount"
Maturity int json:"maturity"
Owners []Owner json:"owner"
Issuer string json:"issuer"
IssueDate string json:"issueDate"
}

to:

type CP struct {
CUSIP string json:"cusip"
Ticker string json:"ticker"
Par string json:"par"
Qty string json:"qty"
Discount string json:"discount"
Maturity string json:"maturity"
Owners []Owner json:"owner"
Issuer string json:"issuer"
IssueDate string json:"issueDate"
}

after that i am getting following error:-
[ibc-js] query - success: { jsonrpc: '2.0',
error:
{ code: -32602,
message: 'Invalid params',
data: 'Chaincode name may not be blank.' },
id: 1463375048073 }
papers undefined

[ibc-js] Unresolved action, must poll

"Error": "Failed loading TCerts from TCA"

I tried deploying cp-web from my machine towards bluemix but got an error

{ "Error": "Failed loading TCerts from TCA" }
This application cannot run without the blockchain network :("

Here's what i did:

  • create a blockchain service in Bluemix
  • configured my cp-web (via manifest.yml) to bind it to the created blockchain service
  • updated the credentials (via mycreds.json) with the ones generated after creating the blockchain service
  • deployed cp-web from my machine via cf push
  • naviagted to the URL, then the pop-up error mentioned appear

Failed loading TCertOwnerKDFKey. Key is missing.

Hi i have setup fabric network on my local when i deploy cp-web on this network it gives following errors:-

grpc: Server.Serve failed to complete security handshake

Failed loading TCertOwnerKDFKey. Key is missing.

23:37:02.064 [chaincode] Launch -> ERRO 16d launchAndWaitForRegister failed Timeout expired while starting chaincode bc25e42864477feeeedbfb5fecb7fea0c5bba627f9af2acf9c19746f705e671019dd04c1f7f7282f62a7cbefba1780d78b27507e777b3620713d7df37131442f(networkid:dev,peerid:vp0,tx:bc25e42864477feeeedbfb5fecb7fea0c5bba627f9af2acf9c19746f705e671019dd04c1f7f7282f62a7cbefba1780d78b27507e777b3620713d7df37131442f)

where to find chaincode logs ?

Hi i have deployed cp-web on my local and using blockchain network of IBM bluemix. where can i find chaincode logs ? i did not able to see logs in live logs on bluemix

question on creating user with CA-how to?

I went through the code here: https://github.com/IBM-Blockchain/cp-web/blob/master/utils/users.js
It talks about user registration once there is user created on to network (found in membersrvc.yaml) with username and hardcoded onetime password.
Seems restrictive to use only users in yaml hardcoded.
How do I create users on the fly?
Is there an example to dynamically create users on to the network?
A step by step document/explanation would be very useful!

Failed to query but invoke is okay

Hi,

Deployed successfully the BlueMix tutorial "learn-chaincode" program to BlueMix (the program is compiled successfully) also successfully ran the 'invoke' but failed at 'query' request. The error message shown was
{
"jsonrpc": "2.0",
"error": {
"code": -32003,
"message": "Query failure",
"data": "Error when querying chaincode: Error:Failed to launch chaincode spec(Error starting container: API error (500): Error: image library/f6eebcc6-5d8c-4dfa-b168-22d407ea8eb7-vp1-2aea9fb4994a013f958f69563279f44d191bf0cfa68a1df68a7c8279103378d538b4fe895512d27f86bb4b16242ba6f7b1d4eaffe6a1f6ec7f3020bb3b240bda not found\n)"
},
"id": 4
}

Here are some of the peer log =
ERR - �[36m20:57:27.743 [peer] SendMessage -> DEBU 256f28�[0m Sending message to stream of type: DISC_GET_PEERS
ERR - �[36m20:57:27.744 [consensus/handler] HandleMessage -> DEBU 256f29�[0m Did not handle message of type DISC_PEERS, passing on to next MessageHandler
ERR - �[36m20:57:27.744 [peer] HandleMessage -> DEBU 256f2a�[0m Handling Message of type: DISC_PEERS
ERR - �[36m20:57:27.744 [peer] beforePeers -> DEBU 256f2b�[0m Received DISC_PEERS, grabbing peers message
ERR - �[36m20:57:27.744 [peer] beforePeers -> DEBU 256f2c�[0m Received PeersMessage with Peers: peers:<ID:<name:"vp0" > address:"f6eebcc6-5d8c-4dfa-b168-22d407ea8eb7_vp0.us.blockchain.ibm.com:30303" type:VALIDATOR pkiID:"\3461\026\362\242\224\340\227\274\204\313\225a\317m\003\261=\221\232\n\354=\260-\246\214\365\225\267 " > peers:<ID:<name:"vp2" > address:"f6eebcc6-5d8c-4dfa-b168-22d407ea8eb7_vp2.us.blockchain.ibm.com:30303" type:VALIDATOR pkiID:"\211B ?\236|\323g\371\3050\220\277\037\311\002\217\256\311\204\210r\001:\313\222>\001\314\276<\205" > peers:<ID:<name:"vp1" > address:"f6eebcc6-5d8c-4dfa-b168-22d407ea8eb7_vp1.us.blockchain.ibm.com:30303" type:VALIDATOR pkiID:"|=G\261\343\267\303\221\230\275\327\312\017\260\224\230~d\357\343\207\354#h<LR$0\202W" >
ERR - �[36m20:57:27.783 [consensus/handler] HandleMessage -> DEBU 256f2d�[0m Did not handle message of type DISC_GET_PEERS, passing on to next

Is grpc case sensitive?

In the ca.proto; the service.method is named "ReadCACertificate()".

In OBCCAConnector, the reflected method is camelCase. Is this normal? I believe the grpc library does the case conversion automcatically, when it does method reflection. Am I correct?

OBCCAConnector.prototype.getECACertificate = function (callback) {
    this.ecapClient.readCaCertificate(new this.protos.Empty(), function (err, cert) {

Did you successfully execute the code to obtain ECA?

Trade creation fails on local deployment

I have succesfully deployed the blockchain on last Bluemix service and add the credentials to my local application.

After creating 2 users, test & test2, i fill the form to create a trade.
Then I got this log on my application console (and it is looping):

Failed to query existing chaincode state: request={"chaincodeID":"7d632678c8ae5462c58d2dbcacc23c7666c332cd6a76b6b638356ab605aced7f","fcn":"query","args":["GetCompany","test2"]}, error={"error":{"status":"FAILURE","msg":{"type":"Buffer","data":[69,114,114,111,114,58,70,97,105,108,101,100,32,116,111,32,108,97,117,110,99,104,32,99,104,97,105,110,99,111,100,101,32,115,112,101,99,40,112,114,101,109,97,116,117,114,101,32,101,120,101,99,117,116,105,111,110,32,45,32,99,104,97,105,110,99,111,100,101,32,40,55,100,54,51,50,54,55,56,99,56,97,101,53,52,54,50,99,53,56,100,50,100,98,99,97,99,99,50,51,99,55,54,54,54,99,51,51,50,99,100,54,97,55,54,98,54,98,54,51,56,51,53,54,97,98,54,48,53,97,99,101,100,55,102,41,32,105,115,32,98,101,105,110,103,32,108,97,117,110,99,104,101,100,41]}},"msg":"Error:Failed to launch chaincode spec(premature execution - chaincode (7d632678c8ae5462c58d2dbcacc23c7666c332cd6a76b6b638356ab605aced7f) is being launched)"}

error in query post - ibm bluemix

My invoke call works fine, however while trying to query i am getting following error:

"data": "Error when querying chaincode: Error:Failed to launch chaincode spec(premature execution - chaincode (abe2a....1) is being launched)"

is there any fix?

Chain Stats - failure: 500 Invalid JSON response

Hi i deployed cp-web on local and connected to IBM bluemix. Chaincode deployed successfully but i am getting following error sometimes due to which node.js application crashes.

[ibc-js] Chain Stats - failure: 500 Invalid JSON response:

<title>302 Found</title>

Found

The document has moved here.

Error while setting up local network for cp-web application

I have set up local environment for Fabric, and trying to run cp-web application on my local setup.
While building using "sudo gulp" I encounter the below error:

Running using Developer settings
app.js: loading 1 hardcoded peers
app.js: loading 22 hardcoded users
app.js: loading ca: 7c405ae6-1abb-45b0-8a82-65dda55ffaef_ca
[ibc-js] Peer: vp0-vp0...:5000
[ibc-js] Registering vp0-vp0...:5000 w/enrollID - user_type1_7e51477dd1
[ibc-js] Register - failure x1 : user_type1_7e51477dd1 500
[ibc-js] going to try to register again in 30 secs
[ibc-js] Registering vp0-vp0...:5000 w/enrollID - user_type1_7e51477dd1
[ibc-js] Register - failure x2 : user_type1_7e51477dd1 500
[ibc-js] going to try to register again in 30 secs
[ibc-js] Registering vp0-vp0...:5000 w/enrollID - user_type1_7e51477dd1
[ibc-js] Register - failure x3 : user_type1_7e51477dd1 500
! looks like an error loading the chaincode, app will fail
{ name: 'register() error',
code: 500,
details:
{ [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect' } }

looks like a deploy error, holding off on the starting the socket

I have created local dev network (2 vp and CA, running with pbft batch consensus). I deployed cp-web, user registration was successful, but it gives following error:-

{ name: 'deploy() error',
code: 500,
details:
{ [Error: write EPROTO 140556406359936:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:782:
] code: 'EPROTO', errno: 'EPROTO', syscall: 'write' } }

I have disabled TLS in options of mycreds.json

Failed to enroll WebAppAdmin

When trying to enroll WebAppAdmin on file client.js, function makeUnaryRequest at call:
call.startBatch I always get the response with status code 2, and no description.

Response from startBatch:
{ send_metadata: true,
send_message: true,
client_close: true,
metadata:
{ server: [ 'nghttpx nghttp2/1.12.0' ],
'content-length': [ '160' ],
date: [ 'Tue, 16 Aug 2016 16:52:28 GMT' ] },
read: null,
status:
{ code: 2,
details: '',
metadata: Metadata { _internal_repr: {} } } }

I do successfully get the member object with the chain.getMember function, but fails enrolling it.
I've tried using the secret/enrollSecret hardcoded from membersvc.yaml and also the secret/enrollSecret from the blockchain service

mycreds.json looks like this:
-------------------------------BEGIN mycreds.json-------------------------------
{
"ibm-blockchain-5-prod": [
{
"name": "cpblockchain",
"label": "ibm-blockchain-5-prod",
"plan": "ibm-blockchain-plan-5-prod",
"credentials": {
"peers": [
{
"discovery_host": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp0.us.blockchain.ibm.com",
"discovery_port": 30303,
"api_host": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp0.us.blockchain.ibm.com",
"api_port_tls": 443,
"api_port": 443,
"type": "peer",
"network_id": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459",
"container_id": "8512486f34f3b92a2891de537f60b2112d8f279bde59cf33696d8497828bc63e",
"id": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp0",
"api_url": "http://dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp0.us.blockchain.ibm.com:443"
},
{
"discovery_host": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp3.us.blockchain.ibm.com",
"discovery_port": 30303,
"api_host": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp3.us.blockchain.ibm.com",
"api_port_tls": 443,
"api_port": 443,
"type": "peer",
"network_id": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459",
"container_id": "8854f7e0374ec22f5c9f9425fe379c2daceebaded75fc155f2e53d44d544ef2f",
"id": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp3",
"api_url": "http://dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp3.us.blockchain.ibm.com:443"
},
{
"discovery_host": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp1.us.blockchain.ibm.com",
"discovery_port": 30303,
"api_host": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp1.us.blockchain.ibm.com",
"api_port_tls": 443,
"api_port": 443,
"type": "peer",
"network_id": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459",
"container_id": "f057b8e5773f31229a169ac0d871db1c807a1c93375d9104f4a07f4add5c6d26",
"id": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp1",
"api_url": "http://dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp1.us.blockchain.ibm.com:443"
},
{
"discovery_host": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp2.us.blockchain.ibm.com",
"discovery_port": 30303,
"api_host": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp2.us.blockchain.ibm.com",
"api_port_tls": 443,
"api_port": 443,
"type": "peer",
"network_id": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459",
"container_id": "67d124efaaa7dd66448b232d13c70819e559176986bcd662b5ed0ce0ad34e544",
"id": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp2",
"api_url": "http://dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_vp2.us.blockchain.ibm.com:443"
}
],
"ca": {
"dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_ca": {
"url": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_ca.us.blockchain.ibm.com:30303",
"discovery_host": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_ca.us.blockchain.ibm.com",
"discovery_port": 30303,
"api_host": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459_ca.us.blockchain.ibm.com",
"api_port_tls": 30303,
"api_port": 443,
"type": "ca",
"network_id": "dd28bcb0-e68d-4c8a-a3aa-a767a6e2e459",
"container_id": "32c8883bc70eee764e8c25af889f902f092897e1618de2309ef6e916ee9fbf4a"
}
},
"users": [
{
"username": "WebAppAdmin",
"secret": DATA FROM YML OR BLOCKCHAIN SERVICE CREDENTIALS,
"enrollId": "WebAppAdmin",
"enrollSecret": DATA FROM YML OR BLOCKCHAIN SERVICE CREDENTIALS
}
],
"cert": "https://blockchain-certs.mybluemix.net/us.blockchain.ibm.com.cert"
}
}
]
}
-------------------------------BEGIN mycreds.json-------------------------------
A clean installation fails too This are the last lines of log file:

2016-08-16T16:13:09.266-0500[App/0]OUTcalling network config
2016-08-16T16:13:09.433-0500[App/0]OUTSuccessfully got WebAppAdmin member --->
2016-08-16T16:13:09.741-0500[App/0]ERRI0816 21:13:09.740372535 34 http_client_filter.c:103] Unexpected content-type 'text/html; charset=UTF-8'
2016-08-16T16:13:09.742-0500[App/0]OUTFailed to enroll WebAppAdmin member ---> Error
2016-08-16T16:13:09.748-0500[App/0]ERR at /home/vcap/app/node_modules/hfc/lib/hfc.js:1062:24
2016-08-16T16:13:09.748-0500[App/0]ERR ^
2016-08-16T16:13:09.748-0500[App/0]ERR throw Error('Uncaught, unspecified "error" event.');
2016-08-16T16:13:09.748-0500[App/0]ERR at deploy (/home/vcap/app/app.js:289:32)
2016-08-16T16:13:09.748-0500[App/0]ERR at TransactionContext.emit (events.js:87:13)
2016-08-16T16:13:09.748-0500[App/0]ERR at TransactionContext.deploy (/home/vcap/app/node_modules/hfc/lib/hfc.js:929:14)
2016-08-16T16:13:09.748-0500[App/0]ERR at Member.getNextTCert (/home/vcap/app/node_modules/hfc/lib/hfc.js:812:20)
2016-08-16T16:13:09.748-0500[App/0]ERR at Error (native)
2016-08-16T16:13:09.748-0500[App/0]ERR at /home/vcap/app/node_modules/hfc/lib/hfc.js:932:22
2016-08-16T16:13:09.748-0500[App/0]ERRevents.js:87
2016-08-16T16:13:09.748-0500[App/0]ERRError: Uncaught, unspecified "error" event.
2016-08-16T16:13:09.748-0500[App/0]ERR at TransactionContext.getMyTCert (/home/vcap/app/node_modules/hfc/lib/hfc.js:1060:21)
2016-08-16T16:13:09.748-0500[App/0]ERR at Member.deploy (/home/vcap/app/node_modules/hfc/lib/hfc.js:765:12)
2016-08-16T16:13:09.749-0500[App/0]ERR at /home/vcap/app/app.js:275:17
2016-08-16T16:13:09.872-0500[API/2]OUTApp instance exited with guid eb01b069-8d0c-418b-aaee-3c9dbc0ce9e5 payload: {"cc_partition"=>"default", "droplet"=>"eb01b069-8d0c-418b-aaee-3c9dbc0ce9e5", "version"=>"693e580e-e761-484c-8ea9-5076f216d630", "instance"=>"21d350f859994457a7518d6455a76937", "index"=>0, "reason"=>"CRASHED", "exit_status"=>1, "exit_description"=>"app instance exited", "crash_timestamp"=>1471381989}

What am I missing?

Thanks in advance.

Error : ibm-blockchain-js 'length' of undefinde

When I run node app.js, I receive the following error. How can I fix about this?

/cp-web/node_modules/ibm-blockchain-js/index.js:780
if(ibc.chaincode.details.deployed_name.length < 32) ibc.chaincode.details.deployed_name = ''; //doesnt look right, let code below catch error

how to edit chaincode ?

i have deployed cp-web on my local and it's connected to IBM bluemix network. I need to do some changes for POC purpose like i want to change default balance.

I tried to do changes in following files

node_modules/ibm-blockchain-js/temp/unzip/cp-chaincode-v2-master/hyperledger/cp_cc.go
node_modules/ibm-blockchain-js/temp/unzip/cp-chaincode-v2-master/cp_cc.go

but it's not reflecting.

TypeError: Cannot read property 'enrollID' of undefined

Hi , I am trying to deploy the CP application on local setup (Vagrant) and it fails with the below error :

[ibc-js] Downloading zip
redirect... https://codeload.github.com/IBM-Blockchain/cp-chaincode-v2/zip/master
[ibc-js] Downloading zip
[ibc-js] Unzipping zip
[ibc-js] Unzip done
[ibc-js] Scanning files [ 'cp_cc.go' ]
[ibc-js] Parsing file for shim version
[ibc-js] Found shim version: github.com/hyperledger/fabric/core/chaincode/shim
[ibc-js] Parsing file for invoke functions - cp_cc.go
[ibc-js] Found cc invoke function: issueCommercialPaper
[ibc-js] Found cc invoke function: transferPaper
[ibc-js] Found cc invoke function: createAccounts
[ibc-js] Found cc invoke function: createAccount
[ibc-js] Found cc invoke function: init
[ibc-js] Parsing file for query functions - cp_cc.go
! [ibc-js] Warning - did not find any query functions in chaincode's "Query()", building a generic "query"
[ibc-js] Found cc query function: query
[ibc-js] load_chaincode() finished
/opt/gopath/cp_git/cp-web/node_modules/ibm-blockchain-js/index.js:732
enrollId = ibc.chaincode.details.peers[ibc.selectedPeer].enrollID;
^
TypeError: Cannot read property 'enrollID' of undefined
at Object.deploy (/opt/gopath/cp_git/cp-web/node_modules/ibm-blockchain-js/index.js:732:59)
at cb_ready (/opt/gopath/cp_git/cp-web/app.js:243:16)
at cb_got_names (/opt/gopath/cp_git/cp-web/node_modules/ibm-blockchain-js/index.js:287:18)
at FSReqWrap.oncomplete (fs.js:95:15)


mycreds.json file is :

{
"credentials": {
"peers": [
{
"discovery_host": "172.17.0.2",
"discovery_port": 30303,
"api_host": "172.17.0.2",
"api_port": 5000,
"type": "peer",
"network_id": "dev",
"id": "ind0",
"api_url": "http://172.17.0.2:5000"
},
{
"discovery_host": "172.17.0.3",
"discovery_port": 30303,
"api_host": "172.17.0.3",
"api_port": 5000,
"type": "peer",
"network_id": "dev",
"id": "ind1",
"api_url": "http://172.17.0.3:5000"
}
],
"users": [
{
"username": "user_type1_ind0",
"secret": "CMS10pEQlB16",
"enrollId": "user_type1_ind0",
"enrollSecret": "CMS10pEQlB16"
},
{
"username": "user_type1_ind1",
"secret": "NOE63pEQbL25",
"enrollId": "user_type1_ind1",
"enrollSecret": "NOE63pEQbL25"
}
]
}
}
~

Please help me to resolve the issue.

Thanks & Regards,
Indira

Values lost or replaced when creating stocks

Creating stocks sometimes loses values.

For example create a stock with a 3.25% discount, then create the same stock with a 10% discount, and it'll lose the 10% and add more stock to the 3.25% row.
I see the same behavior when changing stock name, maturity, etc, although I did see name and maturity sometimes work correctly and end up in a separate row in the UI, but not consistently.

Chaincode deployment failure in local environment

I'm set a local network with a cs and 1 validating peer. I've also updated the mycreds.json file so that it reflects to my local network. But I'm facing an error while running the application, it seems like chaincode deployment has issue. Can some provide some pointers on this ?

himanshus-mbp:cp-web himanshutyagi$ node app.js
D0724 13:05:44.303798000 140735184187392 ev_posix.c:101] Using polling engine: poll
------------------------------------------ Server Up - localhost:3000 ------------------------------------------
Running using Developer settings
app.js: loading 1 hardcoded peers
app.js: loading 1 hardcoded users
[ibc-js] Peer: vp0-dev_vp0...:443
[ibc-js] No membership users found after filtering, assuming this is a network w/o membership
[ibc-js] removing temp dir
[ibc-js] Downloading zip
redirect... https://codeload.github.com/IBM-Blockchain/cp-chaincode-v2/zip/master
[ibc-js] Downloading zip
[ibc-js] Unzipping zip
[ibc-js] Unzip done
[ibc-js] Scanning files [ 'cp_cc.go' ]
[ibc-js] Parsing file for shim version
[ibc-js] Found shim version: github.com/hyperledger/fabric/core/chaincode/shim
[ibc-js] Parsing file for invoke functions - cp_cc.go
[ibc-js] Found cc invoke function: issueCommercialPaper
[ibc-js] Found cc invoke function: transferPaper
[ibc-js] Found cc invoke function: createAccounts
[ibc-js] Found cc invoke function: createAccount
[ibc-js] Found cc invoke function: init
[ibc-js] Parsing file for query functions - cp_cc.go
! [ibc-js] Warning - did not find any query functions in chaincode's "Query()", building a generic "query"
[ibc-js] Found cc query function: query
[ibc-js] load_chaincode() finished
[ibc-js] Deploy Chaincode - Starting
[ibc-js] function: init , arg: []

Waiting...
[ibc-js] deploy - failure: 500
! looks like a deploy error, holding off on the starting the socket
{ name: 'deploy() error',
code: 500,
details:
{ [Error: connect ECONNREFUSED 127.0.0.1:443]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 443 } }

How to configure ledger ?

Run Hyperledger fabric CA Server and peer as test network. Deploy cp-web. It gives following error:-

{ name: 'query() resp error',
code: 400,
details:
{ code: -32003,
message: 'Query failure',
data: 'Error when querying chaincode: Error:Failed to launch chaincode spec(Could not get deployment transaction for bc25e42864477feeeedbfb5fecb7fea0c5bba627f9af2acf9c19746f705e671019dd04c1f7f7282f62a7cbefba1780d78b27507e777b3620713d7df37131442f - LedgerError - ResourceNotFound: ledger: resource not found)' } }

TypeError: Cannot read property 'pb' of undefined

When trying to connect my local copy of CP to new bluemix blockchain instance running v.6 I get the following error while running gulp command:

chain_setup.js successfully got registrar. Enrolling with secret: 4acb17630f
chain_setup.js Successfully enrolled registrar
chain_setup.js using registrar to deploy chaincode
chain_setup.js will wait for 80 seconds after deployment for chaincode to startup
chain_setup.js Deploying commercial paper chaincode as: WebAppAdmin
chain_setup.js Deployment request: {"fcn":"init","args":["a","100"],"chaincodePath":"chaincode/","certificatePath":"/certs/peer/cert.pem"}
**C:\Users\IBM_ADMIN\git\cp-web\node_modules\hfc\lib\hfc.js:1011
tx.pb.setNonce(self.nonce);
^

TypeError: Cannot read property 'pb' of undefined
at C:\Users\IBM_ADMIN\git\cp-web\node_modules\hfc\lib\hfc.js:1011:19
at TransactionContext.getMyTCert (C:\Users\IBM_ADMIN\git\cp-web\node_modules\hfc\lib\hfc.js:1057:20)
at TransactionContext.execute (C:\Users\IBM_ADMIN\git\cp-web\node_modules\hfc\lib\hfc.js:1004:14)
at C:\Users\IBM_ADMIN\git\cp-web\node_modules\hfc\lib\hfc.js:943:29
at C:\Users\IBM_ADMIN\git\cp-web\node_modules\hfc\lib\hfc.js:1155:24
at C:\Users\IBM_ADMIN\git\cp-web\node_modules\hfc\lib\hfc.js:1279:28
at WriteStream. (C:\Users\IBM_ADMIN\git\cp-web\node_modules\hfc\lib\sdk_util.js:163:16)
at emitOne (events.js:101:20)
at WriteStream.emit (events.js:188:7)
at WriteStream. (fs.js:2109:12)**

Please advise

Failed to launch chaincode spec(Error starting container: API error (500)

hi i am getting following error while deploying chaincode

[ibc-js] query - failure: 400 {"Error": "Error:Failed to launch chaincode spec(Error starting container: API error (500): Error: image library/dev-b44bffa8-4752-4a99-93d9-cae3f4350947_vp1-da54a9650fe87e2fa433c70d1082328a6b9984bbe9d22dfc10513c254ee757aa36e97528613669df0204321d068b0ac0f8d57b8a2a99cde74d79b92fc6d15484 not found
)"}
papers error { name: 'query() error',
code: 400,
details: '{"Error": "Error:Failed to launch chaincode spec(Error starting container: API error (500): Error: image library/dev-b44bffa8-4752-4a99-93d9-cae3f4350947_vp1-da54a9650fe87e2fa433c70d1082328a6b9984bbe9d22dfc10513c254ee757aa36e97528613669df0204321d068b0ac0f8d57b8a2a99cde74d79b92fc6d15484 not found\n)"}' }
[ibc-js] query - failure: 400 {"Error": "Error:Failed to launch chaincode spec(Error starting container: API error (500): Error: image library/dev-b44bffa8-4752-4a99-93d9-cae3f4350947_vp1-da54a9650fe87e2fa433c70d1082328a6b9984bbe9d22dfc10513c254ee757aa36e97528613669df0204321d068b0ac0f8d57b8a2a99cde74d79b92fc6d15484 not found
)"}
papers error { name: 'query() error',
code: 400,
details: '{"Error": "Error:Failed to launch chaincode spec(Error starting container: API error (500): Error: image library/dev-b44bffa8-4752-4a99-93d9-cae3f4350947_vp1-da54a9650fe87e2fa433c70d1082328a6b9984bbe9d22dfc10513c254ee757aa36e97528613669df0204321d068b0ac0f8d57b8a2a99cde74d79b92fc6d15484 not found\n)"}' }
[ibc-js] Chain Stats - success
[ibc-js] query - failure: 400 {"Error": "Error:Failed to launch chaincode spec(Error starting container: API error (500): Error: image library/dev-b44bffa8-4752-4a99-93d9-cae3f4350947_vp1-da54a9650fe87e2fa433c70d1082328a6b9984bbe9d22dfc10513c254ee757aa36e97528613669df0204321d068b0ac0f8d57b8a2a99cde74d79b92fc6d15484 not found
)"}
company error { name: 'query() error',
code: 400,
details: '{"Error": "Error:Failed to launch chaincode spec(Error starting container: API error (500): Error: image library/dev-b44bffa8-4752-4a99-93d9-cae3f4350947_vp1-da54a9650fe87e2fa433c70d1082328a6b9984bbe9d22dfc10513c254ee757aa36e97528613669df0204321d068b0ac0f8d57b8a2a99cde74d79b92fc6d15484 not found\n)"}' }

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.