@parity/ppn-network-config 0.2.0-rc.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.
Files changed (59) hide show
  1. package/LICENSE +202 -0
  2. package/config/ports.env +128 -0
  3. package/dist/bundle.d.ts +36 -0
  4. package/dist/bundle.d.ts.map +1 -0
  5. package/dist/bundle.js +7 -0
  6. package/dist/bundle.js.map +1 -0
  7. package/dist/dashboard-model.d.ts +63 -0
  8. package/dist/dashboard-model.d.ts.map +1 -0
  9. package/dist/dashboard-model.js +126 -0
  10. package/dist/dashboard-model.js.map +1 -0
  11. package/dist/dub.d.ts +98 -0
  12. package/dist/dub.d.ts.map +1 -0
  13. package/dist/dub.js +202 -0
  14. package/dist/dub.js.map +1 -0
  15. package/dist/env-file.d.ts +6 -0
  16. package/dist/env-file.d.ts.map +1 -0
  17. package/dist/env-file.js +30 -0
  18. package/dist/env-file.js.map +1 -0
  19. package/dist/fork-toml.d.ts +35 -0
  20. package/dist/fork-toml.d.ts.map +1 -0
  21. package/dist/fork-toml.js +276 -0
  22. package/dist/fork-toml.js.map +1 -0
  23. package/dist/genesis-patch.d.ts +54 -0
  24. package/dist/genesis-patch.d.ts.map +1 -0
  25. package/dist/genesis-patch.js +223 -0
  26. package/dist/genesis-patch.js.map +1 -0
  27. package/dist/index.d.ts +19 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +19 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/load.d.ts +12 -0
  32. package/dist/load.d.ts.map +1 -0
  33. package/dist/load.js +23 -0
  34. package/dist/load.js.map +1 -0
  35. package/dist/networks.d.ts +214 -0
  36. package/dist/networks.d.ts.map +1 -0
  37. package/dist/networks.js +329 -0
  38. package/dist/networks.js.map +1 -0
  39. package/dist/nginx-routes.d.ts +10 -0
  40. package/dist/nginx-routes.d.ts.map +1 -0
  41. package/dist/nginx-routes.js +37 -0
  42. package/dist/nginx-routes.js.map +1 -0
  43. package/dist/overrides.d.ts +50 -0
  44. package/dist/overrides.d.ts.map +1 -0
  45. package/dist/overrides.js +169 -0
  46. package/dist/overrides.js.map +1 -0
  47. package/dist/repo-root.d.ts +42 -0
  48. package/dist/repo-root.d.ts.map +1 -0
  49. package/dist/repo-root.js +129 -0
  50. package/dist/repo-root.js.map +1 -0
  51. package/dist/toml-generator.d.ts +30 -0
  52. package/dist/toml-generator.d.ts.map +1 -0
  53. package/dist/toml-generator.js +469 -0
  54. package/dist/toml-generator.js.map +1 -0
  55. package/dist/types.d.ts +14 -0
  56. package/dist/types.d.ts.map +1 -0
  57. package/dist/types.js +2 -0
  58. package/dist/types.js.map +1 -0
  59. package/package.json +37 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,128 @@
1
+ # config/ports.env - Port configuration for PPN
2
+ # Update this file when adding/removing validators or chains
3
+ # Run scripts/validate-ports.sh to verify consistency with toml-generator
4
+
5
+ # Relay chain validator RPC ports
6
+ RELAY_ALICE_PORT=10000
7
+ RELAY_BOB_PORT=10001
8
+ RELAY_CHARLIE_PORT=10002
9
+ RELAY_DAVE_PORT=10003
10
+ RELAY_EVE_PORT=10004
11
+ RELAY_FERDIE_PORT=10005
12
+
13
+ # Parachain collator RPC ports
14
+ PEOPLE_PORT=10010
15
+ ASSET_HUB_PORT=10020
16
+ BULLETIN_PORT=10030
17
+ WEB3_STORAGE_PORT=10040
18
+
19
+ # Parachain IDs are NOT here: they belong to the network, not the machine, and two
20
+ # networks use different ones (previewnet 1500+, devnet 1000+). Each chain declares
21
+ # its own in networks/<name>.json — see networks/README.md. This file holds only what
22
+ # is local: which port each chain listens on.
23
+
24
+ # P2P ports (must be reachable for external nodes to connect)
25
+ RELAY_ALICE_P2P_PORT=30334
26
+ ASSET_HUB_P2P_PORT=30335
27
+ PEOPLE_P2P_PORT=30336
28
+ BULLETIN_P2P_PORT=30333
29
+ WEB3_STORAGE_P2P_PORT=30337
30
+
31
+ # P2P WSS ports (must be reachable for in-browser light clients to connect)
32
+ #
33
+ # nginx terminates TLS on these and proxies to the P2P WS ports above.
34
+ # Each is the matching P2P WS port + 1000.
35
+ RELAY_ALICE_P2P_WSS_PORT=31334
36
+ ASSET_HUB_P2P_WSS_PORT=31335
37
+ PEOPLE_P2P_WSS_PORT=31336
38
+ BULLETIN_P2P_WSS_PORT=31333
39
+ WEB3_STORAGE_P2P_WSS_PORT=31337
40
+
41
+ # Bootnode hostname (127.0.0.1 for local, override in ppn.service for server)
42
+ BOOTNODE_HOSTNAME=127.0.0.1
43
+
44
+ # Storage-provider data dir (disk mode). Empty locally so the wrapper derives it
45
+ # from DATA_DIR; server/redeploy.sh patches this to an absolute path under the
46
+ # persistent DATA_DIR, because zombie-cli does not forward env vars to
47
+ # custom_processes (same reason BOOTNODE_HOSTNAME is patched here).
48
+ WEB3_STORAGE_PROVIDER_DATA_DIR=
49
+
50
+ # Storage-provider storage mode: "disk" (persistent) or "inmemory" (ephemeral).
51
+ # Defaults to disk. zombie-cli does not forward env vars to custom_processes, so
52
+ # EPHEMERAL cannot reach the wrapper directly; for native runs `make start`
53
+ # regenerates config/ports.local.env (sourced after this file) to flip the mode
54
+ # to inmemory under EPHEMERAL=1. The server stays on the disk default.
55
+ WEB3_STORAGE_PROVIDER_STORAGE_MODE=disk
56
+
57
+ # Auxiliary service ports (defaults from binaries)
58
+ ETH_RPC_PORT=8545
59
+
60
+ # eth-rpc's receipt/index cache. Empty locally so the wrapper derives it from
61
+ # DATA_DIR (as $DATA_DIR/eth-rpc-db — NOT eth-rpc, which is where zombienet
62
+ # writes that process's log); server/redeploy.sh patches this to an absolute
63
+ # path under the persistent DATA_DIR, for the same reason
64
+ # WEB3_STORAGE_PROVIDER_DATA_DIR above is patched (zombie-cli does not forward
65
+ # env vars to custom_processes). The cache must share the chain data's lifetime:
66
+ # a cache left over from a wiped chain makes eth-rpc exit with ChainMismatch.
67
+ ETH_RPC_DATA_DIR=
68
+ IPFS_GATEWAY_PORT=8080
69
+ IPFS_API_PORT=5001
70
+ IPFS_SWARM_PORT=4001
71
+ WEB3_STORAGE_PROVIDER_PORT=3333
72
+
73
+ # Identity backend ports (see docs/DEVICE-UNIQUENESS-BACKEND.md)
74
+ #
75
+ # Kept out of the 10000-10040 band on purpose: that band is node RPC ports, one
76
+ # per chain, and anything adjacent to it reads as "the next parachain". These
77
+ # sit with the other auxiliary HTTP services instead, and Postgres keeps its own
78
+ # well-known number (offset by one so it does not fight a developer's system
79
+ # Postgres on 5432).
80
+ #
81
+ # Deliberately absent from ALL_PORTS below: that list is compared against the
82
+ # TOML's rpc_port entries by scripts/validate-ports.sh, and these are plain
83
+ # services, not nodes.
84
+ DUB_POSTGRES_PORT=5433
85
+
86
+ # The device-uniqueness backend's single origin: every HTTP surface, on one port. Backend v0.2.0
87
+ # ships one binary whose `all-in-one` role merges the six HTTP services behind the route
88
+ # table it compiles in, which is why there is one port here and not one per service — and
89
+ # why PPN no longer runs a gateway of its own to reassemble them.
90
+ DUB_PORT=8092
91
+ # The dashboard: the network's own status UI and API (docs/DASHBOARD.md)
92
+ DASHBOARD_PORT=8090
93
+
94
+ # What the dashboard advertises as the public address of every chain and service. Empty
95
+ # locally, so it falls back to http://127.0.0.1:$DASHBOARD_PORT; server/redeploy.sh patches
96
+ # it to https://$PPN_DOMAIN. It lives here and not only in /etc/ppn/deploy.env because
97
+ # deploy.env reaches ppn.service and stops there — zombienet hands the dashboard, which is a
98
+ # custom process, no environment at all. Without it a server tells every browser behind nginx
99
+ # to connect to 127.0.0.1.
100
+ PPN_PUBLIC_URL=
101
+
102
+ # Where this run's chain state and per-process logs live. Empty locally: `ppn start`
103
+ # resolves it per mode (data/ vs data-fork/) and writes the answer to
104
+ # config/ports.local.env, which is sourced after this file. A server never runs
105
+ # `ppn start` — ppn.service spawns zombie-cli directly — so nothing wrote it there
106
+ # and the dashboard fell back to <release>/data, an empty directory: no logs, no
107
+ # spawn stamp, no chain-spec downloads. server/redeploy.sh patches this to the
108
+ # persistent DATA_DIR, for the same reason the three paths above are patched
109
+ # (zombie-cli does not forward env vars to custom_processes).
110
+ PPN_DATA_DIR=
111
+
112
+ # Postgres cluster directory. Empty locally so the wrapper derives it from
113
+ # DATA_DIR (as $DATA_DIR/identity-pgdata — NOT $DATA_DIR/dub-postgres, which is
114
+ # where zombienet writes that process's log, and initdb refuses a non-empty dir).
115
+ #
116
+ # The directory keeps the name identity-pgdata deliberately: renaming a state path
117
+ # orphans the cluster already on a deployed server, which would silently reinitialise
118
+ # an empty one. A name is not worth someone's data.
119
+ # server/redeploy.sh patches this to an absolute path under the persistent
120
+ # DATA_DIR, for the same reason WEB3_STORAGE_PROVIDER_DATA_DIR above is patched
121
+ # (zombie-cli does not forward env vars to custom_processes).
122
+ DUB_POSTGRES_DATA_DIR=
123
+
124
+
125
+ # Aggregate lists (used by server-redeploy.sh)
126
+ RELAY_PORTS="$RELAY_ALICE_PORT $RELAY_BOB_PORT $RELAY_CHARLIE_PORT $RELAY_DAVE_PORT $RELAY_EVE_PORT $RELAY_FERDIE_PORT"
127
+ PARACHAIN_PORTS="$PEOPLE_PORT $ASSET_HUB_PORT $BULLETIN_PORT $WEB3_STORAGE_PORT"
128
+ ALL_PORTS="$RELAY_PORTS $PARACHAIN_PORTS"
@@ -0,0 +1,36 @@
1
+ export interface ForkManifestChain {
2
+ paraId: number | null;
3
+ /** Basename of the chain spec inside the bundle. */
4
+ spec: string;
5
+ /** Resolved http(s) JSON-RPC URL the chain was bitten from. Absent in old bundles. */
6
+ endpoint?: string;
7
+ specName: string;
8
+ specVersion: number;
9
+ headAtStart: number;
10
+ genesis: string;
11
+ }
12
+ export interface ForkManifest {
13
+ bittenAt: string;
14
+ source: string;
15
+ /** Which networks/<name>.json this bundle is a bite of. Absent in old bundles: previewnet. */
16
+ network?: string;
17
+ nodeVersion: string;
18
+ epochDuration: number;
19
+ chains: Record<string, ForkManifestChain>;
20
+ /** Keyed by para id, plus "relay". Written by bite.sh once each chain is bitten. */
21
+ biteBlocks: Record<string, number>;
22
+ /** Same keys as biteBlocks. Absent in bundles bitten before it was recorded. */
23
+ snapshotBytes?: Record<string, number>;
24
+ /**
25
+ * Runtimes authorized at import, keyed as biteBlocks is. A fork of a chain with no sudo
26
+ * cannot authorize an upgrade once it is running, so the authorization is written into
27
+ * state at bite time and the blob travels in the bundle under upgrades/<key>.wasm —
28
+ * `ppn runtime-upgrade` submits the apply half, which needs no privilege.
29
+ */
30
+ seededUpgrades?: Record<string, {
31
+ file: string;
32
+ codeHash: string;
33
+ checkVersion: boolean;
34
+ }>;
35
+ }
36
+ //# sourceMappingURL=bundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,8FAA8F;IAC9F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC1C,oFAAoF;IACpF,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAC5F"}
package/dist/bundle.js ADDED
@@ -0,0 +1,7 @@
1
+ // The fork-bundle format: what `ppn bite` writes and `generateForkToml` reads.
2
+ //
3
+ // The shape lives here, in the package both sides depend on, rather than next to the code
4
+ // that produces it — otherwise config generation would have to import the bite tooling,
5
+ // which is backwards and would make the dependency graph a cycle.
6
+ export {};
7
+ //# sourceMappingURL=bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,0FAA0F;AAC1F,wFAAwF;AACxF,kEAAkE"}
@@ -0,0 +1,63 @@
1
+ import type { NetworkDef } from './networks.js';
2
+ /** Bumped when the shape changes incompatibly. Renderers support N and N-1. */
3
+ export declare const DASHBOARD_SCHEMA_VERSION = 1;
4
+ export interface DashboardEndpoint {
5
+ /** Stable id — also the log-stream id where a log exists. */
6
+ id: string;
7
+ label: string;
8
+ /** Route path on a domain (`/relay/alice`); also what the local proxy serves. */
9
+ path: string;
10
+ /** Local port the path proxies to. */
11
+ port: number;
12
+ /** 'ws' endpoints speak substrate RPC; 'http' are plain web services. */
13
+ protocol: 'ws' | 'http';
14
+ /** Full URLs, precomputed so no renderer ever assembles one. */
15
+ url: string;
16
+ directUrl: string;
17
+ /** How to probe it. rpc = chain head via WS; http = GET path expecting 200. */
18
+ health: {
19
+ kind: 'rpc';
20
+ } | {
21
+ kind: 'http';
22
+ path: string;
23
+ } | null;
24
+ /**
25
+ * Whether a proxy forwards the route's path prefix to the upstream. Chains and most
26
+ * services are mounted at / upstream, so the prefix is stripped; kubo's gateway serves
27
+ * /ipfs/<cid> itself and 404s without it. nginx encodes the same fact per location.
28
+ */
29
+ keepPrefix?: boolean;
30
+ /** Extra links (pjs/papi consoles, docs), keyed by kind. */
31
+ links: Record<string, string>;
32
+ /**
33
+ * Chain-spec basenames this chain might publish, most specific first. Genesis names its
34
+ * spec after the chain id (paseo-local); a fork carries the source's (paseo). Which one
35
+ * exists is a fact about the running network's data directory, so the sidecar resolves
36
+ * these to a `spec` link and drops the ones with no file — a dead download link on a
37
+ * light-client page is worse than none.
38
+ */
39
+ specCandidates?: string[];
40
+ }
41
+ export interface DashboardChain extends DashboardEndpoint {
42
+ paraId: number | null;
43
+ }
44
+ export interface DashboardModel {
45
+ schemaVersion: number;
46
+ network: {
47
+ name: string;
48
+ displayName: string;
49
+ genesis: boolean;
50
+ };
51
+ baseUrl: string;
52
+ chains: DashboardChain[];
53
+ services: DashboardEndpoint[];
54
+ /** Ids whose logs the dashboard may stream — the whitelist, nothing else is served. */
55
+ logs: string[];
56
+ }
57
+ /**
58
+ * Whether URLs are path-style (behind a domain / the local proxy) is decided by the caller
59
+ * through `baseUrl` alone: the model always emits both the path URL and the direct port URL,
60
+ * and the renderer chooses which to feature.
61
+ */
62
+ export declare function dashboardModel(net: NetworkDef, baseUrl: string): DashboardModel;
63
+ //# sourceMappingURL=dashboard-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-model.d.ts","sourceRoot":"","sources":["../src/dashboard-model.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AAG3D,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,MAAM,EAAE;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAChE;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,uFAAuF;IACvF,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAmBD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CA4G/E"}
@@ -0,0 +1,126 @@
1
+ // The dashboard's contract: everything a UI needs to render a network, as one document.
2
+ //
3
+ // This is the single source the dashboard service serves, the SPA renders, the local proxy
4
+ // routes by, and the nginx generator emits location blocks from. Nothing downstream may know
5
+ // a chain, port, or path this file did not tell it — that rule is what stopped the old
6
+ // hand-maintained trio (index.html, nginx template, spawn.html) from ever agreeing.
7
+ //
8
+ // Pure: no I/O, no environment reads. Callers hand in the loaded network and the base URL,
9
+ // which is the one thing that differs per environment (127.0.0.1 vs a domain).
10
+ import { PORTS, RELAY_BASE_PORT, VALIDATORS, requiredPort } from './toml-generator.js';
11
+ /** Bumped when the shape changes incompatibly. Renderers support N and N-1. */
12
+ export const DASHBOARD_SCHEMA_VERSION = 1;
13
+ /** ws:// or wss:// according to the base URL's scheme. */
14
+ function wsUrl(baseUrl, path) {
15
+ return baseUrl.replace(/^http/, 'ws') + path;
16
+ }
17
+ /** Distinct, defined spec basenames, genesis id first. */
18
+ function specNamesOf(...names) {
19
+ return [...new Set(names.filter((n) => Boolean(n)))];
20
+ }
21
+ function chainLinks(url) {
22
+ return {
23
+ pjs: `https://polkadot.js.org/apps/?rpc=${encodeURIComponent(url)}#/explorer`,
24
+ papi: `https://dev.papi.how/explorer#networkId=custom&endpoint=${encodeURIComponent(url)}`,
25
+ };
26
+ }
27
+ /**
28
+ * Whether URLs are path-style (behind a domain / the local proxy) is decided by the caller
29
+ * through `baseUrl` alone: the model always emits both the path URL and the direct port URL,
30
+ * and the renderer chooses which to feature.
31
+ */
32
+ export function dashboardModel(net, baseUrl) {
33
+ const base = baseUrl.replace(/\/$/, '');
34
+ const chains = [];
35
+ // Relay validators. Only the ones this network runs (a fork may run fewer than six).
36
+ for (let i = 0; i < net.relay.validators; i++) {
37
+ const name = VALIDATORS[i];
38
+ const path = `/relay/${name}`;
39
+ const port = RELAY_BASE_PORT + i;
40
+ const url = wsUrl(base, path);
41
+ chains.push({
42
+ id: `relay-${name}`,
43
+ label: `Relay ${name[0].toUpperCase()}${name.slice(1)}`,
44
+ paraId: null,
45
+ path,
46
+ port,
47
+ protocol: 'ws',
48
+ url,
49
+ directUrl: `ws://127.0.0.1:${port}`,
50
+ health: { kind: 'rpc' },
51
+ links: chainLinks(url),
52
+ specCandidates: specNamesOf(net.relay.genesisSpec?.chainId, net.relay.spec),
53
+ });
54
+ }
55
+ for (const p of net.parachains) {
56
+ const path = `/${p.key}`;
57
+ const port = PORTS[p.key];
58
+ const url = wsUrl(base, path);
59
+ chains.push({
60
+ id: p.key,
61
+ label: `${p.key} (${p.paraId})`,
62
+ paraId: p.paraId,
63
+ path,
64
+ port,
65
+ protocol: 'ws',
66
+ url,
67
+ directUrl: `ws://127.0.0.1:${port}`,
68
+ health: { kind: 'rpc' },
69
+ links: chainLinks(url),
70
+ specCandidates: specNamesOf(p.genesisSpec?.chainId, p.spec),
71
+ });
72
+ }
73
+ // Services: emitted only when the descriptor has not switched them off AND the chain they
74
+ // serve is part of this network — the same gates the spawn applies (fork-toml's
75
+ // PROCESS_GATES), or the UI shows a permanently-down service the network never runs:
76
+ // devnet has no web3-storage parachain, so it has no storage provider either.
77
+ const present = new Set(net.parachains.map((p) => p.key));
78
+ const services = [];
79
+ const service = (id, label, path, portKey, health, links = {}, needs) => {
80
+ if (net.services[id] === false)
81
+ return;
82
+ if (needs && !present.has(needs))
83
+ return;
84
+ const port = requiredPort(portKey);
85
+ services.push({
86
+ id,
87
+ label,
88
+ path,
89
+ port,
90
+ protocol: 'http',
91
+ url: base + path,
92
+ directUrl: `http://127.0.0.1:${port}`,
93
+ health,
94
+ links,
95
+ });
96
+ };
97
+ service('eth-rpc', 'Ethereum RPC', '/eth-rpc', 'ETH_RPC_PORT', { kind: 'http', path: '/health' }, {}, 'asset-hub');
98
+ service('ipfs-daemon', 'IPFS Gateway', '/ipfs', 'IPFS_GATEWAY_PORT', null, {}, 'bulletin');
99
+ {
100
+ const ipfs = services[services.length - 1];
101
+ if (ipfs && ipfs.id === 'ipfs-daemon') {
102
+ // kubo serves /ipfs/<cid> itself: proxies forward the prefix, and the URL a user
103
+ // copies should end where the CID goes.
104
+ ipfs.keepPrefix = true;
105
+ ipfs.url = `${base}/ipfs/`;
106
+ ipfs.directUrl = `http://127.0.0.1:${ipfs.port}/ipfs/`;
107
+ }
108
+ }
109
+ service('storage-provider-node', 'Web3 Storage Provider', '/web3-storage-provider', 'WEB3_STORAGE_PROVIDER_PORT', { kind: 'http', path: '/health' }, {}, 'web3-storage');
110
+ // The links an integrator actually reaches for — the old landing page listed all four.
111
+ service('dub', 'Device Uniqueness Backend', '/dub', 'DUB_PORT', { kind: 'http', path: '/readyz' }, {
112
+ docs: `${base}/dub/docs`,
113
+ readyz: `${base}/dub/readyz`,
114
+ jwks: `${base}/dub/.well-known/jwks.json`,
115
+ attester: `${base}/dub/api/v1/attester`,
116
+ }, 'people');
117
+ return {
118
+ schemaVersion: DASHBOARD_SCHEMA_VERSION,
119
+ network: { name: net.name, displayName: net.displayName, genesis: net.genesis },
120
+ baseUrl: base,
121
+ chains,
122
+ services,
123
+ logs: [...chains.map((c) => c.id), ...services.map((s) => s.id)],
124
+ };
125
+ }
126
+ //# sourceMappingURL=dashboard-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-model.js","sourceRoot":"","sources":["../src/dashboard-model.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,EAAE;AACF,2FAA2F;AAC3F,6FAA6F;AAC7F,uFAAuF;AACvF,oFAAoF;AACpF,EAAE;AACF,2FAA2F;AAC3F,+EAA+E;AAG/E,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEvF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAqD1C,0DAA0D;AAC1D,SAAS,KAAK,CAAC,OAAe,EAAE,IAAY;IAC1C,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;AAC/C,CAAC;AAED,0DAA0D;AAC1D,SAAS,WAAW,CAAC,GAAG,KAA6B;IACnD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO;QACL,GAAG,EAAE,qC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