Skip to content

Commit 6efef18

Browse files
committed
online: store ceremony artifacts in AWS S3
Add a storage backend for AWS S3. Configure the server to use this backend if relevant config is provided. Otherwise fall back to tmpfs. Signed-off-by: Wojciech Zmuda <[email protected]>
1 parent 5c790cc commit 6efef18

File tree

8 files changed

+488
-9
lines changed

8 files changed

+488
-9
lines changed

README.md

Lines changed: 118 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* [`ptau`](#ptau)
1616
* [Online mode commands](#online-mode-commands)
1717
* [`server`](#server)
18+
* [Using AWS S3 for artifacts storage](#using-aws-s3-for-artifacts-storage)
1819
* [`client`](#client)
1920
* [Offline mode commands](#offline-mode-commands)
2021
* [`init`](#init)
@@ -23,9 +24,6 @@
2324
* [`extract-keys`](#extract-keys)
2425
<!-- TOC -->
2526

26-
**Warning**
27-
Please note that this tool is under development. Please consider it unusable before the first release.
28-
2927
## Overview
3028
This utility program allows for performing a Trusted Setup Ceremony in a Multi-Party Computation fashion. It is meant
3129
to be used by the Coordinator of the ceremony, as well as by the Contributors. In the end, the Coordinator will obtain
@@ -170,15 +168,132 @@ The server is configured with a JSON file. An example configuration is shown bel
170168
"r1cs": "resources/server.r1cs",
171169
// The path to the Phase 1 file (possibly generated from a ptau file - see the `ptau` command for details).
172170
"phase1": "resources/server.ph1",
171+
// (optional) If true, AWS S3 is chosen as the storage backend. If false or not present,
172+
// the server will fall back to storing artifacts in tmpfs.
173+
"useS3": true,
174+
// (optional) Name of the AWS S3 bucket to store ceremony artifacts. The bucket must exist.
175+
// If not provided, this information is taken from a default source (env or AWS CLI config file).
176+
"s3Bucket": "my-ceremony-bucket",
177+
// (optional) Region of the AWS S3 bucket to store ceremony artifacts.
178+
// If not provided, this information is taken from a default source (env or AWS CLI config file).
179+
"s3Region": "us-east-1",
180+
// (optional) Profile of the AWS S3 bucket to store ceremony artifacts.
181+
// If not provided, this information is taken from a default source (env or AWS CLI config file).
182+
"s3Profile": "test",
183+
// (optional) Credentials file for AWS S3.
184+
// If not provided, this information is taken from a default source (env or AWS CLI config file).
185+
"s3CredentialsFile": "~/.aws/credentials",
173186
}
174187
```
175188

176189
Coordination of the ceremony is automatic. No action from the Coordinator is required besides starting the server
177190
and stopping it with CTRL+C at any arbitrary moment. At CTRL+C, the server stops accepting new contributions and starts
178191
key extraction from the existing contributions.
179192

193+
At the end of the contribution, the artifacts are either saved in the temporary filesystem or in the AWS S3, depending
194+
on the provided configuration. The stored artifacts are:
195+
- SRS commons of the circuit,
196+
- all intermediate Phase 2 files,
197+
- Proving Key,
198+
- Verifying Key,
199+
- JSON structured log documenting the ceremony.
200+
201+
These artifacts are enough to re-generate the keys again using the offline mode [`extract-keys`](#extract-keys) command.
202+
180203
- `--config` - Path to a JSON file containing the server configuration.
181204

205+
Example usage:
206+
207+
```shell
208+
$ ./trusted-setup server --config small.json
209+
2025/09/02 00:33:00 Loading config file: small.json
210+
2025/09/02 00:33:00 Loading R1CS from online/test/resources/server.r1cs
211+
2025/09/02 00:33:00 Loading Phase 1 from online/test/resources/server.ph1
212+
2025/09/02 00:33:01 INF beacon=a40d1701974c7e804732d3bf21131137f6b05dc054b073d0e48110ed2099f11c
213+
2025/09/02 00:33:01 Ceremony artifacts will be stored in tmpfs
214+
2025/09/02 00:33:01 Initializing Phase 2
215+
2025/09/02 00:33:02 INF new ceremony started name=testCeremony
216+
2025/09/02 00:33:02 Server started, waiting for Contributors on 127.0.0.1:7312...
217+
2025/09/02 00:33:02 Press Ctrl+C to end Ceremony and generate Keys
218+
2025/09/02 00:33:09 INF new contributor connected ip=127.0.0.1:64624
219+
2025/09/02 00:33:09 INF contributor position update ip=127.0.0.1:64624 newQueuePosition=0
220+
2025/09/02 00:33:09 INF sending last accepted contribution ip=127.0.0.1:64624
221+
2025/09/02 00:33:09 INF sent last accepted contribution ip=127.0.0.1:64624 size=27147
222+
2025/09/02 00:33:09 INF receiving new contribution candidate ip=127.0.0.1:64624
223+
2025/09/02 00:33:09 INF new contribution candidate accepted ip=127.0.0.1:64624 size=27179
224+
^C2025/09/02 00:33:15 Generating keys out of 1 contributions...
225+
2025/09/02 00:33:15 Artifacts generated in the ceremony:
226+
2025/09/02 00:33:15 /var/folders/jh/bj77hlmj3k50qyxt3tzlbrwc0000gn/T/testCeremony-srs-commons-1639893806
227+
2025/09/02 00:33:15 /var/folders/jh/bj77hlmj3k50qyxt3tzlbrwc0000gn/T/testCeremony-phase2-1-3080991318
228+
2025/09/02 00:33:15 /var/folders/jh/bj77hlmj3k50qyxt3tzlbrwc0000gn/T/testCeremony-pk-2115635955
229+
2025/09/02 00:33:15 /var/folders/jh/bj77hlmj3k50qyxt3tzlbrwc0000gn/T/testCeremony-vk-2427354540
230+
2025/09/02 00:33:15 /var/folders/jh/bj77hlmj3k50qyxt3tzlbrwc0000gn/T/testCeremony-log-454330672
231+
2025/09/02 00:33:15 Operation successful
232+
```
233+
234+
Example structured JSON log from the above ceremony:
235+
236+
```json
237+
{"level":"info","beacon":"a40d1701974c7e804732d3bf21131137f6b05dc054b073d0e48110ed2099f11c","time":"2025-09-02T00:33:01+02:00"}
238+
{"level":"info","name":"testCeremony","time":"2025-09-02T00:33:02+02:00","message":"new ceremony started"}
239+
{"level":"info","ip":"127.0.0.1:64624","time":"2025-09-02T00:33:09+02:00","message":"new contributor connected"}
240+
{"level":"info","newQueuePosition":0,"ip":"127.0.0.1:64624","time":"2025-09-02T00:33:09+02:00","message":"contributor position update"}
241+
{"level":"info","ip":"127.0.0.1:64624","time":"2025-09-02T00:33:09+02:00","message":"sending last accepted contribution"}
242+
{"level":"info","ip":"127.0.0.1:64624","size":27147,"time":"2025-09-02T00:33:09+02:00","message":"sent last accepted contribution"}
243+
{"level":"info","ip":"127.0.0.1:64624","time":"2025-09-02T00:33:09+02:00","message":"receiving new contribution candidate"}
244+
{"level":"info","ip":"127.0.0.1:64624","size":27179,"time":"2025-09-02T00:33:09+02:00","message":"new contribution candidate accepted"}
245+
```
246+
247+
##### Using AWS S3 for artifacts storage
248+
249+
The server can store the ceremony artifacts in AWS S3.
250+
251+
AWS S3 is chosen as the storage backend if `useS3` configuration field is set to `true`. If the field is `false` or not
252+
present, the server will use tmpfs for storage. Some S3 settings can be overridden. See [`server`](#server)
253+
for the details on the configuration file.
254+
255+
AWS S3 credentials are loaded from the credentials file. This file is automatically generated by the
256+
[AWS CLI tool](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html). The file can be
257+
generated as follows:
258+
259+
```shell
260+
$ aws configure --profile <profile name>
261+
AWS Access Key ID [None]: <ID>
262+
AWS Secret Access Key [None]: <key>
263+
Default region name [None]: <region name>
264+
Default output format [None]:
265+
```
266+
267+
After the ceremony, the bucket can be queried as follows:
268+
269+
```shell
270+
$ AWS_PROFILE=test aws s3 ls s3://ceremony-bucket
271+
2025-09-02 01:58:10 998 log
272+
2025-09-02 01:58:05 27179 phase2-1
273+
2025-09-02 01:58:09 59955 pk
274+
2025-09-02 01:58:04 98248 srs-commons
275+
2025-09-02 01:58:10 364 vk
276+
```
277+
278+
Artifacts can be downloaded as follows:
279+
280+
```shell
281+
$ AWS_PROFILE=test aws s3 cp s3://ceremony-bucket/ ceremony_artifacts --recursive
282+
download: s3://ceremony-bucket/log to ceremony_artifacts/log
283+
download: s3://ceremony-bucket/vk to ceremony_artifacts/vk
284+
download: s3://ceremony-bucket/phase2-1 to ceremony_artifacts/phase2-1
285+
download: s3://ceremony-bucket/pk to ceremony_artifacts/pk
286+
download: s3://ceremony-bucket/srs-commons to ceremony_artifacts/srs-commons
287+
288+
$ ls -l ceremony_artifacts
289+
total 384
290+
-rw-r--r--@ 1 user group 998 Sep 2 01:58 log
291+
-rw-r--r--@ 1 user group 27179 Sep 2 01:58 phase2-1
292+
-rw-r--r--@ 1 user group 59955 Sep 2 01:58 pk
293+
-rw-r--r--@ 1 user group 98248 Sep 2 01:58 srs-commons
294+
-rw-r--r--@ 1 user group 364 Sep 2 01:58 vk
295+
```
296+
182297
#### `client`
183298

184299
Connect to a Ceremony [server](#server) and provide contributions. This step is performed by the Contributors.

go.mod

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ module github.com/reilabs/trusted-setup
33
go 1.24
44

55
require (
6+
github.com/aws/aws-sdk-go-v2 v1.38.2
7+
github.com/aws/aws-sdk-go-v2/config v1.31.4
8+
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.19.2
9+
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.2
610
github.com/consensys/gnark v0.13.0
711
github.com/consensys/gnark-crypto v0.18.0
812
github.com/drand/go-clients v0.2.3
@@ -18,6 +22,21 @@ replace github.com/worldcoin/ptau-deserializer => github.com/reilabs/ptau-deseri
1822

1923
require (
2024
github.com/BurntSushi/toml v1.5.0 // indirect
25+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.1 // indirect
26+
github.com/aws/aws-sdk-go-v2/credentials v1.18.8 // indirect
27+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.5 // indirect
28+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.5 // indirect
29+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.5 // indirect
30+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
31+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.5 // indirect
32+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect
33+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.5 // indirect
34+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.5 // indirect
35+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.5 // indirect
36+
github.com/aws/aws-sdk-go-v2/service/sso v1.28.3 // indirect
37+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.1 // indirect
38+
github.com/aws/aws-sdk-go-v2/service/sts v1.38.1 // indirect
39+
github.com/aws/smithy-go v1.23.0 // indirect
2140
github.com/beorn7/perks v1.0.1 // indirect
2241
github.com/bits-and-blooms/bitset v1.22.0 // indirect
2342
github.com/blang/semver/v4 v4.0.0 // indirect
@@ -32,6 +51,7 @@ require (
3251
github.com/hashicorp/go-multierror v1.1.1 // indirect
3352
github.com/hashicorp/golang-lru v1.0.2 // indirect
3453
github.com/ingonyama-zk/icicle-gnark/v3 v3.2.2 // indirect
54+
github.com/johannesboyne/gofakes3 v0.0.0-20250825084532-6555d310c473 // indirect
3555
github.com/kilic/bls12-381 v0.1.0 // indirect
3656
github.com/mattn/go-colorable v0.1.14 // indirect
3757
github.com/mattn/go-isatty v0.0.20 // indirect
@@ -43,15 +63,18 @@ require (
4363
github.com/prometheus/common v0.65.0 // indirect
4464
github.com/prometheus/procfs v0.17.0 // indirect
4565
github.com/ronanh/intcomp v1.1.1 // indirect
66+
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect
4667
github.com/x448/float16 v0.8.4 // indirect
4768
go.dedis.ch/fixbuf v1.0.3 // indirect
69+
go.shabbyrobe.org/gocovmerge v0.0.0-20230507111327-fa4f82cfbf4d // indirect
4870
go.uber.org/multierr v1.11.0 // indirect
4971
go.uber.org/zap v1.27.0 // indirect
5072
golang.org/x/crypto v0.39.0 // indirect
5173
golang.org/x/net v0.41.0 // indirect
5274
golang.org/x/sync v0.15.0 // indirect
5375
golang.org/x/sys v0.33.0 // indirect
5476
golang.org/x/text v0.26.0 // indirect
77+
golang.org/x/tools v0.33.0 // indirect
5578
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect
5679
gopkg.in/yaml.v3 v3.0.1 // indirect
5780
)

go.sum

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,44 @@ github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg
22
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
33
github.com/ardanlabs/darwin/v2 v2.0.0 h1:XCisQMgQ5EG+ZvSEcADEo+pyfIMKyWAGnn5o2TgriYE=
44
github.com/ardanlabs/darwin/v2 v2.0.0/go.mod h1:MubZ2e9DAYGaym0mClSOi183NYahrrfKxvSy1HMhoes=
5+
github.com/aws/aws-sdk-go-v2 v1.38.2 h1:QUkLO1aTW0yqW95pVzZS0LGFanL71hJ0a49w4TJLMyM=
6+
github.com/aws/aws-sdk-go-v2 v1.38.2/go.mod h1:sDioUELIUO9Znk23YVmIk86/9DOpkbyyVb1i/gUNFXY=
7+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.1 h1:i8p8P4diljCr60PpJp6qZXNlgX4m2yQFpYk+9ZT+J4E=
8+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.1/go.mod h1:ddqbooRZYNoJ2dsTwOty16rM+/Aqmk/GOXrK8cg7V00=
9+
github.com/aws/aws-sdk-go-v2/config v1.31.4 h1:aY2IstXOfjdLtr1lDvxFBk5DpBnHgS5GS3jgR/0BmPw=
10+
github.com/aws/aws-sdk-go-v2/config v1.31.4/go.mod h1:1IAykiegrTp6n+CbZoCpW6kks1I74fEDgl2BPQSkLSU=
11+
github.com/aws/aws-sdk-go-v2/credentials v1.18.8 h1:0FfdP0I9gs/f1rwtEdkcEdsclTEkPB8o6zWUG2Z8+IM=
12+
github.com/aws/aws-sdk-go-v2/credentials v1.18.8/go.mod h1:9UReQ1UmGooX93JKzHyr7PRF3F+p3r+PmRwR7+qHJYA=
13+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.5 h1:ul7hICbZ5Z/Pp9VnLVGUVe7rqYLXCyIiPU7hQ0sRkow=
14+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.5/go.mod h1:5cIWJ0N6Gjj+72Q6l46DeaNtcxXHV42w/Uq3fIfeUl4=
15+
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.19.2 h1:eZAl6tdv3HrIHAxbpnDQByEOD84bmxyhLmgvUYJ8ggo=
16+
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.19.2/go.mod h1:vV+YS0SWfpwbIGOUWbB5NWklaYKscfYrQRb9ggHptxs=
17+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.5 h1:d45S2DqHZOkHu0uLUW92VdBoT5v0hh3EyR+DzMEh3ag=
18+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.5/go.mod h1:G6e/dR2c2huh6JmIo9SXysjuLuDDGWMeYGibfW2ZrXg=
19+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.5 h1:ENhnQOV3SxWHplOqNN1f+uuCNf9n4Y/PKpl6b1WRP0Q=
20+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.5/go.mod h1:csQLMI+odbC0/J+UecSTztG70Dc4aTCOu4GyPNDNpVo=
21+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo=
22+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=
23+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.5 h1:ovHE1XM53pMGOwINf8Mas4FMl5XRRMAihNokV1YViZ8=
24+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.5/go.mod h1:Cmu/DOSYwcr0xYTFk7sA9NJ5HF3ND0EqNUBdoK16nPI=
25+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 h1:oegbebPEMA/1Jny7kvwejowCaHz1FWZAQ94WXFNCyTM=
26+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1/go.mod h1:kemo5Myr9ac0U9JfSjMo9yHLtw+pECEHsFtJ9tqCEI8=
27+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.5 h1:gC3YW8AojITDXfI5avcKZst5iOg6v5aQEU4HIcxwAss=
28+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.5/go.mod h1:z5OdVolKifM0NpEel6wLkM/TQ0eodWB2dmDFoj3WCbw=
29+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.5 h1:Cx1M/UUgYu9UCQnIMKaOhkVaFvLy1HneD6T4sS/DlKg=
30+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.5/go.mod h1:fTRNLgrTvPpEzGqc9QkeO4hu/3ng+mdtUbL8shUwXz4=
31+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.5 h1:IM2yO5Dd9bzCmYEvLU6Di5kduRKh4O93TjrZ47hxLhQ=
32+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.5/go.mod h1:0nXagJIQFWms6GJ1jvPJLwr8r3hN6f+kTwt17Q2NrPQ=
33+
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.2 h1:HNAbIp6VXmtKR+JuDmywGcRc3kYoIGT9y4a2Zg9bSTQ=
34+
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.2/go.mod h1:6VSEglrPCTx7gi7Z7l/CtqSgbnFr1N6UJ6+Ik+vjuEo=
35+
github.com/aws/aws-sdk-go-v2/service/sso v1.28.3 h1:z6lajFT/qGlLRB/I8V5CCklqSuWZKUkdwRAn9leIkiQ=
36+
github.com/aws/aws-sdk-go-v2/service/sso v1.28.3/go.mod h1:BnyjuIX0l+KXJVl2o9Ki3Zf0M4pA2hQYopFCRUj9ADU=
37+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.1 h1:8yI3jK5JZ310S8RpgdZdzwvlvBu3QbG8DP7Be/xJ6yo=
38+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.1/go.mod h1:HPzXfFgrLd02lYpcFYdDz5xZs94LOb+lWlvbAGaeMsk=
39+
github.com/aws/aws-sdk-go-v2/service/sts v1.38.1 h1:3kWmIg5iiWPMBJyq/I55Fki5fyfoMtrn/SkUIpxPwHQ=
40+
github.com/aws/aws-sdk-go-v2/service/sts v1.38.1/go.mod h1:yi0b3Qez6YamRVJ+Rbi19IgvjfjPODgVRhkWA6RTMUM=
41+
github.com/aws/smithy-go v1.23.0 h1:8n6I3gXzWJB2DxBDnfxgBaSX6oe0d/t10qGz7OKqMCE=
42+
github.com/aws/smithy-go v1.23.0/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=
543
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
644
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
745
github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4=
@@ -65,6 +103,8 @@ github.com/ingonyama-zk/icicle-gnark/v3 v3.2.2 h1:B+aWVgAx+GlFLhtYjIaF0uGjU3rzpl
65103
github.com/ingonyama-zk/icicle-gnark/v3 v3.2.2/go.mod h1:CH/cwcr21pPWH+9GtK/PFaa4OGTv4CtfkCKro6GpbRE=
66104
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
67105
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
106+
github.com/johannesboyne/gofakes3 v0.0.0-20250825084532-6555d310c473 h1:dFhdS4skQ9FYVrhMYmoTFAZpdrVDKUDL+ACqEBGLZns=
107+
github.com/johannesboyne/gofakes3 v0.0.0-20250825084532-6555d310c473/go.mod h1:zrz/yDxjXycSAS7BFibBFSxIB6DKybZh+x1Bb+hVi4U=
68108
github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I=
69109
github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60=
70110
github.com/kilic/bls12-381 v0.1.0 h1:encrdjqKMEvabVQ7qYOKu1OvhqpK4s47wDYtNiPtlp4=
@@ -113,6 +153,8 @@ github.com/ronanh/intcomp v1.1.1/go.mod h1:7FOLy3P3Zj3er/kVrU/pl+Ql7JFZj7bwliMGk
113153
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
114154
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
115155
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
156+
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 h1:GHRpF1pTW19a8tTFrMLUcfWwyC0pnifVo2ClaLq+hP8=
157+
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46/go.mod h1:uAQ5PCi+MFsC7HjREoAz1BU+Mq60+05gifQSsHSDG/8=
116158
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
117159
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
118160
github.com/urfave/cli/v3 v3.3.8 h1:BzolUExliMdet9NlJ/u4m5vHSotJ3PzEqSAZ1oPMa/E=
@@ -147,6 +189,8 @@ go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt
147189
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
148190
go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
149191
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
192+
go.shabbyrobe.org/gocovmerge v0.0.0-20230507111327-fa4f82cfbf4d h1:Ns9kd1Rwzw7t0BR8XMphenji4SmIoNZPn8zhYmaVKP8=
193+
go.shabbyrobe.org/gocovmerge v0.0.0-20230507111327-fa4f82cfbf4d/go.mod h1:92Uoe3l++MlthCm+koNi0tcUCX3anayogF0Pa/sp24k=
150194
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
151195
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
152196
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
@@ -169,6 +213,8 @@ golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
169213
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
170214
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
171215
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
216+
golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=
217+
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
172218
google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e h1:UdXH7Kzbj+Vzastr5nVfccbmFsmYNygVLSPk1pEfDoY=
173219
google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e/go.mod h1:085qFyf2+XaZlRdCgKNCIZ3afY2p4HHZdoIRpId8F4A=
174220
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e h1:ztQaXfzEXTmCBvbtWYRhJxW+0iJcz2qXfd38/e9l7bA=

online/actions/server.go

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,34 @@ func Server(_ context.Context, cmd *cli.Command) error {
6262
beacon := beaconProvider.GetBeacon()
6363
ceremonyLogger.Info().Hex("beacon", beacon).Send()
6464

65-
store := storage.NewTmpfs(config.CeremonyName)
65+
var store storage.Storage
66+
if !config.UseS3 {
67+
log.Print("Ceremony artifacts will be stored in tmpfs")
68+
store = storage.NewTmpfs(config.CeremonyName)
69+
} else {
70+
log.Println("Ceremony artifacts will be stored in AWS S3")
71+
var s3Opts []storage.S3Option
72+
if config.S3Bucket != "" {
73+
log.Printf("\tbucket: %s", config.S3Bucket)
74+
s3Opts = append(s3Opts, storage.WithBucket(config.S3Bucket))
75+
}
76+
if config.S3Region != "" {
77+
log.Printf("\tregion: %s", config.S3Region)
78+
s3Opts = append(s3Opts, storage.WithRegion(config.S3Region))
79+
}
80+
if config.S3Profile != "" {
81+
log.Printf("\tprofile: %s", config.S3Profile)
82+
s3Opts = append(s3Opts, storage.WithProfile(config.S3Profile))
83+
}
84+
if config.S3CredentialsFile != "" {
85+
log.Printf("\tcredentials file: %s", config.S3CredentialsFile)
86+
s3Opts = append(s3Opts, storage.WithCredentialsFile(config.S3CredentialsFile))
87+
}
88+
store, err = storage.NewS3(s3Opts...)
89+
if err != nil {
90+
return err
91+
}
92+
}
6693

6794
log.Print("Initializing Phase 2")
6895
last, err := contribution.New(p1, ccs, store, beacon)

0 commit comments

Comments
 (0)