Skip to content

Commit 5507868

Browse files
phbnfroger2hk
andauthored
Hammer POSIX instructions (#902)
* posix hammer instructions * Update internal/hammer/README.md Co-authored-by: Roger Ng <roger2hk@gmail.com> * Update cmd/tesseract/posix/README.md Co-authored-by: Roger Ng <roger2hk@gmail.com> * fix code snippet --------- Co-authored-by: Roger Ng <roger2hk@gmail.com>
1 parent 3e22fff commit 5507868

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

cmd/tesseract/posix/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ the format described by https://git.glasklar.is/sigsum/core/sigsum-go/-/blob/mai
6868

6969
## Codelab
7070

71+
In this codelab, you'll bring a new TesseraCT POSIX instance up,
72+
and send certificate chains to it. These entries can either be
73+
preloaded from an existing RFC6962 log, or generated locally with
74+
the [hammer tool](/internal/hammer).
75+
76+
### Preloading
77+
7178
Generate an ECDSA key like so:
7279

7380
```bash
@@ -107,3 +114,49 @@ Note that running this command a second time may show a lot of errors with
107114
entries being sent to the log.
108115
Use a larger `start_index` to avoid submitting duplicate entries and running into
109116
this behaviour.
117+
118+
### Hammer
119+
120+
Generate ECDSA public and private keys like so:
121+
122+
```bash
123+
openssl ecparam -name prime256v1 -genkey -noout -out /tmp/test-ecdsa-priv.pem
124+
openssl ec -in /tmp/test-ecdsa-priv.pem -pubout > /tmp/test-ecdsa-pub.pem
125+
```
126+
127+
Then, start a log with the following command:
128+
129+
```bash
130+
go run ./cmd/tesseract/posix/ \
131+
--http_endpoint=0.0.0.0:6962 \
132+
--storage_dir=/tmp/ecdsa_log \
133+
--slog_level=-4 \
134+
--roots_pem_file=internal/hammer/testdata/test_root_ca_cert.pem \
135+
--origin=example.com/test-ecdsa \
136+
--private_key=/tmp/test-ecdsa-priv.pem \
137+
--checkpoint_interval=2s \
138+
--enable_publication_awaiter=false
139+
```
140+
141+
In a different terminal, start the hammer:
142+
143+
```bash
144+
go run ./internal/hammer \
145+
--log_url=file:///tmp/ecdsa_log \
146+
--write_log_url=http://localhost:6962/ \
147+
--origin=example.com/test-ecdsa \
148+
--log_public_key=$(openssl ec -pubin -inform PEM -in /tmp/test-ecdsa-pub.pem -outform der | base64 -w 0) \
149+
--cert_sign_private_key_path=internal/hammer/testdata/test_leaf_cert_signing_private_key.pem \
150+
--intermediate_ca_cert_path=internal/hammer/testdata/test_intermediate_ca_cert.pem \
151+
--intermediate_ca_key_path=internal/hammer/testdata/test_intermediate_ca_private_key.pem \
152+
--max_read_ops=10 \
153+
--num_readers_random=2 \
154+
--num_readers_full=2 \
155+
--num_writers=500 \
156+
--max_write_ops=500 \
157+
--num_mmd_verifiers=1 \
158+
--mmd_duration=60s \
159+
--leaf_write_goal=4000 \
160+
--show_ui=true \
161+
--dup_chance=0.1
162+
```

internal/hammer/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ disable the UI.
1818

1919
## Usage
2020

21+
### GCP
2122
Example usage to test a deployment of `cmd/tesseract/gcp`:
2223

2324
```shell
@@ -56,6 +57,10 @@ go run ./internal/hammer \
5657
--show_ui=false
5758
```
5859

60+
### POSIX
61+
62+
Use [these](/cmd/tesseract/posix/README.md#hammer) instructions.
63+
5964
## Design
6065

6166
### Objective

0 commit comments

Comments
 (0)