ibm-blockchain-archive / cp-web Goto Github PK
View Code? Open in Web Editor NEWA demonstration of a commercial paper trading application on IBM Blockchain.
License: Apache License 2.0
A demonstration of a commercial paper trading application on IBM Blockchain.
License: Apache License 2.0
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)' } }
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.
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
We have connectors to register new users with the ca. Therefore, it should be possible to take all of the users from the user_creds.json list and allow users to log in as them.
[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
Membership services has been updated in the Hyperledger fabric version we are now using for the BMX service. Need to add support for affiliation groups when adding new users
[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
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.
I have deployed commercial paper demo on IBM bluemix. While registration new user to membership services i got following error:-
OUT - TRACE: 2016/07/21 04:13:45 eca.go:477: gRPC ECAA:checkRegistrarSignature: no registrar was specified
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"
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?
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' } }
Hi I am not able to create paper with normal user. Also once i land to Create Page I cannot go back to home page to login as auditor
While using gulp command, i'm facing this error:
/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found
Please help to resolve this..!
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?
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 :
I have two question regarding this:
mycreds.json
file.tls:false
option. Has anyone been able to run this app locally. Any pointers on what might be wrong ?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
/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?
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
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?
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)
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>The document has moved here.
In addition to the filter feature, the trade and audit views would be much easier to use if the was a way to control how the displayed trades were sorted.
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 ?
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
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)"}' }
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"
Comments below reference each step of the cp-web instructions. So my comment 1 applies to step 1, etc.
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.
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.
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
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)
A timing element needs to be added to this demo to cause funds to transfer between accounts when papers reach their maturity.
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
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'
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
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:
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 :(
Hi I have setup openchain on local I am getting following error:-
code: 400,
details: '{"Error": "Error:Failed to launch chaincode spec(Error starting container: API error (400): {'message':'starting container with HostConfig was deprecated since v1.10 and removed in v1.12'}\n)"}' }
@masterDev1985 Can you please help me to resolve the problem ? Thank you.
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.
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 } }
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!
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:
# 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"
}
]
}
}
in Loopback-based connector for OBCCA GRPC services i wanted to add functions as RegisterAffiliationGroup() . what changes should i make in ca.proto file as well as in eca.go?
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
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)"}
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.
I'm running this application, but application is not getting loaded properly and is giving this error:
Web_Socket_Server: Chainstats failure {"name":"block_stats() error","code":500,"details":{"code":"ECONNRESET"}}
Please let me know whats going wrong?
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
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.
minimally we will need to modify cp-web to leverage the new SDK in order to interact with the new version of membership services but
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.