@devtion/devcli 0.0.0-7e983e3 → 0.0.0-a6dcd68

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/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="AIzaSyC_m2yETFfuJ_dO5mtQfyU6qlc8k3CTFUY"
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="pse-p0tion-production.firebaseapp.com"
11
+ # The Firebase Application project id (should match with application name).
12
+ FIREBASE_PROJECT_ID="pse-p0tion-production"
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="791425100143"
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:791425100143:web:86313c4d311c8f6014a09a"
19
+ FIREBASE_CF_URL_VERIFY_CONTRIBUTION="https://verifycontribution-h3mhz7ox4a-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="057a55ac6fe383cfcc3a"
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="-pse-p0tion-production"
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(verification.user_code, { 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-7e983e3",
4
+ "version": "0.0.0-a6dcd68",
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",
@@ -67,7 +67,8 @@
67
67
  "@octokit/auth-oauth-app": "^5.0.5",
68
68
  "@octokit/auth-oauth-device": "^4.0.4",
69
69
  "@octokit/request": "^6.2.3",
70
- "@p0tion/actions": "^1.0.5",
70
+ "@p0tion/actions": "^0.0.0-a6dcd68",
71
+ "@aws-sdk/client-s3": "^3.329.0",
71
72
  "blakejs": "^1.2.1",
72
73
  "boxen": "^7.1.0",
73
74
  "chalk": "^5.2.0",
@@ -95,6 +96,5 @@
95
96
  },
96
97
  "publishConfig": {
97
98
  "access": "public"
98
- },
99
- "gitHead": "afae72061a3b366b05508de53fe91e9b254cc3d5"
99
+ }
100
100
  }
@@ -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(verification.user_code, { 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(
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Ethereum Foundation
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.