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

Let's suppose the following network architecture:

A -> Chaincode1 -> fabcar

A is the application, Chaincode1 is a chaincode in Go and fabcar is a chaincode in Nodejs. They are on the same channel: "mychannel".

When is performed the operation APIstub.InvokeChaincode from the Chaincode1 such as APIstub.InvokeChaincode("fabcar", chainCodeArgs, "mychannel"), is there a possibility for the chaincode fabcar (the chaincode called) to get the id of the the caller chaincode?

The getCreator() method in the fabcar chaincode just returns the caller organization; but the information needed is the chaincode id or some info only connected to the Chaincode1.


UPDATE

I tryed the getSignedProposal() method as written in the official documentation of hyperledger: https://fabric-shim.github.io/ChaincodeStub.html#getSignedProposal__anchor

The getSignedProposal() method returns a fully decoded object of the signed transaction proposal of type SignedProposal. The SignedProposal object represents the request object sent by the client application to the chaincode.

Executing the following code:

const proposal = stub.getSignedProposal();
console.log("signed proposal: ", proposal);

the result is the following:

signed proposal:  { signature: <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 ... >,
  proposal:
   { header: { signature_header: [Object], channel_header: [Object] },
     payload: { input: [Object], TransientMap: [Object] } } }

Seems really difficult to understand which is the info where is possible to retrieve the calling chaincode ID. Here is the link of the doc concerning the SignedProposal type: https://fabric-shim.github.io/global.html#SignedProposal

douxi5940
douxi5940 投票为-1的人至少可以解释我的问题出了什么问题,以便我可以纠正?矿山似乎是所有社区都可能感兴趣的问题。感谢您的理解。
接近 2 年之前 回复

2个回答



否,当前无法执行此操作,因为链码本身没有身份。 </ p>
</ div>

展开原文

原文

No, it is not currently possible to do this because the chaincode itself does not have an identity, per se.

dongpu1331
dongpu1331 从理论上讲,您应该能够从SingedProposal中提取信息,在cc2cc刚刚从另一个传递到另一个的情况下,因此第二个可以使用它。
接近 2 年之前 回复
dsx666666
dsx666666 因此,没有办法知道链码以哪种方式称为另一个。 这听起来真的很糟糕,如果有人想通过回调进行回复...
接近 2 年之前 回复




fabcar链代码中的 getCreator()</ code>函数只是返回调用者组织,我 想要chaincode ID或仅连接到Chaincode1的某些信息。</ p>
</ blockquote>

您可以使用 GetSignedProposal </ code>方法,即:</ p> \ n

  //交易提议的数据元素部分。
GetSignedProposal()(* pb.SignedProposal,错误)
</ code> </ pre>

< code> SignedProposal </ code>包含原始链代码客户端发送的交易建议的信息,如果链代码被简单地转发到链代码调用 SignedProposal </ code>,则可以提取先前链代码的信息。</ p> \ n

注意</ strong>:如果您具有复杂的链码调用链,例如 chaincode1 </ em>调用 chaincode2 </ em>,后者调用chaincode3, SignedProposal </ code>将包含 chaincode1 </ em>的信息,即您不会了解 > chaincode2 </ em>。</ p>
</ div>

展开原文

原文

The getCreator() function in the fabcar chaincode just returns the caller organization, I want the chaincode id or some info only connected to the Chaincode1.

You can use GetSignedProposal method, i.e.:

// data elements part of a transaction proposal.
GetSignedProposal() (*pb.SignedProposal, error)

the SignedProposal contains information of the original chaincode client sent transaction proposal, in case of chaincode to chaincode invocation SignedProposal simply forwarded, hence you can extract information of previous chaincode.

NOTE: If you have complex chain of chaincodes invocations, e.g. chaincode1 calls chaincode2 which calls chaincode3, SignedProposal will contain information of chaincode1 i.e. you won't know about chaincode2.

doujie1917
doujie1917 不跟随,你能解释吗?
大约一年之前 回复
drccfl9407
drccfl9407 这样,您可以获得调用者的身份。 真好。 但是谁将成为第二个chaincode执行的签名人?
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
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="https://chainhero.io/2017/07/tutorial-build-blockchain-app/" rel="nofollow noreferrer">Fabric Basic App - Tutorial</a> <a href="https://chainhero.io/2017/07/tutorial-build-blockchain-app/" rel="nofollow noreferrer">https://chainhero.io/2017/07/tutorial-build-blockchain-app/</a></p> <p><a href="https://github.com/chainHero/heroes-service/" rel="nofollow noreferrer">Fabric Basic App using GoLang SDK - Code</a> <a href="https://github.com/chainHero/heroes-service/" rel="nofollow noreferrer">https://github.com/chainHero/heroes-service/</a></p> <p><a href="https://github.com/hyperledger/fabric-sdk-go" rel="nofollow noreferrer">GoLang SDK - Official SDK</a> <a href="https://github.com/hyperledger/fabric-sdk-go" rel="nofollow noreferrer">https://github.com/hyperledger/fabric-sdk-go</a></p> </div>

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

<div class="post-text" itemprop="text"> <p>I am working with this blockchain application for medics traceability (<a href="https://github.com/rastringer/medication-blockchain" rel="nofollow noreferrer">https://github.com/rastringer/medication-blockchain</a>) based on hyperledger fabric blockchain. </p> <p>It's exactly the same app as this project (<a href="https://github.com/hyperledger/education/tree/master/LFS171x/fabric-material/tuna-app" rel="nofollow noreferrer">https://github.com/hyperledger/education/tree/master/LFS171x/fabric-material/tuna-app</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="https://stackoverflow.com/questions/47330576/how-to-upgrade-a-chaincode-after-modification">How to upgrade a chaincode after modification?</a>)</p> <p>Anyhelp is welcome, thank you in advance ;)</p> </div>

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>

hyperledger fabric超级账本中使用putState无法保存数据?

最近在学习hyperledger fabric,遇到了好多坑。其中在链码中使用putState去保存一头猪的数据时,始终无法成功,但在初始化链码时却可以正常保存数据。 chaincode中保存猪的信息的函数: ``` //记录一头猪的信息 async recordPig(stub, args) { var pig={ breed:"大白猪", //猪的品种 birthday: "2020-4-15", //猪的出生日期 feed: "s", //猪饲料的品种 drug: "a", //养殖用药 feederId: "但是", //养殖工id farmId: "第三方", //养殖场id weight:"sdf", //猪的出厂体重 health: "sdfs", //猪的健康状态 holder:"dsdf", state:"sdfs"//状态 }; await stub.putState('PIG'+3, Buffer.from(JSON.stringify(pig))); console.info('Added <--> ', pig); } ``` server.js中的部分代码: ``` var query=async(fcn,args)=>{ try{ var state_store=await Fabric_Client.newDefaultKeyValueStore({path:store_path}); fabric_client.setStateStore(state_store); var crypto_suite=Fabric_Client.newCryptoSuite(); var crypto_store=Fabric_Client.newCryptoKeyStore({path:store_path}); crypto_suite.setCryptoKeyStore(crypto_store); fabric_client.setCryptoSuite(crypto_suite); var user_from_store=await fabric_client.getUserContext('user1',true); if(user_from_store&&user_from_store.isEnrolled()){ console.log('Successfully loaded user1 from persistence'); member_user=user_from_store; }else{ throw new Error('Failed to get user1... run registerUser.js'); } const request={ chaincodeId:'psctscc', fcn:fcn, //修改为要调用的chaincode中的方法 args:args }; var query_responses=await channel.queryByChaincode(request); console.log("Query has completed, checking results"); console.log(query_responses); console.log(query_responses.length); if(query_responses&&query_responses.length==1){ if(query_responses[0] instanceof Error){ console.error("error from query = ",query_responses[0]); }else{ console.log("Response is ",query_responses[0].toString()); return query_responses[0].toString(); } }else{ console.log("No payloads were returned from query"); } }catch(err){ console.error('Failed to query successfully ::'+err); } }; ``` 运行结果: ![图片说明](https://img-ask.csdn.net/upload/202004/19/1587291237_801760.png)

如何从Hyperledger Fabric分类帐中获取数据并更新

<div class="post-text" itemprop="text"> <pre><code>package main import ( "fmt" "encoding/json" "strconv" "github.com/hyperledger/fabric/core/chaincode/shim" pb "github.com/hyperledger/fabric/protos/peer" ) // ============================================================================================================================ // write() - genric write variable into ledger // // Shows Off PutState() - writting a key/value into the ledger // // Inputs - Array of strings // 0 , 1 // key , value // "abc" , "test" // ============================================================================================================================ func write(stub shim.ChaincodeStubInterface, args []string) pb.Response { var value,key string var err error var keys = 1 </code></pre> <p>The following is my write method in hyperledger fabric i have assigned the keys = 1 </p> <p>2) Always my method is making the keys = 1 so i should get the key from fabric and assign it to keys variable can anyone help me with this ISSUE or provide any documention how to do that </p> </div>

无法安装fabric-sdk-go及其依赖项

<div class="post-text" itemprop="text"> <p>I am trying to download <code>fabric-sdk-go</code> library and all its dependency with the below command in a linux VM. </p> <pre><code>go get -u github.com/hyperledger/fabric-sdk-go/... </code></pre> <p>It is giving the below error. </p> <pre><code># github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations ../github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations/system.go:227:23: not enough arguments in call to s.statsd.SendLoop have (&lt;-chan time.Time, string, string) want (context.Context, &lt;-chan time.Time, string, string) # github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util ../github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util/csp.go:47:8: cannot convert nil to type csr.KeyRequest ../github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util/csp.go:132:37: cannot use req.KeyRequest (type *csr.KeyRequest) as type csr.KeyRequest in argument to getBCCSPKeyOpts </code></pre> <p>Could this be because of <code>go</code> version mismatch or something? Here is the <code>go version</code> I am using the in linux VM. </p> <pre><code>go version go1.12.8 linux/amd64 </code></pre> </div>

我用对hyperledger fabric性能进行了测试,但是测试结果并不是很懂,求解答

![图片说明](https://img-ask.csdn.net/upload/201812/05/1543973916_452553.png) 在这张图中 我对Hyperledger Fabric进行了性能测试,得出了图中的结果,但测试结果并不很了解 1.docker中的名称是什么意思?peer0.org1.example.com和dev.peer0.org1.example.com以及couchdb.peer0.org1.example.com有什么区别? 2.cpu的占有率为什么会超过100%,为什么会有cpu(max)和cpu(avg)? 3.traffic in和traffic out什么意思? 4.Disc Read什么意思?

hyperledger fabric1.4新功能测试

有测试过新功能吗?matbles02_private测试用例里面,在私有数据集合配置文件里将memberReadOnly设置为false,org2里提交proposal的节点为什么还是没有可读权限

Hyperledger-fabric无法实例化链码

<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="https://stackoverflow.com/questions/48852755/oci-runtimer-error-when-installing-hyperledger-chaincode-via-java-sdk%5D">OCI Runtimer Error when installing Hyperledger Chaincode via Java-SDK</a> and [<a href="https://stackoverflow.com/questions/47593097/oci-runtime-error-when-sending-hyperledger-fabrics-chaincode-instantiation-requ%5D">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 "github.com/hyperledger/fabric/core/chaincode/shim" and "github.com/hyperledger/fabric/protos/peer"</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="http://hyperledger-fabric-docs.readthedocs.io/en/latest/chaincode4noah.html%5D" rel="nofollow noreferrer">http://hyperledger-fabric-docs.readthedocs.io/en/latest/chaincode4noah.html]</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 172.18.0.6:41228 couchdb | [notice] 2018-04-17T13:29:43.624931Z nonode@nohost &lt;0.16042.3&gt; b5d38cd27d couchdb:5984 172.18.0.5 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 172.18.0.6:41228, 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 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>

我现在将项目部署到Hyperledger Fabric上,请问我如何测试该平台性能?

我现在将项目部署到Hyperledger Fabric上,请问我如何测试该平台性能?我用什么软件来测试该平台性能,具体过程越具体越好,谢谢

如何在Hyperledger Fabric V0.6 Chaincode实现中查询一段时间的状态

<div class="post-text" itemprop="text"> <p>I am using the Hyperledger fabric V0.6 service in IBM-bluemix and deployed my go language chaincode to the peer as provided in the bluemix documentation. Since I am very new to this implementation, I could find only the <strong>PutState</strong> and <strong>GetState</strong> methods there in <a href="https://github.com/hyperledger/fabric/tree/v0.6/core/chaincode/shim" rel="nofollow noreferrer"><strong>ChaincodeStubInterface</strong></a>.<br> But my requirement is to query the states for a period of time.<br> eg:<br> 11-Feb-2017 10:00:00 : created Asset1<br> 11-Feb-2017 12:00:00 : created Asset2<br> 12-Feb-2017 10:00:00 : Modified Asset1<br> 13-Feb-2017 13:00:00 : Created Asset3<br> ....<br> 15-Feb-2017 14:00:00 : Created AssetN<br></p> <p>Now I want to query the states for the range 12-Feb-2017 00:00:00 to current timestamp. I have gone through lots of documentations but I didn't find any solution for this.</p> <p>How can I get this data? Thanks in advance. </p> </div>

使用IDE进行Hyperledger Fabric 源码调试

最近想研究一下fabric的源代码,打算使用IDE来分析链码的执行过程(不使用docker容器),想请问各位大神,有没有知道具体应该怎么做。

如何下载fabric-sdk-go的所有依赖项?

<div class="post-text" itemprop="text"> <p>I used command "<strong>go get github.com/hyperledger/fabric-sdk-go</strong>" to download fabric-sdk-go and its dependencies. No error happened.</p> <p>In the golang documentation( <a href="https://golang.org/cmd/go/#hdr-Download_and_install_packages_and_dependencies" rel="nofollow noreferrer">https://golang.org/cmd/go/#hdr-Download_and_install_packages_and_dependencies</a> ), it said that "Get downloads the packages named by the import paths, along with their dependencies. It then installs the named packages, like 'go install'."</p> <p>So I originally thought that all the dependencies of fabric-sdk-go would be downloaded <strong>recursively</strong>. But the fact proved that I was wrong.</p> <p>When I ran command "go install ./..." under fabric-sdk-go directory, many errors "cannot find package" were displayed: <a href="https://i.stack.imgur.com/nlrwu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nlrwu.png" alt="enter image description here"></a> So my questions are:</p> <ol> <li><p>Does "go get" download dependencies <strong>recursively</strong> or not?</p></li> <li><p>How to download <strong>all</strong> the dependencies of fabric-sdk-go, instead of using "go get [a_dependency_package]" to download every single dependency one by one?</p></li> </ol> <p>Thanks very much.</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>

如何在Hyperledger Fabric代码上运行测试?

<div class="post-text" itemprop="text"> <p>I'm sorry to interrupt you guys, but I wish to know how can I run the Hyperledger Fabric code originally.</p> <p>I download all the Go, Docker, Docker composer, VSCode and those plugins for Go. And when I using <code>go test consensus_test.go</code> in <code>/orderer/solo</code>.</p> <p>It will give me these answer, so how can I run these code? Thank you.</p> <p><img src="https://i.stack.imgur.com/SFCyB.png" alt=""></p> <pre><code>$fabric@ubuntu:~/go/src/github.com/hyperledger/fabric/orderer/consensus/solo$ go test consensus_test.go # command-line-arguments ./consensus_test.go:35:26: undefined: pkgLogID ./consensus_test.go:45:48: undefined: chain ./consensus_test.go:74:8: undefined: newChain ./consensus_test.go:95:11: undefined: New ./consensus_test.go:116:8: undefined: newChain ./consensus_test.go:134:8: undefined: newChain ./consensus_test.go:178:8: undefined: newChain ./consensus_test.go:220:8: undefined: newChain ./consensus_test.go:256:8: undefined: newChain ./consensus_test.go:293:8: undefined: newChain ./consensus_test.go:293:8: too many errors FAIL command-line-arguments [build failed] fabric@ubuntu:~/go/src/github.com/hyperledger/fabric/orderer/consensus/solo$ </code></pre> </div>

如何在Fabric GO SDK中添加认可策略JSON?

<div class="post-text" itemprop="text"> <p>I am currently trying to add an endorsement policy json in Go SDK. But not able to find proper api in Hyperledger Fabric Go.</p> <p>As in Node.js sendTransactionProposal() api is available to add the endorsement policy JSON. Similarly in Fabric Go-SDK, how to use this endorsement policy json.</p> <pre><code>{ identities: [{ role: { name: 'member', mspId: 'Org1MSP' } }, { role: { name: 'member', mspId: 'Org2MSP' } } ], policy: { '2-of': [{ 'signed-by': 0 }, { 'signed-by': 1 }] } } </code></pre> <p>please suggest me some solution</p> </div>

在HyperLedger Fabric中访问外部Api

<div class="post-text" itemprop="text"> <p>I am trying to access the following Api via hyperLedger Fabric chaincode :<a href="http://api.open-notify.org/astros.json.However" rel="nofollow noreferrer">http://api.open-notify.org/astros.json.However</a> I come up with following error </p> <p>panic: Get <a href="http://api.open-notify.org/astros.json" rel="nofollow noreferrer">http://api.open-notify.org/astros.json</a>: proxyconnect tcp: dial tcp: i/o timeout</p> <p>I have tried multiple ways to resolve proxy but it always times out.</p> <p>Can anybody suggest a fix ?</p> <p>Thanks in advance.</p> </div>

HyperLedger fabric 1.0 部署问题

![各位大牛我在部署HyperLedger fabric 1.0时,执行./byfn.sh -m up 时包这个错怎么回事?麻烦各位大牛指教指教,谢谢了](https://img-ask.csdn.net/upload/201707/12/1499862394_291263.png)

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

汽车行驶工况构建2019 D题.zip

1. 标记0与0之间的片段位置 2.标记所之间的毛刺数的位置 3.去掉毛刺数据 速度 并生成 新的数组 4.标记时间段 5. 0与0之间 如果有不连续的时间片段 置零 先找到时间间隔 再看间隔时间对应

Python+OpenCV计算机视觉

Python+OpenCV计算机视觉系统全面的介绍。

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

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

专为程序员设计的数学课

<p> 限时福利限时福利,<span>15000+程序员的选择!</span> </p> <p> 1、原价 115 元,限时特价仅需 49 元!<br> 2、购课后添加学习助手(微信号:csdnxy68),按提示消息领取编程大礼包!并获取讲师答疑服务! </p> <p> <br> </p> <p> 套餐中一共包含5门程序员必学的数学课程(共47讲) </p> <p> 课程1:《零基础入门微积分》 </p> <p> 课程2:《数理统计与概率论》 </p> <p> 课程3:《代码学习线性代数》 </p> <p> 课程4:《数据处理的最优化》 </p> <p> 课程5:《马尔可夫随机过程》 </p> <p> <br> </p> <p> 哪些人适合学习这门课程? </p> <p> 1)大学生,平时只学习了数学理论,并未接触如何应用数学解决编程问题; </p> <p> 2)对算法、数据结构掌握程度薄弱的人,数学可以让你更好的理解算法、数据结构原理及应用; </p> <p> 3)看不懂大牛代码设计思想的人,因为所有的程序设计底层逻辑都是数学; </p> <p> 4)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; </p> <p> 5)想修炼更好的编程内功,在遇到问题时可以灵活的应用数学思维解决问题。 </p> <p> <br> </p> <p> 在这门「专为程序员设计的数学课」系列课中,我们保证你能收获到这些:<br> <br> <span> </span> </p> <p class="ql-long-24357476"> <span class="ql-author-24357476">①价值300元编程课程大礼包</span> </p> <p class="ql-long-24357476"> <span class="ql-author-24357476">②应用数学优化代码的实操方法</span> </p> <p class="ql-long-24357476"> <span class="ql-author-24357476">③数学理论在编程实战中的应用</span> </p> <p class="ql-long-24357476"> <span class="ql-author-24357476">④程序员必学的5大数学知识</span> </p> <p class="ql-long-24357476"> <span class="ql-author-24357476">⑤人工智能领域必修数学课</span> </p> <p> <br> 备注:此课程只讲程序员所需要的数学,即使你数学基础薄弱,也能听懂,只需要初中的数学知识就足矣。<br> <br> 如何听课? </p> <p> 1、登录CSDN学院 APP 在我的课程中进行学习; </p> <p> 2、登录CSDN学院官网。 </p> <p> <br> </p> <p> 购课后如何领取免费赠送的编程大礼包和加入答疑群? </p> <p> 购课后,添加助教微信:<span> csdnxy68</span>,按提示领取编程大礼包,或观看付费视频的第一节内容扫码进群答疑交流! </p> <p> <img src="https://img-bss.csdn.net/201912251155398753.jpg" alt=""> </p>

微信公众平台开发入门

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

4小时玩转微信小程序——基础入门与微信支付实战

这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

IE主页被篡改修复

IE主页修复。IE主页被篡改修复。一键修复IE主页

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

土豆SDK(Java版)-非官方

由于土豆SDK一直建设中,最近几天抽空写了一套java的SDK。包含了现有的所有请求协议。本套SDK中仅提供了oAuth的方式(引用oAuth.net的java版示例),并没有在框架中实现,涉及到登录

Java8零基础入门视频教程

这门课程基于主流的java8平台,由浅入深的详细讲解了java SE的开发技术,可以使java方向的入门学员,快速扎实的掌握java开发技术!

【数据结构与算法综合实验】欢乐连连看(C++ & MFC)案例

这是武汉理工大学计算机学院数据结构与算法综合实验课程的第三次项目:欢乐连连看(C++ & MFC)迭代开发代码。运行环境:VS2017。已经实现功能:开始游戏、消子、判断胜负、提示、重排、计时、帮助。

数学建模竞赛D题“汽车行驶工况构建

第十六届“华为杯”数学建模竞赛D题“汽车行驶工况构建”论文。论文获得比赛国家二等奖,论文为原创,仅供参考。 关键词:数据处理;降维;聚类。

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

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

Android音视频开发全套

Android平台音视频开发全套,涉及:FFmpeg软解码解码、Mediacodec硬解码编码、Openssl音频播放、OpenGL ES视频渲染、RTMP推流等核心重要知识点。

设计模式(JAVA语言实现)--20种设计模式附带源码

课程亮点: 课程培训详细的笔记以及实例代码,让学员开始掌握设计模式知识点 课程内容: 工厂模式、桥接模式、组合模式、装饰器模式、外观模式、享元模式、原型模型、代理模式、单例模式、适配器模式 策略模式、模板方法模式、观察者模式、迭代器模式、责任链模式、命令模式、备忘录模式、状态模式、访问者模式 课程特色: 笔记设计模式,用笔记串连所有知识点,让学员从一点一滴积累,学习过程无压力 笔记标题采用关键字标识法,帮助学员更加容易记住知识点 笔记以超链接形式让知识点关联起来,形式知识体系 采用先概念后实例再应用方式,知识点深入浅出 提供授课内容笔记作为课后复习以及工作备查工具 部分图表(电脑PC端查看):

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

想学好JAVA必须要报两万的培训班吗? Java大神勿入 如果你: 零基础想学JAVA却不知道从何入手 看了一堆书和视频却还是连JAVA的环境都搭建不起来 囊中羞涩面对两万起的JAVA培训班不忍直视 在职没有每天大块的时间专门学习JAVA 那么恭喜你找到组织了,在这里有: 1. 一群志同道合立志学好JAVA的同学一起学习讨论JAVA 2. 灵活机动的学习时间完成特定学习任务+每日编程实战练习 3. 热心助人的助教和讲师及时帮你解决问题,不按时完成作业小心助教老师的家访哦 上一张图看看前辈的感悟: &nbsp; &nbsp; 大家一定迫不及待想知道什么是极简JAVA学习营了吧,下面就来给大家说道说道: 什么是极简JAVA学习营? 1. 针对Java小白或者初级Java学习者; 2. 利用9天时间,每天1个小时时间; 3.通过 每日作业 / 组队PK / 助教答疑 / 实战编程 / 项目答辩 / 社群讨论 / 趣味知识抢答等方式让学员爱上学习编程 , 最终实现能独立开发一个基于控制台的‘库存管理系统’ 的学习模式 极简JAVA学习营是怎么学习的? &nbsp; 如何报名? 只要购买了极简JAVA一:JAVA入门就算报名成功! &nbsp;本期为第四期极简JAVA学习营,我们来看看往期学员的学习状态: 作业看这里~ &nbsp; 助教的作业报告是不是很专业 不交作业打屁屁 助教答疑是不是很用心 &nbsp; 有奖抢答大家玩的很嗨啊 &nbsp; &nbsp; 项目答辩终于开始啦 &nbsp; 优秀者的获奖感言 &nbsp; 这是答辩项目的效果 &nbsp; &nbsp; 这么细致的服务,这么好的氛围,这样的学习效果,需要多少钱呢? 不要1999,不要199,不要99,只要9.9 是的你没听错,只要9.9以上所有就都属于你了 如果你: 1、&nbsp;想学JAVA没有基础 2、&nbsp;想学JAVA没有整块的时间 3、&nbsp;想学JAVA没有足够的预算 还等什么?赶紧报名吧,抓紧抢位,本期只招300人,错过只有等时间待定的下一期了 &nbsp; 报名请加小助手微信:eduxy-1 &nbsp; &nbsp;

2019 AI开发者大会

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

web网页制作期末大作业

分享思维,改变世界. web网页制作,期末大作业. 所用技术:html css javascript 分享所学所得

手把手实现Java图书管理系统(附源码)

【超实用课程内容】 本课程演示的是一套基于Java的SSM框架实现的图书管理系统,主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的java人群。详细介绍了图书管理系统的实现,包括:环境搭建、系统业务、技术实现、项目运行、功能演示、系统扩展等,以通俗易懂的方式,手把手的带你从零开始运行本套图书管理系统,该项目附带全部源码可作为毕设使用。 【课程如何观看?】 PC端:https://edu.csdn.net/course/detail/27513 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 下载方式:电脑登录https://edu.csdn.net/course/detail/27513,点击右下方课程资料、代码、课件等打包下载

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

2019 Python开发者日-培训

本次活动将秉承“只讲技术,拒绝空谈”的理念,邀请十余位身处一线的Python技术专家,重点围绕Web开发、自动化运维、数据分析、人工智能等技术模块,分享真实生产环境中使用Python应对IT挑战的真知灼见。此外,针对不同层次的开发者,大会还安排了深度培训实操环节,为开发者们带来更多深度实战的机会。

C++语言基础视频教程

C++语言基础视频培训课程:本课与主讲者在大学开出的程序设计课程直接对接,准确把握知识点,注重教学视频与实践体系的结合,帮助初学者有效学习。本教程详细介绍C++语言中的封装、数据隐藏、继承、多态的实现等入门知识;主要包括类的声明、对象定义、构造函数和析构函数、运算符重载、继承和派生、多态性实现等。 课程需要有C语言程序设计的基础(可以利用本人开出的《C语言与程序设计》系列课学习)。学习者能够通过实践的方式,学会利用C++语言解决问题,具备进一步学习利用C++开发应用程序的基础。

零基础学C#编程—C#从小白到大咖

本课程从初学者角度出发,提供了C#从入门到成为程序开发高手所需要掌握的各方面知识和技术。 【课程特点】 1 由浅入深,编排合理; 2 视频讲解,精彩详尽; 3 丰富实例,轻松易学; 4 每章总结配有难点解析文档。 15大章节,228课时,1756分钟与你一同进步!

编程实现学生基本信息管理程序

编程实现学生基本信息管理程序。学生基本信息包括:学号、姓名、性别、年龄、班级、学院、专业等。具体实现的管理功能如下: (1) 输入并显示多个学生的基本信息; (2) 可根据需要实现学生信息的添加; (

android 漂亮的UI界面 完整的界面设计

声明:这也是我学习时在网上下载的,鉴于分享精神,并且觉得很不错才上传上来的。。。。。 android 漂亮的UI界面 完整的界面设计 这是一个完整的UI设计,但是没写动作,这是一个公司程序员的公司任务

Anaconda详细安装及使用教程(带图文)

Anacond的介绍 Anaconda指的是一个开源的Python发行版本,其包含了conda、Python等180多个科学包及其依赖项。 因为包含了大量的科学包,Anaconda 的下载文件比较大(约 531 MB),如果只需要某些包,或者需要节省带宽或存储空间,也可以使用Miniconda这个较小的发行版(仅包含conda和 Python)。 Conda是一个开源的包、环境管理器,可以用于...

DirectX修复工具V4.0增强版

DirectX修复工具(DirectX Repair)是一款系统级工具软件,简便易用。本程序为绿色版,无需安装,可直接运行。 本程序的主要功能是检测当前系统的DirectX状态,如果发现异常则进行修复

相关热词 c#跨线程停止timer c#批量写入sql数据库 c# 自动安装浏览器 c#语言基础考试题 c# 偏移量打印是什么 c# 绘制曲线图 c#框体中的退出函数 c# 按钮透明背景 c# idl 混编出错 c#在位置0处没有任何行
立即提问