@xyo-network/xl1-cli 4.0.6 → 4.2.1
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 +59 -3
- package/dist/cli-min.mjs +2273 -1786
- package/dist/cli-min.mjs.map +1 -1
- package/package.json +16 -30
package/README.md
CHANGED
|
@@ -191,6 +191,8 @@ Named **connections** describe where providers read/write state:
|
|
|
191
191
|
|
|
192
192
|
**providerBindings** map each provider moniker to a connection. When omitted, bindings are synthesized per connection name (chain monikers → `local-store` / `chain-mongo`, DLQ → `dlq-store` or dev-aliased chain store, mempool → `mempool-store` or dev-aliased chain store, viewers → `default-rpc` when present, EVM monikers → `default-evm-rpc` when declared, otherwise memory fallback at plan time).
|
|
193
193
|
|
|
194
|
+
Set the root option **`strictDependencies: true`** to disable implicit in-memory provider creation. In strict mode, every memory-backed dependency must have an explicit `providerBindings.<Moniker>.connection` pointing to a declared memory connection. An unbound required dependency fails configuration, while an unbound optional dependency is omitted. The option defaults to `false`; config-less runs retain the in-memory development preset and implicit memory fallback.
|
|
195
|
+
|
|
194
196
|
**Index summaries** use two monikers (not one provider per family):
|
|
195
197
|
|
|
196
198
|
| Moniker | Typical connection | Role |
|
|
@@ -198,6 +200,15 @@ Named **connections** describe where providers read/write state:
|
|
|
198
200
|
| `IndexViewer` | `rest-index` (CDN) or `memory` (local dev) | Read step-summary families: `balances`, `blocks`, `schemas`, `transfers` |
|
|
199
201
|
| `IndexPublishRunner` | `s3-index` | Publish those families to the index bucket |
|
|
200
202
|
|
|
203
|
+
**Finalized EVM contract events** reuse the index bucket under an address-scoped `evm/events/` layout:
|
|
204
|
+
|
|
205
|
+
| Moniker | Typical connection | Role |
|
|
206
|
+
|---|---|---|
|
|
207
|
+
| `EvmEventIndexPublishRunner` | `s3-index` | Read all logs for `chain.id` through Ethereum's `finalized` head and publish resumable range frames |
|
|
208
|
+
| `StakeEventsViewer` | `rest-index` | Decode the published raw logs with the staking ABI; no historical `eth_getLogs` calls |
|
|
209
|
+
|
|
210
|
+
The EVM index is optional. Bind `EvmChainViewer → default-evm-rpc` and `EvmEventIndexPublishRunner → s3-index` on the indexer to enable it. Bind `StakeEventsViewer → rest-index` on reward/staking consumers. Without the REST binding, `EvmStakeEventsViewer` remains the direct-RPC fallback.
|
|
211
|
+
|
|
201
212
|
Local dev omits `IndexViewer` — `AccountBalanceViewer` computes summaries on demand from `BlockViewer`. Bind `IndexViewer` → `memory` (`SimpleIndexViewer`) when you want in-process summary memoization without S3.
|
|
202
213
|
|
|
203
214
|
**S3 write + REST read:** The finalizer writes finalized blocks and the chain-state head to S3 (`BlockPublishRunner`, `ChainStatePublishRunner`). The indexer reads the published head and blocks over REST (`ChainStateViewer`, `BlockViewer`) and writes the index bucket via `IndexPublishRunner` → `s3-index`. Because `BlockViewer` must stay on the authority store for finalization, use split per-actor configs ([Finalizer](#finalizer-per-actor) + [Indexer](#indexer-per-actor)) or override `providerBindings` explicitly as in [S3 write + REST read](#s3-write--rest-read).
|
|
@@ -617,6 +628,11 @@ Mongo store plus S3 publish connections for finalizer and indexer in one process
|
|
|
617
628
|
"database": "xl1",
|
|
618
629
|
"domain": "internal"
|
|
619
630
|
},
|
|
631
|
+
"default-evm-rpc": {
|
|
632
|
+
"type": "evm-rpc",
|
|
633
|
+
"url": "https://sepolia.infura.io/v3/YOUR_INFURA_PROJECT_ID",
|
|
634
|
+
"chainId": "0xaa36a7"
|
|
635
|
+
},
|
|
620
636
|
"s3-finalized": {
|
|
621
637
|
"type": "s3",
|
|
622
638
|
"accountId": "YOUR_R2_ACCOUNT_ID",
|
|
@@ -648,8 +664,11 @@ Mongo store plus S3 publish connections for finalizer and indexer in one process
|
|
|
648
664
|
"providerBindings": {
|
|
649
665
|
"BlockViewer": { "connection": "chain-mongo" },
|
|
650
666
|
"BlockPublishRunner": { "connection": "s3-finalized" },
|
|
667
|
+
"ChainContractViewer": { "connection": "default-evm-rpc" },
|
|
651
668
|
"ChainStatePublishRunner": { "connection": "s3-chain-state" },
|
|
652
669
|
"ChainStateViewer": { "connection": "s3-chain-state" },
|
|
670
|
+
"EvmChainViewer": { "connection": "default-evm-rpc" },
|
|
671
|
+
"EvmEventIndexPublishRunner": { "connection": "s3-index" },
|
|
653
672
|
"FinalizationRunner": { "connection": "chain-mongo" },
|
|
654
673
|
"FinalizationViewer": { "connection": "chain-mongo" },
|
|
655
674
|
"IndexPublishRunner": { "connection": "s3-index" },
|
|
@@ -694,6 +713,11 @@ Indexer: `s3-index` publish + REST CDN viewers.
|
|
|
694
713
|
"bucket": "xl1-index",
|
|
695
714
|
"readUrl": "https://index.xl1.example"
|
|
696
715
|
},
|
|
716
|
+
"default-evm-rpc": {
|
|
717
|
+
"type": "evm-rpc",
|
|
718
|
+
"url": "https://sepolia.infura.io/v3/YOUR_INFURA_PROJECT_ID",
|
|
719
|
+
"chainId": "0xaa36a7"
|
|
720
|
+
},
|
|
697
721
|
"rest-finalized": {
|
|
698
722
|
"type": "rest",
|
|
699
723
|
"baseUrl": "https://chain.xl1.example"
|
|
@@ -714,6 +738,12 @@ Indexer: `s3-index` publish + REST CDN viewers.
|
|
|
714
738
|
"ChainStateViewer": {
|
|
715
739
|
"connection": "rest-chain-state"
|
|
716
740
|
},
|
|
741
|
+
"EvmChainViewer": {
|
|
742
|
+
"connection": "default-evm-rpc"
|
|
743
|
+
},
|
|
744
|
+
"EvmEventIndexPublishRunner": {
|
|
745
|
+
"connection": "s3-index"
|
|
746
|
+
},
|
|
717
747
|
"IndexViewer": {
|
|
718
748
|
"connection": "rest-index"
|
|
719
749
|
},
|
|
@@ -742,14 +772,14 @@ One config per actor **process** — the shape a real multi-host deployment runs
|
|
|
742
772
|
| `api` | `chain-mongo` (mempool + tx submission) | — | blocks / state / index over REST |
|
|
743
773
|
| `producer` | `chain-mongo` authority + `default-evm-rpc` + `producer-wallet` | — | authority store + EVM staking contract |
|
|
744
774
|
| `finalizer` | `chain-mongo` authority | `s3-finalized` (blocks), `s3-chain-state` (head) | authority store |
|
|
745
|
-
| `indexer` |
|
|
775
|
+
| `indexer` | `default-evm-rpc` (when event indexing is enabled) | `s3-index` | finalized blocks + chain-state over REST; finalized contract logs from EVM |
|
|
746
776
|
| `mempool` | `chain-mongo` | — | authority store |
|
|
747
777
|
| `bridge` | `chain-mongo` + `default-evm-rpc` + `bridge-wallet` + Redis | — | authority store + remote EVM chain |
|
|
748
778
|
| `rewardRedemption` | `chain-mongo` + `default-evm-rpc` + `rewardRedemption-wallet` | — | authority store + EVM staking contract |
|
|
749
779
|
|
|
750
780
|
- **One writer per bucket.** The finalizer owns `s3-finalized` + `s3-chain-state`; the indexer owns `s3-index`. No other actor writes object storage.
|
|
751
781
|
- **`BlockViewer` is not auto-bound to REST.** When a process declares a local store, `BlockViewer` defaults to it, so the API and indexer configs bind `BlockViewer → rest-finalized` explicitly to read finalized blocks from the CDN. `ChainStateViewer` / `IndexViewer` bind to their REST connections automatically when those connections are declared (the explicit bindings here are for clarity).
|
|
752
|
-
- **Staking.** `chain.id`
|
|
782
|
+
- **Staking.** `chain.id` is the staking contract address on the backing EVM. The indexer needs `default-evm-rpc` only when `EvmEventIndexPublishRunner` is enabled. Staking/reward consumers can bind `StakeEventsViewer → rest-index` for indexed finalized history while retaining EVM bindings for mutating calls and point-in-time contract state.
|
|
753
783
|
- **Wallets.** Wallet connections (`<actor>-wallet`) and the `XyoSigner` binding are auto-synthesized for signing actors (`producer`, `bridge`, `rewardRedemption`); they are shown explicitly here for clarity. `bridge` and `rewardRedemption` cannot be co-located in one process (they share `XyoSigner`).
|
|
754
784
|
- **Secrets.** `YOUR_*` placeholders (R2 keys, Mongo credentials, Infura project id) and wallet mnemonics should be supplied via `XL1_*` env vars / your secret store in production — do not commit real credentials.
|
|
755
785
|
|
|
@@ -883,6 +913,11 @@ One config per actor **process** — the shape a real multi-host deployment runs
|
|
|
883
913
|
"database": "xl1",
|
|
884
914
|
"domain": "internal"
|
|
885
915
|
},
|
|
916
|
+
"default-evm-rpc": {
|
|
917
|
+
"type": "evm-rpc",
|
|
918
|
+
"url": "https://sepolia.infura.io/v3/YOUR_INFURA_PROJECT_ID",
|
|
919
|
+
"chainId": "0xaa36a7"
|
|
920
|
+
},
|
|
886
921
|
"s3-finalized": {
|
|
887
922
|
"type": "s3",
|
|
888
923
|
"accountId": "YOUR_R2_ACCOUNT_ID",
|
|
@@ -902,12 +937,16 @@ One config per actor **process** — the shape a real multi-host deployment runs
|
|
|
902
937
|
"readUrl": "https://chain-state.xl1.example"
|
|
903
938
|
}
|
|
904
939
|
},
|
|
940
|
+
"chain": {
|
|
941
|
+
"id": "dd381fbb392c85160d8b0453e446757b12384046"
|
|
942
|
+
},
|
|
905
943
|
"providerBindings": {
|
|
906
944
|
"AccountBalanceViewer": { "connection": "chain-mongo" },
|
|
907
945
|
"BlockPublishRunner": { "connection": "s3-finalized" },
|
|
908
946
|
"BlockRunner": { "connection": "chain-mongo" },
|
|
909
947
|
"BlockValidationViewer": { "connection": "chain-mongo" },
|
|
910
948
|
"BlockViewer": { "connection": "chain-mongo" },
|
|
949
|
+
"ChainContractViewer": { "connection": "default-evm-rpc" },
|
|
911
950
|
"ChainStatePublishRunner": { "connection": "s3-chain-state" },
|
|
912
951
|
"ChainStateViewer": { "connection": "s3-chain-state" },
|
|
913
952
|
"DeadLetterQueueRunner": { "connection": "chain-mongo" },
|
|
@@ -956,6 +995,11 @@ One config per actor **process** — the shape a real multi-host deployment runs
|
|
|
956
995
|
"type": "rest",
|
|
957
996
|
"baseUrl": "https://index.xl1.example"
|
|
958
997
|
},
|
|
998
|
+
"default-evm-rpc": {
|
|
999
|
+
"type": "evm-rpc",
|
|
1000
|
+
"url": "https://sepolia.infura.io/v3/YOUR_INFURA_PROJECT_ID",
|
|
1001
|
+
"chainId": "0xaa36a7"
|
|
1002
|
+
},
|
|
959
1003
|
"s3-index": {
|
|
960
1004
|
"type": "s3",
|
|
961
1005
|
"accountId": "YOUR_R2_ACCOUNT_ID",
|
|
@@ -973,6 +1017,12 @@ One config per actor **process** — the shape a real multi-host deployment runs
|
|
|
973
1017
|
"ChainStateViewer": {
|
|
974
1018
|
"connection": "rest-chain-state"
|
|
975
1019
|
},
|
|
1020
|
+
"EvmChainViewer": {
|
|
1021
|
+
"connection": "default-evm-rpc"
|
|
1022
|
+
},
|
|
1023
|
+
"EvmEventIndexPublishRunner": {
|
|
1024
|
+
"connection": "s3-index"
|
|
1025
|
+
},
|
|
976
1026
|
"IndexViewer": {
|
|
977
1027
|
"connection": "rest-index"
|
|
978
1028
|
},
|
|
@@ -1168,18 +1218,21 @@ Beyond the authority store (`lmdb` / `mongodb`), the chain can publish a static,
|
|
|
1168
1218
|
|---|---|---|
|
|
1169
1219
|
| `finalized` | `finalizer` (when `publishOnFinalize` is set) | finalized blocks, payloads, `manifest.json` |
|
|
1170
1220
|
| `chainState` | `finalizer` (when `publishOnFinalize` is set) | the mutable head pointer (`head.json`) |
|
|
1171
|
-
| `index` | `indexer` |
|
|
1221
|
+
| `index` | `indexer` | step-summary families plus optional address-scoped finalized EVM event frames and their manifests/head pointers |
|
|
1172
1222
|
|
|
1173
1223
|
The `indexer` is gated at the finalized head the `finalizer` has published, so `publishOnFinalize` must be enabled on the finalizer for the index to advance.
|
|
1174
1224
|
|
|
1175
1225
|
Configure the buckets as named `connections` (`s3-finalized`, `s3-chain-state`, `s3-index`). Credentials and `prefix` can be set per connection; each bucket sets its own `bucket` name and public `readUrl` — the CDN base URL anonymous reads go through, so they hit the CDN rather than the (per-operation billed) S3 API.
|
|
1176
1226
|
|
|
1227
|
+
The `chainState` bucket also carries the chain-contract manifest (`minWithdrawalBlocks`, `rewardsContract`, `stakingTokenAddress`), read from `ChainContractViewer` when the publisher starts — so a chain-state-publishing finalizer must bind `ChainContractViewer` to an `evm-rpc` connection (config compilation rejects the plan otherwise; an explicit memory binding opts into dev placeholder values instead).
|
|
1228
|
+
|
|
1177
1229
|
`xyo.json`:
|
|
1178
1230
|
```json
|
|
1179
1231
|
{
|
|
1180
1232
|
"xl1": {
|
|
1181
1233
|
"connections": {
|
|
1182
1234
|
"chain-mongo": { "type": "mongo", "connectionString": "mongodb://user:pass@db.internal:27017", "database": "xl1", "domain": "internal" },
|
|
1235
|
+
"default-evm-rpc": { "type": "evm-rpc", "url": "https://sepolia.infura.io/v3/YOUR_INFURA_PROJECT_ID", "chainId": "0xaa36a7" },
|
|
1183
1236
|
"s3-finalized": { "type": "s3", "accountId": "…", "accessKeyId": "…", "secretAccessKey": "…", "prefix": "", "bucket": "xl1-chain", "readUrl": "https://chain.xl1.example" },
|
|
1184
1237
|
"s3-chain-state": { "type": "s3", "bucket": "xl1-chain-state", "readUrl": "https://chain-state.xl1.example" },
|
|
1185
1238
|
"s3-index": { "type": "s3", "bucket": "xl1-index", "readUrl": "https://index.xl1.example" }
|
|
@@ -1187,8 +1240,11 @@ Configure the buckets as named `connections` (`s3-finalized`, `s3-chain-state`,
|
|
|
1187
1240
|
"providerBindings": {
|
|
1188
1241
|
"BlockViewer": { "connection": "chain-mongo" },
|
|
1189
1242
|
"BlockPublishRunner": { "connection": "s3-finalized" },
|
|
1243
|
+
"ChainContractViewer": { "connection": "default-evm-rpc" },
|
|
1190
1244
|
"ChainStatePublishRunner": { "connection": "s3-chain-state" },
|
|
1191
1245
|
"ChainStateViewer": { "connection": "s3-chain-state" },
|
|
1246
|
+
"EvmChainViewer": { "connection": "default-evm-rpc" },
|
|
1247
|
+
"EvmEventIndexPublishRunner": { "connection": "s3-index" },
|
|
1192
1248
|
"FinalizationRunner": { "connection": "chain-mongo" },
|
|
1193
1249
|
"FinalizationViewer": { "connection": "chain-mongo" },
|
|
1194
1250
|
"IndexPublishRunner": { "connection": "s3-index" },
|