@devtion/devcli 0.0.0-7e983e3

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.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +118 -0
  3. package/dist/.env +41 -0
  4. package/dist/index.js +3206 -0
  5. package/dist/types/commands/auth.d.ts +25 -0
  6. package/dist/types/commands/clean.d.ts +6 -0
  7. package/dist/types/commands/contribute.d.ts +139 -0
  8. package/dist/types/commands/finalize.d.ts +51 -0
  9. package/dist/types/commands/index.d.ts +9 -0
  10. package/dist/types/commands/listCeremonies.d.ts +5 -0
  11. package/dist/types/commands/logout.d.ts +6 -0
  12. package/dist/types/commands/observe.d.ts +22 -0
  13. package/dist/types/commands/setup.d.ts +86 -0
  14. package/dist/types/commands/validate.d.ts +8 -0
  15. package/dist/types/index.d.ts +2 -0
  16. package/dist/types/lib/errors.d.ts +60 -0
  17. package/dist/types/lib/files.d.ts +64 -0
  18. package/dist/types/lib/localConfigs.d.ts +110 -0
  19. package/dist/types/lib/prompts.d.ts +104 -0
  20. package/dist/types/lib/services.d.ts +31 -0
  21. package/dist/types/lib/theme.d.ts +42 -0
  22. package/dist/types/lib/utils.d.ts +158 -0
  23. package/dist/types/types/index.d.ts +65 -0
  24. package/package.json +100 -0
  25. package/src/commands/auth.ts +194 -0
  26. package/src/commands/clean.ts +49 -0
  27. package/src/commands/contribute.ts +1090 -0
  28. package/src/commands/finalize.ts +382 -0
  29. package/src/commands/index.ts +9 -0
  30. package/src/commands/listCeremonies.ts +32 -0
  31. package/src/commands/logout.ts +67 -0
  32. package/src/commands/observe.ts +193 -0
  33. package/src/commands/setup.ts +901 -0
  34. package/src/commands/validate.ts +29 -0
  35. package/src/index.ts +66 -0
  36. package/src/lib/errors.ts +77 -0
  37. package/src/lib/files.ts +102 -0
  38. package/src/lib/localConfigs.ts +186 -0
  39. package/src/lib/prompts.ts +748 -0
  40. package/src/lib/services.ts +191 -0
  41. package/src/lib/theme.ts +45 -0
  42. package/src/lib/utils.ts +778 -0
  43. package/src/types/conf.d.ts +16 -0
  44. package/src/types/index.ts +70 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
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.
package/README.md ADDED
@@ -0,0 +1,118 @@
1
+ <p align="center">
2
+ <h1 align="center">
3
+ Phase2 CLI 👨‍💻
4
+ </h1>
5
+ <p align="center">All-in-one command line tool for interfacing with Groth16 zkSNARKs Phase 2 Trusted Setup ceremonies</p>
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="https://github.com/privacy-scaling-explorations/p0tion">
10
+ <img src="https://img.shields.io/badge/project-p0tion-blue.svg?style=flat-square">
11
+ </a>
12
+ <a href="https://github.com/privacy-scaling-explorations/p0tion/blob/main/LICENSE">
13
+ <img alt="Github License" src="https://img.shields.io/github/license/privacy-scaling-explorations/p0tion.svg?style=flat-square">
14
+ </a>
15
+ <a href="https://www.npmjs.com/package/@p0tion/phase2cli">
16
+ <img alt="NPM Version" src="https://img.shields.io/npm/v/@p0tion/phase2cli?style=flat-square" />
17
+ </a>
18
+ <a href="https://npmjs.org/package/@p0tion/phase2cli">
19
+ <img alt="Downloads" src="https://img.shields.io/npm/dm/@p0tion/phase2cli.svg?style=flat-square" />
20
+ </a>
21
+ <a href="https://eslint.org/">
22
+ <img alt="Linter" src="https://img.shields.io/badge/linter-eslint-8080f2?style=flat-square&logo=eslint" />
23
+ </a>
24
+ <a href="https://prettier.io/">
25
+ <img alt="Prettier" src="https://img.shields.io/badge/code%20style-prettier-f8bc45?style=flat-square&logo=prettier" />
26
+ </a>
27
+ </p>
28
+
29
+ <div align="center">
30
+ <h4>
31
+ <a href="https://github.com/privacy-scaling-explorations/p0tion/blob/main/CONTRIBUTING.md">
32
+ 👥 Contributing
33
+ </a>
34
+ <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
35
+ <a href="https://github.com/privacy-scaling-explorations/p0tion/blob/main/CODE_OF_CONDUCT.md">
36
+ 🤝 Code of conduct
37
+ </a>
38
+ <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
39
+ <a href="https://discord.gg/sF5CT5rzrR">
40
+ 🗣️ Chat &amp; Support
41
+ </a>
42
+ </h4>
43
+ </div>
44
+
45
+ | The interaction with Trusted Setup ceremonies commonly involves the usage of different tools according to the roles (coordinator vs. participants) and ceremony stages (setup, contribution, finalization). The Phase2 CLI acts as an all-in-one independent interface with a custom set of user-friendly and interactive commands. |
46
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
47
+
48
+ Rounding up the option of using a unique tool for different ceremony stages makes it possible to reduce the context switch, level of expertise, and bug exposure. This standard tool (built on top of the `actions` package) contains only the core commands for interfacing with one or more Trusted Setup Phase 2 ceremonies. You could get advantage from these commands and customize (or extend them) based on your unique ceremony needs. By using the CLI, the computing power of the contributor's machine could be fully exploited thus enabling contributions up to larger sizes than with ordinary web-browser clients.
49
+
50
+ ## 🛠 Installation
51
+
52
+ Install the `@p0tion/phase2cli` package globally
53
+
54
+ ```bash
55
+ npm i -g @p0tion/phase2cli
56
+ ```
57
+
58
+ or run specific commands with `npx`:
59
+
60
+ ```bash
61
+ npx @p0tion/phase2cli contribute
62
+ ```
63
+
64
+ ## 📜 Usage
65
+
66
+ ### Local Development
67
+
68
+ **Prerequisities**
69
+
70
+ - Node.js version 16.0 or higher.
71
+ - Yarn version 3.5.0 or higher.
72
+
73
+ Copy the `.env.default` file as `.env`:
74
+
75
+ ```bash
76
+ cp .env.default .env
77
+ ```
78
+
79
+ And add your environment variables.
80
+
81
+ ⚠️ Your environment variables must match the corresponding properties values inside the `.env` file of the `actions` package ⚠️
82
+
83
+ #### Core Commands
84
+
85
+ ```bash
86
+ Usage: phase2cli [options] [command]
87
+
88
+ All-in-one command line tool for interfacing with Groth16 zkSNARKs Phase 2 Trusted Setup ceremonies
89
+
90
+ Options:
91
+ -V, --version output the version number
92
+ -h, --help display help for command
93
+
94
+ Commands:
95
+ auth authenticate yourself using your Github Account (Device Flow OAuth 2.0)
96
+ contribute compute contributions for a Phase2 Trusted Setup ceremony circuits
97
+ clean clean up output generated by commands from the current working directory
98
+ logout sign out from Firebae Auth service and delete Github OAuth 2.0 token from your machine
99
+ coordinate special subset of commands for coordinating a ceremony (coordinator only)
100
+ help [command] display help for command
101
+ ```
102
+
103
+ #### Coordinator Commands
104
+
105
+ ```bash
106
+ Usage: phase2cli coordinate [options] [command]
107
+
108
+ special subset of commands for coordinating a ceremony (coordinator only)
109
+
110
+ Options:
111
+ -h, --help display help for command
112
+
113
+ Commands:
114
+ setup setup a Groth16 Phase 2 Trusted Setup ceremony for zk-SNARK circuits
115
+ observe real-time updates about queue status for each ceremony circuit
116
+ finalize finalize a Phase2 Trusted Setup ceremony (beacon + artifacts exports)
117
+ help [command] display help for command
118
+ ```
package/dist/.env ADDED
@@ -0,0 +1,41 @@
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
41
+