Coder Social home page Coder Social logo

ibm-blockchain-archive / marbles Goto Github PK

View Code? Open in Web Editor NEW
1.0K 1.0K 979.0 43 MB

WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.

License: Apache License 2.0

JavaScript 71.26% CSS 10.38% HTML 7.69% Go 10.61% Shell 0.02% Dockerfile 0.04%

marbles's People

Contributors

anishman avatar balakrishna513 avatar benjsmi avatar dhyey-ibm avatar dhyey20 avatar dshuffma-ibm avatar g8rengr avatar ichaobuster avatar jmarca avatar joequant avatar lat94 avatar lnrego avatar macinjoke avatar mastersingh24 avatar mcr222 avatar miku2000 avatar mrshah-at-ibm avatar rantwijk avatar rmohta avatar ronaldpetty avatar seanbarclay avatar some-ibmer avatar szbra avatar teora avatar wwalisa avatar yamachan 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  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  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

marbles's Issues

Cannot download chaincode from local deployment

Hi!
I am trying to set up the marbles application by setting up a local network of VPs and a local CA too.

I have been capable of building everything and all the steps are executed properly until the deployment of the chaincode:

Waiting...
   [ibc-js] deploy - failure: 400
   ! looks like a deploy error, holding off on the starting the socket
    { name: 'deploy() error',
     code: 400,
     details: { Error: 'Error getting chaincode package bytes: Error getting code p
   rocess done with error = exit status 1' } }

when I set git_url to: github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 it finds the chaincode and deploys it.

I don't know why the git_url to: https://github.com/IBM-Blockchain/marbles-chaincode/part2_v1.0.0 it fails to download it.

read property '0' undefined

Hi I am little bit confused about the marble tutorial

npm install
gulp

its done here locally on osx yosemite with the blockchain hyperledger api connectivity
the mycreds_bluemix.json is correctly filled with credentials and users (user_type1_0 plus the secret)

I am experiencing this nodejs error and I can understand why.

TypeError: Cannot read property '0' of undefined
at Object. (/.../marbles.v2/app.js:218:20)

node -v
v7.2.1

npm -v
4.1.1

looking at the line mentioned in code snippet: peers: [peers[0]],

thanks

fs.access error

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

    fs.access(unzip_cc_dest, cb_file_exists);                                       //check if files exist ye
       ^

TypeError: Object # has no method 'access'
at cb_ready (/root/marbles/node_modules/ibm-blockchain-js/index.js:181:6)
at /root/marbles/node_modules/ibm-blockchain-js/lib/helper.js:44:4
at Object.oncomplete (fs.js:107:15)

Error loading the chaincode or network

------------------------------------------ Server Up - localhost:3000 ------------------------------------------
Running using Developer settings

  • Tracking Deployment
    loading hardcoded peers
    loading hardcoded users
    [ibc-js] Peer: vp0-vp0...:7050
    [ibc-js] Registering vp0-vp0...:7050 w/enrollId - bob
    [ibc-js] Register - failure x1 : bob 401
    [ibc-js] going to try to register again in 30 secs
    [ibc-js] Registering vp0-vp0...:7050 w/enrollId - bob
    [ibc-js] Register - failure x2 : bob 401
    ! looks like an error loading the chaincode or network, app will fail
    { name: 'register() error',
    code: 401,
    details: { Error: 'rpc error: code = 2 desc = Identity or token does not match.' } }

{
"credentials": {
"peers": [{
"api_host": "localhost",
"api_port": 7050,
"type": "peer",
"id": "vp0"
}],
"users": [{
"enrollId": "bob",
"enrollSecret": "NOE63pEQbL25"
}],
"cert": "https://blockchain-certs.mybluemix.net/us.blockchain.ibm.com.cert"
}
}

Also I get

Error creating connection to peer address 172.20.0.7:7051: grpc: timed out when dialing
in console when I run "docker-compose -f four-peer-ca.yaml up"

deploy - failure: 408

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

[ibc-js] deploy - failure: 408
! looks like a deploy error, holding off on the starting the socket
{ name: 'deploy() error',
code: 408,
details: 'Request timed out' }

Local installation tutorial

Request: local (non-bluemix) installation tutorial with all the following configuration steps specified:

  1. docker-compose.yml
  2. options in app.js
  3. mycreds_docker json
  4. os / environment (e.g. OSX / ubuntu / windows / vagrant)

that gets the demo working. See #13 (comment)

Proposed changes to marbles demo documentation.

Here's a few changes I'd suggest to the getting started demo documentation. To be clear, the path I followed was running marbles app on my local system using a blockchain network in bluemix.

  1. Suggestion: Keep as much "informational" stuff out of the initial instructions as possible. Too much information causes people to get confused IMO. Not sure if they need to care about
    certain things or if they are extra.

For example, get rid of the whole "chaincode" part of these instructions. If they want to learn chaincode, they can do it via the link. If they don't want to yet, this will just confuse them, especially with code snippets since they'll likely think they need to do these. Flow should be context flows then setup options.

  1. All Screenshots and instructions need to be updated to match new UI. I captured a few of these.

  2. In the instructions where you have "Keep creds at the default value" - There's only one but it's not selected. You don't need to do anything here. I'd clarify that.

  3. In the instructions where you tell the user to rename network to "my blockchain". Can be renamed from bluemix dashboard. Need to tell people how to get back and rename. I wouldn't assume they know bluemix.

  4. In the doc where you tell user to "Copy the value of the whole JSON object to the mycreds.json file in the root of this project". You haven't told them to clone the project yet at this point. I'd either have them copy this off and save it locally somewhere "You'll use these credentials later" or more likely refer them back to how to get this information when they actually get to the point of editing the file after cloning the project.

  5. Where you tell them this "Next we need to install our dependencies. Open a command prompt/terminal and browse to the root of this project." Give them the exact directory name.

  6. For this:

npm install gulp -g
npm install

I see some warnings. Need to tell them how to check if it worked or not or at least let them know about the warnings and what's OK vs what isn't.

  1. I'd have multiple sets of instructions for editing the JSON file..basically the section you have where you tell them "if your usecase is this, you need to edit the JSON file". Expand each one of those to show exactly what they need to do for each usecase. Part of the confusion I think comes from the fact that the instructions jump around between the different usecases.

  2. VCAP, define this and make it clear it's an environment variable everytime it's referenced and where it will be set and where it won't.

How to host marbles locally?

I run npm install and gulp marbles1. And open web browser with url http://localhost:3001/. In the browser, login with admin. The console side outputs many errors:

error: Error: Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 127.0.0.1:7054]
    at ClientRequest.<anonymous> (/home/allen/gopath/src/github.com/hyperledger/marbles/node_modules/fabric-ca-client/lib/FabricCAClientImpl.js:568:12)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at Socket.socketErrorListener (_http_client.js:310:9)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1278:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
error: [fcw] Failed to get enrollment marbles-marbles-ibm-mychannel-fabric-peer-1a Error: Failed to obtain an enrolled user
    at ca_client.enroll.then.then.then.catch (/home/allen/gopath/src/github.com/hyperledger/marbles/utils/fc_wrangler/enrollment.js:131:12)
    at process._tickCallback (internal/process/next_tick.js:103:7)
error: [fcw] could not format error
error: could not enroll...

Run docker ps -a, I can not find any containers running. Does marbles need start docker-compose blockchain network first before running gulp marbles1? And how to host marbles locally? And most of most, does marbles support the latest fabric 1.0.0 release? Please give us some instructions.

[ibc-js] Register - failure after IBM update

Hey,
I was running the marbles demo inside of bluemix for the last few days and everything worked perfectly fine. Today IBM released a new version (see here) of its blockchain-service. And suddenly my Application stopped working. It fails to register the users somehow, although the users that are tried are valid users (they are all visible at API -> Network's Enroll IDs and passwords are correct, too).

I would really appreciate some help!
Best regards

EDIT: There seems to be a problem with the Blockchain service itself..so probably this ticket is at the wrong place. I'll wait for IBM to fix their issue and then close this ticket if the error is gone.

Here is what the app log says:

App/0
------------------------------------------ Server Up - 0.0.0.0:61078 ------------------------------------------
2016-07-15T15:07:23.010+0200
App/0
Running using Developer settings
2016-07-15T15:07:23.010+0200
App/0

  • Tracking Deployment
    2016-07-15T15:07:23.010+0200
    App/0
    loading hardcoded users
    2016-07-15T15:07:23.197+0200
    App/0
    [!] looks like you are in bluemix, I am going to clear out the deploy_name so that it deploys new cc.
    2016-07-15T15:07:23.197+0200
    App/0
    overwritting users, loading from a vcap service: ibm-blockchain-5-prod
    2016-07-15T15:07:23.197+0200
    App/0
    loading hardcoded peers
    2016-07-15T15:07:23.197+0200
    App/0
    overwritting peers, loading from a vcap service: ibm-blockchain-5-prod
    2016-07-15T15:07:23.197+0200
    App/0
    [!] hope that is ok budddy
    2016-07-15T15:07:23.197+0200
    App/0
    [ibc-js] Peer: vp0-6cbde53e-afe...:30443
    2016-07-15T15:07:23.200+0200
    App/0
    [ibc-js] Peer: vp1-6cbde53e-afe...:30443
    2016-07-15T15:07:23.203+0200
    App/0
    [ibc-js] Peer: vp2-6cbde53e-afe...:30443
    2016-07-15T15:07:23.203+0200
    App/0
    [ibc-js] Peer: vp3-6cbde53e-afe...:30443
    2016-07-15T15:07:23.203+0200
    App/0
    [ibc-js] Registering vp0-6cbde53e-afe...:30443 w/enrollID - user_type1_eb92dc0802
    2016-07-15T15:07:23.204+0200
    App/0
    [ibc-js] Registering vp3-6cbde53e-afe...:30443 w/enrollID - user_type1_c501966b65
    2016-07-15T15:07:23.212+0200
    App/0
    [ibc-js] Registering vp1-6cbde53e-afe...:30443 w/enrollID - user_type1_61e36d90b2
    2016-07-15T15:07:23.216+0200
    App/0
    [ibc-js] Registering vp2-6cbde53e-afe...:30443 w/enrollID - user_type1_1cb6af04b6
    2016-07-15T15:07:23.217+0200
    App/0
    [ibc-js] going to try to register again in 30 secs
    2016-07-15T15:07:23.447+0200
    App/0
    [ibc-js] Register - failure x1 : user_type1_eb92dc0802 500
    2016-07-15T15:07:23.447+0200
    App/0
    [ibc-js] Register - failure x1 : user_type1_1cb6af04b6 500
    2016-07-15T15:07:23.451+0200
    App/0
    [ibc-js] going to try to register again in 30 secs
    2016-07-15T15:07:23.451+0200
    App/0
    [ibc-js] going to try to register again in 30 secs
    2016-07-15T15:07:23.452+0200
    App/0
    [ibc-js] Register - failure x1 : user_type1_61e36d90b2 500
    2016-07-15T15:07:23.452+0200
    App/0
    [ibc-js] Register - failure x1 : user_type1_c501966b65 500
    2016-07-15T15:07:23.457+0200
    App/0
    [ibc-js] going to try to register again in 30 secs
    2016-07-15T15:07:23.457+0200
    App/0
    Uploaded stats { ok: true }
    2016-07-15T15:07:24.020+0200
    RTR/0
    trade-finance-test.eu-gb.mybluemix.net - [15/07/2016:13:07:24.587 +0000] "GET / HTTP/1.1" 101 0 0 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0" 159.122.215.10:18086 x_forwarded_for:"195.212.29.168, 159.122.215.10" x_forwarded_proto:"http" vcap_request_id:d6168395-8d9a-4d4a-5be1-edd03380b0e8 response_time:0.003958422 app_id:f4346050-bd7d-4271-a42b-0bb5f181c8dc x_global_transaction_id:"418089773"
    2016-07-15T15:07:24.592+0200
    App/0
    [ibc-js] Registering vp0-6cbde53e-afe...:30443 w/enrollID - user_type1_eb92dc0802
    2016-07-15T15:07:53.477+0200
    App/0
    [ibc-js] Registering vp2-6cbde53e-afe...:30443 w/enrollID - user_type1_1cb6af04b6
    2016-07-15T15:07:53.480+0200
    App/0
    [ibc-js] Registering vp1-6cbde53e-afe...:30443 w/enrollID - user_type1_61e36d90b2
    2016-07-15T15:07:53.481+0200
    App/0
    [ibc-js] Registering vp3-6cbde53e-afe...:30443 w/enrollID - user_type1_c501966b65
    2016-07-15T15:07:53.483+0200
    App/0
    [ibc-js] Register - failure x2 : user_type1_eb92dc0802 500
    2016-07-15T15:07:53.705+0200
    App/0
    { name: 'register() error',
    2016-07-15T15:07:53.708+0200
    App/0
    code: 500,
    2016-07-15T15:07:53.708+0200
    App/0
    details: { [Error: socket hang up] code: 'ECONNRESET' } }
    2016-07-15T15:07:53.708+0200
    App/0
    ! looks like an error loading the chaincode or network, app will fail
    2016-07-15T15:07:53.708+0200
    App/0
    [ibc-js] Register - failure x2 : user_type1_61e36d90b2 500
    2016-07-15T15:07:53.709+0200
    App/0
    [ibc-js] Register - failure x2 : user_type1_1cb6af04b6 500
    2016-07-15T15:07:53.709+0200
    App/0
    [ibc-js] Register - failure x2 : user_type1_c501966b65 500
    2016-07-15T15:07:53.714+0200

Unable to Connect to Bluemix Network

Hi,
Newbie here trying to learn/demo on the Marble Application. Unfortunately i am not able to connec to the BlockChain Network. Can anyone share the reasons on the issue and possible work arounds?
_Error Message_
Start Up Error
{ "code": "ECONNRESET" }
This application cannot run without the blockchain network :(

Thank You
Aswink

Gulp error

Hi,
I am trying to setup marbles with my bluemix. I have deployed the app directly to bluemix and now following the instructions. But I'm getting a "Unhandled error event" in 'events.js' line 141, error on gulp command. Can anyone please explain what I might be doing wrong.
screen shot 2016-06-15 at 11 44 31 am

error deploying chaincode at node startup - chaincode took too long

on a local single node setup, I get this error:

	 deploy resp error - there is no chaincode hash name in response: { jsonrpc: '2.0',
  error:
   { code: -32001,
     message: 'Deployment failure',
     data: 'Error when deploying chaincode: Error getting chaincode package bytes: Error getting code Getting chaincode took too long' },
  id: 1484720495587 }
! looks like a deploy error, holding off on the starting the socket
 { name: 'deploy() error no cc name',
  code: 502,
  details:
   { jsonrpc: '2.0',
     error:
      { code: -32001,
        message: 'Deployment failure',
        data: 'Error when deploying chaincode: Error getting chaincode package bytes: Error getting code Getting chaincode took too long' },
     id: 1484720495587 } }

missing network manual configuration

Hi,

Setup Options:
So the cc is great and all but first we need a blockchain network. Choose 1 option below:

(1) Deploy the app on my local machine and create a network manually

OR

(2) Deploy the app and network at once on Bluemix. Simply click this button Deploy to Bluemix then continue hereptions:
So the cc is great and all but first we need a blockchain network. Choose 1 option below:

(1) Deploy the app on my local machine and create a network manually

OR

(2) Deploy the app and network at once on Bluemix. Simply click this button Deploy to Bluemix then continue here

manually link is broken: "https://github.com/IBM-Blockchain/marbles/blob/master/tutorial_part1.md#Network"
and so so network manual configuration is missing.

thanks.

No net address for eth1

I'm following the tutorial for setting up environment and network in my own laptop.My VP are setup and I'm able to query and invoke transactions on them. In the steps for "Marbles Adjust for local network" , in the step 6 it says to change the setup.js and figure out the address the Vagrant virtual machine offers to the local machine. When I run ifconfig there is no eth1 - net addr (as shown in screenshot. )
screen shot 2016-07-03 at 11 23 27 pm

While setting up the Vagrant environment, I used Wi-Fi adapter to bridge connection between vagrant and local machine

Sample application deployment tracking: repository URL is missing

Hello!

It appears that the application is using the Sample application deployment tracking library cf-deployment-tracker-client(https://github.com/IBM-Blockchain/marbles/blob/master/app.js#L108) but doesn't specify a value for the repository property in package.json. Without this property no traceback information to your github repository is recorded. Please consider adding the following to package.json

    ...
    "dependencies": {
        ...   
       "cf-deployment-tracker-client": "*"
    },
    ...
   "repository": {
     "type": "git",
     "url": "https://github.com/IBM-Blockchain/marbles.git"
   }

as shown in this example: https://github.com/IBM-Bluemix/node-helloworld/blob/master/package.json#L9-18

Undefined setTimeout references in tutorial_part2.md

part2 makes two references to not using setTimeout() anymore but this is not something that is talked about in part1.
Either part1 needs to talk about setTimeout() so the reader understands the reference in part2 or part2 should not talk about it.

Chaincode loading from repo

Any particular reason that the server loads the chaincode from another repo?
Wouldn't it be easier if you can have the chaincode file in the same directory as your app.js and loading from there?
Saves the hassle of pushing every small change to your chaincode.

docker-compose error: manifest for ibmblockchain/fabric-membersrvc: latest not found

I used Docker Toolbox on Windows 7 and I followed the guide of IBM blockchain to pull the heyperledger fabric. When I ran the "docker-compose -f single-peer-ca.yaml up" command, I found this error message:
[31mERROR[0m: manifest for ibmblockchain/fabric-membersrvc: latest not found
I ran "docker images" command and saw that the tag of "ibmblockchain/fabric-membersrvc" was "x86_64-0.6.1-preview" (it is indeed not the latest) and the tag of "ibmblockchain/fabric-peer" was also x86_64-0.6.1-preview.
How to make them the latest? Thanks!

Query error on new deployment from local

Getting the following error
When I call this function on new deployment,

chaincode.query.read(['_marbleindex']

error: { name: 'query() error',
code: 400,
details: '{"Error": "Error:Failed to launch chaincode spec(Error starting container: API error (500): Error: image library/dev-3939016b-d70c-4a46-b754-dcc10d9ceb87_vp1-c29ff1807036492ec8602bb935cee8cc7cb6a45eba307aa642bed12ceceb9dc997e54edd6584936e3976b54125f94a931527494284360aa88bd9ea051aab2da1 not found\n)"}' }

chaincode directory

I run takes marvels chaincode local download, it did not find the directory connection ...

Under inde part of the js code, I'd like to run the js chaincode local, download the code in relation to the local server time-consuming just to be running on the local server.

How can I change non-zip and unzip and local chaincode call in the following?

        zip_url: 'https://github.com/ibm-blockchain/marbles-chaincode/archive/master.zip', 
        unzip_dir: 'marbles-chaincode-master / part2_v1.0.0', 
        git_url: 'https://github.com /ibm-blockchain/marbles-chaincode/part2_v1.0.0 '

In docker toolbox getting ECONNREFUSED error and registration failure

HI @dshuffma-ibm ,

i am trying to run marbles application using docker toolbox option in local.

While executing the gulp command in the prompt getting the ECONNREFUSED error and registration failure message.

My docker-compose.yml file looks like:

membersrvc:

image: hyperledger/fabric-membersrvc
command: membersrvc
vp0:
image: hyperledger/fabric-peer
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=http://172.17.0.1:2375
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_ID=vp0
- CORE_PEER_PKI_ECA_PADDR=membersrvc:7054
- CORE_PEER_PKI_TCA_PADDR=membersrvc:7054
- CORE_PEER_PKI_TLSCA_PADDR=membersrvc:7054
- CORE_SECURITY_ENABLED=true
- CORE_SECURITY_ENROLLID=test_vp0
- CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT
links:
- membersrvc
command: sh -c "sleep 5; peer node start --peer-chaincodedev"

my mycreds_docker_compose.json file looks like:

{

"credentials": {
	"peers": [{
		"api_host": "localhost",
		"api_port": 7050,
		"type": "peer",
		"id": "vp0"
	}],
	"users": [{
		"enrollId": "bob",
		"enrollSecret": "NOE63pEQbL25"
	}],
}

}

Can you please explain what are all the configuration changes need to do in the following files app.js, setup.js, docker-compose.yml and mycreds_docker_compose.json.

deploy resp error - there is no chaincode hash name in response: { jsonrpc: '2.0', error: { code: -32001, message: 'Deployment failure',

Hi, I am getting the below error when trying to deploy the marbles application on local vagrant environment. It was working fine before and I have n't modified any thing specifically except that IP addresses when I connect to different network.


[ibc-js] Deploy Chaincode - Starting
[ibc-js] function: init , arg: [ '99' ]

 Waiting...


 deploy resp error - there is no chaincode hash name in response: { jsonrpc: '2.0',

error:
{ code: -32001,
message: 'Deployment failure',
data: 'Error when deploying chaincode: Error getting chaincode package bytes: Error getting code Getting chaincode took too long' },
id: 1470050652578 }
! looks like a deploy error, holding off on the starting the socket
{ name: 'deploy() error no cc name',
code: 502,
details:
{ jsonrpc: '2.0',
error:
{ code: -32001,
message: 'Deployment failure',
data: 'Error when deploying chaincode: Error getting chaincode package bytes: Error getting code Getting chaincode took too long' },
id: 1470050652578 } }


Please let me know what could be the reason for this issue and if any possible solution.

Always failing to Register user with gulp

[ibc-js] Registering  eedd070b694947d382a9aace7bb52783-vp2-eedd070b6949...:5004  w/enrollId - user_type1_0
Register - failure x1 : user_type1_0 401
! looks like an error loading the chaincode or network, app will fail
 { name: 'register() error',
  code: 401,
  details: { Error: 'rpc error: code = 2 desc = Identity or token does not match.' } }

running locally- error - configure of 'mycreds.json'?

I'm trying to run the marbles example locally- but I ran into this error:

12121j2kkkmm123

12121j2kkkmm1234

kkmm123

I guess maybe it has something to do with my mycreds.json file, because that was the only part of the tutorial I didn't fully grasp.

In the docs this is given as an example:

{
"credentials": {
"peers": [
{
"api_host": "12345678-abcde-_vp0.blockchain.ibm.com", //hostname or ip of peer
"api_port_tls": 443, //https port (optional)
"api_port": 80, //http port
"id": "12345678-abcde-4d6f-_vp0", //unique id of peer
},
],
"users": [
{
"enrollId": "user_type1_1234567890", //enroll username
"enrollSecret": "1234567890" //enroll's secret
}
]
}
}

but I don't really understand how that relates to my system or what I need to change exactly.

{
  "credentials": {
    "peers": [
      {
        "discovery_host": "8aa42d25-c620-4d6f-872e-90545ce399d4_vp0.blockchain.ibm.com",
        "discovery_port": 30304,
        "api_host": "8aa42d25-c620-4d6f-872e-90545ce399d4_vp0.blockchain.ibm.com",
        "api_port_tls": 30443,
        "api_port": 30443,
        "type": "peer",
        "network_id": "8aa42d25-c620-4d6f-872e-90545ce399d4",
        "container_id": "82b2cbfd17c5495296cc048edf7d5a7d50032d2e8191e4603626231da648a01c",
        "id": "8aa42d25-c620-4d6f-872e-90545ce399d4_vp0",
        "api_url": "http://8aa42d25-c620-4d6f-872e-90545ce399d4_vp0.blockchain.ibm.com:30443"
      },
      {
        "discovery_host": "8aa42d25-c620-4d6f-872e-90545ce399d4_vp1.blockchain.ibm.com",
        "discovery_port": 30304,
        "api_host": "8aa42d25-c620-4d6f-872e-90545ce399d4_vp1.blockchain.ibm.com",
        "api_port_tls": 30443,
        "api_port": 30443,
        "type": "peer",
        "network_id": "8aa42d25-c620-4d6f-872e-90545ce399d4",
        "container_id": "d1e19c515263370793044fb0b64d4a049c4c033c161522782296a635c840ef69",
        "id": "8aa42d25-c620-4d6f-872e-90545ce399d4_vp1",
        "api_url": "http://8aa42d25-c620-4d6f-872e-90545ce399d4_vp1.blockchain.ibm.com:30443"
      },
      {
        "discovery_host": "8aa42d25-c620-4d6f-872e-90545ce399d4_vp3.blockchain.ibm.com",
        "discovery_port": 30304,
        "api_host": "8aa42d25-c620-4d6f-872e-90545ce399d4_vp3.blockchain.ibm.com",
        "api_port_tls": 30443,
        "api_port": 30443,
        "type": "peer",
        "network_id": "8aa42d25-c620-4d6f-872e-90545ce399d4",
        "container_id": "bd69aef23dd06381d0cc64b68e834ff4dbb59de311bf4a97b10a606d6f0d68a8",
        "id": "8aa42d25-c620-4d6f-872e-90545ce399d4_vp3",
        "api_url": "http://8aa42d25-c620-4d6f-872e-90545ce399d4_vp3.blockchain.ibm.com:30443"
      }
    ],
    "ca": {
      "8aa42d25-c620-4d6f-872e-90545ce399d4_ca": {
        "url": "8aa42d25-c620-4d6f-872e-90545ce399d4_ca.blockchain.ibm.com:30304",
        "discovery_host": "8aa42d25-c620-4d6f-872e-90545ce399d4_ca.blockchain.ibm.com",
        "discovery_port": 30304,
        "api_host": "8aa42d25-c620-4d6f-872e-90545ce399d4_ca.blockchain.ibm.com",
        "api_port_tls": 30304,
        "api_port": 30443,
        "type": "ca",
        "network_id": "8aa42d25-c620-4d6f-872e-90545ce399d4",
        "container_id": "da818d4c027963635671a81f96c99a17cfa92d052449ef07d40db1419b4a077d"
      }
    },
    "users": [
      {
        "username": "admin",
        "secret": "dfc2dd1fe7",
        "enrollId": "admin",
        "enrollSecret": "dfc2dd1fe7"
      },
      {
        "username": "WebAppAdmin",
        "secret": "00cac86b46",
        "enrollId": "WebAppAdmin",
        "enrollSecret": "00cac86b46"
      },
      {
        "username": "dashboarduser_type1_de9e08c8e7",
        "secret": "d356d1801e",
        "enrollId": "dashboarduser_type1_de9e08c8e7",
        "enrollSecret": "d356d1801e"
      },
      {
        "username": "dashboarduser_type1_733b81ccfb",
        "secret": "d1359b3bb9",
        "enrollId": "dashboarduser_type1_733b81ccfb",
        "enrollSecret": "d1359b3bb9"
      },
      {
        "username": "dashboarduser_type1_4a9f59b3dc",
        "secret": "46863c70da",
        "enrollId": "dashboarduser_type1_4a9f59b3dc",
        "enrollSecret": "46863c70da"
      },
      {
        "username": "dashboarduser_type1_f5387afa3b",
        "secret": "0df4cbc984",
        "enrollId": "dashboarduser_type1_f5387afa3b",
        "enrollSecret": "0df4cbc984"
      },
      {
        "username": "user_type1_c711dabdbe",
        "secret": "d0903ab61d",
        "enrollId": "user_type1_c711dabdbe",
        "enrollSecret": "d0903ab61d"
      },
      {
        "username": "user_type1_14824e9f6d",
        "secret": "1473f80c51",
        "enrollId": "user_type1_14824e9f6d",
        "enrollSecret": "1473f80c51"
      },
      {
        "username": "user_type1_6586bcd182",
        "secret": "e853fa6073",
        "enrollId": "user_type1_6586bcd182",
        "enrollSecret": "e853fa6073"
      },
      {
        "username": "user_type1_07799d5465",
        "secret": "24ee24ca15",
        "enrollId": "user_type1_07799d5465",
        "enrollSecret": "24ee24ca15"
      },
      {
        "username": "user_type1_4c682e8a20",
        "secret": "6880c1e88c",
        "enrollId": "user_type1_4c682e8a20",
        "enrollSecret": "6880c1e88c"
      },
      {
        "username": "user_type2_b5bbab6465",
        "secret": "df62eb3bb8",
        "enrollId": "user_type2_b5bbab6465",
        "enrollSecret": "df62eb3bb8"
      },
      {
        "username": "user_type2_187a4aabfb",
        "secret": "f8af825a13",
        "enrollId": "user_type2_187a4aabfb",
        "enrollSecret": "f8af825a13"
      },
      {
        "username": "user_type2_9f757a0ea7",
        "secret": "2b63039ac9",
        "enrollId": "user_type2_9f757a0ea7",
        "enrollSecret": "2b63039ac9"
      },
      {
        "username": "user_type2_7f91f93fa5",
        "secret": "e607419b15",
        "enrollId": "user_type2_7f91f93fa5",
        "enrollSecret": "e607419b15"
      },
      {
        "username": "user_type2_24b8b22ac6",
        "secret": "6894ea9800",
        "enrollId": "user_type2_24b8b22ac6",
        "enrollSecret": "6894ea9800"
      },
      {
        "username": "user_type4_0289fe29cf",
        "secret": "7251384b2b",
        "enrollId": "user_type4_0289fe29cf",
        "enrollSecret": "7251384b2b"
      },
      {
        "username": "user_type4_2049ded2b4",
        "secret": "b8a51ab655",
        "enrollId": "user_type4_2049ded2b4",
        "enrollSecret": "b8a51ab655"
      },
      {
        "username": "user_type4_cec61f8db5",
        "secret": "b23f764bb3",
        "enrollId": "user_type4_cec61f8db5",
        "enrollSecret": "b23f764bb3"
      },
      {
        "username": "user_type4_1c39d64696",
        "secret": "c74e91332b",
        "enrollId": "user_type4_1c39d64696",
        "enrollSecret": "c74e91332b"
      },
      {
        "username": "user_type4_565ca41b4b",
        "secret": "8a278015b8",
        "enrollId": "user_type4_565ca41b4b",
        "enrollSecret": "8a278015b8"
      },
      {
        "username": "user_type8_8e704c3bcb",
        "secret": "c74eb98482",
        "enrollId": "user_type8_8e704c3bcb",
        "enrollSecret": "c74eb98482"
      },
      {
        "username": "user_type8_ef8c228d33",
        "secret": "e3cbee199d",
        "enrollId": "user_type8_ef8c228d33",
        "enrollSecret": "e3cbee199d"
      },
      {
        "username": "user_type8_2a3d9753fe",
        "secret": "86f50dc81f",
        "enrollId": "user_type8_2a3d9753fe",
        "enrollSecret": "86f50dc81f"
      },
      {
        "username": "user_type8_743bc5dfcf",
        "secret": "7458320203",
        "enrollId": "user_type8_743bc5dfcf",
        "enrollSecret": "7458320203"
      },
      {
        "username": "user_type8_bd45a365d9",
        "secret": "ebd96b87b0",
        "enrollId": "user_type8_bd45a365d9",
        "enrollSecret": "ebd96b87b0"
      }
    ]
  }
}

Error on redeploy

I've modified chaincode go code and I would like to redeploy to apply changes.

I'm deploying to bluemix

The problem is that I'm receiving the following error

  hfc $GOPATH: blockchain/app +0ms
  hfc projDir: blockchain/app/src/chaincode +0ms
  hfc GenerateParameterHash... +0ms
  hfc path: chaincode +1ms
  hfc func: init +0ms
  hfc args: a,100,b,200 +0ms
  hfc str: chaincodeinita100b200 +0ms
  hfc strHash: 9917933edde33368e8725555a00183d9d4d3d3eb8231270f96f0cf6937e75438 +0ms
  hfc hash: ad56458b896701114f996106bc54c5a6f18cf948f4a0eb6bfd2bc45438c9159c +3s
  hfc type of request.certificatePath: string +0ms
  hfc request.certificatePath: /certs/peer/cert.pem +0ms
  hfc Adding COPY certificate.pem command +0ms
  hfc Created Dockerfile at [blockchain/app/src/chaincode/Dockerfile] +2ms
  hfc GenerateTarGz +0ms
  hfc Created deployment archive at [/tmp/deployment-package.tar.gz] +3s
  hfc chaincodeID: {"path":"","name":"ad56458b896701114f996106bc54c5a6f18cf948f4a0eb6bfd2bc45438c9159c"} +2ms
  hfc chaincodeSpec: {"type":1,"chaincodeID":{"path":"","name":"ad56458b896701114f996106bc54c5a6f18cf948f4a0eb6bfd2bc45438c9159c"},"ctorMsg":{"args":[{"buffer":{"type":"Buffer","data":[105,110,105,116]},"offset":0,"markedOffset":-1,"limit":4,"littleEndian":false,"noAssert":false},{"buffer":{"type":"Buffer","data":[97]},"offset":0,"markedOffset":-1,"limit":1,"littleEndian":false,"noAssert":false},{"buffer":{"type":"Buffer","data":[49,48,48]},"offset":0,"markedOffset":-1,"limit":3,"littleEndian":false,"noAssert":false},{"buffer":{"type":"Buffer","data":[98]},"offset":0,"markedOffset":-1,"limit":1,"littleEndian":false,"noAssert":false},{"buffer":{"type":"Buffer","data":[50,48,48]},"offset":0,"markedOffset":-1,"limit":3,"littleEndian":false,"noAssert":false}]},"timeout":0,"secureContext":"","confidentialityLevel":0,"metadata":{"buffer":{"type":"Buffer","data":[]},"offset":0,"markedOffset":-1,"limit":0,"littleEndian":false,"noAssert":false},"attributes":[]} +2ms
  hfc Read in deployment archive from [/tmp/deployment-package.tar.gz] +9ms
  hfc Set confidentiality level to PUBLIC +38ms
  hfc Temporary archive deleted successfully ---> /tmp/deployment-package.tar.gz +1ms
  hfc File deleted successfully ---> blockchain/app/src/chaincode/Dockerfile +0ms
  hfc Calling TransactionContext.execute +1ms
  hfc Executing transaction +0ms
  hfc [TransactionContext] TCert already cached. +0ms
  hfc Process Confidentiality... +1ms
  hfc Sign transaction... +1ms
  hfc Send transaction... +238ms
  hfc Confidentiality:  0 +0ms
  hfc reg txid ad56458b896701114f996106bc54c5a6f18cf948f4a0eb6bfd2bc45438c9159c +0ms
  hfc waiting 60 seconds before emitting complete event +4ms
  hfc peer.sendTransaction +162ms
  hfc timeout uuid= ad56458b896701114f996106bc54c5a6f18cf948f4a0eb6bfd2bc45438c9159c +60s

Failed to deploy chaincode: request={"fcn":"init","args":["a","100","b","200"],"chaincodePath":"chaincode","certificatePath":"/certs/peer/cert.pem"}, error="timed out waiting for transaction to complete"

[ERROR] Tag latest not found in repository docker.io/ibmblockchain/fabric-membersrvc

Using Docker Compose Local to run Hyperledger Network
follow the documentation: https://hub.docker.com/r/ibmblockchain/fabric-peer/
Step 5. Try to run one of the two docker compose files, single-peer-ca.yaml or four-peer-ca.yaml.
Get Error like this:

$ sudo docker-compose -f four-peer-ca.yaml up
WARNING: The ARCH_TAG variable is not set. Defaulting to a blank string.
Pulling membersrvc (ibmblockchain/fabric-membersrvc:latest)...
Pulling repository docker.io/ibmblockchain/fabric-membersrvc
ERROR: Tag latest not found in repository docker.io/ibmblockchain/fabric-membersrvc

Docker Version:
docker-compose version 1.5.2, build unknown
docker-py version: 1.8.0
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016

System Version:
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

Using Marbles demo with IBM Blockchain Local with hardcoded enrollId/Secret

Hello,

Can someone help replace enrollId/Seceret with hardcoded ones from Dockerized IBM Hyperledger from docker hub please?

I am trying to use marbles demo in local machine, first it was connected to HSBN/Bluemix okay. When I tried to use local version of hyperledger( https://hub.docker.com/r/ibmblockchain/ ) - it seems it has a problem using enrollId/Secret as local version's hardcoded id/key (changed in mycred.json) is different format - I see the document said it should contain 'type_1' in the enrollId. Can following key be used with minimal modification? this is from ver0.6 membersvc.yaml...

            test_user0: 1 MS9qrN8hFjlE bank_a
            test_user1: 1 jGlNl6ImkuDo institution_a
            test_user2: 1 zMflqOKezFiA bank_c
            test_user3: 1 vWdLCE00vJy0 bank_a
            test_user4: 1 4nXSrfoYGFCP institution_a
            test_user5: 1 yg5DVhm0er1z bank_b
            test_user6: 1 b7pmSxzKNFiw bank_a
            test_user7: 1 YsWZD4qQmYxo institution_a
            test_user8: 1 W8G0usrU7jRk bank_a
	test_user9: 1 H80SiB5ODKKQ institution_a

Deployment to Bluemix failed

Deployment demo to Bluemix IBM Bluemix United Kingdom failed with errors:

Downloading artifacts...DOWNLOAD SUCCESSFUL
Target: https://api.eu-gb.bluemix.net
Creating service instance myblockchain in org [email protected] / space dev as [email protected]...
FAILED
Server error, status code: 502, error code: 10001, message: Service broker error: Calling url >https://broker-prod.blockchain.ibm.com/v2/service_instances/f392e168-cc79-432b-8c08-cbcce425296b?accepts_incomplete=true failed with error message read ECONNRESET

Finished: FAILED
Stage has no runtime information

Marbles timeout

When I try to run marbles (version 2) using the gulp command I get the below error. I am running fabric locally using vagrant.

[ibc-js] Deploy Chaincode - Starting
[ibc-js] function: init , arg: [ '99' ]

Waiting...

[http POST - y] localhost:7050
[http POST - y] /chaincode
body: {"jsonrpc":"2.0","method":"deploy","params":{"type":1,"chaincodeID":{"path":"http://gopkg.in/ibm-blockchain/marbles.v2/chaincode"},"ctorMsg":{"function":"init","args":["99"]},"secureContext":"bob"},"id":XXXXXXXXXXX}

[http POST - y] Error - request timed out
[ibc-js] deploy - failure: 408
! looks like a deploy error, holding off on the starting the socket
{ name: 'deploy() error',
code: 408,
details: 'Request timed out' }
[http POST - y] Error - request timed out
[http POST - y] Status code: 200

I changed the content of 'mycreds_docker_compose.json" to:

{
"credentials": {
"peers": [{
"api_host": "localhost",
"api_port": 7050,
"type": "peer",
"id": "vp0"
}],
"users": [{
"enrollId": "bob",
"enrollSecret": "NOE63pEQbL25"
}],
"cert": "https://blockchain-certs.mybluemix.net/us.blockchain.ibm.com.cert"
}
}

And the command to start the peer is:
peer node start --logging-level=DEBUG

And in the app.js I changed
deploytimeout: 30000
to
deploytimeout: 120000

As otherwise I received the bellow error:

[ibc-js] Deploy Chaincode - Starting
[ibc-js] function: init , arg: [ '99' ]

Waiting...
deploy resp error - there is no chaincode hash name in response: { json rpc: '2.0',
error:
{ code: -32001,
message: 'Deployment failure',
data: 'Error when deploying chaincode: Error getting chaincode package byte s: Error getting code Getting chaincode took too long' },
id: 1489827931548 }
! looks like a deploy error, holding off on the starting the socket
{ name: 'deploy() error no cc name',
code: 502,
details:
{ jsonrpc: '2.0',
error:
{ code: -32001,
message: 'Deployment failure',
data: 'Error when deploying chaincode: Error getting chaincode package b ytes: Error getting code Getting chaincode took too long' },
id: 1489827931548 } }

Refactor to use hfc

as fabric v0.7+ no longer has REST apis, so we should use hfc package instead of ibm-blockchain-js

No route, failed deploy

Hello,

Have tried deploying to bluemix through the "deploy" button on git as well as within my blockchain network on bluemix.

When deployed, I receive the following error upon opening the application:

{ "jsonrpc": "2.0", "error": { "code": -32001, "message": "Deployment failure", "data": "Error when deploying chaincode: Error getting chaincode package bytes: Error getting code 'go get' failed with error: 'exit status 1'\n# cd .; git clone https://github.com/ibm-blockchain/marbles-chaincode /go/usercode/435367883/src/github.com/ibm-blockchain/marbles-chaincode\nCloning into '/go/usercode/435367883/src/github.com/ibm-blockchain/marbles-chaincode'...\nfatal: unable to access 'https://github.com/ibm-blockchain/marbles-chaincode/': Failed to connect to github.com port 443: No route to host\npackage github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2: exit status 128\n" }, "id": 1475514717593 }

Have I failed to do something rudimentary?

Thanks!

v3 docker network cannot be set up as COP enrollment credentials not available

Hi,

I'd like to set up a local network for deploying the marbles app in version 3 as described at:
https://github.com/IBM-Blockchain/marbles/blob/v3.0/docs/use_local_hyperledger.md

The referenced connecathon setup uses a hosted COP server which is behind a firewall. To access this credentials are required, that only have been provided to the participants.

Could you please provide those or explain another way to set up such a network.

Thank you in advance,
kc

Query Failure

I deployed marbles in localhost, everything run fine until some of time.
When I wake up this morning, and tried to run marbles again, I got this error:

read  - success: { jsonrpc: '2.0',
  error:
   { code: -32003,
     message: 'Query failure',
     data: 'Error when querying chaincode: Error:Failed to launch chaincode spec(Timeout expired while starting chaincode 14b711be6f0d00
b190ea26ca48c22234d93996b6e625a4b108a7bbbde064edf0179527f30df238d61b66246fe1908005caa5204dd73488269c8999276719ca8b(networkid:dev,peerid:
c9527fe1-2332-48aa-8e6f-797d0689c52e_vp1,tx:f77a672d-b239-498b-9e54-803ebeccfca5))' },
  id: 1466646199791 }
marbles index msg error: [SyntaxError: Unexpected token u]

All marbles did I create also dissapear and I can't create new marble.
Any idea what happened?

watch-sass error after building marbles app offline

I'm trying to build the marbles app offline and connect it to a Bluemix blockchain.

after changing mycreds.json to appropriate values, installing dependencies I get this error:

[15:01:41] Using gulpfile ~/SchoolCode/capstone/marbles/gulpfile.js
[15:01:41] Starting 'build-sass'...
[15:01:41] Finished 'build-sass' after 16 ms
[15:01:41] Starting 'watch-sass'...
[15:01:41] 'watch-sass' errored after 9.2 ms
[15:01:41] Error: watch /home/andreibuiza/SchoolCode/capstone/marbles/scss/ ENOSPC
    at exports._errnoException (util.js:1026:11)
    at FSWatcher.start (fs.js:1429:19)
    at Object.fs.watch (fs.js:1456:11)
    at Gaze._watchDir (/home/andreibuiza/SchoolCode/capstone/marbles/node_modules/gaze/lib/gaze.js:289:30)
    at /home/andreibuiza/SchoolCode/capstone/marbles/node_modules/gaze/lib/gaze.js:358:10
    at iterate (/home/andreibuiza/SchoolCode/capstone/marbles/node_modules/gaze/lib/helper.js:52:5)
    at Object.forEachSeries (/home/andreibuiza/SchoolCode/capstone/marbles/node_modules/gaze/lib/helper.js:66:3)
    at Gaze._initWatched (/home/andreibuiza/SchoolCode/capstone/marbles/node_modules/gaze/lib/gaze.js:354:10)
    at Gaze.add (/home/andreibuiza/SchoolCode/capstone/marbles/node_modules/gaze/lib/gaze.js:177:8)
    at new Gaze (/home/andreibuiza/SchoolCode/capstone/marbles/node_modules/gaze/lib/gaze.js:74:10)
    at gaze (/home/andreibuiza/SchoolCode/capstone/marbles/node_modules/gaze/lib/gaze.js:86:10)
    at Object.module.exports [as watch] (/home/andreibuiza/SchoolCode/capstone/marbles/node_modules/glob-watcher/index.js:12:17)
    at Gulp.watch (/home/andreibuiza/SchoolCode/capstone/marbles/node_modules/gulp/index.js:35:16)
    at Gulp.<anonymous> (/home/andreibuiza/SchoolCode/capstone/marbles/gulpfile.js:42:7)
    at module.exports (/home/andreibuiza/SchoolCode/capstone/marbles/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/home/andreibuiza/SchoolCode/capstone/marbles/node_modules/orchestrator/index.js:273:3)

Anyone have a clue to solve this ?

Marbles demo for v0.6 fabric ?

Hello, is there marbles demo available for version 0.6.1 of the fabric?

I tried to use it with IBM provided docker-compose fabric(v0.6.1) and getting following error...it seems it requires good amount of app code changes and was curious if anyone had updates yet.

Thanks,

loading hardcoded users
[ibc-js] Peer: vp0-vp0...:1443
[ibc-js] Registering vp0-vp0...:1443 w/enrollId - test_user1
[ibc-js] Registration success x1 : test_user1
[ibc-js] removing temp dir
[ibc-js] Downloading zip
redirect... https://codeload.github.com/IBM-Blockchain/marbles-chaincode/zip/master
[ibc-js] Downloading zip
[ibc-js] Unzipping zip
[ibc-js] Unzip done
[ibc-js] Scanning files [ 'part2_chaincode.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 - part2_chaincode.go
[ibc-js] Found cc invoke function: init
[ibc-js] Found cc invoke function: delete
[ibc-js] Found cc invoke function: write
[ibc-js] Found cc invoke function: init_marble
[ibc-js] Found cc invoke function: set_user
[ibc-js] Found cc invoke function: open_trade
[ibc-js] Found cc invoke function: perform_trade
[ibc-js] Found cc invoke function: remove_trade
[ibc-js] Parsing file for query functions - part2_chaincode.go
[ibc-js] Found cc query function: read
[ibc-js] load_chaincode() finished
[ibc-js] Deploy Chaincode - Starting
[ibc-js] function: init , arg: [ '99' ]

     Waiting...


     deploy resp error - there is no chaincode hash name in response: { jsonrpc: '2.0',

error:
{ code: -32001,
message: 'Deployment failure',
data: 'Error when deploying chaincode: Error getting chaincode package bytes: Error getting code 'go get' failed with error: "exit status 2"\n# github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2\n/opt/gopath/usercode/556595698/src/github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2/part2_chaincode.go:67: cannot use new(SimpleChaincode) (type SimpleChaincode) as type shim.Chaincode in argument to shim.Start:\n\tSimpleChaincode does not implement shim.Chaincode (wrong type for Init method)\n\t\thave Init(*shim.ChaincodeStub, string, []string) ([]byte, error)\n\t\twant Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error)\n' },
id: 1478501361330 }
! looks like a deploy error, holding off on the starting the socket
{ name: 'deploy() error no cc name',
code: 502,
details:
{ jsonrpc: '2.0',
error:
{ code: -32001,
message: 'Deployment failure',
data: 'Error when deploying chaincode: Error getting chaincode package bytes: Error getting code 'go get' failed with error: "exit status 2"\n# github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2\n/opt/gopath/usercode/556595698/src/github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2/part2_chaincode.go:67: cannot use new(SimpleChaincode) (type SimpleChaincode) as type shim.Chaincode in argument to shim.Start:\n\tSimpleChaincode does not implement shim.Chaincode (wrong type for Init method)\n\t\thave Init(*shim.ChaincodeStub, string, []string) ([]byte, error)\n\t\twant Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error)\n' },
id: 1478501361330 }
peers:<ID:<name:"vp0" > address:"172.19.0.2:7051" type:VALIDATOR >
vp0_1 | 06:49:31.274 [devops] getChaincodeBytes -> ERRO 140 Error getting chaincode package bytes: Error getting code 'go get' failed with error: "exit
vp0_1 | # github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2
vp0_1 | /opt/gopath/usercode/556595698/src/github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2/part2_chaincode.go:67: cannot use new(SimpleCode) as type shim.Chaincode in argument to shim.Start:
vp0_1 | *SimpleChaincode does not implement shim.Chaincode (wrong type for Init method)
vp0_1 | have Init(*shim.ChaincodeStub, string, []string) ([]byte, error)
vp0_1 | want Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error)
vp0_1 | 06:49:31.274 [devops] Deploy -> ERRO 141 Error deploying chaincode spec: type:GOLANG chaincodeID:<path:"https://github.com/ibm-blockchain/marble" > ctorMsg:<args:"init" args:"99" > secureContext:"test_user1"
vp0_1 |
vp0_1 | error: Error getting chaincode package bytes: Error getting code 'go get' failed with error: "exit status 2"
vp0_1 | # github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2
vp0_1 | /opt/gopath/usercode/556595698/src/github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2/part2_chaincode.go:67: cannot use new(SimpleCode) as type shim.Chaincode in argument to shim.Start:
vp0_1 | *SimpleChaincode does not implement shim.Chaincode (wrong type for Init method)
vp0_1 | have Init(*shim.ChaincodeStub, string, []string) ([]byte, error)
vp0_1 | want Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error)
vp0_1 | 06:49:31.274 [rest] processChaincodeDeploy -> ERRO 142 Error when deploying chaincode: Error getting chaincode package bytes: Error getting code"exit status 2"
vp0_1 | # github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2
vp0_1 | /opt/gopath/usercode/556595698/src/github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2/part2_chaincode.go:67: cannot use new(SimpleCode) as type shim.Chaincode in argument to shim.Start:
vp0_1 | *SimpleChaincode does not implement shim.Chaincode (wrong type for Init method)
vp0_1 | have Init(shim.ChaincodeStub, string, []string) ([]byte, error)
vp0_1 | want Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error)
vp0_1 | 06:49:31.274 [rest] ProcessChaincode -> INFO 143 REST successfully deploy chaincode: {"jsonrpc":"2.0","error":{"code":-32001,"message":"Deploymen deploying chaincode: Error getting chaincode package bytes: Error getting code 'go get' failed with error: "exit status 2"\n# github.com/ibm-blockchain/marbt2\n/opt/gopath/usercode/556595698/src/github.com/ibm-blockchain/marbles-chaincode/hyperledger/part2/part2_chaincode.go:67: cannot use new(SimpleChaincode) (t shim.Chaincode in argument to shim.Start:\n\t
SimpleChaincode does not implement shim.Chaincode (wrong type for Init method)\n\t\thave Init(*shim.ChaincodeStuberror)\n\t\twant Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error)\n"},"id":1478501361330}
vp1_1 | 06:49:33.324 [peer] ensureConnected -> DEBU 0c4 Touch service indicates no dropped connections

local docker deploy

I'm having similar issues with deploying the marbles demo like in #38 . Didn't seem like it was resolved, so here goes:

I'm using [email protected]:IBM-Blockchain/fabric-images.git

$ echo $ARCH_TAG
x86_64-0.6.1-preview
$ cat docker-compose/single-peer-ca.yaml 
version: '2'
services:
  baseimage:
    build: ./baseimage
    image: hyperledger/fabric-baseimage:latest

  membersrvc:
    image: ibmblockchain/fabric-membersrvc:${ARCH_TAG}
    networks:
      - blockchain-net
    extends:
      file: base/membersrvc.yaml
      service: membersrvc

  vp:
    image: ibmblockchain/fabric-peer:${ARCH_TAG}
    networks:
      - blockchain-net
    extends:
      file: base/peer-secure-base.yaml
      service: peer-secure-base
    ports:
      - "7050:7050"
      - "7051:7051"
      - "7053:7053"
    environment:
      - CORE_PEER_ID=vp0
      - CORE_SECURITY_ENROLLID=vp
      - CORE_SECURITY_ENROLLSECRET=f3489fy98ghf
    links:
      - membersrvc

networks:
  blockchain-net:
    external:
      name: blockchain-net

This seems to start ok:

$ docker-compose -f single-peer-ca.yaml up

Now, for the marbles demo after building it under blockchain-marbles-v2:

$ docker run --name ${SERVICE} --network blockchain-net -p 3000:3000 -it -d ${SERVICE} bash

In another window, I can see that they are in the same network:

$ docker network inspect blockchain-net
...
        "Containers": {
            "a671e00d7608ed18c2d0797848c2f844ff74d3d7b12f0a684e70b5c9c916ac2b": {
                "Name": "blockchain-marbles-v2",
                "EndpointID": "651c68f4c351c735bd0753fa40162cf91317e2c390c7915299f49b31fb93abed",
                "MacAddress": "02:42:0a:c8:00:02",
                "IPv4Address": "10.200.0.2/16",
                "IPv6Address": ""
            },
            "d1df6af60c2d84269eb3a4701c90de51b79aca3bceda656743cd9c400bfbf44d": {
                "Name": "dockercompose_membersrvc_1",
                "EndpointID": "5a5756da41df6179fda814a96ad095773b429b6880b1354a351dcac2c45689bb",
                "MacAddress": "02:42:0a:c8:00:04",
                "IPv4Address": "10.200.0.4/16",
                "IPv6Address": ""
            },
            "f225d585b77f6707f79be701426cda0354ef346f9a6dfb238d12959b9fd2b036": {
                "Name": "dockercompose_vp_1",
                "EndpointID": "eebe85a50ef5465716dd7c3a62072a4ff1b9a7c0688ee769163bcb8a7f1353b2",
                "MacAddress": "02:42:0a:c8:00:05",
                "IPv4Address": "10.200.0.5/16",
                "IPv6Address": ""
            }
        },

I changed the api_host to dockercompose_vp_1 in file mycreds_docker_compose.json:

{
	"credentials": {
		"peers": [{
			"api_host": "dockercompose_vp_1",
			"api_port": 7050,
			"type": "peer",
			"id": "vp0"
		}],
		"users": [{
			"enrollId": "bob",
			"enrollSecret": "NOE63pEQbL25"
		}],
		"cert": "https://blockchain-certs.mybluemix.net/us.blockchain.ibm.com.cert"
	}
}

Inside the container, I run gulp:

Running using Developer settings
- Tracking Deployment
loading hardcoded peers
loading hardcoded users
[ibc-js] Peer:  vp0-vp0...:7050
[ibc-js] Registering  vp0-vp0...:7050  w/enrollId - bob
[ibc-js] Registration success x1 : bob
[ibc-js] removing temp dir
[ibc-js] Downloading zip
redirect... https://codeload.github.com/IBM-Blockchain/marbles/zip/v2.0
[ibc-js] Downloading zip
[ibc-js] Unzipping zip
[ibc-js] Unzip done
[ibc-js] Scanning files [ 'marbles_chaincode.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 - marbles_chaincode.go
[ibc-js] Found cc invoke function:  init
[ibc-js] Found cc invoke function:  delete
[ibc-js] Found cc invoke function:  write
[ibc-js] Found cc invoke function:  init_marble
[ibc-js] Found cc invoke function:  set_user
[ibc-js] Found cc invoke function:  open_trade
[ibc-js] Found cc invoke function:  perform_trade
[ibc-js] Found cc invoke function:  remove_trade
[ibc-js] Parsing file for query functions - marbles_chaincode.go
[ibc-js] Found cc query function:  read
[ibc-js] load_chaincode() finished
[ibc-js] Deploy Chaincode - Starting
[ibc-js] 	function: init , arg: [ '99' ]


	 Waiting...


	 deploy resp error - there is no chaincode hash name in response: { jsonrpc: '2.0',
  error: 
   { code: -32001,
     message: 'Deployment failure',
     data: 'Error when deploying chaincode: Error getting chaincode package bytes: Error getting code Getting chaincode took too long' },
  id: 1483146533342 }
! looks like a deploy error, holding off on the starting the socket
 { name: 'deploy() error no cc name',
  code: 502,
  details: 
   { jsonrpc: '2.0',
     error: 
      { code: -32001,
        message: 'Deployment failure',
        data: 'Error when deploying chaincode: Error getting chaincode package bytes: Error getting code Getting chaincode took too long' },
     id: 1483146533342 } }

On the peer side, I see traffic, but ultimately, there's an error:

vp_1          | 01:08:50.024 [crypto] Debugf -> DEBU 0ac [client.bob] Storing TLS key and certificate for user [bob]...
vp_1          | 01:08:50.027 [crypto] Debug -> DEBU 0ad [client.bob]  Registering node crypto engine...done!
vp_1          | 01:08:50.028 [crypto] Info -> INFO 0ae [client.bob]  Register crypto engine...
vp_1          | 01:08:50.032 [crypto] Info -> INFO 0af [client.bob]  Register crypto engine...done.
vp_1          | 01:08:50.032 [crypto] Debugf -> DEBU 0b0 [client.bob] Registration of node [%!s(crypto.NodeType=0)] with name [bob] completed
vp_1          | 01:08:50.032 [crypto] Debug -> DEBU 0b1 [client.bob]  Closing keystore...
vp_1          | 01:08:50.032 [crypto] Debug -> DEBU 0b2 [client.bob]  Closing keystore...done!
vp_1          | 01:08:50.032 [crypto] RegisterClient -> INFO 0b3 Registering client [bob] with name [bob]...done!
vp_1          | 01:08:50.033 [rest] Register -> INFO 0b4 Storing login token for user 'bob'.
vp_1          | 01:08:50.035 [rest] Register -> INFO 0b5 Login successful for user 'bob'.
vp_1          | 01:08:53.350 [rest] ProcessChaincode -> INFO 0b6 REST processing chaincode request...
vp_1          | 01:08:53.361 [rest] processChaincodeDeploy -> INFO 0b7 REST deploying chaincode...
vp_1          | 01:08:53.364 [rest] processChaincodeDeploy -> INFO 0b8 Local user 'bob' is already logged in. Retrieving login token.
vp_1          | 01:08:53.366 [devops] getChaincodeBytes -> DEBU 0b9 Received build request for chaincode spec: type:GOLANG chaincodeID:<path:"http://gopkg.in/ibm-blockchain/marbles.v2/chaincode" > ctorMsg:<args:"init" args:"99" > secureContext:"bob" 
vp_1          | 01:08:53.375 [golang/hash] getCodeFromHTTP -> DEBU 0ba getCodeFromHTTP gopkg.in/ibm-blockchain/marbles.v2/chaincode
vp_1          | 01:08:53.381 [golang/hash] getCodeFromHTTP -> DEBU 0bb go get gopkg.in/ibm-blockchain/marbles.v2/chaincode
vp_1          | 01:09:23.436 [devops] getChaincodeBytes -> ERRO 0bc Error getting chaincode package bytes: Error getting code Getting chaincode took too long
vp_1          | 01:09:23.436 [devops] Deploy -> ERRO 0bd Error deploying chaincode spec: type:GOLANG chaincodeID:<path:"http://gopkg.in/ibm-blockchain/marbles.v2/chaincode" > ctorMsg:<args:"init" args:"99" > secureContext:"bob" 
vp_1          | 
vp_1          |  error: Error getting chaincode package bytes: Error getting code Getting chaincode took too long
vp_1          | 01:09:23.437 [rest] processChaincodeDeploy -> ERRO 0be Error when deploying chaincode: Error getting chaincode package bytes: Error getting code Getting chaincode took too long
vp_1          | 01:09:23.439 [rest] ProcessChaincode -> INFO 0bf REST successfully deploy chaincode: {"jsonrpc":"2.0","error":{"code":-32001,"message":"Deployment failure","data":"Error when deploying chaincode: Error getting chaincode package bytes: Error getting code Getting chaincode took too long"},"id":1483146533342}

Any ideas how to fix this?

Thanks!

Viewing transaction history

How can I view the entire life cycle of the marble since its inception?
For e.g. when created, Bob was the owner, then it was traded for 2 white marbles at block number 12 with Leroy

[ibc-js] deploy - failure: 500 ! looks like a deploy error, holding off on the starting the socket.......many thanks for help

Hello sir......my environment is running Nodejs app on local and use Blockchain on Bluemix. I encounter an error in bellow when Nodejs app try to deploy chaincode....Please give some help, many thanks!

Running using Developer settings

  • Tracking Deployment
    loading hardcoded peers
    loading hardcoded users
    [ibc-js] Peer: vp0-e09125f8-45d...:30303
    [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/marbles-chaincode/zip/master
    [ibc-js] Downloading zip
    [ibc-js] Unzipping zip
    [ibc-js] Unzip done
    [ibc-js] Scanning files [ 'part2_chaincode.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 - part2_chaincode.go
    [ibc-js] Found cc invoke function: init
    [ibc-js] Found cc invoke function: delete
    [ibc-js] Found cc invoke function: write
    [ibc-js] Found cc invoke function: init_marble
    [ibc-js] Found cc invoke function: set_user
    [ibc-js] Found cc invoke function: open_trade
    [ibc-js] Found cc invoke function: perform_trade
    [ibc-js] Found cc invoke function: remove_trade
    [ibc-js] Parsing file for query functions - part2_chaincode.go
    [ibc-js] Found cc query function: read
    [ibc-js] load_chaincode() finished
    [ibc-js] Deploy Chaincode - Starting
    [ibc-js] function: init , arg: [ '99' ]

     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: socket hang up
    at createHangUpError (_http_client.js:252:15)
    at TLSSocket.socketOnEnd (_http_client.js:344:23)
    at emitNone (events.js:91:20)
    at TLSSocket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)

    at process._tickCallback (internal/process/next_tick.js:98:9) code: 'ECONNRESET' } }

    It seems problem happen in user register....."No membership users found after filtering, assuming this is a network w/o membership". I modified mycreds.json by the user listed in Service Credentials page on Bluemix. Bellow is my mycreds.json

    {
    "credentials": {
    "peers": [
    {
    "discovery_host": "e09125f8-45df-4cce-96b5-8ce57858f622_vp0.us.blockchain.ibm.com",
    "discovery_port": 30303,
    "api_host": "e09125f8-45df-4cce-96b5-8ce57858f622_vp0.us.blockchain.ibm.com",
    "api_port_tls": 30303,
    "api_port": 443,
    "type": "peer",
    "network_id": "e09125f8-45df-4cce-96b5-8ce57858f622",
    "container_id": "ea18a428f5133461b99edcfbb4c59d2da6cce006ddcb252a4faf496b2fa13e06",
    "id": "e09125f8-45df-4cce-96b5-8ce57858f622_vp0",
    "api_url": "http://e09125f8-45df-4cce-96b5-8ce57858f622_vp0.us.blockchain.ibm.com:433"
    }
    ],
    "ca": {
    "e09125f8-45df-4cce-96b5-8ce57858f622_ca": {
    "url": "e09125f8-45df-4cce-96b5-8ce57858f622_ca.us.blockchain.ibm.com:30303",
    "discovery_host": "e09125f8-45df-4cce-96b5-8ce57858f622_ca.us.blockchain.ibm.com",
    "discovery_port": 30303,
    "api_host": "e09125f8-45df-4cce-96b5-8ce57858f622_ca.us.blockchain.ibm.com",
    "api_port_tls": 30303,
    "api_port": 433,
    "type": "ca",
    "network_id": "e09125f8-45df-4cce-96b5-8ce57858f622",
    "container_id": "3a17bd002c297e375190462377aa503a17cd2c9a53e13514f161e09bbad0772e"
    }
    },
    "users": [
    {
    "username": "user_type8_3b11bb4a7e",
    "secret": "2ae4ecee2f",
    "enrollId": "user_type8_3b11bb4a7e",
    "enrollSecret": "2ae4ecee2f"
    }
    ],
    "cert": "https://blockchain-certs.mybluemix.net/us.blockchain.ibm.com.cert"
    }

    }

    I had tried another user but still have other error. It look register error.

    Running using Developer settings

  • Tracking Deployment
    loading hardcoded peers
    loading hardcoded users
    [ibc-js] Peer: vp0-e09125f8-45d...:30303
    [ibc-js] Registering vp0-e09125f8-45d...:30303 w/enrollId - user_type1_270373e350
    [ibc-js] Register - failure x1 : user_type1_270373e350 500
    [ibc-js] going to try to register again in 30 secs
    [ibc-js] Registering vp0-e09125f8-45d...:30303 w/enrollId - user_type1_270373e350
    [ibc-js] Register - failure x2 : user_type1_270373e350 500
    ! looks like an error loading the chaincode or network, app will fail
    { name: 'register() error',
    code: 500,
    details:
    { Error: socket hang up
    at createHangUpError (_http_client.js:252:15)
    at TLSSocket.socketOnEnd (_http_client.js:344:23)
    at emitNone (events.js:91:20)
    at TLSSocket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:975:12)

    But I can register this user by APIs page on Bluemix. It is strange.

Many thanks for advise!

Running on debian system

If you want to run locally on the Debian-type OS's, you must also install the package nodejs-legacy in order to sucessfully perform npm install. It would be great if you added this to the installation/setup notes :)

Delete functionality

The blockchain being an append only ledger, doesn't the delete functionality go against the principles of a blockchain?

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.