-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide channel id and endpoint from user and support https #210
Hide channel id and endpoint from user and support https #210
Conversation
…and endpoints in 'snet client call'
…s in 'snet channel open-init*'
…l-state'. Also add tests for multiply endpoints in metadata (keeping tests for sinlge endpoint in metadata as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 - Unused imports:
setup.py#L11 import glob
mpe_channel_command.py#L17 import json
mpe_client_command.py#L7 import os
from snet_cli.mpe_service_metadata import load_mpe_service_metadata
utils_ipfs#L6 import sys
2 - Maybe we want to add minimal python version to:
setup.py#L44 python_requires='>=3.5'
3 - Whas about increment version (0.2.0 or even 0.1.10) at __init__.py
?
4 - Typos (minor)
*** I'm not the best guy to propose it...feel free to ignore some of these suggestions.
arguments.py#L104 identies -> identities
arguments.py#L221 Informations -> Information
arguments.py#L373 currect -> current
arguments.py#L400 transfered -> transferred
arguments.py#L454 initilize -> initialize
arguments.py#L460 initilize -> initialize
arguments.py#L490 initilized -> initialized
arguments.py#L585 initilized -> initialized
arguments.py#L589 initilized -> initialized
arguments.py#L658 publising -> publishing
config.py#L159 get_all_identies_names() -> get_all_identities_names() # 4 Matches
mpe_channel_command.py#L109 canont -> can't
mpe_channel_command.py#L191 initilize -> initialize
mpe_channel_command.py#L233 initilized -> initialized
mpe_channel_command.py#L236 initilized -> initialized
mpe_channel_command.py#L240 _get_all_initilized_channels() -> _get_all_initialized_channels()
mpe_channel_command.py#L253 _get_initilized_channels_for_service() -> _get_initialized_channels_for_service()
mpe_channel_command.py#L272 initilized -> initialized
mpe_channel_command.py#L302 UNDIFINED -> UNDEFINED
mpe_channel_command.py#L382 _get_all_channels_filter_sender_recipeint_group -> _get_all_channels_filter_sender_recipient_group()
mpe_service_command.py#L121 opennned -> open
mpe_service_metadata.py#L65 unknow -> unknown
mpe_treasurer_command.py#L incorect -> incorrect
utils_proto.py#L72 switch_to_json_payload_econding() -> switch_to_json_payload_encoding()
Wow...this one was awesome, @astroseger! |
snet_cli/mpe_channel_command.py
Outdated
raise | ||
|
||
def _init_or_update_service_from_metadata(self, metadata): | ||
tmp_dir = tempfile.mkdtemp() | ||
shutil.rmtree(tmp_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We create and delete right away?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes... It is bad design. I will rewrite this function using tempfile.TemporaryDirectory pattern...
…m_metadata and _open_init_channel_from_metadata
@raamb I've improved work with temporary directories. Could you approve :) ? |
This PR solves #201 and #208. It adds proper support for secure channels (https) and it significantly simplifies the life for users by hiding channel_id (and endpoints).
Example of workflow:
This PR does the following:
~/.snet/mpe_client
in order to make it more similar to @vforvalerio87 SDK. This new directories structure allows hiding channel_id from user.<org_id>
and<service_id>
in~/.snet/mpe_client/<mpe_address>_<registry_address>/<org_id>/<service_id>/service
~/.snet/mpe_client/<mpe_address>_<registry_address>/<org_id>/<service_id>/channels
snet channel open-init
will not open new channel if old channel for this service already exists. It will simply initialize existed channel.snet client call
has the following positional parameters:<org_id> <service_id> <method> <params>
. User will need to manually specify channel_id only in case of multiply channels initialized for the same service (which, by default, is prevented insnet channel open-init
).snet client call
more faster by removing unnecessary blockchain call.snet client call
. Instead, as was proposed by @arturgontijo, we have interactive confirmation. We have possibility to skip this confirmation by--yes/-y
.snet channel print-initialized
to include org_id and service_id and remove unnecessary group_idsnet channel print-initialized-filter-group
tosnet channel print-initialized-filter-service
because now it will print all initialized channels for whole service (not only for the specifc group). Change output to more informative similarly tosnet channel print-initialized
.snet channel claim-timeout-all
function which check ALL channels for the given identity and claim timeout for all expired channels.snet channel extend-add-for-service
function which add funds and extend expiration data for the channel which was opened for specific channelsnet service update-metadata
check that group_id or payment_address haven't been changed. We have possibility to force this change by--force
snet client call-lowlevel
,snet client get-channel-state
)