@elgora/cli 10.2.0 → 11.0.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.
Files changed (3) hide show
  1. package/README.md +69 -35
  2. package/dist/cli.js +3219 -2756
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -55,29 +55,74 @@ answer.
55
55
  creates the small advisory `VerificationRecord` for a finalized bounty, which
56
56
  `GET /api/bounties/<bounty_id>` inlines.
57
57
 
58
- Run `elgora-cli help <command>` for exact arguments and environment variables.
58
+ Run `elgora-cli help <command>` for exact arguments, options, and secrets.
59
59
  Run `elgora-cli --version` to print the installed release's version; it is the
60
60
  version of the npm package or standalone binary in use, stamped in at build
61
61
  time, so it stays correct however the CLI was installed.
62
62
 
63
- ## Wallets and keys
63
+ ## Signers
64
64
 
65
- Posters use `ELGORA_POSTER_PRIVATE_KEY`. Solvers should normally use
66
- `--solver-address` and sign the emitted EIP-712 requests and prepared
67
- transaction with an external wallet; `ELGORA_SOLVER_PRIVATE_KEY` is an optional
68
- local testing convenience. Each emitted `typed_data` is in the
69
- `eth_signTypedData_v4` shape, with `EIP712Domain` in its types; for ethers v6,
70
- delete `types.EIP712Domain` before passing it to `signTypedData`. Claimants can
71
- use `--claimant-address`, or `ELGORA_CLAIMANT_PRIVATE_KEY` for a local test
72
- wallet.
65
+ Functional choices are options; the environment holds only secrets. A command
66
+ names any option it does not accept. `--signer` chooses how its one account
67
+ signs:
68
+
69
+ | `--signer` | Use | Settings |
70
+ | --- | --- | --- |
71
+ | `local` (default) | a private key | `ELGORA_PRIVATE_KEY` |
72
+ | `privy` | a Privy server wallet, e.g. an unattended Guardian | `--privy-wallet-id <id>`, optional `--privy-sponsor`; `PRIVY_APP_ID`, `PRIVY_APP_SECRET`, optional `PRIVY_AUTHORIZATION_PRIVATE_KEY` |
73
+ | `manual` | your own wallet tooling, so no key enters this process | `--signer-address <address>` |
74
+
75
+ `--signer-address` also checks the account any signer resolves to. The account
76
+ may be a plain key, a contract wallet (ERC-1271/6492), or an EIP-7702 account;
77
+ Elgora verifies every signature on chain.
78
+
79
+ ### `--signer manual`
80
+
81
+ For each signature or transaction the command needs, it writes a request file
82
+ and prints one line on stdout:
83
+
84
+ ```json
85
+ {"event":"signer.request_written","kind":"api_request_approval","request_path":"…/01-api_request_approval.request.json","response_path":"…/01-api_request_approval.response","expires_at":"…"}
86
+ ```
87
+
88
+ The request holds `kind`, `address`, `chain_id`, and one of `typed_data`
89
+ (EIP-712, `eth_signTypedData_v4` shape), `message` (hex bytes for
90
+ `personal_sign`), or `calls` (`to`, `value`, `data`). Sign or send it with your
91
+ own wallet, then write the signature, or the transaction hash(es) separated by
92
+ spaces, to `response_path` before `expires_at` (25 minutes for a signature, 60
93
+ for transactions). The CLI verifies each signature on chain and keeps
94
+ checking an answer that does not pass, so one refused during an RPC outage
95
+ still counts once the check succeeds. An unanswered transaction request ends in
96
+ `verification_pending`, since it may have been sent anyway.
97
+
98
+ ### Transactions
99
+
100
+ Commands send their transactions last. `--prepare-only` prints them as
101
+ `<event>.calls_prepared` (`chain_id`, `from`, `calls`) instead. A sent
102
+ transaction counts only once ElgoraHub shows its effect: the command prints
103
+ `<event>.recorded`, fails, or prints `<event>.verification_pending` and exits
104
+ 75 when it may be on chain but is not confirmed yet. Check ElgoraHub before
105
+ running it again; a second `poster:publish-fund` funds a second bounty.
106
+
107
+ The CLI checks only real transactions: their receipts and ElgoraHub, through
108
+ its RPC. It never talks to a bundler or paymaster and cannot resolve a user
109
+ operation hash or a Safe transaction id. A smart wallet's calls count once the
110
+ wallet hands back the hash of the transaction they were mined in; with
111
+ `--signer manual`, write that hash, and with `--signer privy --privy-sponsor`,
112
+ Privy reports it.
113
+
114
+ A local key funds a bounty with one USDC authorization (EIP-3009); any other
115
+ signer funds through `approve`, then `createBounty`.
116
+
117
+ ### Guardian keys
73
118
 
74
119
  Guardian commands use two different kinds of secret:
75
120
 
76
- - `ELGORA_GUARDIAN_ACCOUNT_PRIVATE_KEY` is the Guardian's Ethereum account key.
77
- It signs protected Submission reads, API writes, and `commitVerdict`
78
- transactions.
121
+ - The Guardian's account, as above. It signs protected Submission reads, API
122
+ writes, the roster key proof, and `commitVerdict` transactions.
79
123
  - `ELGORA_GUARDIAN_PRIVATE_KEYS_JSON` contains retained X25519 encryption keys.
80
- They decrypt Submissions and never sign transactions.
124
+ They decrypt Submissions and never sign. They stay local whatever
125
+ `--signer` is.
81
126
 
82
127
  A Guardian may retain old and new X25519 keys after rotating the public key for
83
128
  the same account. The CLI tries the retained keys locally so an earlier bounty
@@ -107,15 +152,16 @@ elgora-cli claim --network 84532 7 # the same, by chain id
107
152
  export ELGORA_CHAIN_ID=84532 # testnet for every run in this shell
108
153
  ```
109
154
 
110
- The chain's public RPC, the ElgoraHub address, the escrow token, and the subgraph
111
- endpoint are all defaulted from that chain id, so targeting Elgora's own
112
- deployment needs no other configuration. They stay individually settable:
113
- `ELGORA_HUB_ADDRESS`, `ELGORA_RPC_URL`, and `ELGORA_SUBGRAPH_ENDPOINT` override
114
- what the chain id resolved — a local anvil stack needs them, since its addresses
115
- change on every run. `elgora-cli help <command>` lists what that command reads
116
- and which values it defaults. Supply a complete, coherent configuration when
117
- targeting a deployment this CLI release does not know about, and do not mix
118
- addresses or endpoints from different deployments.
155
+ The chain's public RPC, the ElgoraHub address, and the subgraph endpoint are all
156
+ defaulted from that chain id, so targeting Elgora's own deployment needs no
157
+ other configuration. They stay individually settable: `--hub-address`,
158
+ `--rpc-url`, and `--subgraph-endpoint` (or `ELGORA_HUB_ADDRESS`,
159
+ `ELGORA_RPC_URL`, `ELGORA_SUBGRAPH_ENDPOINT`) override what the chain id
160
+ resolved — a local anvil stack needs them, since its addresses change on every
161
+ run. The escrow token is read from ElgoraHub. `elgora-cli help <command>` lists
162
+ the options that command accepts. Supply a complete, coherent configuration
163
+ when targeting a deployment this CLI release does not know about, and do not
164
+ mix addresses or endpoints from different deployments.
119
165
 
120
166
  The API follows the chain too: `https://elgora.ai` for `base` and
121
167
  `https://testnet.elgora.ai` for `base-sepolia`. Commands that use the public API
@@ -136,18 +182,6 @@ wallet, gets the same result a bounty page visit would — it reads that page's
136
182
  own `GET /api/bounties/<bounty_id>`. A bounty with no record yet fails with the
137
183
  reason the API gave.
138
184
 
139
- ## Solver custody
140
-
141
- `solver:submit --solver-address <address> <bounty_id> <artifact_dir>` prints an
142
- approval request whenever the API needs a signed write. Sign its exact
143
- `typed_data` value and return only the hex signature on stdin. The CLI then
144
- checks the pinned Guardian roster directly against ElgoraHub, verifies the four
145
- prepared `submit` values, and locally encodes the transaction for the same
146
- wallet.
147
-
148
- Without `--solver-address`, `ELGORA_SOLVER_PRIVATE_KEY` signs and sends the same
149
- requests locally. It is intended only for controlled testing.
150
-
151
185
  ## Development
152
186
 
153
187
  From the repository root: