95 lines
2.1 KiB
Markdown
95 lines
2.1 KiB
Markdown
# Live Bundle Record
|
||
|
||
`run_live_bundle_record.sh` 是当前 `ours` 的单命令 live bundle 录制入口。
|
||
|
||
它做三件事:
|
||
|
||
1. 联网执行 **live base recorder**
|
||
2. 基于刚录制的 base bundle 执行 **live delta recorder**
|
||
3. 产出一个统一的最终目录,包含:
|
||
- `base-payload-archive/`
|
||
- `payload-delta-archive/`
|
||
- `base-locks.json`
|
||
- `locks-delta.json`
|
||
- `tal.tal`
|
||
- `ta.cer`
|
||
- `base.ccr`
|
||
- `delta.ccr`
|
||
- `base-vrps.csv`
|
||
- `base-vaps.csv`
|
||
- `record-delta.csv`
|
||
- `record-delta-vaps.csv`
|
||
- `bundle.json`
|
||
- `verification.json`
|
||
- `timings/`
|
||
|
||
## 用法
|
||
|
||
```bash
|
||
cd rpki
|
||
./scripts/replay_bundle/run_live_bundle_record.sh \
|
||
--rir apnic \
|
||
--tal-path tests/fixtures/tal/apnic-rfc7730-https.tal \
|
||
--ta-path tests/fixtures/ta/apnic-ta.cer
|
||
```
|
||
|
||
默认输出目录:
|
||
|
||
```text
|
||
target/replay/<rir>_live_bundle_<timestamp>
|
||
```
|
||
|
||
如果要一次录制多个 RIR,使用:
|
||
|
||
```bash
|
||
cd rpki
|
||
./scripts/replay_bundle/run_live_bundle_record_multi_rir.sh \
|
||
--rir afrinic,apnic,arin,lacnic,ripe
|
||
```
|
||
|
||
默认输出目录:
|
||
|
||
```text
|
||
target/replay/live_bundle_matrix_<timestamp>
|
||
```
|
||
|
||
每个 RIR 会落到:
|
||
|
||
```text
|
||
target/replay/live_bundle_matrix_<timestamp>/<rir>_live_bundle_<timestamp>
|
||
```
|
||
|
||
## 可选参数
|
||
|
||
- `--out-dir <path>`
|
||
- `--base-validation-time <rfc3339>`
|
||
- `--delta-validation-time <rfc3339>`
|
||
- `--http-timeout-secs <n>`
|
||
- `--rsync-timeout-secs <n>`
|
||
- `--rsync-mirror-root <path>`
|
||
- `--max-depth <n>`
|
||
- `--max-instances <n>`
|
||
- `--trust-anchor <name>`
|
||
- `--bin-dir <path>`
|
||
- `--no-build`
|
||
|
||
`run_live_bundle_record_multi_rir.sh` 会自动按 RIR 选择当前仓库内置的:
|
||
|
||
- `tests/fixtures/tal/*.tal`
|
||
- `tests/fixtures/ta/*.cer`
|
||
|
||
并将 `--trust-anchor` 设置为对应 RIR 名称。
|
||
|
||
## 说明
|
||
|
||
- 该脚本会先构建:
|
||
- `replay_bundle_capture`
|
||
- `replay_bundle_capture_delta`
|
||
- 如果提供 `--no-build`,则直接复用:
|
||
- `--bin-dir <path>` 下的现有二进制
|
||
- 中间 staging 目录:
|
||
- `<out>.stage-base`
|
||
- `<out>.stage-delta`
|
||
在成功完成后会清理,只保留最终输出目录。
|
||
- 最终输出目录是 **delta 阶段产物**,其中已经包含 base 阶段结果。
|