bulletin-deploy 0.7.5 → 0.7.6

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.
@@ -0,0 +1,49 @@
1
+ # bulletin-bootstrap
2
+
3
+ `bulletin-bootstrap` is the operator CLI for initializing Bulletin pool accounts. It is separate from `bulletin-deploy` on purpose: deploys are the normal user path, bootstrap is an admin/setup operation.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ bulletin-bootstrap
9
+ ```
10
+
11
+ Options:
12
+
13
+ | Flag | What it does |
14
+ |---|---|
15
+ | `--rpc wss://...` | Override the Bulletin RPC endpoint. Also readable from `BULLETIN_RPC`. |
16
+ | `--pool-size N` | Number of derived pool accounts to initialize. Default: `10`. |
17
+ | `--mnemonic "..."` | Root mnemonic used to derive the pool accounts. Also readable from `BULLETIN_POOL_MNEMONIC`, then `MNEMONIC`. |
18
+ | `--version` | Print the CLI version. |
19
+ | `--help` | Show help. |
20
+
21
+ ## What it does
22
+
23
+ The command derives the pool account set and initializes the on-chain authorization state needed for Bulletin uploads.
24
+
25
+ Use it when:
26
+
27
+ - you are bringing up a fresh pool on a testnet
28
+ - the shared uploader pool has not been authorized yet
29
+ - you want to pre-initialize a non-default pool mnemonic
30
+
31
+ Do not use it as part of routine deploys. Normal deploys go through `bulletin-deploy`.
32
+
33
+ ## Examples
34
+
35
+ ```bash
36
+ # Default testnet pool against the default RPC
37
+ bulletin-bootstrap
38
+
39
+ # Different RPC and larger pool
40
+ bulletin-bootstrap --rpc wss://custom-bulletin.example.com --pool-size 20
41
+
42
+ # Explicit pool mnemonic
43
+ bulletin-bootstrap --mnemonic "..."
44
+ ```
45
+
46
+ ## Related Docs
47
+
48
+ - [Main README](../README.md)
49
+ - [E2E test setup](./e2e-bootstrap.md)
@@ -0,0 +1,64 @@
1
+ # E2E test setup
2
+
3
+ The E2E suite (`test/e2e.test.js`, driven by `.github/workflows/e2e.yml`) deploys real content to Paseo Bulletin testnet via `bulletin-deploy` and verifies the on-chain round-trip. It consumes the **shared default pool** (derived from `DEV_PHRASE` — the same pool real users hit in production) for Bulletin chunk upload, so no pool bootstrapping is required.
4
+
5
+ Three one-time setup items are needed before the workflow can pass. Do them once per testnet lifetime (redo if testnet is wiped).
6
+
7
+ ## Prerequisites
8
+
9
+ - `bulletin-deploy` built locally (`npm run build`).
10
+ - `@parity/dotns-cli` on `$PATH` (for the Bob registration in item 3). Install with `npm i -g @parity/dotns-cli`.
11
+ - Network access to Paseo Bulletin RPC (`wss://paseo-bulletin-rpc.polkadot.io`) and Asset Hub Paseo (DotNS).
12
+ - Alice's dev mnemonic: `bottom drive obey lake curtain smoke basket hold race lonely fit walk`.
13
+
14
+ ## Setup
15
+
16
+ ### 1. Grant Alice PoP Full
17
+
18
+ Both happy-path scenarios (S1, S2) deploy as Alice via DotNS. Registering a new un-reserved base name requires PoP Full:
19
+
20
+ ```bash
21
+ node tools/check-pop-status.mjs --grant full
22
+ ```
23
+
24
+ Idempotent. Re-run if the check shows Alice below Full.
25
+
26
+ ### 2. Fund and map Bob on Asset Hub Paseo
27
+
28
+ Bob (`//Bob` from the dev phrase) is the owner of `e2eowned.dot` (see item 3). He needs:
29
+
30
+ - **Balance** on Asset Hub Paseo for his on-chain fees. Request ~1 PAS from the Paseo faucet at [https://faucet.polkadot.io/](https://faucet.polkadot.io/) sending to Bob's SS58 address `5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty`.
31
+ - **Revive mapping** so he can sign EVM transactions. Running `check-pop-status` against Bob's key URI submits `map_account` automatically on connect if the mapping is absent:
32
+
33
+ ```bash
34
+ node tools/check-pop-status.mjs "bottom drive obey lake curtain smoke basket hold race lonely fit walk//Bob"
35
+ ```
36
+
37
+ Expected output: Bob's SS58, his H160 (`0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01`), and PoP status (`NoStatus (0)` initially). Idempotent.
38
+
39
+ ### 3. Register `e2eowned.dot` directly as Bob
40
+
41
+ The S3 negative scenario asserts that `bulletin-deploy` refuses to deploy to a domain owned by a different account (exit 78 with transfer guidance). Have Bob register the label via `dotns-cli` — no Alice intermediary, no Bulletin content needed (S3 never reads content):
42
+
43
+ ```bash
44
+ dotns register domain -n e2eowned -s full --cb 30 \
45
+ -k "bottom drive obey lake curtain smoke basket hold race lonely fit walk//Bob"
46
+ ```
47
+
48
+ Expected: exit 0, stdout ends with "Operation Complete" and `Domain: e2eowned.dot`. After this, `e2eowned.dot` is owned by Bob's H160 `0x41dccbd49b26c50d34355ed86ff0fa9e489d1e01`. PoP Full is auto-granted on testnet as part of the registration (an 8-char base name requires Full per `classifyDotnsLabel`). The `--cb 30` sets a 30s commitment buffer — the default 6s sometimes misses the 12s `minCommitmentAge` on Asset Hub Paseo.
49
+
50
+ If S3 ever fails because `e2eowned.dot` was transferred back to Alice by mistake, re-run this step to restore Bob's ownership.
51
+
52
+ ## No pre-registration needed for `e2epool.dot` / `e2edirect.dot`
53
+
54
+ The stable happy-path labels auto-register to Alice on first deploy (pool mode and direct mode both resolve to Alice at the DotNS layer — `--mnemonic` only overrides the DotNS signer, not the Bulletin signer; Bulletin always uses the pool). Subsequent runs exercise the update path (new contenthash under existing ownership).
55
+
56
+ ## Verifying locally
57
+
58
+ ```bash
59
+ E2E=1 E2E_SIGNER=pool E2E_MERKLE=js E2E_SCENARIO=s1 \
60
+ BULLETIN_RPC=wss://paseo-bulletin-rpc.polkadot.io \
61
+ npm run test:e2e
62
+ ```
63
+
64
+ Vary `E2E_SCENARIO` (`s1`, `s2`, `s3`), `E2E_SIGNER` (`pool`, `direct`), and `E2E_MERKLE` (`js`, `kubo`) to cover the full CI matrix.
@@ -0,0 +1,59 @@
1
+ # Telemetry
2
+
3
+ Telemetry is **off by default for external users**. It is enabled automatically for known internal Parity contexts and can also be controlled explicitly.
4
+
5
+ ## Opt in / opt out
6
+
7
+ - `BULLETIN_DEPLOY_TELEMETRY=1`: explicit opt-in
8
+ - `BULLETIN_DEPLOY_TELEMETRY=0`: force off
9
+
10
+ Internal detection signals are OR'd together:
11
+
12
+ 1. `GITHUB_REPOSITORY` matches a known internal org
13
+ 2. `RUNNER_NAME` starts with `parity-`
14
+ 3. `git remote get-url origin` points at a known internal org
15
+
16
+ ## What is tracked
17
+
18
+ - deploy duration and success/failure
19
+ - storage phase timing
20
+ - DotNS phase timing
21
+ - pool account selection
22
+ - source metadata such as repo, branch, and CI vs local
23
+ - tool version
24
+
25
+ ## Ambient Sentry mode
26
+
27
+ If another app embeds `bulletin-deploy` and already owns Sentry initialization, set these before importing or invoking the library:
28
+
29
+ ```sh
30
+ BULLETIN_DEPLOY_USE_AMBIENT_SENTRY=1
31
+ BULLETIN_DEPLOY_HOST_APP=<your-app-name>
32
+ ```
33
+
34
+ That makes `bulletin-deploy` reuse the existing Sentry client instead of calling its own `Sentry.init()`.
35
+
36
+ Requirements:
37
+
38
+ - the host app must initialize Sentry first
39
+ - Sentry SDK compatibility still matters
40
+ - quotas and issue grouping remain owned by the host project
41
+
42
+ ## Tagging test traffic
43
+
44
+ Use `--tag` or `DEPLOY_TAG` to separate test and benchmark traffic from real deploys.
45
+
46
+ Examples:
47
+
48
+ ```bash
49
+ bulletin-deploy --tag e2e-ci-pr ./build my-app.dot
50
+ DEPLOY_TAG=load-test bulletin-deploy ./build my-app.dot
51
+ ```
52
+
53
+ Common tags in this repo:
54
+
55
+ - `e2e-ci-pr`
56
+ - `e2e-ci-nightly`
57
+ - `e2e-local-smoke`
58
+ - `e2e-local-pr`
59
+ - `e2e-local-nightly`
@@ -0,0 +1,44 @@
1
+ # Testing
2
+
3
+ The repo has three practical test layers: offline unit tests, live-testnet E2E coverage, and GitHub Actions matrices that exercise the shipped reusable workflow.
4
+
5
+ ## Offline tests
6
+
7
+ ```bash
8
+ npm test
9
+ ```
10
+
11
+ This runs the local Node test suite without network access.
12
+
13
+ ## Live-testnet E2E
14
+
15
+ The E2E suite deploys real content to Paseo Bulletin and verifies the on-chain round-trip.
16
+
17
+ Local launchers:
18
+
19
+ ```bash
20
+ npm run test:e2e:smoke
21
+ npm run test:e2e:pr
22
+ npm run test:e2e:nightly
23
+ ```
24
+
25
+ Quiet mode:
26
+
27
+ ```bash
28
+ E2E_QUIET=1 npm run test:e2e:smoke
29
+ E2E_QUIET=1 npm run test:e2e:pr
30
+ E2E_QUIET=1 npm run test:e2e:nightly
31
+ ```
32
+
33
+ Each scenario writes a JUnit XML report under `e2e-reports/`.
34
+
35
+ For one-time chain setup, see [E2E test setup](./e2e-bootstrap.md).
36
+
37
+ ## CI matrices
38
+
39
+ `.github/workflows/e2e.yml` calls the shipped reusable `.github/workflows/deploy.yml` so the E2E jobs exercise the same path consumers use.
40
+
41
+ - per-PR: stable happy-path coverage plus negative ownership coverage
42
+ - nightly: broader signer, merkleization, and mirror-path coverage
43
+
44
+ E2E deploys are tagged so telemetry can distinguish them from real-user traffic. See [Telemetry](./telemetry.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulletin-deploy",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,8 @@
14
14
  "main": "./dist/index.js",
15
15
  "types": "./dist/index.d.ts",
16
16
  "bin": {
17
- "bulletin-deploy": "./bin/bulletin-deploy"
17
+ "bulletin-deploy": "./bin/bulletin-deploy",
18
+ "bulletin-bootstrap": "./bin/bulletin-bootstrap"
18
19
  },
19
20
  "exports": {
20
21
  ".": {
@@ -24,12 +25,13 @@
24
25
  },
25
26
  "files": [
26
27
  "dist",
27
- "bin"
28
+ "bin",
29
+ "docs"
28
30
  ],
29
31
  "scripts": {
30
32
  "build": "tsup src/index.ts src/deploy.ts src/dotns.ts src/pool.ts src/telemetry.ts src/memory-report.ts src/merkle.ts src/gh-pages-mirror.ts src/version-check.ts src/bug-report.ts src/run-state.ts --format esm --dts --clean --target node22",
31
33
  "prepare": "npm run build",
32
- "test": "npm run build && node --test test/test.js test/pool.test.js test/helpers/e2e-helpers.test.js",
34
+ "test": "npm run build && node --test test/test.js test/cli-help.test.js test/helpers/e2e-helpers.test.js",
33
35
  "test:e2e": "npm run build && node --test test/e2e.test.js",
34
36
  "test:e2e:smoke": "bash scripts/e2e-pass.sh smoke",
35
37
  "test:e2e:pr": "bash scripts/e2e-pass.sh pr",