@devtion/devcli 0.0.0-5d170d3 → 0.0.0-7140596

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 CHANGED
@@ -61,6 +61,8 @@ or run specific commands with `npx`:
61
61
  npx @p0tion/phase2cli contribute
62
62
  ```
63
63
 
64
+ > Please note that phase2cli only runs on Linux or Mac systems. If a Windows user, please install [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install) first.
65
+
64
66
  ## 📜 Usage
65
67
 
66
68
  ### Local Development
package/dist/.env CHANGED
@@ -1,41 +1,40 @@
1
- ### FIREBASE ###
2
- ### These configs are related to the configuration of the Firebase services.
3
-
4
-
5
- # The Firebase Application API key for making request against the services.
6
- # nb. this is going to be auto-generated when creating a new application.
7
- FIREBASE_API_KEY=AIzaSyDVAu8U4zBpM3FFLPyktSjZnCmg1IR73Cg
8
- # The URL to Firebase Authentication service (should point to default).
9
- # nb. this is going to be auto-generated when creating a new application.
10
- FIREBASE_AUTH_DOMAIN=p0tion-ci-environment.firebaseapp.com
11
- # The Firebase Application project id (should match with application name).
12
- FIREBASE_PROJECT_ID=p0tion-ci-environment
13
- # The Firebase unique message sender identifier (to recognize the application user).
14
- # nb. this is going to be auto-generated when creating a new application.
15
- FIREBASE_MESSAGING_SENDER_ID=22680510841
16
- # The Firebase unique identifier for your application.
17
- # nb. this is going to be auto-generated when creating a new application.
18
- FIREBASE_APP_ID=1:22680510841:web:529a664e73dbabd1c7cfa8
19
- FIREBASE_CF_URL_VERIFY_CONTRIBUTION=https://verifycontribution-mq4aqokliq-ew.a.run.app
20
-
21
- ### AUTHENTICATION ###
22
- ### These configs are related to the authentication of users.
23
-
24
- # The unique identifier for the Github client associated to the OAuth Application.
25
- AUTH_GITHUB_CLIENT_ID=e9f8a5fabdfe0d95618c
26
-
27
- ### AWS S3 STORAGE ###
28
- ### These configs are related to the configuration of the interaction with the
29
- ### AWS S3 bucket used as storage for ceremony artifacts.
30
-
31
- # The chunk size to be used when executing multi-part upload or downloads.
32
- # default 50 MBs.
33
- # (e.g. a 200 MB file setting a stream chunk size of 50 MB is going to be splitted and uploaded/downloaded in 4 chunks).
34
- CONFIG_STREAM_CHUNK_SIZE_IN_MB=50
35
- # The postfix string for each ceremony bucket.
36
- # default -ph2-ceremony
37
- CONFIG_CEREMONY_BUCKET_POSTFIX=-p0tion-development-environment
38
- # The amount of time in seconds which indicates the duration about the validity of a pre-signed URL.
39
- # default: 7200 seconds = 2 hours.
40
- CONFIG_PRESIGNED_URL_EXPIRATION_IN_SECONDS=7200
1
+ ### FIREBASE ###
2
+ ### These configs are related to the configuration of the Firebase services.
41
3
 
4
+
5
+ # The Firebase Application API key for making request against the services.
6
+ # nb. this is going to be auto-generated when creating a new application.
7
+ FIREBASE_API_KEY="AIzaSyDVAu8U4zBpM3FFLPyktSjZnCmg1IR73Cg"
8
+ # The URL to Firebase Authentication service (should point to default).
9
+ # nb. this is going to be auto-generated when creating a new application.
10
+ FIREBASE_AUTH_DOMAIN="p0tion-ci-environment.firebaseapp.com"
11
+ # The Firebase Application project id (should match with application name).
12
+ FIREBASE_PROJECT_ID="p0tion-ci-environment"
13
+ # The Firebase unique message sender identifier (to recognize the application user).
14
+ # nb. this is going to be auto-generated when creating a new application.
15
+ FIREBASE_MESSAGING_SENDER_ID="22680510841"
16
+ # The Firebase unique identifier for your application.
17
+ # nb. this is going to be auto-generated when creating a new application.
18
+ FIREBASE_APP_ID="1:22680510841:web:529a664e73dbabd1c7cfa8"
19
+ FIREBASE_CF_URL_VERIFY_CONTRIBUTION="https://verifycontribution-mq4aqokliq-ew.a.run.app"
20
+
21
+ ### AUTHENTICATION ###
22
+ ### These configs are related to the authentication of users.
23
+
24
+ # The unique identifier for the Github client associated to the OAuth Application.
25
+ AUTH_GITHUB_CLIENT_ID="e9f8a5fabdfe0d95618c"
26
+
27
+ ### AWS S3 STORAGE ###
28
+ ### These configs are related to the configuration of the interaction with the
29
+ ### AWS S3 bucket used as storage for ceremony artifacts.
30
+
31
+ # The chunk size to be used when executing multi-part upload or downloads.
32
+ # default 50 MBs.
33
+ # (e.g. a 200 MB file setting a stream chunk size of 50 MB is going to be splitted and uploaded/downloaded in 4 chunks).
34
+ CONFIG_STREAM_CHUNK_SIZE_IN_MB=50
35
+ # The postfix string for each ceremony bucket.
36
+ # default "-ph2-ceremony"
37
+ CONFIG_CEREMONY_BUCKET_POSTFIX="-p0tion-development-environment"
38
+ # The amount of time in seconds which indicates the duration about the validity of a pre-signed URL.
39
+ # default: 7200 seconds = 2 hours.
40
+ CONFIG_PRESIGNED_URL_EXPIRATION_IN_SECONDS=7200
package/dist/index.js CHANGED
@@ -2113,8 +2113,9 @@ const onVerification = async (verification) => {
2113
2113
  clipboard.writeSync(verification.user_code);
2114
2114
  clipboard.readSync();
2115
2115
  // Display data.
2116
- 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`);
2117
- console.log(`${theme.symbols.info} Your auth code: ${theme.text.bold(verification.user_code)} (${theme.emojis.clipboard} ${theme.symbols.success})\n`);
2116
+ 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`);
2117
+ console.log(theme.colors.magenta(figlet.textSync("Code is Below", { font: "ANSI Shadow" })), '\n');
2118
+ console.log(`${theme.symbols.info} Your auth code: ${theme.text.bold(verification.user_code)} has been copied to your clipboard (${theme.emojis.clipboard} ${theme.symbols.success})\n`);
2118
2119
  const spinner = customSpinner(`Redirecting to Github...`, `clock`);
2119
2120
  spinner.start();
2120
2121
  await sleep(10000); // ~10s to make users able to read the CLI.
@@ -2407,7 +2408,6 @@ const listenToCeremonyCircuitDocumentChanges = (firestoreDatabase, ceremonyId, p
2407
2408
  const { avgTimings, waitingQueue } = changedCircuit.data();
2408
2409
  const { fullContribution, verifyCloudFunction } = avgTimings;
2409
2410
  const { currentContributor } = waitingQueue;
2410
- // Get circuit current contributor participant document.
2411
2411
  const circuitCurrentContributor = await getDocumentById(firestoreDatabase, getParticipantsCollectionPath(ceremonyId), currentContributor);
2412
2412
  // Check data.
2413
2413
  if (!circuitCurrentContributor.data())
@@ -2616,7 +2616,7 @@ const listenToParticipantDocumentChanges = async (firestoreDatabase, cloudFuncti
2616
2616
  // Get latest contribution verification result.
2617
2617
  await getLatestVerificationResult(firestoreDatabase, ceremony.id, circuit.id, participant.id);
2618
2618
  // Get next circuit for contribution.
2619
- const nextCircuit = getCircuitBySequencePosition(circuits, changedContributionProgress + 1);
2619
+ const nextCircuit = timeoutExpired ? getCircuitBySequencePosition(circuits, changedContributionProgress) : getCircuitBySequencePosition(circuits, changedContributionProgress + 1);
2620
2620
  // Check disk space requirements for participant.
2621
2621
  const wannaGenerateAttestation = await handleDiskSpaceRequirementForNextContribution(cloudFunctions, ceremony.id, nextCircuit.data.sequencePosition, nextCircuit.data.zKeySizeInBytes, timeoutExpired, providerUserId);
2622
2622
  // Check if the participant would like to generate a new attestation.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devtion/devcli",
3
3
  "type": "module",
4
- "version": "0.0.0-5d170d3",
4
+ "version": "0.0.0-7140596",
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",
@@ -64,10 +64,11 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@adobe/node-fetch-retry": "^2.2.0",
67
+ "@aws-sdk/client-s3": "^3.329.0",
68
+ "@devtion/actions": "latest",
67
69
  "@octokit/auth-oauth-app": "^5.0.5",
68
70
  "@octokit/auth-oauth-device": "^4.0.4",
69
71
  "@octokit/request": "^6.2.3",
70
- "@p0tion/actions": "^1.0.5",
71
72
  "blakejs": "^1.2.1",
72
73
  "boxen": "^7.1.0",
73
74
  "chalk": "^5.2.0",
@@ -96,5 +97,5 @@
96
97
  "publishConfig": {
97
98
  "access": "public"
98
99
  },
99
- "gitHead": "ff032e8717f4aac3f66730e0a256660c2e741505"
100
+ "gitHead": "5f4dde47fdee59378296f3581ce9c7ce01676083"
100
101
  }
@@ -4,6 +4,7 @@ import { Verification } from "@octokit/auth-oauth-device/dist-types/types.js"
4
4
  import clipboard from "clipboardy"
5
5
  import dotenv from "dotenv"
6
6
  import open from "open"
7
+ import figlet from "figlet"
7
8
  import { fileURLToPath } from "url"
8
9
  import { dirname } from "path"
9
10
  import { GENERIC_ERRORS, showError } from "../lib/errors.js"
@@ -69,10 +70,13 @@ export const onVerification = async (verification: Verification): Promise<void>
69
70
  console.log(
70
71
  `${theme.symbols.warning} Visit ${theme.text.bold(
71
72
  theme.text.underlined(verification.verification_uri)
72
- )} on this device to generate a new token and authenticate`
73
+ )} on this device to generate a new token and authenticate\n`
73
74
  )
75
+
76
+ console.log(theme.colors.magenta(figlet.textSync("Code is Below", { font: "ANSI Shadow" })), '\n')
77
+
74
78
  console.log(
75
- `${theme.symbols.info} Your auth code: ${theme.text.bold(verification.user_code)} (${theme.emojis.clipboard} ${
79
+ `${theme.symbols.info} Your auth code: ${theme.text.bold(verification.user_code)} has been copied to your clipboard (${theme.emojis.clipboard} ${
76
80
  theme.symbols.success
77
81
  })\n`
78
82
  )
@@ -464,7 +464,6 @@ export const listenToCeremonyCircuitDocumentChanges = (
464
464
  const { fullContribution, verifyCloudFunction } = avgTimings
465
465
  const { currentContributor } = waitingQueue
466
466
 
467
- // Get circuit current contributor participant document.
468
467
  const circuitCurrentContributor = await getDocumentById(
469
468
  firestoreDatabase,
470
469
  getParticipantsCollectionPath(ceremonyId),
@@ -811,7 +810,7 @@ export const listenToParticipantDocumentChanges = async (
811
810
  await getLatestVerificationResult(firestoreDatabase, ceremony.id, circuit.id, participant.id)
812
811
 
813
812
  // Get next circuit for contribution.
814
- const nextCircuit = getCircuitBySequencePosition(circuits, changedContributionProgress + 1)
813
+ const nextCircuit = timeoutExpired ? getCircuitBySequencePosition(circuits, changedContributionProgress) : getCircuitBySequencePosition(circuits, changedContributionProgress + 1)
815
814
 
816
815
  // Check disk space requirements for participant.
817
816
  const wannaGenerateAttestation = await handleDiskSpaceRequirementForNextContribution(