|
8 | 8 |
|
9 | 9 | ### CLI |
10 | 10 |
|
11 | | -The `@generationsoftware/pt-v5-cli` [node module package](https://www.npmjs.com/package/@generationsoftware/pt-v5-cli) is a Node command line interface (CLI) to interact with the **PoolTogether V5 protocol**. The CLI uses the `v5-autotasks-library` modules to fetch and run calculations/computations for essential PoolTogether V5 tasks. |
| 11 | +The `@generationsoftware/pt-v5-cli` [node module package](https://www.npmjs.com/package/@generationsoftware/pt-v5-cli) is a Node command line interface (CLI) to interact with the **PoolTogether V5 protocol**. The CLI uses the `pt-v5-utils-js` package to fetch and run calculations/computations for essential PoolTogether V5 tasks. |
12 | 12 |
|
13 | 13 | Primary CLI Commands (help) |
14 | 14 |
|
15 | 15 | ```sh |
16 | | -npx @generationsoftware/pt-v5-cli help compute drawPrizes |
| 16 | +npx @generationsoftware/pt-v5-cli help utils vaultAccounts |
| 17 | +npx @generationsoftware/pt-v5-cli help utils concatWinners |
17 | 18 | ``` |
18 | 19 |
|
19 | 20 | # ⌨️ CLI Installation |
20 | 21 |
|
21 | 22 | <!-- usage --> |
| 23 | + |
22 | 24 | ```sh-session |
23 | 25 | $ npm install -g @generationsoftware/pt-v5-cli |
24 | 26 | $ ptv5 COMMAND |
25 | 27 | running command... |
26 | 28 | $ ptv5 (--version) |
27 | | -@generationsoftware/pt-v5-cli/1.0.9 darwin-arm64 node-v18.16.0 |
| 29 | +@generationsoftware/pt-v5-cli/1.1.1 darwin-arm64 node-v18.17.0 |
28 | 30 | $ ptv5 --help [COMMAND] |
29 | 31 | USAGE |
30 | 32 | $ ptv5 COMMAND |
31 | 33 | ... |
32 | 34 | ``` |
| 35 | + |
33 | 36 | <!-- usagestop --> |
34 | 37 |
|
35 | 38 | # Commands |
36 | 39 |
|
37 | | -## Compute Draw Prizes |
| 40 | +## Compute Vault Accounts |
| 41 | + |
| 42 | +```sh-session |
| 43 | +ptv5 utils vaultAccounts |
| 44 | +``` |
| 45 | + |
| 46 | +Computes the previous draw's depositors with a non-zero balance for a PrizePool to a target output directory. |
| 47 | + |
| 48 | +JSON is in the format required by the [@GenerationSoftware/foundry-winner-calc](https://github.com/@GenerationSoftware/foundry-winner-calc) repo to quickly winners. |
| 49 | + |
| 50 | +Simply pass a `chainId`, `prizePool` and `outDir` to compute and locally save the results. |
| 51 | + |
| 52 | +``` |
| 53 | +USAGE |
| 54 | + $ ptv5 utils vaultAccounts --chainId 1 --outDir ./temp --prizePool '0xdd4d117723C257CEe402285D3aCF218E9A8236E1' |
| 55 | +
|
| 56 | +DESCRIPTION |
| 57 | + Computes the previous draw's depositors with a non-zero balance for a PrizePool to a target output directory. |
| 58 | +
|
| 59 | +EXAMPLES |
| 60 | + $ ptv5 utils vaultAccounts --chainId 1 --prizePool 0x0000000000000000000000000000000000000000 --outDir ./temp |
| 61 | + Running utils:vaultAccounts on chainId: 1 |
| 62 | +``` |
| 63 | + |
| 64 | +## Vaults Files ([vaultAddress].json) |
| 65 | + |
| 66 | +```json |
| 67 | +{ |
| 68 | + "chainId": 10, |
| 69 | + "prizePoolAddress": "0xe32e5E1c5f0c80bD26Def2d0EA5008C107000d6A", |
| 70 | + "vaultAddress": "0xf0B19f02c63d51B69563A2b675e0160e1C34397C", |
| 71 | + "userAddresses": [ |
| 72 | + "0x07967251f6db5f9d095119379bd8fc4fce60b3e1", |
| 73 | + "0x084039db4e3c6775eabfc59cbd3725d3d9a6d752" |
| 74 | + // ... |
| 75 | + ] |
| 76 | +} |
| 77 | +``` |
| 78 | + |
| 79 | +## Status File (status.json) |
| 80 | + |
| 81 | +```json |
| 82 | +{ |
| 83 | + "status": "LOADING", |
| 84 | + "createdAt": "11" |
| 85 | +} |
| 86 | +``` |
| 87 | + |
| 88 | +### Success |
| 89 | + |
| 90 | +```json |
| 91 | +{ |
| 92 | + "status": "SUCCESS", |
| 93 | + "createdAt": 1693423691768, |
| 94 | + "updatedAt": 1693423805132, |
| 95 | + "runtime": 114, |
| 96 | + "meta": { |
| 97 | + "numVaults": 7, |
| 98 | + "numTiers": 3, |
| 99 | + "numPrizeIndices": 21, |
| 100 | + "numAccounts": 3830 |
| 101 | + } |
| 102 | +} |
| 103 | +``` |
| 104 | + |
| 105 | +### Failure |
| 106 | + |
| 107 | +```json |
| 108 | +{ |
| 109 | + "status": "FAILURE", |
| 110 | + "createdAt": "11", |
| 111 | + "updatedAt": "33", |
| 112 | + "runtime": "22", |
| 113 | + "error": "ErrorCode" |
| 114 | +} |
| 115 | +``` |
| 116 | + |
| 117 | +## Concat Winners |
38 | 118 |
|
39 | 119 | ```sh-session |
40 | | -ptv5 compute drawPrizes |
| 120 | +ptv5 utils concatWinners |
41 | 121 | ``` |
42 | 122 |
|
43 | | -Computes the previous draw's prizes for a PrizePool to a target output directory. |
| 123 | +Receives all of the winners by vault JSON files created by the [foundry-winner-calc](https://github.com/GenerationSoftware/foundry-winner-calc?tab=readme-ov-file) tool and ties them into one winners.json file. Therefore is dependent on `foundry-winner-calc` running prior to concatWinners being run. |
44 | 124 |
|
45 | 125 | Simply pass a `chainId`, `prizePool` and `outDir` to compute and locally save the results. |
46 | 126 |
|
47 | 127 | ``` |
48 | 128 | USAGE |
49 | | - $ ptv5 compute drawPrizes --chainId 1 --outDir ./temp --prizePool '0xdd4d117723C257CEe402285D3aCF218E9A8236E1' |
| 129 | + $ ptv5 utils concatWinners --chainId 1 --outDir ./temp --prizePool '0xdd4d117723C257CEe402285D3aCF218E9A8236E1' |
50 | 130 |
|
51 | 131 | DESCRIPTION |
52 | | - Computes the previous draw's prizes for a PrizePool to a target output directory. |
| 132 | + Ingests foundry-winner-calc output files and ties them into one winners.json file. |
53 | 133 |
|
54 | 134 | EXAMPLES |
55 | | - $ ptv5 compute drawPrizes --chainId 1 --prizePool 0x0000000000000000000000000000000000000000 --outDir ./temp |
56 | | - Running compute:drawPrizes on chainId: 1 |
| 135 | + $ ptv5 utils concatWinners --chainId 1 --prizePool 0x0000000000000000000000000000000000000000 --outDir ./temp |
| 136 | + Running utils:concatWinners on chainId: 1 |
57 | 137 | ``` |
58 | 138 |
|
59 | 139 | ## Prizes File (prizes.json) |
@@ -100,24 +180,7 @@ EXAMPLES |
100 | 180 | "numVaults": 7, |
101 | 181 | "numTiers": 3, |
102 | 182 | "numPrizeIndices": 21, |
103 | | - "numAccounts": 3830, |
104 | | - "numPrizes": 21, |
105 | | - "prizePoolReserve": "431450369493570544008", |
106 | | - "amountsTotal": "318001330964753848953", |
107 | | - "tierPrizeAmounts": { |
108 | | - "0": "271304907889060131200", |
109 | | - "1": "45062486366179690039", |
110 | | - "2": "1633936709514027714" |
111 | | - }, |
112 | | - "vaultPortions": { |
113 | | - "0x0410cae69dd01f58224d54881648e35c6cb874fa": "12491920408565", |
114 | | - "0x0bfe04201c496a9994b920deb6087a60bdadfbbb": "973235150974337855", |
115 | | - "0x4b7a2e1a70ea05523542c9189fa51b133884f321": "232229504251603", |
116 | | - "0x9e11c3d53a68c07f6d839e5d89a94052753cedcb": "5916502876505634", |
117 | | - "0xb9a647d3391b939cb49b44d3c5e93c63d96ad4a4": "9173734225780914", |
118 | | - "0xe2ef926250b0e8a07578d76d9f57e5092340a6fa": "11429890498715426", |
119 | | - "0xffb08a9ffc360806be7ef8cf815c1274ef92cea9": "0" |
120 | | - } |
| 183 | + "numAccounts": 3830 |
121 | 184 | } |
122 | 185 | } |
123 | 186 | ``` |
@@ -160,8 +223,8 @@ DESCRIPTION |
160 | 223 |
|
161 | 224 | ### Using the tool in dev |
162 | 225 |
|
163 | | -You can test the CLI while developing by using the following, with whichever chain / prizePool flags you want to test with: |
| 226 | +You can test the CLI while developing by using the following, with whichever chain & prizePool flags you want to test with: |
164 | 227 |
|
165 | 228 | ``` |
166 | | -./bin/run.js compute drawPrizes --chainId 80001 -o ./temp -p '0xA32C8f94191c9295634f0034eb2b0e2749e77974' |
| 229 | +./bin/run.js utils vaultAccounts --chainId 80001 -o ./temp -p '0xA32C8f94191c9295634f0034eb2b0e2749e77974' |
167 | 230 | ``` |
0 commit comments