Open g2flyer opened 5 years ago
This is a good idea! For solid multi-peer testing the use of the client SDK will make our life much easier.
In such a test we would execute (endorse) a transaction on peer A and check if peer B successfully commits this tx.
We could use the peer CLI for that (https://hyperledger-fabric.readthedocs.io/en/release-1.4/commands/peerchannel.html#peer-channel-fetch) but this requires polling blocks and parsing them in order to check. Not nice.
Using the fabric client SDK (https://github.com/hyperledger/fabric-sdk-go) one can easily register for events. Eg.
client.RegisterChaincodeEvent(ccID, eventID)
seems the peer CLI indeed provides an event listener, which we can use here (and also remove the sleep command)
--waitForEvent Whether to wait for the event from each peer's deliver filtered service signifying that the 'invoke' transaction has been committed successfully
--waitForEventTimeout duration Time to wait for the event from each peer's deliver filtered service signifying that the 'invoke' transaction has been committed successfully (default 30s)
relevant pointers of setting up multi-peer/multi-org: https://hyperledger-fabric.readthedocs.io/en/latest/channel_update_tutorial.html
While the peer.sh wrapper tries to handle multi-peer, e.g., in setup as described in PR #144, it was not tested with multi-org/peer, so be warned ...
Note: while in old lifecycle, our peer.sh wrapper logic should have worked with multiple peers and the ercc install&instantiate and the ecc onDemand setup, with the new lifecyle this is not true anymore, e.g., the ercc configuration in channel join would require tighter coordination between multiple peers. So this might require now more explicit additional management commands but also has to be looked at from the perspective of the additional steps necessary for th new key-managment protocols
depends on resolution of issue #12
Done in conjunction with #394 ..
Another useful feature and test that can be added in this setting is the following:
fabric-sample test-network does already do now in a minimalistical cut multi-peer setup (though no automated test yet)
To make sure all our design really work and also to illustrate to users how a multi-org (and hence, multi-peer) would work we should have a test-case with at least 2 orgs and peers ...