@parity/ppn 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 (147) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +84 -0
  3. package/config/ports.env +128 -0
  4. package/config/versions.env +120 -0
  5. package/dist/bin.d.ts +2 -0
  6. package/dist/bin.js +30 -0
  7. package/dist/bin.js.map +1 -0
  8. package/dist/cli.d.ts +3 -0
  9. package/dist/cli.js +471 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/commands/bite.d.ts +27 -0
  12. package/dist/commands/bite.js +556 -0
  13. package/dist/commands/bite.js.map +1 -0
  14. package/dist/commands/dashboard.d.ts +2 -0
  15. package/dist/commands/dashboard.js +503 -0
  16. package/dist/commands/dashboard.js.map +1 -0
  17. package/dist/commands/dist.d.ts +7 -0
  18. package/dist/commands/dist.js +121 -0
  19. package/dist/commands/dist.js.map +1 -0
  20. package/dist/commands/fetch.d.ts +11 -0
  21. package/dist/commands/fetch.js +550 -0
  22. package/dist/commands/fetch.js.map +1 -0
  23. package/dist/commands/fork.d.ts +1 -0
  24. package/dist/commands/fork.js +164 -0
  25. package/dist/commands/fork.js.map +1 -0
  26. package/dist/commands/generate.d.ts +7 -0
  27. package/dist/commands/generate.js +201 -0
  28. package/dist/commands/generate.js.map +1 -0
  29. package/dist/commands/genesis-toml.d.ts +1 -0
  30. package/dist/commands/genesis-toml.js +26 -0
  31. package/dist/commands/genesis-toml.js.map +1 -0
  32. package/dist/commands/nginx-conf.d.ts +1 -0
  33. package/dist/commands/nginx-conf.js +32 -0
  34. package/dist/commands/nginx-conf.js.map +1 -0
  35. package/dist/commands/service-context.d.ts +13 -0
  36. package/dist/commands/service-context.js +5 -0
  37. package/dist/commands/service-context.js.map +1 -0
  38. package/dist/commands/service.d.ts +28 -0
  39. package/dist/commands/service.js +807 -0
  40. package/dist/commands/service.js.map +1 -0
  41. package/dist/commands/stamp-spawn.d.ts +7 -0
  42. package/dist/commands/stamp-spawn.js +43 -0
  43. package/dist/commands/stamp-spawn.js.map +1 -0
  44. package/dist/commands/start.d.ts +33 -0
  45. package/dist/commands/start.js +462 -0
  46. package/dist/commands/start.js.map +1 -0
  47. package/dist/commands/upgrade.d.ts +15 -0
  48. package/dist/commands/upgrade.js +101 -0
  49. package/dist/commands/upgrade.js.map +1 -0
  50. package/dist/fork/chains.d.ts +25 -0
  51. package/dist/fork/chains.js +36 -0
  52. package/dist/fork/chains.js.map +1 -0
  53. package/dist/fork/codec.d.ts +36 -0
  54. package/dist/fork/codec.js +122 -0
  55. package/dist/fork/codec.js.map +1 -0
  56. package/dist/fork/manifest.d.ts +13 -0
  57. package/dist/fork/manifest.js +77 -0
  58. package/dist/fork/manifest.js.map +1 -0
  59. package/dist/fork/overrides.d.ts +45 -0
  60. package/dist/fork/overrides.js +255 -0
  61. package/dist/fork/overrides.js.map +1 -0
  62. package/dist/fork/products.d.ts +68 -0
  63. package/dist/fork/products.js +265 -0
  64. package/dist/fork/products.js.map +1 -0
  65. package/dist/fork/rpc.d.ts +25 -0
  66. package/dist/fork/rpc.js +51 -0
  67. package/dist/fork/rpc.js.map +1 -0
  68. package/dist/fork/shared-relay.d.ts +99 -0
  69. package/dist/fork/shared-relay.js +162 -0
  70. package/dist/fork/shared-relay.js.map +1 -0
  71. package/dist/fork/sleep.d.ts +3 -0
  72. package/dist/fork/sleep.js +2 -0
  73. package/dist/fork/sleep.js.map +1 -0
  74. package/dist/fork/validators.d.ts +81 -0
  75. package/dist/fork/validators.js +170 -0
  76. package/dist/fork/validators.js.map +1 -0
  77. package/dist/fork/verify.d.ts +79 -0
  78. package/dist/fork/verify.js +192 -0
  79. package/dist/fork/verify.js.map +1 -0
  80. package/dist/lib/archive.d.ts +8 -0
  81. package/dist/lib/archive.js +40 -0
  82. package/dist/lib/archive.js.map +1 -0
  83. package/dist/lib/fork-bundle-name.d.ts +4 -0
  84. package/dist/lib/fork-bundle-name.js +20 -0
  85. package/dist/lib/fork-bundle-name.js.map +1 -0
  86. package/dist/lib/github.d.ts +48 -0
  87. package/dist/lib/github.js +192 -0
  88. package/dist/lib/github.js.map +1 -0
  89. package/dist/lib/provenance.d.ts +67 -0
  90. package/dist/lib/provenance.js +98 -0
  91. package/dist/lib/provenance.js.map +1 -0
  92. package/dist/lib/spawn-env.d.ts +33 -0
  93. package/dist/lib/spawn-env.js +71 -0
  94. package/dist/lib/spawn-env.js.map +1 -0
  95. package/dist/lib/spawn-stamp.d.ts +34 -0
  96. package/dist/lib/spawn-stamp.js +63 -0
  97. package/dist/lib/spawn-stamp.js.map +1 -0
  98. package/dist/upgrade/chains.d.ts +4 -0
  99. package/dist/upgrade/chains.js +17 -0
  100. package/dist/upgrade/chains.js.map +1 -0
  101. package/dist/upgrade/fund.d.ts +38 -0
  102. package/dist/upgrade/fund.js +119 -0
  103. package/dist/upgrade/fund.js.map +1 -0
  104. package/dist/upgrade/provider-node.d.ts +2 -0
  105. package/dist/upgrade/provider-node.js +7 -0
  106. package/dist/upgrade/provider-node.js.map +1 -0
  107. package/dist/upgrade/signer.d.ts +21 -0
  108. package/dist/upgrade/signer.js +48 -0
  109. package/dist/upgrade/signer.js.map +1 -0
  110. package/dist/upgrade/sudo.d.ts +2 -0
  111. package/dist/upgrade/sudo.js +26 -0
  112. package/dist/upgrade/sudo.js.map +1 -0
  113. package/dist/upgrade/upgrade.d.ts +128 -0
  114. package/dist/upgrade/upgrade.js +539 -0
  115. package/dist/upgrade/upgrade.js.map +1 -0
  116. package/networks/README.md +120 -0
  117. package/networks/devnet.json +113 -0
  118. package/networks/kusama.json +56 -0
  119. package/networks/paseo-next-v2.json +87 -0
  120. package/networks/polkadot.json +57 -0
  121. package/networks/previewnet.json +186 -0
  122. package/package.json +54 -0
  123. package/scripts/assign-cores.sh +12 -0
  124. package/scripts/dashboard.sh +11 -0
  125. package/scripts/docker-entrypoint.sh +52 -0
  126. package/scripts/dub/postgres.sh +116 -0
  127. package/scripts/dub/service.sh +202 -0
  128. package/scripts/ensure-dot-cli.sh +23 -0
  129. package/scripts/eth-rpc.sh +45 -0
  130. package/scripts/force-open-hrmp.sh +11 -0
  131. package/scripts/grant-invites.sh +11 -0
  132. package/scripts/increase-people-lite-attestation-allowance.sh +11 -0
  133. package/scripts/install.sh +12 -0
  134. package/scripts/ipfs-daemon.sh +48 -0
  135. package/scripts/ipfs-swarm.sh +48 -0
  136. package/scripts/kill-port.sh +11 -0
  137. package/scripts/lib/workspace.sh +47 -0
  138. package/scripts/omni-node.sh +112 -0
  139. package/scripts/patch-bootnodes.sh +11 -0
  140. package/scripts/pin-bulletin-products.sh +11 -0
  141. package/scripts/pin-design-families.sh +144 -0
  142. package/scripts/set-dispatcher-address.sh +11 -0
  143. package/scripts/storage-provider-node.sh +11 -0
  144. package/web/assets/index-BW4b1s2y.js +7 -0
  145. package/web/assets/index-X3pZpnYk.css +1 -0
  146. package/web/index.html +13 -0
  147. package/zombienet-configs/local-dev.toml +253 -0
@@ -0,0 +1,121 @@
1
+ // `ppn dist` — package a deployable build.
2
+ //
3
+ // Why this exists: the server used to get its code with `git reset --hard origin/main`
4
+ // while taking its *artifacts* from a pinned release tag. So a deploy could pair release
5
+ // v20260812's binaries with whatever had landed on main since — two different versions of
6
+ // the same system, with nothing recording the combination. Rollback meant reverting commits.
7
+ //
8
+ // A dist tarball is the code for one release, built and pinned. Deploying is unpack +
9
+ // symlink; rolling back is repointing the symlink at the previous release.
10
+ //
11
+ // What goes in: the compiled packages, the entry point, the shell launchers zombienet
12
+ // needs, and the configuration. What stays out: `bin/` (the server runs `ppn fetch`, which
13
+ // pins its own artifacts per network), `node_modules` (installed from the committed
14
+ // lockfile, which is in here), `.git`, the tests, and the deployment side — `server/` is
15
+ // uploaded by deploy.yml straight from its checkout as a versionless overlay next to
16
+ // releases/, so the release is the engine only.
17
+ import fs from 'node:fs';
18
+ import path from 'node:path';
19
+ import { repoRoot } from '@parity/ppn-network-config';
20
+ import { execFileSync } from 'node:child_process';
21
+ const REPO = repoRoot();
22
+ /** Everything a server needs to run a network, relative to the repo root. */
23
+ const CONTENTS = [
24
+ // The entry point and the compiled code behind it.
25
+ 'bin/ppn.mjs',
26
+ 'packages/network-config/dist',
27
+ 'packages/network-config/package.json',
28
+ 'packages/cli/dist',
29
+ 'packages/cli/package.json',
30
+ // The launchers zombienet's custom_processes must exec, plus the shell that stayed shell.
31
+ 'scripts',
32
+ // Configuration and the network definitions.
33
+ 'networks',
34
+ 'config',
35
+ 'zombienet-configs',
36
+ // The verbs the server calls.
37
+ 'Makefile',
38
+ // A prod install needs all three; the lockfile is what makes it reproducible.
39
+ 'package.json',
40
+ 'pnpm-lock.yaml',
41
+ 'pnpm-workspace.yaml',
42
+ // The dashboard UI, built by dashboard-ui into the CLI package. The dashboard resolves it
43
+ // relative to its own compiled code (dist/commands/../../web), so a release without it
44
+ // serves the API and answers `{"error":"not found"}` at / — which is what staging did.
45
+ 'packages/cli/web',
46
+ ];
47
+ export async function run(_args, opts = {}) {
48
+ const version = opts.version ?? 'dev';
49
+ const outFile = path.resolve(opts.out ?? path.join(REPO, `ppn-dist-${version}.tar.gz`));
50
+ const missing = CONTENTS.filter((p) => !fs.existsSync(path.join(REPO, p)));
51
+ if (missing.length) {
52
+ throw new Error(`not built — missing ${missing.join(', ')}\n` +
53
+ ' Run `make build` first (the dist carries compiled output, not sources).');
54
+ }
55
+ // A manifest so a deployed tree can say what it is. Without this, "which version is on
56
+ // the box?" is answered by guessing from file dates.
57
+ const manifest = {
58
+ version,
59
+ builtAt: new Date().toISOString(),
60
+ repo: gitRepo(),
61
+ commit: gitCommit(),
62
+ node: process.version,
63
+ contents: CONTENTS,
64
+ };
65
+ const manifestPath = path.join(REPO, '.ppn-dist.json');
66
+ fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
67
+ try {
68
+ // --exclude keeps test files and stray node_modules out even when a listed directory
69
+ // contains them; scripts/ has picked up a node_modules before now.
70
+ execFileSync('tar', [
71
+ '-czf', outFile,
72
+ '-C', REPO,
73
+ '--exclude=node_modules',
74
+ '--exclude=*.test.*',
75
+ '--exclude=.DS_Store',
76
+ '.ppn-dist.json',
77
+ ...CONTENTS,
78
+ ], { stdio: 'inherit' });
79
+ }
80
+ finally {
81
+ fs.rmSync(manifestPath, { force: true });
82
+ }
83
+ const mb = (fs.statSync(outFile).size / 1024 / 1024).toFixed(1);
84
+ console.log(`\n${path.basename(outFile)} (${mb} MB) — version ${version}, commit ${manifest.commit}`);
85
+ console.log(' unpack it, `pnpm install --prod --frozen-lockfile`, then the deploy overlay runs server/redeploy.sh');
86
+ }
87
+ /**
88
+ * "owner/name", so the manifest's commit resolves in the right repository. The tarball no
89
+ * longer carries the deployment side, so whoever debugs a server sees this manifest in a tree
90
+ * with no other hint of where the code lives — and a bare hash would be looked up in whatever
91
+ * repo the reader had in mind.
92
+ */
93
+ function gitRepo() {
94
+ try {
95
+ const url = execFileSync('git', ['config', '--get', 'remote.origin.url'], {
96
+ cwd: REPO,
97
+ encoding: 'utf-8',
98
+ stdio: ['pipe', 'pipe', 'ignore'],
99
+ }).trim();
100
+ // https://github.com/owner/name(.git), git@github.com:owner/name(.git),
101
+ // ssh://git@github.com/owner/name(.git) — all reduce to owner/name.
102
+ const m = url.match(/^(?:https?:\/\/[^/]+\/|(?:ssh:\/\/)?[^/@]+@[^/:]+(?::\d+)?[:/])(.+?)(?:\.git)?\/?$/);
103
+ return m ? m[1] : url || 'unknown';
104
+ }
105
+ catch {
106
+ return 'unknown';
107
+ }
108
+ }
109
+ function gitCommit() {
110
+ try {
111
+ return execFileSync('git', ['rev-parse', '--short', 'HEAD'], {
112
+ cwd: REPO,
113
+ encoding: 'utf-8',
114
+ stdio: ['pipe', 'pipe', 'ignore'],
115
+ }).trim();
116
+ }
117
+ catch {
118
+ return 'unknown';
119
+ }
120
+ }
121
+ //# sourceMappingURL=dist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dist.js","sourceRoot":"","sources":["../../src/commands/dist.ts"],"names":[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C,KAAK,EAAE,kBAAkB,OAAO,YAAY,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACtG,OAAO,CAAC,GAAG,CAAC,uGAAuG,CAAC,CAAC;AACvH,CAAC;AAED;;;;;GAKG;AACH,SAAS,OAAO;IACd,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,mBAAmB,CAAC,EAAE;YACxE,GAAG,EAAE,IAAI;YACT,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;SAClC,CAAC,CAAC,IAAI,EAAE,CAAC;QACV,wEAAwE;QACxE,oEAAoE;QACpE,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,oFAAoF,CAAC,CAAC;QAC1G,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,SAAS,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,SAAS;IAChB,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE;YAC3D,GAAG,EAAE,IAAI;YACT,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;SAClC,CAAC,CAAC,IAAI,EAAE,CAAC;IACZ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ export interface FetchOptions {
2
+ /** Skip the download when everything the descriptor declares is already present. */
3
+ ifNeeded?: boolean;
4
+ /**
5
+ * Re-download every artifact even when the previous stamp proves it is current. The escape
6
+ * hatch for a suspect bin/ — a partial extract, a file edited by hand — where the stamp
7
+ * agrees with the disk but neither is what the release holds.
8
+ */
9
+ force?: boolean;
10
+ }
11
+ export declare function run(args: string[], opts?: FetchOptions): Promise<void>;