@devtion/devcli 0.0.0-4f2b2be → 0.0.0-521e678
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/.env +3 -3
- package/dist/index.js +116 -65
- package/dist/types/commands/finalize.d.ts +3 -2
- package/dist/types/commands/setup.d.ts +1 -1
- package/dist/types/lib/prompts.d.ts +5 -5
- package/dist/types/lib/utils.d.ts +2 -1
- package/package.json +2 -2
- package/src/commands/auth.ts +18 -8
- package/src/commands/contribute.ts +11 -7
- package/src/commands/finalize.ts +18 -9
- package/src/commands/index.ts +1 -1
- package/src/commands/listCeremonies.ts +1 -2
- package/src/commands/observe.ts +2 -2
- package/src/commands/setup.ts +59 -27
- package/src/commands/validate.ts +1 -2
- package/src/index.ts +17 -8
- package/src/lib/prompts.ts +19 -19
- package/src/lib/services.ts +0 -2
- package/src/lib/utils.ts +41 -8
package/README.md
CHANGED
package/dist/.env
CHANGED
|
@@ -29,9 +29,9 @@ AUTH_GITHUB_CLIENT_ID=e9f8a5fabdfe0d95618c
|
|
|
29
29
|
### AWS S3 bucket used as storage for ceremony artifacts.
|
|
30
30
|
|
|
31
31
|
# The chunk size to be used when executing multi-part upload or downloads.
|
|
32
|
-
# default
|
|
33
|
-
# (e.g. a 200 MB file setting a stream chunk size of
|
|
34
|
-
CONFIG_STREAM_CHUNK_SIZE_IN_MB=
|
|
32
|
+
# default 25 MBs.
|
|
33
|
+
# (e.g. a 200 MB file setting a stream chunk size of 25 MB is going to be splitted and uploaded/downloaded in 4 chunks).
|
|
34
|
+
CONFIG_STREAM_CHUNK_SIZE_IN_MB=25
|
|
35
35
|
# The postfix string for each ceremony bucket.
|
|
36
36
|
# default -ph2-ceremony
|
|
37
37
|
CONFIG_CEREMONY_BUCKET_POSTFIX=-p0tion-development-environment
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @module @
|
|
5
|
-
* @version 1.
|
|
4
|
+
* @module @p0tion/phase2cli
|
|
5
|
+
* @version 1.1.1
|
|
6
6
|
* @file All-in-one interactive command-line for interfacing with zkSNARK Phase 2 Trusted Setup ceremonies
|
|
7
7
|
* @copyright Ethereum Foundation 2022
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @see [Github]{@link https://github.com/privacy-scaling-explorations/p0tion}
|
|
10
10
|
*/
|
|
11
11
|
import { createCommand } from 'commander';
|
|
12
|
-
import fs, { readFileSync, createWriteStream, renameSync } from 'fs';
|
|
12
|
+
import fs, { readFileSync, createWriteStream, existsSync, renameSync } from 'fs';
|
|
13
13
|
import { dirname } from 'path';
|
|
14
14
|
import { fileURLToPath } from 'url';
|
|
15
15
|
import { zKey } from 'snarkjs';
|
|
@@ -365,6 +365,12 @@ const getVerificationKeyLocalFilePath = (completeFilename) => `${verificationKey
|
|
|
365
365
|
* @returns <string> - the complete final verifier contract path to the file.
|
|
366
366
|
*/
|
|
367
367
|
const getVerifierContractLocalFilePath = (completeFilename) => `${verifierContractsLocalFolderPath}/${completeFilename}`;
|
|
368
|
+
/**
|
|
369
|
+
* Get the complete final attestation file path.
|
|
370
|
+
* @param completeFilename <string> - the complete filename of the file (name.ext).
|
|
371
|
+
* @returns <string> - the complete final final attestation path to the file.
|
|
372
|
+
*/
|
|
373
|
+
const getFinalAttestationLocalFilePath = (completeFilename) => `${finalAttestationsLocalFolderPath}/${completeFilename}`;
|
|
368
374
|
/**
|
|
369
375
|
* Get the final transcript file path.
|
|
370
376
|
* @param completeFilename <string> - the complete filename of the file (name.ext).
|
|
@@ -579,8 +585,18 @@ const publishGist = async (token, content, ceremonyTitle, ceremonyPrefix) => {
|
|
|
579
585
|
* @returns <string> - the ready to share tweet url.
|
|
580
586
|
*/
|
|
581
587
|
const generateCustomUrlToTweetAboutParticipation = (ceremonyName, gistUrl, isFinalizing) => isFinalizing
|
|
582
|
-
? `https://twitter.com/intent/tweet?text=I%20have%20finalized%20the%20${ceremonyName}
|
|
583
|
-
|
|
588
|
+
? `https://twitter.com/intent/tweet?text=I%20have%20finalized%20the%20${ceremonyName}${ceremonyName.toLowerCase().includes("trusted") ||
|
|
589
|
+
ceremonyName.toLowerCase().includes("setup") ||
|
|
590
|
+
ceremonyName.toLowerCase().includes("phase2") ||
|
|
591
|
+
ceremonyName.toLowerCase().includes("ceremony")
|
|
592
|
+
? "!"
|
|
593
|
+
: "%20Phase%202%20Trusted%20Setup%20ceremony!"}%20You%20can%20view%20my%20final%20attestation%20here:%20${gistUrl}%20#Ethereum%20#ZKP%20#PSE`
|
|
594
|
+
: `https://twitter.com/intent/tweet?text=I%20contributed%20to%20the%20${ceremonyName}${ceremonyName.toLowerCase().includes("trusted") ||
|
|
595
|
+
ceremonyName.toLowerCase().includes("setup") ||
|
|
596
|
+
ceremonyName.toLowerCase().includes("phase2") ||
|
|
597
|
+
ceremonyName.toLowerCase().includes("ceremony")
|
|
598
|
+
? "!"
|
|
599
|
+
: "%20Phase%202%20Trusted%20Setup%20ceremony!"}%20You%20can%20view%20the%20steps%20to%20contribute%20here:%20https://ceremony.pse.dev%20You%20can%20view%20my%20attestation%20here:%20${gistUrl}%20#Ethereum%20#ZKP`;
|
|
584
600
|
/**
|
|
585
601
|
* Return a custom progress bar.
|
|
586
602
|
* @param type <ProgressBarType> - the type of the progress bar.
|
|
@@ -708,13 +724,14 @@ const getLatestUpdatesFromParticipant = async (firestoreDatabase, ceremonyId, pa
|
|
|
708
724
|
* @param entropyOrBeaconHash <string> - the entropy or beacon hash (only when finalizing) for the contribution.
|
|
709
725
|
* @param contributorOrCoordinatorIdentifier <string> - the identifier of the contributor or coordinator (only when finalizing).
|
|
710
726
|
* @param isFinalizing <boolean> - flag to discriminate between ceremony finalization (true) and contribution (false).
|
|
727
|
+
* @param circuitsLength <number> - the total number of circuits in the ceremony.
|
|
711
728
|
*/
|
|
712
|
-
const handleStartOrResumeContribution = async (cloudFunctions, firestoreDatabase, ceremony, circuit, participant, entropyOrBeaconHash, contributorOrCoordinatorIdentifier, isFinalizing) => {
|
|
729
|
+
const handleStartOrResumeContribution = async (cloudFunctions, firestoreDatabase, ceremony, circuit, participant, entropyOrBeaconHash, contributorOrCoordinatorIdentifier, isFinalizing, circuitsLength) => {
|
|
713
730
|
// Extract data.
|
|
714
731
|
const { prefix: ceremonyPrefix } = ceremony.data;
|
|
715
732
|
const { waitingQueue, avgTimings, prefix: circuitPrefix, sequencePosition } = circuit.data;
|
|
716
733
|
const { completedContributions } = waitingQueue; // = current progress.
|
|
717
|
-
console.log(`${theme.text.bold(`\n- Circuit # ${theme.colors.magenta(`${sequencePosition}`)}`)} (Contribution Steps)`);
|
|
734
|
+
console.log(`${theme.text.bold(`\n- Circuit # ${theme.colors.magenta(`${sequencePosition}/${circuitsLength}`)}`)} (Contribution Steps)`);
|
|
718
735
|
// Get most up-to-date data from the participant document.
|
|
719
736
|
let participantData = await getLatestUpdatesFromParticipant(firestoreDatabase, ceremony.id, participant.id);
|
|
720
737
|
const spinner = customSpinner(`${participantData.contributionStep === "DOWNLOADING" /* ParticipantContributionStep.DOWNLOADING */
|
|
@@ -760,6 +777,7 @@ const handleStartOrResumeContribution = async (cloudFunctions, firestoreDatabase
|
|
|
760
777
|
// Download the latest contribution from bucket.
|
|
761
778
|
await downloadCeremonyArtifact(cloudFunctions, bucketName, lastZkeyStorageFilePath, lastZkeyLocalFilePath);
|
|
762
779
|
console.log(`${theme.symbols.success} Contribution ${theme.text.bold(`#${lastZkeyIndex}`)} correctly downloaded`);
|
|
780
|
+
await sleep(3000);
|
|
763
781
|
// Advance to next contribution step (COMPUTING) if not finalizing.
|
|
764
782
|
if (!isFinalizing) {
|
|
765
783
|
spinner.text = `Preparing for contribution computation...`;
|
|
@@ -787,11 +805,14 @@ const handleStartOrResumeContribution = async (cloudFunctions, firestoreDatabase
|
|
|
787
805
|
showError(COMMAND_ERRORS.COMMAND_CONTRIBUTE_FINALIZE_NO_TRANSCRIPT_CONTRIBUTION_HASH_MATCH, true);
|
|
788
806
|
// Format contribution hash.
|
|
789
807
|
const contributionHash = matchContributionHash?.at(0)?.replace("\n\t\t", "");
|
|
808
|
+
await sleep(500);
|
|
790
809
|
// Make request to cloud functions to permanently store the information.
|
|
791
810
|
await permanentlyStoreCurrentContributionTimeAndHash(cloudFunctions, ceremony.id, computingTime, contributionHash);
|
|
792
811
|
// Format computing time.
|
|
793
812
|
const { seconds: computationSeconds, minutes: computationMinutes, hours: computationHours } = getSecondsMinutesHoursFromMillis(computingTime);
|
|
794
813
|
spinner.succeed(`${isFinalizing ? "Contribution" : `Contribution ${theme.text.bold(`#${nextZkeyIndex}`)}`} computation took ${theme.text.bold(`${convertToDoubleDigits(computationHours)}:${convertToDoubleDigits(computationMinutes)}:${convertToDoubleDigits(computationSeconds)}`)}`);
|
|
814
|
+
// ensure the previous step is completed
|
|
815
|
+
await sleep(5000);
|
|
795
816
|
// Advance to next contribution step (UPLOADING) if not finalizing.
|
|
796
817
|
if (!isFinalizing) {
|
|
797
818
|
spinner.text = `Preparing for uploading the contribution...`;
|
|
@@ -807,12 +828,17 @@ const handleStartOrResumeContribution = async (cloudFunctions, firestoreDatabase
|
|
|
807
828
|
console.log(`${theme.symbols.success} Contribution ${theme.text.bold(`#${nextZkeyIndex}`)} already computed`);
|
|
808
829
|
// Contribution step = UPLOADING.
|
|
809
830
|
if (isFinalizing || participantData.contributionStep === "UPLOADING" /* ParticipantContributionStep.UPLOADING */) {
|
|
810
|
-
spinner.text = `Uploading ${isFinalizing ? "final" : "your"} contribution ${!isFinalizing ? theme.text.bold(`#${nextZkeyIndex}`) : ""} to storage.\n${theme.symbols.warning} This step may take a while based on circuit size and your
|
|
831
|
+
spinner.text = `Uploading ${isFinalizing ? "final" : "your"} contribution ${!isFinalizing ? theme.text.bold(`#${nextZkeyIndex}`) : ""} to storage.\n${theme.symbols.warning} This step may take a while based on circuit size and your internet speed. Everything's fine, just be patient.`;
|
|
811
832
|
spinner.start();
|
|
812
|
-
|
|
813
|
-
|
|
833
|
+
const progressBar = customProgressBar(ProgressBarType.UPLOAD, `your contribution`);
|
|
834
|
+
if (!isFinalizing) {
|
|
835
|
+
await multiPartUpload(cloudFunctions, bucketName, nextZkeyStorageFilePath, nextZkeyLocalFilePath, Number(process.env.CONFIG_STREAM_CHUNK_SIZE_IN_MB), ceremony.id, participantData.tempContributionData, progressBar);
|
|
836
|
+
progressBar.stop();
|
|
837
|
+
}
|
|
814
838
|
else
|
|
815
839
|
await multiPartUpload(cloudFunctions, bucketName, nextZkeyStorageFilePath, nextZkeyLocalFilePath, Number(process.env.CONFIG_STREAM_CHUNK_SIZE_IN_MB));
|
|
840
|
+
// small sleep to ensure the previous step is completed
|
|
841
|
+
await sleep(5000);
|
|
816
842
|
spinner.succeed(`${isFinalizing ? `Contribution` : `Contribution ${theme.text.bold(`#${nextZkeyIndex}`)}`} correctly saved to storage`);
|
|
817
843
|
// Advance to next contribution step (VERIFYING) if not finalizing.
|
|
818
844
|
if (!isFinalizing) {
|
|
@@ -990,7 +1016,7 @@ const promptCircomCompiler = async () => {
|
|
|
990
1016
|
* Shows a list of circuits for a single option selection.
|
|
991
1017
|
* @dev the circuit names are derived from local R1CS files.
|
|
992
1018
|
* @param options <Array<string>> - an array of circuits names.
|
|
993
|
-
* @returns Promise<string> - the name of the
|
|
1019
|
+
* @returns Promise<string> - the name of the chosen circuit.
|
|
994
1020
|
*/
|
|
995
1021
|
const promptCircuitSelector = async (options) => {
|
|
996
1022
|
const { circuitFilename } = await prompts({
|
|
@@ -1008,7 +1034,7 @@ const promptCircuitSelector = async (options) => {
|
|
|
1008
1034
|
* Shows a list of standard EC2 VM instance types for a single option selection.
|
|
1009
1035
|
* @notice the suggested VM configuration type is calculated based on circuit constraint size.
|
|
1010
1036
|
* @param constraintSize <number> - the amount of circuit constraints
|
|
1011
|
-
* @returns Promise<string> - the name of the
|
|
1037
|
+
* @returns Promise<string> - the name of the chosen VM type.
|
|
1012
1038
|
*/
|
|
1013
1039
|
const promptVMTypeSelector = async (constraintSize) => {
|
|
1014
1040
|
let suggestedConfiguration = 0;
|
|
@@ -1105,7 +1131,7 @@ const promptVMDiskTypeSelector = async () => {
|
|
|
1105
1131
|
/**
|
|
1106
1132
|
* Show a series of questions about the circuits.
|
|
1107
1133
|
* @param constraintSize <number> - the amount of circuit constraints.
|
|
1108
|
-
* @param timeoutMechanismType <CeremonyTimeoutType> - the
|
|
1134
|
+
* @param timeoutMechanismType <CeremonyTimeoutType> - the chosen timeout mechanism type for the ceremony.
|
|
1109
1135
|
* @param needPromptCircomCompiler <boolean> - a boolean value indicating if the questions related to the Circom compiler version and commit hash must be asked.
|
|
1110
1136
|
* @param enforceVM <boolean> - a boolean value indicating if the contribution verification could be supported by VM-only approach or not.
|
|
1111
1137
|
* @returns Promise<Array<Circuit>> - circuit info prompted by the coordinator.
|
|
@@ -1118,7 +1144,7 @@ const promptCircuitInputData = async (constraintSize, timeoutMechanismType, same
|
|
|
1118
1144
|
let circomVersion = "";
|
|
1119
1145
|
let circomCommitHash = "";
|
|
1120
1146
|
let circuitInputData;
|
|
1121
|
-
let
|
|
1147
|
+
let cfOrVm;
|
|
1122
1148
|
let vmDiskType;
|
|
1123
1149
|
let vmConfigurationType = "";
|
|
1124
1150
|
const questions = [
|
|
@@ -1173,18 +1199,21 @@ const promptCircuitInputData = async (constraintSize, timeoutMechanismType, same
|
|
|
1173
1199
|
circomVersion = version;
|
|
1174
1200
|
circomCommitHash = commitHash;
|
|
1175
1201
|
}
|
|
1176
|
-
// Ask for
|
|
1202
|
+
// Ask for preferred contribution verification method (CF vs VM).
|
|
1177
1203
|
if (!enforceVM) {
|
|
1178
1204
|
const { confirmation } = await askForConfirmation(`The contribution verification can be performed using Cloud Functions (CF, cheaper for small contributions but limited to 1M constraints) or custom virtual machines (expensive but could scale up to 30M constraints). Be aware about VM costs and if you wanna learn more, please visit the documentation to have a complete overview about cost estimation of the two mechanisms.\nChoose the contribution verification mechanism`, `CF`, // eq. true.
|
|
1179
1205
|
`VM` // eq. false.
|
|
1180
1206
|
);
|
|
1181
|
-
|
|
1207
|
+
cfOrVm = confirmation
|
|
1208
|
+
? "CF" /* CircuitContributionVerificationMechanism.CF */
|
|
1209
|
+
: "VM" /* CircuitContributionVerificationMechanism.VM */;
|
|
1182
1210
|
}
|
|
1183
|
-
else
|
|
1184
|
-
|
|
1185
|
-
|
|
1211
|
+
else {
|
|
1212
|
+
cfOrVm = "VM" /* CircuitContributionVerificationMechanism.VM */;
|
|
1213
|
+
}
|
|
1214
|
+
if (cfOrVm === undefined)
|
|
1186
1215
|
showError(COMMAND_ERRORS.COMMAND_ABORT_PROMPT, true);
|
|
1187
|
-
if (
|
|
1216
|
+
if (cfOrVm === "VM" /* CircuitContributionVerificationMechanism.VM */) {
|
|
1188
1217
|
// Ask for selecting the specific VM configuration type.
|
|
1189
1218
|
vmConfigurationType = await promptVMTypeSelector(constraintSize);
|
|
1190
1219
|
// Ask for selecting the specific VM disk (volume) type.
|
|
@@ -1218,9 +1247,7 @@ const promptCircuitInputData = async (constraintSize, timeoutMechanismType, same
|
|
|
1218
1247
|
paramsConfiguration: circuitConfigurationValues
|
|
1219
1248
|
},
|
|
1220
1249
|
verification: {
|
|
1221
|
-
cfOrVm
|
|
1222
|
-
? "CF" /* CircuitContributionVerificationMechanism.CF */
|
|
1223
|
-
: "VM" /* CircuitContributionVerificationMechanism.VM */,
|
|
1250
|
+
cfOrVm,
|
|
1224
1251
|
vm: {
|
|
1225
1252
|
vmConfigurationType,
|
|
1226
1253
|
vmDiskType
|
|
@@ -1256,9 +1283,7 @@ const promptCircuitInputData = async (constraintSize, timeoutMechanismType, same
|
|
|
1256
1283
|
paramsConfiguration: circuitConfigurationValues
|
|
1257
1284
|
},
|
|
1258
1285
|
verification: {
|
|
1259
|
-
cfOrVm
|
|
1260
|
-
? "CF" /* CircuitContributionVerificationMechanism.CF */
|
|
1261
|
-
: "VM" /* CircuitContributionVerificationMechanism.VM */,
|
|
1286
|
+
cfOrVm,
|
|
1262
1287
|
vm: {
|
|
1263
1288
|
vmConfigurationType,
|
|
1264
1289
|
vmDiskType
|
|
@@ -1302,7 +1327,7 @@ const promptCircuitAddition = async () => {
|
|
|
1302
1327
|
* Shows a list of pre-computed zKeys for a single option selection.
|
|
1303
1328
|
* @dev the names are derived from local zKeys files.
|
|
1304
1329
|
* @param options <Array<string>> - an array of pre-computed zKeys names.
|
|
1305
|
-
* @returns Promise<string> - the name of the
|
|
1330
|
+
* @returns Promise<string> - the name of the chosen pre-computed zKey.
|
|
1306
1331
|
*/
|
|
1307
1332
|
const promptPreComputedZkeySelector = async (options) => {
|
|
1308
1333
|
const { preComputedZkeyFilename } = await prompts({
|
|
@@ -1340,13 +1365,13 @@ const promptNeededPowersForCircuit = async (suggestedSmallestNeededPowers) => {
|
|
|
1340
1365
|
* Shows a list of PoT files for a single option selection.
|
|
1341
1366
|
* @dev the names are derived from local PoT files.
|
|
1342
1367
|
* @param options <Array<string>> - an array of PoT file names.
|
|
1343
|
-
* @returns Promise<string> - the name of the
|
|
1368
|
+
* @returns Promise<string> - the name of the chosen PoT.
|
|
1344
1369
|
*/
|
|
1345
1370
|
const promptPotSelector = async (options) => {
|
|
1346
1371
|
const { potFilename } = await prompts({
|
|
1347
1372
|
type: "select",
|
|
1348
1373
|
name: "potFilename",
|
|
1349
|
-
message: theme.text.bold("Select the Powers of Tau file
|
|
1374
|
+
message: theme.text.bold("Select the Powers of Tau file chosen for the circuit"),
|
|
1350
1375
|
choices: options.map((option) => {
|
|
1351
1376
|
console.log(option);
|
|
1352
1377
|
return { title: option, value: option };
|
|
@@ -1416,7 +1441,7 @@ const promptToTypeEntropyOrBeacon = async (isEntropy = true) => {
|
|
|
1416
1441
|
* @return <Promise<string>> - the entropy.
|
|
1417
1442
|
*/
|
|
1418
1443
|
const promptForEntropy = async () => {
|
|
1419
|
-
// Prompt for entropy generation
|
|
1444
|
+
// Prompt for entropy generation preferred method.
|
|
1420
1445
|
const { confirmation } = await askForConfirmation(`Do you prefer to type your entropy or generate it randomly?`, "Manually", "Randomly");
|
|
1421
1446
|
if (confirmation === undefined)
|
|
1422
1447
|
showError(COMMAND_ERRORS.COMMAND_ABORT_PROMPT, true);
|
|
@@ -1633,7 +1658,7 @@ const handleAdditionOfCircuitsToCeremony = async (r1csOptions, wasmOptions, cere
|
|
|
1633
1658
|
wasmFilename.split(`.${commonTerms.foldersAndPathsTerms.wasm}`)[0]);
|
|
1634
1659
|
if (matchingWasms.length !== 1)
|
|
1635
1660
|
showError(COMMAND_ERRORS.COMMAND_SETUP_MISMATCH_R1CS_WASM, true);
|
|
1636
|
-
// Get input data for
|
|
1661
|
+
// Get input data for chosen circuit.
|
|
1637
1662
|
const circuitInputData = await getInputDataToAddCircuitToCeremony(choosenCircuitFilename, matchingWasms[0], ceremonyTimeoutMechanismType, sameCircomCompiler, circuitSequencePosition, sharedCircomCompilerData);
|
|
1638
1663
|
// Store circuit data.
|
|
1639
1664
|
inputDataForCircuits.push(circuitInputData);
|
|
@@ -1723,7 +1748,7 @@ const checkAndDownloadSmallestPowersOfTau = async (powers, ptauCompleteFilename)
|
|
|
1723
1748
|
* number of powers greater than or equal to the powers needed by the zKey), the coordinator will be asked
|
|
1724
1749
|
* to provide a number of powers manually, ranging from the smallest possible to the largest.
|
|
1725
1750
|
* @param neededPowers <number> - the smallest amount of powers needed by the zKey.
|
|
1726
|
-
* @returns Promise<string, string> - the information about the
|
|
1751
|
+
* @returns Promise<string, string> - the information about the chosen Powers of Tau file for the pre-computed zKey
|
|
1727
1752
|
* along with related powers.
|
|
1728
1753
|
*/
|
|
1729
1754
|
const handlePreComputedZkeyPowersOfTauSelection = async (neededPowers) => {
|
|
@@ -1824,7 +1849,9 @@ const setup = async (cmd) => {
|
|
|
1824
1849
|
let ceremonyId = ""; // The unique identifier of the ceremony.
|
|
1825
1850
|
const { firebaseApp, firebaseFunctions, firestoreDatabase } = await bootstrapCommandExecutionAndServices();
|
|
1826
1851
|
// Check for authentication.
|
|
1827
|
-
const { user, providerUserId } = cmd.auth
|
|
1852
|
+
const { user, providerUserId } = cmd.auth
|
|
1853
|
+
? await authWithToken(firebaseApp, cmd.auth)
|
|
1854
|
+
: await checkAuth(firebaseApp);
|
|
1828
1855
|
// Preserve command execution only for coordinators.
|
|
1829
1856
|
if (!(await isCoordinator(user)))
|
|
1830
1857
|
showError(COMMAND_ERRORS.COMMAND_NOT_COORDINATOR, true);
|
|
@@ -1841,7 +1868,7 @@ const setup = async (cmd) => {
|
|
|
1841
1868
|
// if there is the file option, then set up the non interactively
|
|
1842
1869
|
if (cmd.template) {
|
|
1843
1870
|
// 1. parse the file
|
|
1844
|
-
// tmp data - do not cleanup files as we need them
|
|
1871
|
+
// tmp data - do not cleanup files as we need them
|
|
1845
1872
|
const spinner = customSpinner(`Parsing ${theme.text.bold(cmd.template)} setup configuration file...`, `clock`);
|
|
1846
1873
|
spinner.start();
|
|
1847
1874
|
const setupCeremonyData = await parseCeremonyFile(cmd.template);
|
|
@@ -1864,12 +1891,20 @@ const setup = async (cmd) => {
|
|
|
1864
1891
|
// 3. generate the zKey
|
|
1865
1892
|
const spinner = customSpinner(`Generating genesis zKey for circuit ${theme.text.bold(circuit.name)}...`, `clock`);
|
|
1866
1893
|
spinner.start();
|
|
1867
|
-
|
|
1868
|
-
|
|
1894
|
+
if (existsSync(zkeyLocalPathAndFileName)) {
|
|
1895
|
+
spinner.succeed(`The genesis zKey for circuit ${theme.text.bold(circuit.name)} is already present on disk`);
|
|
1896
|
+
}
|
|
1897
|
+
else {
|
|
1898
|
+
await zKey.newZKey(r1csLocalPathAndFileName, getPotLocalFilePath(circuit.files.potFilename), zkeyLocalPathAndFileName, undefined);
|
|
1899
|
+
spinner.succeed(`Generation of the genesis zKey for circuit ${theme.text.bold(circuit.name)} completed successfully`);
|
|
1900
|
+
}
|
|
1901
|
+
const hashSpinner = customSpinner(`Calculating hashes for circuit ${theme.text.bold(circuit.name)}...`, `clock`);
|
|
1902
|
+
hashSpinner.start();
|
|
1869
1903
|
// 4. calculate the hashes
|
|
1870
1904
|
const wasmBlake2bHash = await blake512FromPath(wasmLocalPathAndFileName);
|
|
1871
1905
|
const potBlake2bHash = await blake512FromPath(getPotLocalFilePath(circuit.files.potFilename));
|
|
1872
1906
|
const initialZkeyBlake2bHash = await blake512FromPath(zkeyLocalPathAndFileName);
|
|
1907
|
+
hashSpinner.succeed(`Hashes for circuit ${theme.text.bold(circuit.name)} calculated successfully`);
|
|
1873
1908
|
// 5. upload the artifacts
|
|
1874
1909
|
// Upload zKey to Storage.
|
|
1875
1910
|
await handleCircuitArtifactUploadToStorage(firebaseFunctions, bucketName, circuit.files.initialZkeyStoragePath, zkeyLocalPathAndFileName, circuit.files.initialZkeyFilename);
|
|
@@ -1887,9 +1922,9 @@ const setup = async (cmd) => {
|
|
|
1887
1922
|
// 6 update the setup data object
|
|
1888
1923
|
ceremonySetupData.circuits[index].files = {
|
|
1889
1924
|
...circuit.files,
|
|
1890
|
-
potBlake2bHash
|
|
1891
|
-
wasmBlake2bHash
|
|
1892
|
-
initialZkeyBlake2bHash
|
|
1925
|
+
potBlake2bHash,
|
|
1926
|
+
wasmBlake2bHash,
|
|
1927
|
+
initialZkeyBlake2bHash
|
|
1893
1928
|
};
|
|
1894
1929
|
ceremonySetupData.circuits[index].zKeySizeInBytes = getFileStats(zkeyLocalPathAndFileName).size;
|
|
1895
1930
|
}
|
|
@@ -2097,17 +2132,29 @@ const expirationCountdownForGithubOAuth = (expirationInSeconds) => {
|
|
|
2097
2132
|
*/
|
|
2098
2133
|
const onVerification = async (verification) => {
|
|
2099
2134
|
// Copy code to clipboard.
|
|
2100
|
-
|
|
2101
|
-
|
|
2135
|
+
let noClipboard = false;
|
|
2136
|
+
try {
|
|
2137
|
+
clipboard.writeSync(verification.user_code);
|
|
2138
|
+
clipboard.readSync();
|
|
2139
|
+
}
|
|
2140
|
+
catch (error) {
|
|
2141
|
+
noClipboard = true;
|
|
2142
|
+
}
|
|
2102
2143
|
// Display data.
|
|
2103
2144
|
console.log(`${theme.symbols.warning} Visit ${theme.text.bold(theme.text.underlined(verification.verification_uri))} on this device to generate a new token and authenticate\n`);
|
|
2104
|
-
console.log(theme.colors.magenta(figlet.textSync("Code is Below", { font: "ANSI Shadow" })),
|
|
2105
|
-
|
|
2145
|
+
console.log(theme.colors.magenta(figlet.textSync("Code is Below", { font: "ANSI Shadow" })), "\n");
|
|
2146
|
+
const message = !noClipboard ? `has been copied to your clipboard (${theme.emojis.clipboard})` : ``;
|
|
2147
|
+
console.log(`${theme.symbols.info} Your auth code: ${theme.text.bold(verification.user_code)} ${message} ${theme.symbols.success}\n`);
|
|
2106
2148
|
const spinner = customSpinner(`Redirecting to Github...`, `clock`);
|
|
2107
2149
|
spinner.start();
|
|
2108
2150
|
await sleep(10000); // ~10s to make users able to read the CLI.
|
|
2109
|
-
|
|
2110
|
-
|
|
2151
|
+
try {
|
|
2152
|
+
// Automatically open the page (# Step 2).
|
|
2153
|
+
await open(verification.verification_uri);
|
|
2154
|
+
}
|
|
2155
|
+
catch (error) {
|
|
2156
|
+
console.log(`${theme.symbols.info} Please authenticate via GitHub at ${verification.verification_uri}`);
|
|
2157
|
+
}
|
|
2111
2158
|
spinner.stop();
|
|
2112
2159
|
// Countdown for time expiration.
|
|
2113
2160
|
expirationCountdownForGithubOAuth(verification.expires_in);
|
|
@@ -2553,8 +2600,8 @@ const listenToParticipantDocumentChanges = async (firestoreDatabase, cloudFuncti
|
|
|
2553
2600
|
// Communicate resume / start of the contribution to participant.
|
|
2554
2601
|
await simpleLoader(`${changedContributionStep === "DOWNLOADING" /* ParticipantContributionStep.DOWNLOADING */ ? `Starting` : `Resuming`} your contribution...`, `clock`, 3000);
|
|
2555
2602
|
// Start / Resume the contribution for the participant.
|
|
2556
|
-
await handleStartOrResumeContribution(cloudFunctions, firestoreDatabase, ceremony, circuit, participant, entropy, providerUserId, false // not finalizing.
|
|
2557
|
-
);
|
|
2603
|
+
await handleStartOrResumeContribution(cloudFunctions, firestoreDatabase, ceremony, circuit, participant, entropy, providerUserId, false, // not finalizing.
|
|
2604
|
+
circuits.length);
|
|
2558
2605
|
}
|
|
2559
2606
|
// Scenario (3.A).
|
|
2560
2607
|
else if (isWaitingForContribution)
|
|
@@ -2603,7 +2650,9 @@ const listenToParticipantDocumentChanges = async (firestoreDatabase, cloudFuncti
|
|
|
2603
2650
|
// Get latest contribution verification result.
|
|
2604
2651
|
await getLatestVerificationResult(firestoreDatabase, ceremony.id, circuit.id, participant.id);
|
|
2605
2652
|
// Get next circuit for contribution.
|
|
2606
|
-
const nextCircuit = timeoutExpired
|
|
2653
|
+
const nextCircuit = timeoutExpired
|
|
2654
|
+
? getCircuitBySequencePosition(circuits, changedContributionProgress)
|
|
2655
|
+
: getCircuitBySequencePosition(circuits, changedContributionProgress + 1);
|
|
2607
2656
|
// Check disk space requirements for participant.
|
|
2608
2657
|
const wannaGenerateAttestation = await handleDiskSpaceRequirementForNextContribution(cloudFunctions, ceremony.id, nextCircuit.data.sequencePosition, nextCircuit.data.zKeySizeInBytes, timeoutExpired, providerUserId);
|
|
2609
2658
|
// Check if the participant would like to generate a new attestation.
|
|
@@ -2641,11 +2690,12 @@ const listenToParticipantDocumentChanges = async (firestoreDatabase, cloudFuncti
|
|
|
2641
2690
|
*/
|
|
2642
2691
|
const contribute = async (opt) => {
|
|
2643
2692
|
const { firebaseApp, firebaseFunctions, firestoreDatabase } = await bootstrapCommandExecutionAndServices();
|
|
2644
|
-
// Check for authentication.
|
|
2645
|
-
const { user, providerUserId, token } = await checkAuth(firebaseApp);
|
|
2646
2693
|
// Get options.
|
|
2647
2694
|
const ceremonyOpt = opt.ceremony;
|
|
2648
2695
|
const entropyOpt = opt.entropy;
|
|
2696
|
+
const { auth } = opt;
|
|
2697
|
+
// Check for authentication.
|
|
2698
|
+
const { user, providerUserId, token } = auth ? await authWithToken(firebaseApp, auth) : await checkAuth(firebaseApp);
|
|
2649
2699
|
// Prepare data.
|
|
2650
2700
|
let selectedCeremony;
|
|
2651
2701
|
// Retrieve the opened ceremonies.
|
|
@@ -2681,7 +2731,7 @@ const contribute = async (opt) => {
|
|
|
2681
2731
|
const userDoc = await getDocumentById(firestoreDatabase, commonTerms.collections.users.name, user.uid);
|
|
2682
2732
|
const userData = userDoc.data();
|
|
2683
2733
|
if (!userData) {
|
|
2684
|
-
spinner.fail(`Unfortunately we could not find a user document with your information. This likely means that you did not pass the GitHub reputation checks and therefore are not elegible to contribute to any ceremony. Please contact the coordinator if you believe this to be an error.`);
|
|
2734
|
+
spinner.fail(`Unfortunately we could not find a user document with your information. This likely means that you did not pass the GitHub reputation checks and therefore are not elegible to contribute to any ceremony. If you believe you pass the requirements, it might be possible that your profile is private and we were not able to fetch your real statistics, in this case please consider making your profile public for the duration of the contribution. Please contact the coordinator if you believe this to be an error.`);
|
|
2685
2735
|
process.exit(0);
|
|
2686
2736
|
}
|
|
2687
2737
|
// Check the user's current participant readiness for contribution status (eligible, already contributed, timed out).
|
|
@@ -2832,7 +2882,7 @@ const observe = async () => {
|
|
|
2832
2882
|
// Preserve command execution only for coordinators].
|
|
2833
2883
|
if (!(await isCoordinator(user)))
|
|
2834
2884
|
showError(COMMAND_ERRORS.COMMAND_NOT_COORDINATOR, true);
|
|
2835
|
-
// Get running
|
|
2885
|
+
// Get running ceremonies info (if any).
|
|
2836
2886
|
const runningCeremoniesDocs = await getOpenedCeremonies(firestoreDatabase);
|
|
2837
2887
|
// Ask to select a ceremony.
|
|
2838
2888
|
const ceremony = await promptForCeremonySelection(runningCeremoniesDocs, false);
|
|
@@ -2901,7 +2951,7 @@ const handleVerifierSmartContract = async (cloudFunctions, bucketName, finalZkey
|
|
|
2901
2951
|
const packagePath = `${dirname(fileURLToPath(import.meta.url))}`;
|
|
2902
2952
|
const verifierPath = packagePath.includes(`src/commands`)
|
|
2903
2953
|
? `${dirname(fileURLToPath(import.meta.url))}/../../../../node_modules/snarkjs/templates/verifier_groth16.sol.ejs`
|
|
2904
|
-
: `${dirname(fileURLToPath(import.meta.url))}
|
|
2954
|
+
: `${dirname(fileURLToPath(import.meta.url))}/../node_modules/snarkjs/templates/verifier_groth16.sol.ejs`;
|
|
2905
2955
|
// Export the Solidity verifier smart contract.
|
|
2906
2956
|
const verifierCode = await exportVerifierContract(finalZkeyLocalFilePath, verifierPath);
|
|
2907
2957
|
spinner.text = `Writing verifier smart contract...`;
|
|
@@ -2928,10 +2978,11 @@ const handleVerifierSmartContract = async (cloudFunctions, bucketName, finalZkey
|
|
|
2928
2978
|
* @param participant <FirebaseDocumentInfo> - the Firestore document of the participant (coordinator).
|
|
2929
2979
|
* @param beacon <string> - the value used to compute the final contribution while finalizing the ceremony.
|
|
2930
2980
|
* @param coordinatorIdentifier <string> - the identifier of the coordinator.
|
|
2981
|
+
* @param circuitsLength <number> - the number of circuits in the ceremony.
|
|
2931
2982
|
*/
|
|
2932
|
-
const handleCircuitFinalization = async (cloudFunctions, firestoreDatabase, ceremony, circuit, participant, beacon, coordinatorIdentifier) => {
|
|
2983
|
+
const handleCircuitFinalization = async (cloudFunctions, firestoreDatabase, ceremony, circuit, participant, beacon, coordinatorIdentifier, circuitsLength) => {
|
|
2933
2984
|
// Step (1).
|
|
2934
|
-
await handleStartOrResumeContribution(cloudFunctions, firestoreDatabase, ceremony, circuit, participant, computeSHA256ToHex(beacon), coordinatorIdentifier, true);
|
|
2985
|
+
await handleStartOrResumeContribution(cloudFunctions, firestoreDatabase, ceremony, circuit, participant, computeSHA256ToHex(beacon), coordinatorIdentifier, true, circuitsLength);
|
|
2935
2986
|
await sleep(2000); // workaound for descriptors.
|
|
2936
2987
|
// Extract data.
|
|
2937
2988
|
const { prefix: circuitPrefix } = circuit.data;
|
|
@@ -2966,10 +3017,11 @@ const handleCircuitFinalization = async (cloudFunctions, firestoreDatabase, cere
|
|
|
2966
3017
|
* @dev For proper execution, the command requires the coordinator to be authenticated with a GitHub account (run auth command first) in order to
|
|
2967
3018
|
* handle sybil-resistance and connect to GitHub APIs to publish the gist containing the final public attestation.
|
|
2968
3019
|
*/
|
|
2969
|
-
const finalize = async () => {
|
|
3020
|
+
const finalize = async (opt) => {
|
|
2970
3021
|
const { firebaseApp, firebaseFunctions, firestoreDatabase } = await bootstrapCommandExecutionAndServices();
|
|
2971
3022
|
// Check for authentication.
|
|
2972
|
-
const {
|
|
3023
|
+
const { auth } = opt;
|
|
3024
|
+
const { user, providerUserId, token: coordinatorAccessToken } = auth ? await authWithToken(firebaseApp, auth) : await checkAuth(firebaseApp);
|
|
2973
3025
|
// Preserve command execution only for coordinators.
|
|
2974
3026
|
if (!(await isCoordinator(user)))
|
|
2975
3027
|
showError(COMMAND_ERRORS.COMMAND_NOT_COORDINATOR, true);
|
|
@@ -3004,7 +3056,7 @@ const finalize = async () => {
|
|
|
3004
3056
|
const circuits = await getCeremonyCircuits(firestoreDatabase, selectedCeremony.id);
|
|
3005
3057
|
// Handle finalization for each ceremony circuit.
|
|
3006
3058
|
for await (const circuit of circuits)
|
|
3007
|
-
await handleCircuitFinalization(firebaseFunctions, firestoreDatabase, selectedCeremony, circuit, participant, beacon, providerUserId);
|
|
3059
|
+
await handleCircuitFinalization(firebaseFunctions, firestoreDatabase, selectedCeremony, circuit, participant, beacon, providerUserId, circuits.length);
|
|
3008
3060
|
process.stdout.write(`\n`);
|
|
3009
3061
|
const spinner = customSpinner(`Wrapping up the finalization of the ceremony...`, "clock");
|
|
3010
3062
|
spinner.start();
|
|
@@ -3019,7 +3071,7 @@ const finalize = async () => {
|
|
|
3019
3071
|
// Generate attestation with final contributions.
|
|
3020
3072
|
const publicAttestation = await generateValidContributionsAttestation(firestoreDatabase, circuits, selectedCeremony.id, participant.id, contributions, providerUserId, ceremonyName, true);
|
|
3021
3073
|
// Write public attestation locally.
|
|
3022
|
-
writeFile(
|
|
3074
|
+
writeFile(getFinalAttestationLocalFilePath(`${prefix}_${finalContributionIndex}_${commonTerms.foldersAndPathsTerms.attestation}.log`), Buffer.from(publicAttestation));
|
|
3023
3075
|
await sleep(3000); // workaround for file descriptor unexpected close.
|
|
3024
3076
|
const gistUrl = await publishGist(coordinatorAccessToken, publicAttestation, ceremonyName, prefix);
|
|
3025
3077
|
console.log(`\n${theme.symbols.info} Your public final attestation has been successfully posted as Github Gist (${theme.text.bold(theme.text.underlined(gistUrl))})`);
|
|
@@ -3155,15 +3207,13 @@ program
|
|
|
3155
3207
|
.description("compute contributions for a Phase2 Trusted Setup ceremony circuits")
|
|
3156
3208
|
.option("-c, --ceremony <string>", "the prefix of the ceremony you want to contribute for", "")
|
|
3157
3209
|
.option("-e, --entropy <string>", "the entropy (aka toxic waste) of your contribution", "")
|
|
3210
|
+
.option("-a, --auth <string>", "the Github OAuth 2.0 token", "")
|
|
3158
3211
|
.action(contribute);
|
|
3159
3212
|
program
|
|
3160
3213
|
.command("clean")
|
|
3161
3214
|
.description("clean up output generated by commands from the current working directory")
|
|
3162
3215
|
.action(clean);
|
|
3163
|
-
program
|
|
3164
|
-
.command("list")
|
|
3165
|
-
.description("List all ceremonies prefixes")
|
|
3166
|
-
.action(listCeremonies);
|
|
3216
|
+
program.command("list").description("List all ceremonies prefixes").action(listCeremonies);
|
|
3167
3217
|
program
|
|
3168
3218
|
.command("logout")
|
|
3169
3219
|
.description("sign out from Firebae Auth service and delete Github OAuth 2.0 token from local storage")
|
|
@@ -3179,8 +3229,8 @@ const ceremony = program.command("coordinate").description("commands for coordin
|
|
|
3179
3229
|
ceremony
|
|
3180
3230
|
.command("setup")
|
|
3181
3231
|
.description("setup a Groth16 Phase 2 Trusted Setup ceremony for zk-SNARK circuits")
|
|
3182
|
-
.option(
|
|
3183
|
-
.option(
|
|
3232
|
+
.option("-t, --template <path>", "The path to the ceremony setup template", "")
|
|
3233
|
+
.option("-a, --auth <string>", "The Github OAuth 2.0 token", "")
|
|
3184
3234
|
.action(setup);
|
|
3185
3235
|
ceremony
|
|
3186
3236
|
.command("observe")
|
|
@@ -3189,5 +3239,6 @@ ceremony
|
|
|
3189
3239
|
ceremony
|
|
3190
3240
|
.command("finalize")
|
|
3191
3241
|
.description("finalize a Phase2 Trusted Setup ceremony by applying a beacon, exporting verification key and verifier contract")
|
|
3242
|
+
.option("-a, --auth <string>", "the Github OAuth 2.0 token", "")
|
|
3192
3243
|
.action(finalize);
|
|
3193
3244
|
program.parseAsync(process.argv);
|
|
@@ -36,8 +36,9 @@ export declare const handleVerifierSmartContract: (cloudFunctions: Functions, bu
|
|
|
36
36
|
* @param participant <FirebaseDocumentInfo> - the Firestore document of the participant (coordinator).
|
|
37
37
|
* @param beacon <string> - the value used to compute the final contribution while finalizing the ceremony.
|
|
38
38
|
* @param coordinatorIdentifier <string> - the identifier of the coordinator.
|
|
39
|
+
* @param circuitsLength <number> - the number of circuits in the ceremony.
|
|
39
40
|
*/
|
|
40
|
-
export declare const handleCircuitFinalization: (cloudFunctions: Functions, firestoreDatabase: Firestore, ceremony: FirebaseDocumentInfo, circuit: FirebaseDocumentInfo, participant: FirebaseDocumentInfo, beacon: string, coordinatorIdentifier: string) => Promise<void>;
|
|
41
|
+
export declare const handleCircuitFinalization: (cloudFunctions: Functions, firestoreDatabase: Firestore, ceremony: FirebaseDocumentInfo, circuit: FirebaseDocumentInfo, participant: FirebaseDocumentInfo, beacon: string, coordinatorIdentifier: string, circuitsLength: number) => Promise<void>;
|
|
41
42
|
/**
|
|
42
43
|
* Finalize command.
|
|
43
44
|
* @notice The finalize command allows a coordinator to finalize a Trusted Setup Phase 2 ceremony by providing the final beacon,
|
|
@@ -47,5 +48,5 @@ export declare const handleCircuitFinalization: (cloudFunctions: Functions, fire
|
|
|
47
48
|
* @dev For proper execution, the command requires the coordinator to be authenticated with a GitHub account (run auth command first) in order to
|
|
48
49
|
* handle sybil-resistance and connect to GitHub APIs to publish the gist containing the final public attestation.
|
|
49
50
|
*/
|
|
50
|
-
declare const finalize: () => Promise<void>;
|
|
51
|
+
declare const finalize: (opt: any) => Promise<void>;
|
|
51
52
|
export default finalize;
|
|
@@ -39,7 +39,7 @@ export declare const checkAndDownloadSmallestPowersOfTau: (powers: string, ptauC
|
|
|
39
39
|
* number of powers greater than or equal to the powers needed by the zKey), the coordinator will be asked
|
|
40
40
|
* to provide a number of powers manually, ranging from the smallest possible to the largest.
|
|
41
41
|
* @param neededPowers <number> - the smallest amount of powers needed by the zKey.
|
|
42
|
-
* @returns Promise<string, string> - the information about the
|
|
42
|
+
* @returns Promise<string, string> - the information about the chosen Powers of Tau file for the pre-computed zKey
|
|
43
43
|
* along with related powers.
|
|
44
44
|
*/
|
|
45
45
|
export declare const handlePreComputedZkeyPowersOfTauSelection: (neededPowers: number) => Promise<{
|
|
@@ -24,14 +24,14 @@ export declare const promptCircomCompiler: () => Promise<CircomCompilerData>;
|
|
|
24
24
|
* Shows a list of circuits for a single option selection.
|
|
25
25
|
* @dev the circuit names are derived from local R1CS files.
|
|
26
26
|
* @param options <Array<string>> - an array of circuits names.
|
|
27
|
-
* @returns Promise<string> - the name of the
|
|
27
|
+
* @returns Promise<string> - the name of the chosen circuit.
|
|
28
28
|
*/
|
|
29
29
|
export declare const promptCircuitSelector: (options: Array<string>) => Promise<string>;
|
|
30
30
|
/**
|
|
31
31
|
* Shows a list of standard EC2 VM instance types for a single option selection.
|
|
32
32
|
* @notice the suggested VM configuration type is calculated based on circuit constraint size.
|
|
33
33
|
* @param constraintSize <number> - the amount of circuit constraints
|
|
34
|
-
* @returns Promise<string> - the name of the
|
|
34
|
+
* @returns Promise<string> - the name of the chosen VM type.
|
|
35
35
|
*/
|
|
36
36
|
export declare const promptVMTypeSelector: (constraintSize: any) => Promise<string>;
|
|
37
37
|
/**
|
|
@@ -42,7 +42,7 @@ export declare const promptVMDiskTypeSelector: () => Promise<DiskTypeForVM>;
|
|
|
42
42
|
/**
|
|
43
43
|
* Show a series of questions about the circuits.
|
|
44
44
|
* @param constraintSize <number> - the amount of circuit constraints.
|
|
45
|
-
* @param timeoutMechanismType <CeremonyTimeoutType> - the
|
|
45
|
+
* @param timeoutMechanismType <CeremonyTimeoutType> - the chosen timeout mechanism type for the ceremony.
|
|
46
46
|
* @param needPromptCircomCompiler <boolean> - a boolean value indicating if the questions related to the Circom compiler version and commit hash must be asked.
|
|
47
47
|
* @param enforceVM <boolean> - a boolean value indicating if the contribution verification could be supported by VM-only approach or not.
|
|
48
48
|
* @returns Promise<Array<Circuit>> - circuit info prompted by the coordinator.
|
|
@@ -67,7 +67,7 @@ export declare const promptCircuitAddition: () => Promise<boolean>;
|
|
|
67
67
|
* Shows a list of pre-computed zKeys for a single option selection.
|
|
68
68
|
* @dev the names are derived from local zKeys files.
|
|
69
69
|
* @param options <Array<string>> - an array of pre-computed zKeys names.
|
|
70
|
-
* @returns Promise<string> - the name of the
|
|
70
|
+
* @returns Promise<string> - the name of the chosen pre-computed zKey.
|
|
71
71
|
*/
|
|
72
72
|
export declare const promptPreComputedZkeySelector: (options: Array<string>) => Promise<string>;
|
|
73
73
|
/**
|
|
@@ -80,7 +80,7 @@ export declare const promptNeededPowersForCircuit: (suggestedSmallestNeededPower
|
|
|
80
80
|
* Shows a list of PoT files for a single option selection.
|
|
81
81
|
* @dev the names are derived from local PoT files.
|
|
82
82
|
* @param options <Array<string>> - an array of PoT file names.
|
|
83
|
-
* @returns Promise<string> - the name of the
|
|
83
|
+
* @returns Promise<string> - the name of the chosen PoT.
|
|
84
84
|
*/
|
|
85
85
|
export declare const promptPotSelector: (options: Array<string>) => Promise<string>;
|
|
86
86
|
/**
|
|
@@ -154,5 +154,6 @@ export declare const getLatestUpdatesFromParticipant: (firestoreDatabase: Firest
|
|
|
154
154
|
* @param entropyOrBeaconHash <string> - the entropy or beacon hash (only when finalizing) for the contribution.
|
|
155
155
|
* @param contributorOrCoordinatorIdentifier <string> - the identifier of the contributor or coordinator (only when finalizing).
|
|
156
156
|
* @param isFinalizing <boolean> - flag to discriminate between ceremony finalization (true) and contribution (false).
|
|
157
|
+
* @param circuitsLength <number> - the total number of circuits in the ceremony.
|
|
157
158
|
*/
|
|
158
|
-
export declare const handleStartOrResumeContribution: (cloudFunctions: Functions, firestoreDatabase: Firestore, ceremony: FirebaseDocumentInfo, circuit: FirebaseDocumentInfo, participant: FirebaseDocumentInfo, entropyOrBeaconHash: any, contributorOrCoordinatorIdentifier: string, isFinalizing: boolean) => Promise<void>;
|
|
159
|
+
export declare const handleStartOrResumeContribution: (cloudFunctions: Functions, firestoreDatabase: Firestore, ceremony: FirebaseDocumentInfo, circuit: FirebaseDocumentInfo, participant: FirebaseDocumentInfo, entropyOrBeaconHash: any, contributorOrCoordinatorIdentifier: string, isFinalizing: boolean, circuitsLength: number) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devtion/devcli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-521e678",
|
|
5
5
|
"description": "All-in-one interactive command-line for interfacing with zkSNARK Phase 2 Trusted Setup ceremonies",
|
|
6
6
|
"repository": "git@github.com:privacy-scaling-explorations/p0tion.git",
|
|
7
7
|
"homepage": "https://github.com/privacy-scaling-explorations/p0tion",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"publishConfig": {
|
|
98
98
|
"access": "public"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "beff6640bb9ab31a1625f952ef13adfb59468280"
|
|
101
101
|
}
|