First Java SDK version with usage example#3
Conversation
In fact autogenerated protobuf code generates such warnings which lead to the red CI status.
|
@keshrisohit , you can look at code coverage report here I used functional tests for main business cases, and unit tests to test pieces which is impractical to cover by functional test. |
|
@keshrisohit , @raamb , do you have any questions on the PR? I would like to merge it and move forward. We can setup a call to discuss if you need it. |
|
@vsbogd have requested Chetan to review as well. I am good from my side for the first merge |
| Sdk sdk = new Sdk(config); | ||
| try { | ||
|
|
||
| PaymentStrategy paymentStrategy = new FixedPaymentChannelPaymentStrategy( |
There was a problem hiding this comment.
python and js sdk currently takes paymentStartegy as sdk input parameter not as service_client parameter , if it makes sense all three sdk should have common api.
There was a problem hiding this comment.
I agree that all three SDK should use same API. But Python and JS SDK takes payment strategy as parameter of create_service_client method, see links below:
Python SDK: https://github.com/singnet/snet-cli/blob/eca41c7e0549fc6bc5aef5a09c18495893fb378f/packages/sdk/snet/sdk/__init__.py#L58-L66
Node.js SDK: https://github.com/singnet/snet-sdk-js/blob/a315f7e95da0e39ac436ed11aff417d3224d70d0/packages/nodejs/src/NodeSdk.js#L14-L18
Web SDK: https://github.com/singnet/snet-sdk-js/blob/a315f7e95da0e39ac436ed11aff417d3224d70d0/packages/web/src/WebSdk.js#L13-L17
I believe it is correct solution as each ervice may have different payment methods etc, so it may require different strategies.
keshrisohit
left a comment
There was a problem hiding this comment.
could not locate channel apis like opne_channel , deopsite_and_open_channel ,load_open_channels
There was a problem hiding this comment.
I didn't implement them in this PR, because I was focused on simplest possible but handy strategies implementations. My opinion the simplest payment strategy is using predefined payment channel. Client can initialize it once and extend it when it is required manually. I have plan to implement these methods later though.
|
Ok, guys, three weeks on review stage, I am merging it. |
|
@keshrisohit , I propose raising issue and add your comments to it, as this PR is already stale. I am going to raise new one in nearest time. |
Class diagram and build instructions: https://github.com/vsbogd/snet-sdk-java/tree/get-payment-channel-state-from-daemon
Usage example: https://github.com/vsbogd/snet-sdk-java/tree/get-payment-channel-state-from-daemon/example
Changes included in PR:
PaymentProviderinterface to provide payment for a client call;FixedPaymentChannelPaymentstrategy to pay for a call using predefined channel;SdkandConfigurationclasses to simplify SDK bootstrappingCntkImageRecognitionservice calling exampleNext steps: