Skip to content
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

extend choice of networks for bazaar helper #344

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/bazaar.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
@click.option('--bizaccount', required=False, help='the account of the owner in ss58 format or raw_seed.')
@click.option('--price', default='0', help='price of your offering.')
@click.option('--client', default='../target/release/encointer-client-notee', help='Client binary to communicate with the chain.')
@click.option('--port', default='9944', help='ws-port of the chain.')
@click.option('-p', '--port', default='9944', help='ws-port of the chain.')
@click.option('-r', '--remote_chain', default=None, help='choose remote chain: gesell.')
@click.pass_context
def cli(ctx, client, port, cid, bizaccount, price, remote_chain):
Expand Down
8 changes: 6 additions & 2 deletions client/py_client/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def mkdir_p(path):
return subprocess.run(['mkdir', '-p', path])


# this method takes the last content identifier, which is the one of the whole folder, for a file, there is only one cid so it works, too.
# this method takes the last content identifier, which is the one of the whole folder, for a file, there is only one cid so it works, too.
def take_only_last_cid(ret_cids):
# last line contains the directory cid
last = ret_cids.stdout.splitlines()[-1]
p = re.compile('Qm\\w*')
cids = p.findall(str(last))

if cids:
print(cids[0])
return cids[0]
Expand Down Expand Up @@ -76,6 +76,10 @@ def set_local_or_remote_chain(client: str, port: str, node_url: str):
else:
if node_url == "gesell":
client = Client(rust_client=client, node_url='wss://gesell.encointer.org', port=443)
elif node_url == "rococo":
client = Client(rust_client=client, node_url='wss://rococo.api.encointer.org', port=443)
elif node_url == "kusama":
client = Client(rust_client=client, node_url='wss://kusama.api.encointer.org', port=443)
else:
raise Exception("You need to choose a valid remote chain")
return client