@secondlayer/cli 16.3.1 → 17.0.0
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.
- package/README.md +10 -11
- package/dist/cli.js +1235 -1887
- package/dist/cli.js.map +23 -24
- package/package.json +3 -7
package/README.md
CHANGED
|
@@ -12,14 +12,14 @@ secondlayer --version
|
|
|
12
12
|
|
|
13
13
|
## Auth
|
|
14
14
|
|
|
15
|
-
Default API is `http://127.0.0.1:3800`. Override with `
|
|
15
|
+
Default API is `http://127.0.0.1:3800`. Override with `SECONDLAYER_API_URL`.
|
|
16
16
|
|
|
17
17
|
Writes against a published bind use `INSTANCE_TOKEN` from `secondlayer init`.
|
|
18
18
|
Loopback reads need no token. Hosted API and archive credits use
|
|
19
19
|
`SECONDLAYER_API_KEY` (`sk-sl_*`).
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
export
|
|
22
|
+
export SECONDLAYER_API_URL=http://127.0.0.1:3800
|
|
23
23
|
export INSTANCE_TOKEN=<from secondlayer init>
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -35,7 +35,7 @@ secondlayer subgraphs deploy subgraphs/my-contract.ts --start-block <recent-bloc
|
|
|
35
35
|
secondlayer subgraphs query my-contract <table> --sort _block_height --order desc
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
`secondlayer setup` is a guided
|
|
38
|
+
`secondlayer setup` is a guided command: it picks network + node mode (with the
|
|
39
39
|
RAM/disk floor shown live), generates secrets, writes `docker-compose.yml` and
|
|
40
40
|
`.env` (including the `DATABASE_URL` every later `bootstrap`/`verify`/`repair`
|
|
41
41
|
in that directory connects with) into a target directory, brings the stack up,
|
|
@@ -45,13 +45,12 @@ secrets → `docker compose up` → `observer` → `bootstrap` → `verify`. `se
|
|
|
45
45
|
is also the only way to bring the stack up: the old `secondlayer start`, which
|
|
46
46
|
printed a compose line for a monorepo checkout, is gone. Without a TTY (or
|
|
47
47
|
with `--yes`), it skips the interactive prompts and runs from flags instead;
|
|
48
|
-
`--network` and `--node-mode` are then required
|
|
49
|
-
|
|
48
|
+
`--network` and `--node-mode` are then required. `--against` defaults to the
|
|
49
|
+
official archive, so it's needed only to point at a different one:
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
secondlayer setup --yes \
|
|
53
|
-
--network mainnet --node-mode external
|
|
54
|
-
--against https://archive.secondlayer.tools/latest.json
|
|
53
|
+
--network mainnet --node-mode external
|
|
55
54
|
```
|
|
56
55
|
|
|
57
56
|
`secondlayer subgraphs scaffold` writes the definition file, creates/updates
|
|
@@ -79,7 +78,7 @@ No account. Writes `.env.local`, restores history, prints the Stacks observer st
|
|
|
79
78
|
|
|
80
79
|
| Command | What it does |
|
|
81
80
|
|---|---|
|
|
82
|
-
| `secondlayer setup [--network …] [--node-mode external\|stacks\|full] [--api-port <spec>] [--dir <path>] [--against <manifest>] [--skip-bootstrap] [--skip-verify] [--yes] [--force]` | Guided self-host onboarding — secrets, compose + `.env`, docker up, observer stanza, bootstrap, verify.
|
|
81
|
+
| `secondlayer setup [--network …] [--node-mode external\|stacks\|full] [--api-port <spec>] [--dir <path>] [--against <manifest>] [--skip-bootstrap] [--skip-verify] [--yes] [--force]` | Guided self-host onboarding — secrets, compose + `.env`, docker up, observer stanza, bootstrap, verify. Prompts when interactive; flags-only (no prompts) with `--yes` or no TTY |
|
|
83
82
|
| `secondlayer init [--network mainnet\|testnet\|devnet] [--api-url <url>] [--force]` | Write `.env.local` (token, secrets key, webhook signing key). `--network` and `--api-url` are the global flags. Idempotent |
|
|
84
83
|
| `secondlayer bootstrap --against <manifest> [--from-block <n>] [--to-block <n>] [--verify all\|blocks] [--public-key <pem>] [-y] [--json]` | Restore chain history from a verified archive into an empty database. A run that died mid-way resumes per dataset on re-run. After the load, digests for blocks, transactions, and events are checked over the restored range (`--verify blocks` skips the child datasets and the minutes they cost). Partition fetches retry three times with backoff on resets, timeouts, 429 (honoring `Retry-After`) and 5xx; a link that stays down exits `1` with a re-run hint, and the re-run resumes. Exit `0` restored, `1` diverged or interrupted, `2` refused |
|
|
85
84
|
| `secondlayer observer [--mode indexer\|signer-shared] [--endpoint host:port] [--network …]` | Print the `[[events_observer]]` stanza. Signer-shared skips retries; a missed block stays a gap until `repair` |
|
|
@@ -191,9 +190,9 @@ operates on both kinds.
|
|
|
191
190
|
| Var | Purpose |
|
|
192
191
|
|---|---|
|
|
193
192
|
| `INSTANCE_TOKEN` | From `secondlayer init` for writes. Loopback reads need no token |
|
|
194
|
-
| `SECONDLAYER_API_KEY` | Hosted account key (`sk-sl_*`)
|
|
195
|
-
| `
|
|
196
|
-
| `SL_PLATFORM_API_URL` | Alias of `
|
|
193
|
+
| `SECONDLAYER_API_KEY` | Hosted account key (`sk-sl_*`) |
|
|
194
|
+
| `SECONDLAYER_API_URL` | Instance API. Default `http://127.0.0.1:3800` |
|
|
195
|
+
| `SL_PLATFORM_API_URL` | Alias of `SECONDLAYER_API_URL` |
|
|
197
196
|
| `STACKS_NETWORK` | Default network (also via `--network <mainnet\|testnet\|devnet>`) |
|
|
198
197
|
| `DATABASE_URL` | Postgres that `bootstrap`, `verify`, `repair`, and `backup` connect to. `secondlayer setup` writes it into `.env` pointing at the compose Postgres; unset, the shared dev URL `postgres://postgres:postgres@localhost:5432/secondlayer_dev` is used |
|
|
199
198
|
| `HIRO_API_KEY` | Used by `secondlayer codegen contracts` for remote contract fetches |
|