Closed austingrice closed 5 years ago
I still get this issue with VSCode 1.0
@austingrice is the problem fixed if you use an unmodified version of the network configuration?
@cazfletch I just tried an unmodified docker-compose.yaml
file and got this when trying to install
Austins-MacBook-Pro:cli Austin$ docker exec cliMagnetoCorp peer chaincode install -n papercontract -v 0 -p /opt/gopath/src/github.com/contract -l node
Error: error getting endorser client for install: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp: lookup peer0.org1.example.com on 127.0.0.11:53: no such host"
This is with 1.0 of VSCode still
@austingrice have you tried installing from within VS Code?
@cazfletch - Yes.. I was just able to install/instantiate within VSCode without an issue.
Also - I noticed how the basic-network/crypto-config
got pulled into the fabric-tools
so I thought the issue could be because the basic-network/config
wasn't getting pulled into as well. So I modified the docker-compose.yaml
file to say
volumes:
- /var/run/:/host/var/run/
- ./../../../../organization/magnetocorp:/opt/gopath/src/github.com/
- ./../../../../../basic-network/crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ./../../../../../basic-network/config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
But then I go into the cliMagnetoCorp
container and get don't get actually mounted.
root@a55515e00dee:/opt/gopath/src/github.com/hyperledger/fabric/peer# ls -l
total 0
drwxr-xr-x 4 root root 128 May 9 15:18 crypto
root@a55515e00dee:/opt/gopath/src/github.com/hyperledger/fabric/peer# cd crypto/
root@a55515e00dee:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto# ls -l
total 0
drwxr-xr-x 3 root root 96 May 9 15:18 ordererOrganizations
drwxr-xr-x 3 root root 96 May 9 15:18 peerOrganizations
@cazfletch - I did progress to the other parts of the tutorial (adding an identity and issuing an issue.js
transaction), but I get an authorization error again as my MSPID Org1MSP
Austins-MacBook-Pro:application Austin$ node addToWallet.js
done
Austins-MacBook-Pro:application Austin$ ls -l ../identity/user/isabella/wallet/
total 0
drwxr-xr-x 5 Austin staff 160 May 9 14:36 User1@org1.example.com
Austins-MacBook-Pro:application Austin$ ls -l
total 192
-rw-r--r-- 1 Austin staff 1476 May 9 11:18 addToWallet.js
-rw-r--r-- 1 Austin staff 2974 May 9 11:18 issue.js
drwxr-xr-x 233 Austin staff 7456 May 9 14:36 node_modules
-rw-r--r-- 1 Austin staff 83093 May 9 14:36 package-lock.json
-rw-r--r-- 1 Austin staff 397 May 9 11:18 package.json
Austins-MacBook-Pro:application Austin$ ls -l ../identity/user/isabella/wallet/User1\@org1.example.com/
total 24
-rw-r--r-- 1 Austin staff 1037 May 9 14:36 User1@org1.example.com
-rw-r--r-- 1 Austin staff 246 May 9 14:36 c75bd6911aca808941c3557ee7c97e90f3952e379497dc55eb903f31b50abc83-priv
-rw-r--r-- 1 Austin staff 182 May 9 14:36 c75bd6911aca808941c3557ee7c97e90f3952e379497dc55eb903f31b50abc83-pub
Austins-MacBook-Pro:application Austin$ node issue.js
Connect to Fabric gateway.
Use network channel: mychannel.
2019-05-09T18:36:27.721Z - error: [Channel.js]: Error: 2 UNKNOWN: access denied: channel [mychannel] creator org [Org1MSP]
2019-05-09T18:36:27.723Z - error: [Network]: _initializeInternalChannel: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: 2 UNKNOWN: access denied: channel [mychannel] creator org [Org1MSP]
Error processing transaction. Error: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: 2 UNKNOWN: access denied: channel [mychannel] creator org [Org1MSP]
Error: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: 2 UNKNOWN: access denied: channel [mychannel] creator org [Org1MSP]
at Network._initializeInternalChannel (/Users/Austin/Documents/VSCodeProjects/fabric-samples/commercial-paper/organization/magnetocorp/application/node_modules/fabric-network/lib/network.js:86:12)
at <anonymous>
Disconnect from Fabric gateway.
Now, I can still submit from the VSCode UI..
Transaction ["issue", "MagnetoCorp", "00001", "2020-05-31", "2020-11-30", "5000000"]
[5/9/2019 2:45:06 PM] [INFO] submitTransaction
[5/9/2019 2:45:51 PM] [INFO] submitting transaction issue with args issue,MagnetoCorp,00001,2020-05-31,2020-11-30,5000000
[5/9/2019 2:45:53 PM] [SUCCESS] Returned value from issue: {"type":"Buffer","data":[123,34,99,108,97,115,115,34,58,34,111,114,103,46,112,97,112,101,114,110,101,116,46,99,111,109,109,101,114,99,105,97,108,112,97,112,101,114,34,44,34,107,101,121,34,58,34,92,34,105,115,115,117,101,92,34,58,92,34,77,97,103,110,101,116,111,67,111,114,112,92,34,34,44,34,99,117,114,114,101,110,116,83,116,97,116,101,34,58,49,44,34,105,115,115,117,101,114,34,58,34,105,115,115,117,101,34,44,34,112,97,112,101,114,78,117,109,98,101,114,34,58,34,77,97,103,110,101,116,111,67,111,114,112,34,44,34,105,115,115,117,101,68,97,116,101,84,105,109,101,34,58,34,48,48,48,48,49,34,44,34,109,97,116,117,114,105,116,121,68,97,116,101,84,105,109,101,34,58,34,50,48,50,48,45,48,53,45,51,49,34,44,34,102,97,99,101,86,97,108,117,101,34,58,34,50,48,50,48,45,49,49,45,51,48,34,44,34,111,119,110,101,114,34,58,34,105,115,115,117,101,34,125]}
@cazfletch
Just to give you an update. I still get this issue. What's weird is that I can do an issue transaction (like above), but I get an endorsement error
when trying to buy the paper. This is all from the VSCode UI. I'm still getting errors from the CLI from both the magnetocorp and digibank perspective.
@cazfletch
Here is my networkConnection.yaml file..
---
#
# The network connection profile provides client applications the information about the target
# blockchain network that are necessary for the applications to interact with it. These are all
# knowledge that must be acquired from out-of-band sources. This file provides such a source.
#
name: "basic-network"
#
# Any properties with an "x-" prefix will be treated as application-specific, exactly like how naming
# in HTTP headers or swagger properties work. The SDK will simply ignore these fields and leave
# them for the applications to process. This is a mechanism for different components of an application
# to exchange information that are not part of the standard schema described below. In particular,
# the "x-type" property with the "hlfv1" value example below is used by Hyperledger Composer to
# determine the type of Fabric networks (v0.6 vs. v1.0) it needs to work with.
#
x-type: "hlfv1"
#
# Describe what the target network is/does.
#
description: "The basic network"
#
# Schema version of the content. Used by the SDK to apply the corresponding parsing rules.
#
version: "1.0"
#
# [Optional]. But most apps would have this section so that channel objects can be constructed
# based on the content below. If an app is creating channels, then it likely will not need this
# section.
#
channels:
# name of the channel
mychannel:
# Required. list of orderers designated by the application to use for transactions on this
# channel. This list can be a result of access control ("org1" can only access "ordererA"), or
# operational decisions to share loads from applications among the orderers. The values must
# be "names" of orgs defined under "organizations/peers"
orderers:
- orderer.example.com
# Required. list of peers from participating orgs
peers:
peer0.org1.example.com:
# [Optional]. will this peer be sent transaction proposals for endorsement? The peer must
# have the chaincode installed. The app can also use this property to decide which peers
# to send the chaincode install request. Default: true
endorsingPeer: true
# [Optional]. will this peer be sent query proposals? The peer must have the chaincode
# installed. The app can also use this property to decide which peers to send the
# chaincode install request. Default: true
chaincodeQuery: true
# [Optional]. will this peer be sent query proposals that do not require chaincodes, like
# queryBlock(), queryTransaction(), etc. Default: true
ledgerQuery: true
# [Optional]. will this peer be the target of the SDK's listener registration? All peers can
# produce events but the app typically only needs to connect to one to listen to events.
# Default: true
eventSource: true
#
# list of participating organizations in this network
#
organizations:
Org1:
mspid: Org1MSP
peers:
- peer0.org1.example.com
# [Optional]. Certificate Authorities issue certificates for identification purposes in a Fabric based
# network. Typically certificates provisioning is done in a separate process outside of the
# runtime network. Fabric-CA is a special certificate authority that provides a REST APIs for
# dynamic certificate management (enroll, revoke, re-enroll). The following section is only for
# Fabric-CA servers.
certificateAuthorities:
- ca.org1.example.com
#
# List of orderers to send transaction and channel create/update requests to. For the time
# being only one orderer is needed. If more than one is defined, which one get used by the
# SDK is implementation specific. Consult each SDK's documentation for its handling of orderers.
#
orderers:
orderer.example.com:
url: grpc://localhost:17050
# these are standard properties defined by the gRPC library
# they will be passed in as-is to gRPC client constructor
grpcOptions:
ssl-target-name-override: orderer.example.com
#
# List of peers to send various requests to, including endorsement, query
# and event listener registration.
#
peers:
peer0.org1.example.com:
# this URL is used to send endorsement and query requests
url: grpc://localhost:17051
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
request-timeout: 120001
# Fabric-CA is a special kind of Certificate Authority provided by Hyperledger Fabric which allows
# certificate management to be done via REST APIs. Application may choose to use a standard
# Certificate Authority instead of Fabric-CA, in which case this section would not be specified.
#
certificateAuthorities:
ca.org1.example.com:
url: http://localhost:17054
# the properties specified under this object are passed to the 'http' client verbatim when
# making the request to the Fabric-CA server
httpOptions:
verify: false
# Fabric-CA supports dynamic user enrollment via REST APIs. A "root" user, a.k.a registrar, is
# needed to enroll and invoke new users.
registrar:
- enrollId: admin
enrollSecret: adminpw
# [Optional] The optional name of the CA.
caName: ca.org1.example.com
I've tried adding the full docker container name (ie fabricvscodelocalfabric_peer0.org1.example.com
) and still don't get passed the error
@austingrice I'm I right in thinking you are trying to interact with the VS code local fabric runtime using the peer cli which is in some sort of container ? If so then you would need to make sure that the MSPs generated to run the vscode local fabric are correctly exposed to these containers. Probably the reason it worked prior to 0.4.0 was that the vscode local fabric used the same crypto material stored in the fabric-samples github repo for basic-network. That isn't the case now.
@davidkel @cazfletch @sstone1
I was trying two things with the goal of getting 1 of them to work.. 1 being connecting commerical paper through the local_fabric
and then the second by trying to do it through the ./start.sh
script in the basic-network
of fabric-samples
. Thank you David for the information about the location of the crypto material. I was pulling down the fabric-tools container to install/instantiate the commercial paper contract. I wanted to get this to work with the local_fabric
so I went with this route. I looked around and saw that they are stored in /Users/<username>/.fabric-vscode/runtime/crypto-config/
so I mapped that in the fabric-tools
container I was pulling down. Then in the addtoWallet.js
file, I mapped that as well to /Users/<username>/.fabric-vscode/runtime
so that it would pick up Isabella and Balaji and replaced the generated private key from the local_fabric
setup. Since the local_fabric
has the anchor peer defined, we avoided the endorsement plan issue I posted in the slack channel.
Thank you all for the help with this! Turns out it was just the mapping of the correct crypto material. We can close this as well.
I'm trying to run commercial paper located here:
https://ibm-blockchain-wsc.github.io/ImmersionWorkshop/vscode-part2/#section-2-setting-the-stage
but it is very similar (I think exactly the same) to the commercial paper found in the Hyperledger docs.Description
I'm getting an error on authorization when installing the commercial paper smart contract via the
hyperledger/fabric-tools
container.I've tried this locally and have had success installing the smart contract via the same container. My
local_fabric
network is up and running with no issues. I did a clean teardown as well.Further, my admin identity is in my wallet within the IBP extension.
I have modified the
docker-compse.yaml
file to match up with my network.I do notice
CORE_PEER_ID
which I've never seen before and can't find in the Fabric docs.This all worked in 0.3.x and now I'm hitting these issues with 0.4.0.
Expected Behavior
Installation of the commercial paper smart contract
Actual Behavior
Failed to install the commercial paper smart contract. I did turn on
debug
logging and found this:Sorry for a lot of logs and wording here, but thought I'd be as thorough as possible from the get-go.
Possible Fix
I did notice that the Fabric docs say to have Node 9.0 installed and I'm operating on 8.15.1 - but that shouldn't cause this type of issue. This did work on 0.3.x with node 8.15.1 and it worked just fine.
Steps to Reproduce
You can follow my steps here..
https://ibm-blockchain-wsc.github.io/ImmersionWorkshop/vscode-part2/#section-2-setting-the-stage
Existing issues
Log File
A lot of the logs are above
Your Environment