hyper-multisig-cli 1.5.0 → 1.6.1
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/bin.js +17 -7
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -29,10 +29,14 @@ const cmdRequest = command(
|
|
|
29
29
|
const cmdVerify = command(
|
|
30
30
|
'verify',
|
|
31
31
|
description('Verify multisig'),
|
|
32
|
+
flag('--start <start>', 'Start length'),
|
|
33
|
+
flag('--blobs-start <blobsStart>', 'Blobs start length'),
|
|
32
34
|
flag(
|
|
33
35
|
'--first-commit',
|
|
34
36
|
'Set when this is the first commit to the multisig target, so it skips those checks'
|
|
35
37
|
),
|
|
38
|
+
flag('--skip-target-well-seeded', 'Skip checking multisig target is well seeded'),
|
|
39
|
+
|
|
36
40
|
flag('--peer-update-timeout <ms>', 'Peer update timeout in ms'),
|
|
37
41
|
arg('request', 'Signing request'),
|
|
38
42
|
rest('[...responses]', 'Signing responses'),
|
|
@@ -139,11 +143,12 @@ async function request() {
|
|
|
139
143
|
}
|
|
140
144
|
|
|
141
145
|
async function verify() {
|
|
142
|
-
const { firstCommit, peerUpdateTimeout } =
|
|
146
|
+
const { start, blobsStart, firstCommit, peerUpdateTimeout, skipTargetWellSeeded } =
|
|
147
|
+
cmdVerify.flags
|
|
143
148
|
const request = cmdVerify.args.request
|
|
144
149
|
const responses = cmdVerify.rest || []
|
|
145
150
|
if (!request) throw new Error('Invalid command')
|
|
146
|
-
console.info(`
|
|
151
|
+
console.info(`Verifying request ${request}`)
|
|
147
152
|
console.info(`Responses:\n -${responses.join('\n -')}`)
|
|
148
153
|
|
|
149
154
|
const { type, publicKeys, namespace, srcKey, quorum, store, swarm } = await setup()
|
|
@@ -152,18 +157,23 @@ async function verify() {
|
|
|
152
157
|
let runner
|
|
153
158
|
if (type === 'core') {
|
|
154
159
|
const srcCore = store.get({ key: idEnc.decode(srcKey) })
|
|
155
|
-
runner = multisig.
|
|
156
|
-
|
|
160
|
+
runner = multisig.verifyCore(publicKeys, namespace, srcCore, request, responses, {
|
|
161
|
+
start,
|
|
157
162
|
skipTargetChecks: firstCommit,
|
|
163
|
+
skipTargetWellSeeded,
|
|
158
164
|
peerUpdateTimeout: peerUpdateTimeout,
|
|
165
|
+
swarmAsServer: false,
|
|
159
166
|
quorum
|
|
160
167
|
})
|
|
161
168
|
} else {
|
|
162
169
|
const srcDrive = new Hyperdrive(store, idEnc.decode(srcKey))
|
|
163
|
-
runner = multisig.
|
|
164
|
-
|
|
170
|
+
runner = multisig.verifyDrive(publicKeys, namespace, srcDrive, request, responses, {
|
|
171
|
+
start,
|
|
172
|
+
blobsStart,
|
|
165
173
|
skipTargetChecks: firstCommit,
|
|
174
|
+
skipTargetWellSeeded,
|
|
166
175
|
peerUpdateTimeout: peerUpdateTimeout,
|
|
176
|
+
swarmAsServer: false,
|
|
167
177
|
quorum
|
|
168
178
|
})
|
|
169
179
|
}
|
|
@@ -316,7 +326,7 @@ function setupProgressLogs(req, name, firstCommit, dryRun) {
|
|
|
316
326
|
)
|
|
317
327
|
})
|
|
318
328
|
req.on('commit-start', () => {
|
|
319
|
-
console.log(dryRun ? `Dry
|
|
329
|
+
console.log(dryRun ? `Dry running the ${name} commit` : `Committing the ${name}...`)
|
|
320
330
|
})
|
|
321
331
|
req.on('verify-committed-start', (key) => {
|
|
322
332
|
console.log(`Committed the ${name}, key ${idEnc.normalize(key)} (hex: ${key.toString('hex')})`)
|