|
2 | 2 |
|
3 | 3 | import { zKey } from "snarkjs"
|
4 | 4 | import boxen from "boxen"
|
5 |
| -import { createWriteStream, Dirent, renameSync, createReadStream } from "fs" |
| 5 | +import { createWriteStream, Dirent, renameSync } from "fs" |
6 | 6 | import { pipeline } from "node:stream"
|
7 | 7 | import { promisify } from "node:util"
|
8 | 8 | import fetch from "node-fetch"
|
9 | 9 | import { Functions } from "firebase/functions"
|
10 | 10 | import { S3Client, GetObjectCommand } from "@aws-sdk/client-s3"
|
11 |
| -import { getSignedUrl } from "@aws-sdk/s3-request-presigner" |
12 | 11 | import {
|
13 | 12 | CeremonyTimeoutType,
|
14 | 13 | CircomCompilerData,
|
@@ -65,7 +64,6 @@ import {
|
65 | 64 | checkAndMakeNewDirectoryIfNonexistent
|
66 | 65 | } from "../lib/files.js"
|
67 | 66 | import { Readable } from "stream"
|
68 |
| -import { transferObject } from "@p0tion/actions" |
69 | 67 |
|
70 | 68 | /**
|
71 | 69 | * Handle whatever is needed to obtain the input data for a circuit that the coordinator would like to add to the ceremony.
|
@@ -462,37 +460,6 @@ export const handleCircuitArtifactUploadToStorage = async (
|
462 | 460 | spinner.succeed(`Upload of (${theme.text.bold(completeFilename)}) file completed successfully`)
|
463 | 461 | }
|
464 | 462 |
|
465 |
| -/** |
466 |
| - * Transfer a file between two buckets |
467 |
| - * @param firebaseFunctions <Functions> - the Firebase Cloud Functions instance connected to the current application. |
468 |
| - * @param bucketName <string> - the ceremony bucket name. |
469 |
| - * @param storageFilePath <string> - the storage (bucket) path where the file should be uploaded. |
470 |
| - * @param sourceBucketName <string> - the source bucket name. |
471 |
| - * @param sourceObjectKey <string> - the source object key. |
472 |
| - * @param completeFilename <string> - the complete filename. |
473 |
| - */ |
474 |
| -export const handleCircuitArtifactTransferToStorage = async ( |
475 |
| - firebaseFunctions: Functions, |
476 |
| - bucketName: string, |
477 |
| - storageFilePath: string, |
478 |
| - sourceBucketName: string, |
479 |
| - sourceObjectKey: string, |
480 |
| - completeFilename: string |
481 |
| -) => { |
482 |
| - const spinner = customSpinner(`Transfering ${theme.text.bold(completeFilename)} file to ceremony storage...`, `clock`) |
483 |
| - spinner.start() |
484 |
| - |
485 |
| - await transferObject( |
486 |
| - firebaseFunctions, |
487 |
| - sourceBucketName, |
488 |
| - bucketName, |
489 |
| - sourceObjectKey, |
490 |
| - storageFilePath |
491 |
| - ) |
492 |
| - |
493 |
| - spinner.succeed(`Transfer of (${theme.text.bold(completeFilename)}) file completed successfully`) |
494 |
| -} |
495 |
| - |
496 | 463 | /**
|
497 | 464 | * Setup command.
|
498 | 465 | * @notice The setup command allows the coordinator of the ceremony to prepare the next ceremony by interacting with the CLI.
|
@@ -608,23 +575,21 @@ const setup = async (cmd: { template?: string, auth?: string}) => {
|
608 | 575 | circuit.files.potFilename
|
609 | 576 | )
|
610 | 577 |
|
611 |
| - // Move r1cs between buckets |
612 |
| - await handleCircuitArtifactTransferToStorage( |
| 578 | + // Upload r1cs to Storage. |
| 579 | + await handleCircuitArtifactUploadToStorage( |
613 | 580 | firebaseFunctions,
|
614 |
| - ceremonySetupData.circuitArtifacts[index].artifacts.bucket, |
615 |
| - ceremonySetupData.circuitArtifacts[index].artifacts.r1csStoragePath, |
616 | 581 | bucketName,
|
617 | 582 | circuit.files.r1csStoragePath,
|
| 583 | + r1csLocalPathAndFileName, |
618 | 584 | circuit.files.r1csFilename
|
619 | 585 | )
|
620 | 586 |
|
621 |
| - // Move wasm between buckets. |
622 |
| - await handleCircuitArtifactTransferToStorage( |
| 587 | + // Upload wasm to Storage. |
| 588 | + await handleCircuitArtifactUploadToStorage( |
623 | 589 | firebaseFunctions,
|
624 |
| - ceremonySetupData.circuitArtifacts[index].artifacts.bucket, |
625 |
| - ceremonySetupData.circuitArtifacts[index].artifacts.wasmStoragePath, |
626 | 590 | bucketName,
|
627 | 591 | circuit.files.wasmStoragePath,
|
| 592 | + r1csLocalPathAndFileName, |
628 | 593 | circuit.files.wasmFilename
|
629 | 594 | )
|
630 | 595 |
|
|
0 commit comments