Zecale - Reconciling Privacy and Scalability on Smart-Contract Chains  0.5
Reference implementation of the Zecale protocol by Clearmatics
zecale_register.py
Go to the documentation of this file.
1 # Copyright (c) 2015-2022 Clearmatics Technologies Ltd
2 #
3 # SPDX-License-Identifier: LGPL-3.0+
4 
5 from zecale.cli.utils import load_verification_key
6 from zecale.cli.command_context import CommandContext
7 from click import command, option, pass_context, Context
8 
9 
10 @command()
11 @option(
12  "--key",
13  required=True,
14  help="Verification key file for application")
15 @option(
16  "--name",
17  required=True,
18  help="Name of the application to register")
19 @pass_context
20 def register(ctx: Context, key: str, name: str) -> None:
21  """
22  Register an application using name and verification key
23  """
24  cmd_ctx: CommandContext = ctx.obj
25 
26  # Load verification key, and register against the given name.
27  nested_snark = cmd_ctx.get_nested_snark()
28  vk = load_verification_key(nested_snark, key)
29  aggregator_client = cmd_ctx.get_aggregator_client()
30  aggregator_client.register_application(nested_snark, vk, name)
zecale.cli.utils
Definition: utils.py:1
zecale.cli.zecale_register.register
None register(Context ctx, str key, str name)
Definition: zecale_register.py:20
zecale.cli.utils.load_verification_key
IVerificationKey load_verification_key(IZKSnarkProvider zksnark, str vk_file)
Definition: utils.py:11
zecale.cli.command_context
Definition: command_context.py:1