windows通过java-sdk调用远程虚拟机上的链码错误,交易失败 10C

错误如下,并配上docker ps,及sdk参数配配置图片

exception in thread "main" org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel mychannel failed with peer Status FAILURE, details: Sending proposal to failed because of: gRPC failure=Status{code=UNKNOWN, description=null, cause=java.lang.IndexOutOfBoundsException: readerIndex(0) + length(10) exceeds writerIndex(0): PooledUnsafeDirectByteBuf(ridx: 0, widx: 0, cap: 30)
at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(
at io.netty.buffer.AbstractByteBuf.checkReadableBytes(
at io.netty.buffer.AbstractByteBuf.readSlice(
at io.netty.handler.codec.http2.DefaultHttp2FrameWriter$DataFrameHeader.slice(
at io.netty.handler.codec.http2.DefaultHttp2FrameWriter.writeData(
at io.netty.handler.codec.http2.Http2OutboundFrameLogger.writeData(
at io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder$FlowControlledData.write(
at io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$FlowState.writeAllocatedBytes(
at io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$WritabilityMonitor$1.write(
at io.netty.handler.codec.http2.WeightedFairQueueByteDistributor$State.write(
at io.netty.handler.codec.http2.WeightedFairQueueByteDistributor.distribute(
at io.netty.handler.codec.http2.WeightedFairQueueByteDistributor.distributeToChildren(
at io.netty.handler.codec.http2.WeightedFairQueueByteDistributor.distribute(
at io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController$WritabilityMonitor.writePendingBytes(
at io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController.writePendingBytes(
at io.netty.handler.codec.http2.Http2ConnectionHandler.flush(
at io.grpc.netty.WriteQueue.flush(
at io.grpc.netty.WriteQueue.access$000(
at io.grpc.netty.WriteQueue$
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(
at io.netty.util.concurrent.SingleThreadEventExecutor$
at Source)
at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(
at org.hyperledger.fabric.sdk.Channel.initialize(
at com.chanpay.demo.Demo.initChannel(
at com.chanpay.demo.Demo.invoke(
at com.chanpay.demo.Demo.main(


@devmiao 不是这个问题,是sdk参数传错了

Csdn user default icon

<div class="post-text" itemprop="text"> <p>I am unable to instantiate chaincode in Hyperledge Fabric.</p> <p>When executing:</p> <pre><code>peer chaincode instantiate -o orderer -n test_cc -C test-channel -v 0.1 -c '{"Args":["initLedger"]}' </code></pre> <p>I get the error:</p> <pre><code>peer0 | 2018-04-17 13:02:11.097 UTC [dockercontroller] Start -&gt; ERRO 046 start-could not start container: API error (400): {"message":"OCI runtime create failed: container_linux.go:348: starting container process caused \"exec: \\\"chaincode\\\": executable file not found in $PATH\": unknown"} </code></pre> <p>When searching the internet, the error message is the same as on the original post at [<a href="">OCI Runtimer Error when installing Hyperledger Chaincode via Java-SDK</a> and [<a href="">OCI runtime error when sending Hyperledger Fabric's chaincode instantiation request to peers</a>, but the comments on these posts did not led me to the solution.</p> <p>I am using the following software versions: Hyperledger 1.1.0 Docker version 18.03.0-ce (on Linux), Hyperledger Docker images: x86_64-1.1.0</p> <p>The following steps succeed:</p> <ul> <li>Building the chaincode. The code compiles without errors. I did not include any dependencies except the two required "" and ""</li> <li>Packaging the chaincode.</li> <li>Signing the chaincode.</li> <li>Installing the chaincode (it ends up in the peer's /var/hyperledger/production/chaincodes/test_cc.0.1.</li> </ul> <p>(Steps according to Hyperledger documentation: [<a href="" rel="nofollow noreferrer">]</a>)</p> <p>In the CLI Docker container, files are located in the directory <code>/opt/gopath/src/chaincode/go/test_cc/</code>, where 4 files are present: <code>test_cc, test_cc.go, test_cc_pack.out, test_cc_signed_pack.out</code> (the binary, source file, packaged file and signed package file).</p> <p>The full output of the orderer and peer is:</p> <pre><code>orderer | 2018-04-17 13:29:43.617 UTC [orderer/common/server] Broadcast -&gt; DEBU 167 Starting new Broadcast handler orderer | 2018-04-17 13:29:43.617 UTC [orderer/common/broadcast] Handle -&gt; DEBU 168 Starting new broadcast loop for couchdb | [notice] 2018-04-17T13:29:43.624931Z nonode@nohost &lt;0.16042.3&gt; b5d38cd27d couchdb:5984 undefined GET /test-channel_lscc/test_cc?attachments=true 404 ok 2 peer | 2018-04-17 13:29:44.416 UTC [dockercontroller] Start -&gt; ERRO 04a start-could not start container: API error (400): {"message":"OCI runtime create failed: container_linux.go:348: starting container process caused \"exec: \\\"chaincode\\\": executable file not found in $PATH\": unknown"} peer | 2018-04-17 13:29:44.647 UTC [chaincode] Launch -&gt; ERRO 04b launchAndWaitForRegister failed: API error (400): {"message":"OCI runtime create failed: container_linux.go:348: starting container process caused \"exec: \\\"chaincode\\\": executable file not found in $PATH\": unknown"} peer | peer | error starting container peer | 2018-04-17 13:29:44.647 UTC [endorser] simulateProposal -&gt; ERRO 04c [test-channel][39e4414a] failed to invoke chaincode name:"lscc" , error: API error (400): {"message":"OCI runtime create failed: container_linux.go:348: starting container process caused \"exec: \\\"chaincode\\\": executable file not found in $PATH\": unknown"} peer | peer | error starting container orderer | 2018-04-17 13:29:44.648 UTC [orderer/common/broadcast] Handle -&gt; DEBU 169 Received EOF from, hangup orderer | 2018-04-17 13:29:44.648 UTC [orderer/common/server] func1 -&gt; DEBU 16a Closing Broadcast stream </code></pre> <p>It looks like there is some path issue, but the process of the creation of the chaincode container and the variables which influence this process.</p> <p>I'm messing around with this issue for few days(!) now, tried all path combinations like placing the file in <code>/opt/gopath/bin</code>, etcetera, but to no avail.</p> <p>Someone who can shine a light on this issue? Or knows what the correct paths are and where they are, or where they should be defined?</p> <p>Thanks</p> </div>

从Hyperledger Fabric Node SDK中的函数InvokeChaincode()获取链码调用方ID

<div class="post-text" itemprop="text"> <p>Let's suppose the following network architecture:</p> <p><strong>A</strong> -&gt; <strong>Chaincode1</strong> -&gt; <strong>fabcar</strong></p> <p><strong>A</strong> is the application, <strong>Chaincode1</strong> is a chaincode in Go and <strong>fabcar</strong> is a chaincode in Nodejs. They are on the same channel: "mychannel". </p> <p>When is performed the operation <code>APIstub.InvokeChaincode</code> from the <strong>Chaincode1</strong> such as <code>APIstub.InvokeChaincode("fabcar", chainCodeArgs, "mychannel")</code>, is there a possibility for the chaincode <strong>fabcar</strong> (the chaincode called) to get the <strong>id</strong> of the the caller chaincode? </p> <p>The <code>getCreator()</code> method in the <strong>fabcar</strong> chaincode just returns the caller organization; but the information needed is <em>the chaincode id</em> or some info only connected to the <strong>Chaincode1</strong>.</p> <hr> <p><strong>UPDATE</strong></p> <p>I tryed the <code>getSignedProposal()</code> method as written in the official documentation of hyperledger: <a href="" rel="nofollow noreferrer"></a></p> <p>The <code>getSignedProposal()</code> method returns a fully decoded object of the signed transaction proposal of type <code>SignedProposal</code>. The <code>SignedProposal</code> object represents the request object sent by the client application to the chaincode.</p> <p>Executing the following code: </p> <pre><code>const proposal = stub.getSignedProposal(); console.log("signed proposal: ", proposal); </code></pre> <p>the result is the following:</p> <pre><code>signed proposal: { signature: &lt;Buffer 30 45 02 21 00 c3 a7 91 4c 74 f9 c2 97 04 fc 84 91 6a 71 2d 69 ad 0e a9 22 f2 ed 53 a3 66 97 56 17 d7 d7 3a e6 02 20 13 26 8a 4f f6 3d 86 4e f9 35 ae ... &gt;, proposal: { header: { signature_header: [Object], channel_header: [Object] }, payload: { input: [Object], TransientMap: [Object] } } } </code></pre> <p>Seems really difficult to understand which is the info where is possible to retrieve the <strong>calling chaincode ID</strong>. Here is the link of the doc concerning the <code>SignedProposal</code> type: <a href="" rel="nofollow noreferrer"></a></p> </div>

HyperLedger Fabric获取块信息-Fabric Go SDK

<div class="post-text" itemprop="text"> <p>I used to set up a Fabric network and deployed a fabric network and basic application using a Fabric and Fabric GoLang SDK. I'm able to do the query and write to the chain. Is there any way to retrieve the Block Info? Like block height and current hash?</p> <pre><code>+ I'm unable to find out a documentation for GoLang Fabric SDK. </code></pre> <p>I followed following code and tutorial,</p> <p><a href="" rel="nofollow noreferrer">Fabric Basic App - Tutorial</a> <a href="" rel="nofollow noreferrer"></a></p> <p><a href="" rel="nofollow noreferrer">Fabric Basic App using GoLang SDK - Code</a> <a href="" rel="nofollow noreferrer"></a></p> <p><a href="" rel="nofollow noreferrer">GoLang SDK - Official SDK</a> <a href="" rel="nofollow noreferrer"></a></p> </div>


<div class="post-text" itemprop="text"> <p>Please help me this issue, error happened when I instantiate my chaincode:</p> <p>Currently, I guess the issue related to shim package, because I remove it in my utils package, instantiate successfully.</p> <h1>MyChainCode:</h1> <pre><code>import ( "bytes" "encoding/hex" "encoding/json" "fmt" "strconv" "" "" "" pb "" "" "" ) APIstub shim.ChaincodeStubInterface ... username, _ = utils.GetCurrentUser(APIstub) ... </code></pre> <h1>My packages</h1> <pre><code>package utils import ( "" "" ) func GetCurrentUser(stub shim.ChaincodeStubInterface) (string, error) { cert, err := GetCreatorCert(stub) return cert.Subject.CommonName, err } </code></pre> <h1>Issue:</h1> <blockquote> <p>Error: Error endorsing chaincode: rpc error: code = Unknown desc = error starting container: Failed to generate platform-specific docker build: Error returned from build: 2 "# ~vendor/ ~vendor/ hdr.Format undefined (type *tar.Header has no field or method Format) ~vendor/ undefined: tar.FormatPAX ~/vendor/ hdr.Format undefined (type *tar.Header has no field or method Format) ~/vendor/ undefined: tar.FormatPAX</p> </blockquote> <p>Fabric ver 1.1.0</p> <p>Go ver 1.9.2</p> </div>

在Hyperledger Fabric区块链上修改链码后升级网络配置

<div class="post-text" itemprop="text"> <p>I am working with this blockchain application for medics traceability (<a href="" rel="nofollow noreferrer"></a>) based on hyperledger fabric blockchain. </p> <p>It's exactly the same app as this project (<a href="" rel="nofollow noreferrer"></a>) except that this project is for tuna traceability. </p> <p>I modify the chaincode file (the file is "drug-chaincode.go"), and now apparently I need to reconfigure all my network in "basic-network" folder so that the modification is add, but I don't how I can do this.</p> <p>I tried to follow this link without results (<a href="">How to upgrade a chaincode after modification?</a>)</p> <p>Anyhelp is welcome, thank you in advance ;)</p> </div>

Docker 中java程序对外请求,报错:Root Cause exception :

1、在虚拟机中centos7 系统中,安装了Docker环境,想实现在docker中运行 “java -jar test.jar”,其中test.jar的main函数中会对外发起http请求,url=“”,初始启动运行镜像文件就报错: ``` PLM at Method) at$1.lookupAllHostAddr( ``` 2、我配置的dockfile 文件为: ``` From centos MAINTAINER liubin ADD test.jar test.jar ADD jdk-7u80-linux-x64.tar.gz /home/jdk/ ENV JAVA_HOME /home/jdk/jdk1.7.0_80 ENV PATH $JAVA_HOME/bin:$PATH ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar ENTRYPOINT ["java","-jar","test.jar"] ``` 3、直接尝试在centos环境中运行java -jar test.jar不会报异常,我的/etc/hosts文件中配置了PLM相关地址 ``` node1 localhost ::1 node1 localhost plmapp PLM #与请求地址相关的域名 ode1 AAASPLMIFS ``` 4、我的问题是docker 中运行java程序报这个UnknownHostException,是不是需要在Dockerfile中配置其它内容。 不好意思,最近没有积分呀、

找不到在Windows 7上运行的自定义链码路径Hyperledger Fabric V1.0本地网络

<div class="post-text" itemprop="text"> <p>I am trying to install my custom chain code in my local Hyperledger Fabric v1.0 environment. </p> <p>For this I have followed the documentation <a href="" rel="nofollow noreferrer">build your first network</a> and I am using first network sample with in the <a href="" rel="nofollow noreferrer">github</a> project. No it is up and running with <code>./ -m up</code> and executing all the scripts for channel creating, chain code installation and instantiation and all by running file.</p> <p>Now I have changed the following to tryout my custom chaincode </p> <pre><code>peer chaincode install -n mycc -v 1.0 -p;&amp;log.txt </code></pre> <p>this I have changed to </p> <pre><code>peer chaincode install -n mycc -v 1.0 -p &gt;&amp;log.txt </code></pre> <p>Now by running <code>./ -m up</code> getting the exception </p> <pre><code>2017-08-22 11:01:17.048 UTC [msp] GetDefaultSigningIdentity -&gt; DEBU 002 Obtaining default signing identity 2017-08-22 11:01:17.048 UTC [chaincodeCmd] checkChaincodeCmdParams -&gt; INFO 003 Using default escc 2017-08-22 11:01:17.048 UTC [chaincodeCmd] checkChaincodeCmdParams -&gt; INFO 004 Using default vscc Error: Error getting chaincode code chaincode: path to chaincode does not exist: Usage: peer chaincode install [flags] Flags: -c, --ctor string Constructor message for the chaincode in JSON format (default "{}") -l, --lang string Language the chaincode is written in (default "golang") -n, --name string Name of the chaincode -p, --path string Path to chaincode -v, --version string Version of the chaincode specified in install/instantiate/upgrade commands Global Flags: --cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoi --logging-level string Default logging level and overrides, see core.yaml for full syntax -o, --orderer string Ordering service endpoint --test.coverprofile string Done (default "coverage.cov") --tls Use TLS when communicating with the orderer endpoint !!!!!!!!!!!!!!! Chaincode installation on remote peer PEER0 has Failed !!!!!!!!!!!!!!!! ========= ERROR !!! FAILED to execute End-2-End Scenario =========== </code></pre> <p>I have the repository there in <a href="" rel="nofollow noreferrer">github</a>, then why it is not showing <strong>does not exit</strong>? </p> <p>I have <em>cloned</em> the same to <strong>Windows 7</strong> machine under the path $GOPATH/src/ and given local path, then also I am getting the same error. I am running all the commands through docker quick start terminal for <strong>windows 7</strong>.</p> <p>Please suggest where I am doing wrong.</p> <p>Also in some of the network log I have found a location <code>/opt/gopath/src/</code> and where it is pointing to. In my windows path gopath is <code>/c/users/public/fabricv1</code>. </p> <p>Since I am not much familiar with the tool, please comment on this also.</p> <blockquote> <p>After doing some analysis from my side, it seems like the chain code is reading from some pre-mounted directories <strong><em>sacc/, fabcar/, /marble02 , chaincode_example_02, hyperledger/</em></strong> under the path <strong><em><code>root@7785f8b27559:/opt/gopath/src/chaincodedev/chaincode#</code></em></strong> and chaincode also pre-loaded at the time of making the network up using docker image. There it seems <strong><em>no effect by adding chaincode in windows folder</em></strong> and it is from the above said virtual machine path.</p> <p>So what can I do now to continue my work? is there any way to install my custom chaincode to the local network. I tried with my githhub path and local path but no use. please somebody help :(</p> </blockquote> </div>

Hyperledger Fabric:无法调用链码名称:“ lscc”

<div class="post-text" itemprop="text"> <p>While trying to instantiate a chaincode, I always get a timeout error on lifecycle chaincode (lscc) as follows:</p> <pre><code>2018-04-06 12:36:50.210 UTC [chaincode] Launch -&gt; ERRO 031 launchAndWaitForRegister failed Timeout expired while starting chaincode mycc:1.0(networkid:dev,peerid:org1-peer1,tx:3fa17e226a26f624d4554f7b64572672370838ddb53bc6ae21f0614c61737a51) 2018-04-06 12:36:50.211 UTC [endorser] simulateProposal -&gt; ERRO 032 failed to invoke chaincode name:"lscc" on transaction 3fa17e226a26f624d4554f7b64572672370838ddb53bc6ae21f0614c61737a51, error: Timeout expired while starting chaincode mycc:1.0(networkid:dev,peerid:org1-peer1,tx:3fa17e226a26f624d4554f7b64572672370838ddb53bc6ae21f0614c61737a51) </code></pre> <p>And chaincode container is never created.</p> <p>EDIT: Timeout issue is solved when I changed the timeout parameters as follows:</p> <p><strong>Previously</strong> (not working):</p> <p><code>CORE_CHAINCODE_DEPLOYTIMEOUT=600000 CORE_CHAINCODE_STARTUPTIMEOUT=600000</code></p> <p><strong>Correct</strong> (working):</p> <p><code>CORE_CHAINCODE_DEPLOYTIMEOUT=300s CORE_CHAINCODE_STARTUPTIMEOUT=300s</code></p> </div>


<div class="post-text" itemprop="text"> <p>I have a setup, which was working until today. Since morning I 'm not able to create new channels or install new chaincodes. Existing chaincodes are working. Getting lscc chaincode timeout error when trying to install new chaincodes or create new channel.</p> <p>Here are the logs, can someone please help?</p> <pre><code>2018-07-18 05:44:59.527 UTC [endorser] SimulateProposal -&gt; ERRO 0d0 [][51efedf7] failed to invoke chaincode name:"lscc" , error: timeout expired while executing transaction*Handler).Execute /opt/gopath/src/*ChaincodeSupport).execute /opt/gopath/src/*ChaincodeSupport).Invoke /opt/gopath/src/*ChaincodeSupport).Execute /opt/gopath/src/*SupportImpl).Execute /opt/gopath/src/*Endorser).callChaincode /opt/gopath/src/*Endorser).SimulateProposal /opt/gopath/src/*Endorser).ProcessProposal /opt/gopath/src/*expirationCheckFilter).ProcessProposal /opt/gopath/src/*filter).ProcessProposal /opt/gopath/src/ /opt/gopath/src/*Server).processUnaryRPC /opt/gopath/src/*Server).handleStream /opt/gopath/src/*Server).serveStreams.func1.1 /opt/gopath/src/ runtime.goexit /opt/go/src/runtime/asm_amd64.s:2361 error sending failed to execute transaction 51efedf7934af10cc3d6627c85262df4542d3186127c94f2a7156bb0111b2f72*ChaincodeSupport).Execute /opt/gopath/src/*SupportImpl).Execute /opt/gopath/src/*Endorser).callChaincode /opt/gopath/src/*Endorser).SimulateProposal /opt/gopath/src/*Endorser).ProcessProposal /opt/gopath/src/*expirationCheckFilter).ProcessProposal /opt/gopath/src/*filter).ProcessProposal /opt/gopath/src/ /opt/gopath/src/*Server).processUnaryRPC /opt/gopath/src/*Server).handleStream /opt/gopath/src/*Server).serveStreams.func1.1 /opt/gopath/src/ runtime.goexit /opt/go/src/runtime/asm_amd64.s:2361 </code></pre> </div>


![图片说明]( ![图片说明]( 用matlab实现,对提取出来的图像链码文件test.csv中的链码进行BWT转换。 提取链码的代码如下: clc;clear;close all; % 测试图像预处理 im0=imread('2.png'); im=im2bw(im0);%二值化 figure(1);imshow(im);title('原图') [M,N]=size(im); % 求轮廓 B=bwboundaries(im);%寻找轮廓,B为存储轮廓信息的结构体 im1=zeros(M,N); for k=1:length(B) boundary=B{k};%第k个轮廓,两列,存储轮廓各像素坐标 %标注第k个轮廓像素所在位置为1 for l=1:length(boundary) im1(boundary(l,1),boundary(l,2))=1; end end figure(2);imshow(im1);title('轮廓图')%绘制轮廓图 % 求链码 [nr,nc]=size(B{1}); Code=size(1,nr); for i=1:nr if i==1 %起点到终点的链码特殊处理 x=B{1}(i,1)-B{1}(nr,1); %x=-1,0,1 y=B{1}(i,2)-B{1}(nr,2); %y=-1,0,1 elseif i~=1 x=B{1}(i,1)-B{1}(i-1,1); %x=-1,0,1 y=B{1}(i,2)-B{1}(i-1,2); %y=-1,0,1 end if x==1 && y==0 Code(i)=0; elseif x==1 && y==1 Code(i)=1; elseif x==0 && y==1 Code(i)=2; elseif x==-1 && y==1 Code(i)=3; elseif x==-1 && y==0 Code(i)=4; elseif x==-1 && y==-1 Code(i)=5; elseif x==0 && y==-1 Code(i)=6; elseif x==1 && y==-1 Code(i)=7; end end csvwrite('test.csv',Code)

Hyperledger Fabric链码-无法使用InvokeChaincode从另一个链码读取数据。 状态200,但有效载荷为空

<div class="post-text" itemprop="text"> <p>I am working on a chaincode where I need to read data previously stored from another one. </p> <p>They are instantiated on the same channel and I can use them individually to read and write data separately. </p> <p>You can replicate it using the <code>marble</code> chaincode, installing it with different names on the same peer.</p> <p>In one of them (A) I implemented invokeChaincode(B), to read data stored by B in this way:</p> <pre><code>func (chaincode *SimpleChaincode) queryMarblesFromAnotherChaincode(stub shim.ChaincodeStubInterface, args []string) peer.Response { queryMarble := "queryMarble" if len(args) != 3 { return shim.Error("Incorrect number of arguments. Expecting 3") } chaincodeName := args[0] chaincodeArgs := toChaincodeArgs(queryMarble, args[1]) chaincodeChannel := args[2] response := stub.InvokeChaincode(chaincodeName, chaincodeArgs, chaincodeChannel) if response.Status != shim.OK { return shim.Error(fmt.Sprintf("Failed to query chaincode: %s", response.Payload)) } return shim.Success(response.Payload) } </code></pre> <p>Running that method using <code>peer chaincode invoke ..</code> , I receive <code>status: 200</code>, but Payload is empty. </p> <p>Could you advise on what I am doing wrong?</p> </div>


<div class="post-text" itemprop="text"> <p>I'm trying to instantiate the chaincode, but an error happens, and I can not find solutions to it.</p> <p>ubuntu 18.04<br> hyperledger fabric 1.4.1<br> I've followed the document and it succeeded last week. The same code works well on another computer.<br> Before instantiate, everything went on well including making channels. I have not applied node in my project.</p> <p>Codes:</p> <pre><code>root@c442cc2748e7:/opt/gopath/src/ peer chaincode instantiate -o --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C $CHANNEL_NAME -n mycc -l golang -v 1.0 -c '{"Args":[]}' -P "AND ('Org1MSP.peer','Org2MSP.peer')" 2019-05-23 06:31:31.382 UTC [chaincodeCmd] checkChaincodeCmdParams -&gt; INFO 001 Using default escc 2019-05-23 06:31:31.382 UTC [chaincodeCmd] checkChaincodeCmdParams -&gt; INFO 002 Using default vscc Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 0 </code></pre> </div>


<div class="post-text" itemprop="text"> <p>When I try to modify the example described in <a href="" rel="nofollow noreferrer">this hyperledger example</a> I get some error when adding <a href="" rel="nofollow noreferrer">this external library</a> in order to get the History of the chaincode state.<br> Why does that happen?</p> <p>I add the library with govendor, but when I run this command:</p> <pre><code>docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/" cli peer chaincode instantiate -o -C mychannel -n $CC_NAME -l "$LANGUAGE" -v 1.0 -c $INIT_STR -P "OR ('Org1MSP.member','Org2MSP.member')" </code></pre> <p>I get this error:</p> <blockquote> <p>Error: Error endorsing chaincode:<br> rpc error: code = Unknown desc = error starting container: Failed to generate platform-specific docker build: Error returned from build: 2 "# firstExample chaincode/input/src/firstExample/firstStep.go:104:11: cannot assign *"".KeyModification to kM (type *"firstExample/vendor/".KeyModification) in multiple assignment chaincode/input/src/firstExample/firstStep.go:146:11: cannot assign *"".KeyModification to kM (type *"firstExample/vendor/".KeyModification) in multiple assignment chaincode/input/src/firstExample/firstStep.go:156:11: cannot assign *"".KeyModification to kM (type *"firstExample/vendor/".KeyModification) in multiple assignment</p> </blockquote> <p>I have some troubles with this. I'm sure that the library is imported because if I build the chaincode written in go with the command:</p> <pre><code>go build </code></pre> <p>I get no errors.<br> Please help me!</p> </div>


<div class="post-text" itemprop="text"> <p>I am getting an error while building my go code on an Ubuntu machine. I have check GOPATH variables and everything seems fine. Below is stack trace of error I am getting:</p> <p>/go/src/Chaincodeexample$ go build # _/home/ubuntu/go/src/Chaincodeexample</p> <pre><code>./Samplesupplychain.go:13:14: cannot refer to unexported name shim.logger ./Samplesupplychain.go:91:5: syntax error: non-declaration statement outside function body </code></pre> <p>Below is my code :</p> <pre><code>import( "errors" "fmt" "encoding/json" "" ) var logger = shim.logger("my logger") //Create a struct for these 2 values type testuser struct{ Username string `json:"username"` Fileuploaded string `json:"fileuploaded"` } //A function to create a user on the ledger func CreateUser(stub shim.ChaincodeStubInterface, args []string) ([]byte, error){ if len(args) &lt; 2 { logger.Error("Invalid number of args") return nil, errors.New("Expected atleast 1 argument for user creation") } var Username = args[0] var UsernameInput = args[1] //trying to understand err := stub.PutState(Username, []byte(UsernameInput)) if err != nil { logger.Error("Could not save new User to ledger", err) return nil, err } var customEvent = "{eventType: 'UserCreation', description:" + Username + "' Successfully created'}" err = stub.SetEvent("evtSender", []byte(customEvent)) if err != nil { return nil, err } logger.Info("Successfully saved a supply chain user") return nil, nil } func Checkuploadstatus(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) { logger.Debug("Entering supply-chain application") if len(args) &lt; 1 { logger.Error("Invalid number of arguments") return nil, errors.New("Missing details") } var Fileuploadedstatus = args[0] bytes, err := stub.GetState(Fileuploadedstatus) if err != nil { logger.Error("Could not fetch Fileuploadedstatus with "+ Fileuploadedstatus +" from ledger", err) return nil, err } return bytes, nil } func (t *testuser) Init(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) { return nil, nil } func (t *testuser) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) { if function == "Checkuploadstatus" { return Checkuploadstatus(stub, args) } return nil, nil } func (t *testuser) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) { if function == "CreateUser" { return CreateUser(stub, args) } else { return nil, errors.New(username + " does not have access to create a User") } } return nil, nil } </code></pre> <p>Give me idea to resolve this.</p> </div>

Hyperledger Fabric registerChaincodeEvent()方法未从链码获取事件

<div class="post-text" itemprop="text"> <p>After deploying my chaincode successfully and being able to perform some get from its data (all data returned are correct), I am not able to check if an event is emitted. The function inside <code>Invoke()</code> is <code>queryAllMachines()</code> and if I call just this function it returns a set of machines (the set of machine insert in the method InitLedger())</p> <p>I follow the documentation and my chaincode (in go) should emit an event in this code line inside its <code>queryAllMachines()</code> function:</p> <pre><code>func (s *testContract) queryAllMachines(APIstub shim.ChaincodeStubInterface) sc.Response { fmt.Println("inside queryAllMachines ") ... err = APIstub.SetEvent("evtsender", []byte("adadsads")) if err != nil { return shim.Error("event not set") } fmt.Printf("No errors ") } </code></pre> <p>This code always prints "no errors", so I suppose the events is emitted rightly.</p> <p>Then in my .js file for query i have the request:</p> <pre><code>let request = { chaincodeId: 'oraclize-test-integration', fcn: 'queryAllMachines', args: [''], txId: tx_object }; </code></pre> <p>Then this is the part of my .js file where I have the problem and where I want to launch <code>registerChaincodeEvent()</code>:</p> <pre><code>let event_monitor = new Promise((resolve, reject) =&gt; { let regid = null; let handle = setTimeout(() =&gt; { if (regid) { // might need to do the clean up this listener channel_event_hub.unregisterChaincodeEvent(regid); console.log('Timeout - Failed to receive the chaincode event'); } reject(new Error('Timed out waiting for chaincode event')); }, 20000); regid = channel_event_hub.registerChaincodeEvent('oraclize-test-integration', 'evtsender', (event, block_num, txnid, status) =&gt; { // This callback will be called when there is a chaincode event name // within a block that will match on the second parameter in the registration // from the chaincode with the ID of the first parameter. console.log('Successfully got a chaincode event with transid:' + txnid + ' with status:' + status); // might be good to store the block number to be able to resume if offline storeBlockNumForLater(block_num); // to see the event payload, the channel_event_hub must be connected(true) let event_payload = event.payload.toString('utf8'); if (event_payload.indexOf('CHAINCODE') &gt; -1) { clearTimeout(handle); // Chaincode event listeners are meant to run continuously // Therefore the default to automatically unregister is false // So in this case we want to shutdown the event listener once // we see the event with the correct payload channel_event_hub.unregisterChaincodeEvent(regid); console.log('Successfully received the chaincode event on block number ' + block_num); resolve('RECEIVED'); } else { console.log('Successfully got chaincode event ... just not the one we are looking for on block number ' + block_num); } }, (error) =&gt; { clearTimeout(handle); console.log('Failed to receive the chaincode event ::' + error); reject(error); } // no options specified // startBlock will default to latest // endBlock will default to MAX // unregister will default to false // disconnect will default to false ); }); // build the promise to send the proposals to the orderer let send_trans = channel.sendTransaction({ proposalResponses: query_responses[0], proposal: query_responses[1] }); // now that we have two promises all set to go... execute them return Promise.all([event_monitor, send_trans]); </code></pre> <p>The error that appears is: </p> <blockquote> <p>Timeout - Failed to receive the chaincode event (node:9180) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Timed out waiting for chaincode event (node:9180) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with anon-zero exit code.</p> </blockquote> <p>So the functions times out in this part of the code, even if I launch another .js file that execute successfully the call to <code>queryAllMachines()</code> function: </p> <pre><code>let handle = setTimeout(() =&gt; { if (regid) { // might need to do the clean up this listener channel_event_hub.unregisterChaincodeEvent(regid); console.log('Timeout - Failed to receive the chaincode event'); } reject(new Error('Timed out waiting for chaincode event')); }, 20000); </code></pre> </div>

fabric第一个网络的例子中,当检查当前节点(默认为已加入到哪些通道中(命令# peer channel list)出现以下错误,请问如何解决?


Hyperledger Fabric 2.0中是否启用了系统链码插件?

<div class="post-text" itemprop="text"> <p>In hyperledger fabric 1.4 they had disabled system chaincode plugins and you had to compile the peer like this:</p> <pre><code>GOPATH+="pluginsenabled" make peer </code></pre> <p>Is this still the case in version 2.0?</p> </div>


<div class="post-text" itemprop="text"> <p>I want to test my chaincode by Golang, so I have used Hyperledger fabric chaincodedev test.</p> <p>All functions of chaincode (invoke, query, etc.) worked, but there are no logs and messages of chaincode on console.</p> <p>Logging is set to "debug" in every case.</p> <p>I want to print out result message of invoke, query on console, but just print out message: "myc"; "myc"; "myc"; ...</p> <pre><code>2019-03-15 18:07:04.550 UTC [shim] setupChaincodeLogging -&gt; INFO 001 Chaincode log level not provided; defaulting to: INFO 2019-03-15 18:07:04.550 UTC [shim] setupChaincodeLogging -&gt; INFO 002 Chaincode (build level: ) starting up ... 2019-03-15 18:07:04.551 UTC [bccsp] initBCCSP -&gt; DEBU 001 Initialize BCCSP [SW] 2019-03-15 18:07:04.551 UTC [grpc] DialContext -&gt; DEBU 002 parsed scheme: "" 2019-03-15 18:07:04.551 UTC [grpc] DialContext -&gt; DEBU 003 scheme "" not registered, fallback to default scheme 2019-03-15 18:07:04.551 UTC [grpc] watcher -&gt; DEBU 004 ccResolverWrapper: sending new addresses to cc: [{peer:7052 0 &lt;nil&gt;}] 2019-03-15 18:07:04.551 UTC [grpc] switchBalancer -&gt; DEBU 005 ClientConn switching balancer to "pick_first" 2019-03-15 18:07:04.551 UTC [grpc] HandleSubConnStateChange -&gt; DEBU 006 pickfirstBalancer: HandleSubConnStateChange: 0xc00038eca0, CONNECTING 2019-03-15 18:07:04.552 UTC [grpc] HandleSubConnStateChange -&gt; DEBU 007 pickfirstBalancer: HandleSubConnStateChange: 0xc00038eca0, READY </code></pre> <p>myc myc myc myc myc myc myc</p> <p><a href="" rel="nofollow noreferrer">enter image description here</a></p> </div>

识别Hyperledger Fabric V1.0链码中的调用同级/组织

<div class="post-text" itemprop="text"> <p>Is there any way to know the invoking peer and organisation inside <strong>golang</strong> <strong>chaincode</strong> for <strong>Hyperledger Fabric V1.0</strong>?</p> </div>


软件测试2小时入门,让您快速了解软件测试基本知识,有系统的了解; SQL一小时,让您快速理解和掌握SQL基本语法 jmeter性能测试 ,让您快速了解主流来源性能测试工具jmeter 测试管理工具-禅道,让您快速学会禅道的使用,学会测试项目、用例、缺陷的管理、



Java 最常见的 200+ 面试题:面试必备

这份面试清单是从我 2015 年做了 TeamLeader 之后开始收集的,一方面是给公司招聘用,另一方面是想用它来挖掘在 Java 技术栈中,还有那些知识点是我不知道的,我想找到这些技术盲点,然后修复它,以此来提高自己的技术水平。虽然我是从 2009 年就开始参加编程工作了,但我依旧觉得自己现在要学的东西很多,并且学习这些知识,让我很有成就感和满足感,那所以何乐而不为呢? 说回面试的事,这份面试...




总课时80+,提供源码和相关资料 本课程从Python零基础到纯Python项目实战。内容详细,案例丰富,覆盖了Python知识的方方面面,学完后不仅对Python知识有个系统化的了解,让你从Python小白变编程大牛! 课程包含: 1.python安装 2.变量、数据类型和运算符 3.选择结构 4.循环结构 5.函数和模块 6.文件读写 7.了解面向对象 8.异常处理


获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:csdn590)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!


本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。






设置复位开关。当按下复位开关时,秒表清零并做好计时准备。在任何情况下只要按下复位开关,秒表都要无条件地进行复位操作,即使是在计时过程中也要无条件地进行清零操作。 设置启/停开关。当按下启/停开关后,将




董付国系列教材《Python程序设计基础》、《Python程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。

计算机操作系统 第三版.pdf

计算机操作系统 第三版 本书全面介绍了计算机系统中的一个重要软件——操作系统(OS),本书是第三版,对2001年出版的修订版的各章内容均作了较多的修改,基本上能反映当前操作系统发展的现状,但章节名称基

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂


本套课程的设计完全是为初学者量身打造,课程内容由浅入深,课程讲解通俗易懂,代码实现简洁清晰。通过本课程的学习,学员能够入门微信公众平台开发,能够胜任企业级的订阅号、服务号、企业号的应用开发工作。 通过本课程的学习,学员能够对微信公众平台有一个清晰的、系统性的认识。例如,公众号是什么,它有什么特点,它能做什么,怎么开发公众号。 其次,通过本课程的学习,学员能够掌握微信公众平台开发的方法、技术和应用实现。例如,开发者文档怎么看,开发环境怎么搭建,基本的消息交互如何实现,常用的方法技巧有哪些,真实应用怎么开发。


【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑




&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!


发现网上很多Java面试题都没有答案,所以花了很长时间搜集整理出来了这套Java面试题大全,希望对大家有帮助哈~ 本套Java面试题大全,全的不能再全,哈哈~ 一、Java 基础 1. JDK 和 JRE 有什么区别? JDK:Java Development Kit 的简称,java 开发工具包,提供了 java 的开发环境和运行环境。 JRE:Java Runtime Environ...

定量遥感中文版 梁顺林著 范闻捷译


GIS程序设计教程 基于ArcGIS Engine的C#开发实例

张丰,杜震洪,刘仁义编著.GIS程序设计教程 基于ArcGIS Engine的C#开发实例.浙江大学出版社,2012.05


系列课程主要分为3大阶段:(1)首先掌握计算机视觉必备算法原理,结合Opencv进行学习与练手,通过实际视项目进行案例应用展示。(2)进军当下最火的深度学习进行视觉任务实战,掌握深度学习中必备算法原理与网络模型架构。(3)结合经典深度学习框架与实战项目进行实战,基于真实数据集展开业务分析与建模实战。整体风格通俗易懂,项目驱动学习与就业面试。 建议同学们按照下列顺序来进行学习:1.Python入门视频课程 2.Opencv计算机视觉实战(Python版) 3.深度学习框架-PyTorch实战/人工智能框架实战精讲:Keras项目 4.Python-深度学习-物体检测实战 5.后续实战课程按照自己喜好选择就可以




微信小程序番茄时钟视频教程,本课程将带着各位学员开发一个小程序初级实战类项目,针对只看过官方文档而又无从下手的开发者来说,可以作为一个较好的练手项目,对于有小程序开发经验的开发者而言,可以更好加深对小程序各类组件和API 的理解,为更深层次高难度的项目做铺垫。

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?




用verilog HDL语言编写的秒表




相关热词 c# 解析cad c#数字格式化万 c#int转byte c#格式化日期 c# wpf 表格 c# 实现ad域验证登录 c#心跳包机制 c#使用fmod.dll c#dll vb 调用 c# outlook