Zecale - Reconciling Privacy and Scalability on Smart-Contract Chains  0.5
Reference implementation of the Zecale protocol by Clearmatics
zecale_get_verification_key.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.defaults import AGGREGATOR_VERIFICATION_KEY_FILE_DEFAULT
6 from zecale.cli.command_context import CommandContext
7 import json
8 from click import option, command, pass_context, Context
9 
10 
11 @command()
12 @option(
13  "--vk-out",
14  "-o",
15  default=AGGREGATOR_VERIFICATION_KEY_FILE_DEFAULT,
16  help=f"Output file (default: {AGGREGATOR_VERIFICATION_KEY_FILE_DEFAULT})")
17 @pass_context
19  ctx: Context,
20  vk_out: str) -> None:
21  """
22  Get the aggregator (wrapping) verification key from the aggregation server
23  and write to a file.
24  """
25  cmd_ctx: CommandContext = ctx.obj
26  aggregator_client = cmd_ctx.get_aggregator_client()
27  aggregator_vk = aggregator_client.get_verification_key(
28  cmd_ctx.get_wrapper_snark())
29  with open(vk_out, "w") as vk_f:
30  json.dump(aggregator_vk.to_json_dict(), vk_f)
zecale.cli.defaults
Definition: defaults.py:1
zecale.cli.zecale_get_verification_key.get_verification_key
None get_verification_key(Context ctx, str vk_out)
Definition: zecale_get_verification_key.py:18
zecale.cli.command_context
Definition: command_context.py:1