Wrapper around the powersoftau commands
Definition at line 18 of file powersoftau_command.py.
◆ __init__()
def coordinator.powersoftau_command.PowersOfTauCommand.__init__ |
( |
|
self, |
|
|
Optional[str] |
powersoftau_path, |
|
|
Optional[int] |
num_powers |
|
) |
| |
Definition at line 22 of file powersoftau_command.py.
24 powersoftau_path: Optional[str],
25 num_powers: Optional[int]):
26 self.powersoftau_path = powersoftau_path
or _default_powersoftau_path()
27 self.num_powers = num_powers
28 if not exists(self.powersoftau_path):
29 raise Exception(f
"expected powersoftau path: {self.powersoftau_path}")
◆ append_response_to_transcript()
None coordinator.powersoftau_command.PowersOfTauCommand.append_response_to_transcript |
( |
str |
response, |
|
|
str |
transcript_file |
|
) |
| |
|
static |
Definition at line 38 of file powersoftau_command.py.
38 def append_response_to_transcript(
40 transcript_file: str) ->
None:
42 with open(transcript_file,
"ab")
as transcript_f:
44 [
"dd", f
"if={response}",
"bs=64",
"skip=1"],
◆ begin()
bool coordinator.powersoftau_command.PowersOfTauCommand.begin |
( |
|
self | ) |
|
◆ contribute()
bool coordinator.powersoftau_command.PowersOfTauCommand.contribute |
( |
|
self, |
|
|
Optional[str] |
digest_file, |
|
|
bool |
skip_user_input |
|
) |
| |
Definition at line 48 of file powersoftau_command.py.
50 digest_file: Optional[str],
51 skip_user_input: bool) -> bool:
52 assert exists(CHALLENGE_FILE)
53 cmd_args: List[str] = []
56 cmd_args += [
"--digest", digest_file]
58 kwargs[
"input"] =
"any data\n".encode()
59 if self._exec(
"compute", cmd_args, kwargs):
60 assert exists(RESPONSE_FILE)
◆ verify_contribution()
bool coordinator.powersoftau_command.PowersOfTauCommand.verify_contribution |
( |
|
self | ) |
|
Definition at line 34 of file powersoftau_command.py.
34 def verify_contribution(self) -> bool:
35 return self._exec(
"verify_transform")
◆ verify_transcript()
bool coordinator.powersoftau_command.PowersOfTauCommand.verify_transcript |
( |
|
self, |
|
|
int |
num_rounds |
|
) |
| |
Definition at line 64 of file powersoftau_command.py.
64 def verify_transcript(self, num_rounds: int) -> bool:
65 return self._exec(
"verify", args=[
"--rounds",
str(num_rounds)])
◆ num_powers
coordinator.powersoftau_command.PowersOfTauCommand.num_powers |
◆ powersoftau_path
coordinator.powersoftau_command.PowersOfTauCommand.powersoftau_path |
The documentation for this class was generated from the following file:
None contribute(str base_url, str key_file, str challenge_file, Callable[[], str] contribute_cb, int wait_interval, Optional[str] server_certificate, bool insecure)