简体   繁体   中英

How can I design a chaincode that invokes the same one on another peer?

I wrote a chaincode1 (deployed on one peer of ORG1) that accepts the invocation from a client application and I'd like to invoke the same chaincode1 on another peer of ORG1 by using the first invocation and not the client application again. This would allow me to pass some data computed by the first one to the second one. Is it possible?

A chaincode can query another chaincode (or itself) without modifying the ledger only if they both are running in the same peer .

It can even invoke another chaincode (or itself) to modify the ledger only if they both are running on the same channel in the same peer .

So it is not possible .

Anyway, maybe you have some misconception in mind. All peers joined to the same channel get synchronized after a block has been committed, so that all of them share the same channel ledger (chain and public world state). So maybe you don't need that feature if both peers are joined to the same channel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM