snet-cli
snet-cli copied to clipboard
"open-init" channel at "client call"
$ snet client call snet sentiment-analysis Analyze test.json -y
Read call params from the file: test.json
# Initilize service with org_id=snet and service_id=sentiment-analysis
Error: Cannot find initialized channel for service with org_id=snet service_id=sentiment-analysis and signer=0xFF2a327ed1Ca40CE93F116C5d6646b56991c0ddE
If you want to see full Traceback then run:
snet --print-traceback [parameters]
We should provide an option here that allows user to open-init
or/and add-extend
a new/existing channel.
It is relatively easy to make, but it will add two optional parameters (amount and expiration) which might be confusing.
What if we prompt the options like this:
# Initilize service with org_id=snet and service_id=sentiment-analysis
Error: Cannot find initialized channel for service with org_id=snet service_id=sentiment-analysis and signer=0xFF2a327ed1Ca40CE93F116C5d6646b56991c0ddE
Do you want to open-init a new channel (y/n)? (Or Do you want to extend-add channel 987 (y/n)?)
If user input "y" we then prompt the other things, like:
Do you want to open-init a new channel (y/n)? y
Amount (AGI): 0.5
Expiration (eg 10days): 20days
I know that this can be a like bit overwhelming but some users (advanced) will leverage this.
Personally, I don't like such interactive command line dialogs. It should be easy to use snet-cli from bash script.
So I would make it like this:
snet client call snet sentiment-analysis Analyze test.json -y --auto-refound-amout 0.001 --auto-refound-expiration 20days
@vforvalerio87 we can use auto-refound strategies from SDK here.
Yeah, your way is much better than mine!