hyperledger-labs / convector

Smart Contract Systems the easy way. Open source development framework.
Other
146 stars 45 forks source link

Inter chaincode invokations #78

Closed diestrin closed 5 years ago

diestrin commented 5 years ago

Proposed changes

To be able to invoke a chaincode from inside another chaincode using convector APIs. This was already possible using the stub object, but this ads some shortcuts to do it easily.

Types of changes

What types of changes does your code introduce to Convector?

Checklist

Further comments

From inside another controller you can make an invokation like this

const adapter = new InChaincodeAdapter();
const secondCtrl = ClientFactory(SecondController, adapter);
const second = await secondCtrl.$config({ tx: this.tx, 'channel-name', 'chaincode-name' }).get(id);