@devtion/devcli 1.0.5-alpha.0
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 +118 -0
- package/dist/index.js +3206 -0
- package/dist/types/commands/auth.d.ts +25 -0
- package/dist/types/commands/clean.d.ts +6 -0
- package/dist/types/commands/contribute.d.ts +139 -0
- package/dist/types/commands/finalize.d.ts +51 -0
- package/dist/types/commands/index.d.ts +9 -0
- package/dist/types/commands/listCeremonies.d.ts +5 -0
- package/dist/types/commands/logout.d.ts +6 -0
- package/dist/types/commands/observe.d.ts +22 -0
- package/dist/types/commands/setup.d.ts +86 -0
- package/dist/types/commands/validate.d.ts +8 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lib/errors.d.ts +60 -0
- package/dist/types/lib/files.d.ts +64 -0
- package/dist/types/lib/localConfigs.d.ts +110 -0
- package/dist/types/lib/prompts.d.ts +104 -0
- package/dist/types/lib/services.d.ts +31 -0
- package/dist/types/lib/theme.d.ts +42 -0
- package/dist/types/lib/utils.d.ts +158 -0
- package/dist/types/types/index.d.ts +65 -0
- package/package.json +99 -0
- package/src/commands/auth.ts +194 -0
- package/src/commands/clean.ts +49 -0
- package/src/commands/contribute.ts +1090 -0
- package/src/commands/finalize.ts +382 -0
- package/src/commands/index.ts +9 -0
- package/src/commands/listCeremonies.ts +32 -0
- package/src/commands/logout.ts +67 -0
- package/src/commands/observe.ts +193 -0
- package/src/commands/setup.ts +901 -0
- package/src/commands/validate.ts +29 -0
- package/src/index.ts +66 -0
- package/src/lib/errors.ts +77 -0
- package/src/lib/files.ts +102 -0
- package/src/lib/localConfigs.ts +186 -0
- package/src/lib/prompts.ts +748 -0
- package/src/lib/services.ts +191 -0
- package/src/lib/theme.ts +45 -0
- package/src/lib/utils.ts +778 -0
- package/src/types/conf.d.ts +16 -0
- package/src/types/index.ts +70 -0
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> | </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> | </span>
|
|
39
|
+
<a href="https://discord.gg/sF5CT5rzrR">
|
|
40
|
+
🗣️ Chat & 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
|
+
```
|